Main Content

images.ui.graphics.events.AnnotationMovedEventData Class

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

Event data is passed when annotation is moved

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

Description

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

The images.ui.graphics.events.AnnotationMovedEventData 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 an AnnotationMovedEventData 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

Annotation that has moved within the viewer, specified as one of these ROI object types.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

Current position of the annotation, specified as a numeric vector or numeric matrix. This table specifies the value for each ROI object type.

ShapePosition
Line

2-by-3 numeric matrix of the form [x1 y1 z1; x2 y2 z2]. Each row specifies one endpoint.

Point

Numeric vector of point coordinates of the form [x y z].

Polygon

n-by-3 matrix, where each row specifies the [x y z] coordinates of the nth point in the polygon.

RectangleNumeric vector of the form [xmin ymin width height], where xmin and ymin specify the upper-left corner of the rectangle, and width and height specify the width and height. A rectangle ROI always lies in the xy-plane, with z equal to 1.
CircleNumeric vector of the form [x y z radius], where x, y, and z specify the center coordinates, and radius specifies the radius.
Angle3-by-3 matrix of the form [x1 y1 z1; x2 y2 z2; x3 y3 z3]. The second row defines the coordinates of the vertex, and the first and third rows define points on the rays that form the angle.
Freehandn-by-3 matrix, where each row specifies the [x y z] coordinates, respectively, of the nth point in the freehand shape.
Polylinen-by-3 matrix, where each row specifies the [x y z] coordinates of the nth point in the polyline shape.
EllipseNumeric vector of the form [x y semix semiy theta] where x and y specifies the center coordinates, semix and semiy specify the horizontal and vertical semiaxes before rotation, and theta specifies the rotation angle. The rotation angle is the clockwise rotation about the center.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

Previous position of the annotation, specified as a numeric vector or numeric matrix. This table specifies the format for each ROI object type.

ShapePosition
Line

2-by-3 numeric matrix of the form [x1 y1 z1; x2 y2 z2]. Each row specifies one endpoint.

Point

Numeric vector of point coordinates of the form [x y z].

Polygon

n-by-3 matrix, where each row specifies the [x y z] coordinates of the nth point in the polygon.

RectangleNumeric vector of the form [xmin ymin width height], where xmin and ymin specify the upper-left corner of the rectangle, and width and height specify the width and height. A rectangle ROI always lies in the xy-plane, with z equal to 1.
CircleNumeric vector of the form [x y z radius], where x, y, and z specify the center coordinates, and radius specifies the radius.
Angle3-by-3 matrix of the form [x1 y1 z1; x2 y2 z2; x3 y3 z3]. The second row defines the coordinates of the vertex, and the first and third rows define points on the rays that form the angle.
Freehandn-by-3 matrix, where each row specifies the [x y z] coordinates, respectively, of the nth point in the freehand shape.
Polylinen-by-3 matrix, where each row specifies the [x y z] coordinates of the nth point in the polyline shape.
EllipseNumeric vector of the form [x y semix semiy theta] where x and y specifies the center coordinates, semix and semiy specify the horizontal and vertical semiaxes before rotation, and theta specifies the rotation angle. The rotation angle is the clockwise rotation about the center.

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.AnnotationMovedEventData object passed to it when the event is triggered.

function myCallbk(s,evtData)
   eventSource = evtData.Source;
   eventName = evtData.EventName;
   eventAnnotation = evtData.Annotation;
   eventCurrPos = evtData.Position;
   eventPrevPos = evtData.PreviousPosition;
   ...
end

Version History

Introduced in R2024a

expand all