Main Content

images.ui.graphics.events.CropRegionChangedEventData Class

Namespace: images.ui.graphics.events
Superclasses: event.EventData

Event data is passed when crop region is changed

Renamed from images.ui.graphics3d.events.CropRegionChangedEventData in R2024b

Description

The images.ui.graphics.events.CropRegionChangedEventData class is the class passed to listeners when you interactively change the crop region within a Viewer object. When the object triggers an event using the notify handle class method, MATLAB® assigns values to the properties of a CropRegionChangedEventData object and passes that object to the listener callback function (the event handler).

The images.ui.graphics.events.CropRegionChangedEventData class is a handle class.

Class Attributes

ConstructOnLoad
true
HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

The notify handle class method creates a CropRegionEventData object when called to trigger an event.

Properties

expand all

Event source, specified as a handle to the Viewer object that triggered the event.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

Name of the event, specified as a character vector.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

Data Types: char

Current position of the crop region, specified as one of the options in the table.

ShapeValue
Rectangular2-by-3 numeric matrix of the form [xmin ymin zmin; xmax ymax zmax], where the first and second rows specify the minimum and maximum coordinates of the crop box, respectively.

Spherical (since R2024b)

4-element numeric row vector of the form [x y z radius], where (x, y, z) and radius specify the center and radius of the sphere, respectively.

Cylindrical (since R2024b)

5-element numeric row vector of the form [x y z radius height], where (x, y, z), radius, and height specify the center, radius, and height of the cylinder, respectively.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

Previous position of the crop region, specified as one of the options in the table.

ShapeValue
Rectangular2-by-3 numeric matrix of the form [xmin ymin zmin; xmax ymax zmax], where the first and second rows specify the minimum and maximum coordinates of the crop box, respectively.

Spherical (since R2024b)

4-element numeric row vector of the form [x y z radius], where (x, y, z) and radius specify the center and radius of the sphere, respectively.

Cylindrical (since R2024b)

5-element numeric row vector of the form [x y z radius height], where (x, y, z), radius, and height specify the center, radius, and height of the cylinder, respectively.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

Examples

collapse all

This code defines a callback function that gets the event properties from the images.ui.graphics.events.CropRegionChangedEventData object passed to it when the event is triggered.

function myCallbk(s,evtData)
   eventSource = evtData.Source;
   eventName = evtData.EventName;
   eventCurrPos = evtData.CropRegion;
   eventPrevPos = evtData.PreviousCropRegion;
   ...
end

Version History

Introduced in R2023b

expand all