Main Content

images.roi.ROIClickedEventData Class

Namespace: images.roi

Event data passed when ROI is clicked

Description

The images.roi.ROIClickedEventData class is the class passed to listeners when a region-of-interest (ROI) is clicked. When the ROI class triggers an event using the notify handle class method, MATLAB® assigns values to the properties of an images.roi.ROIClickedEventData object and passes that object to the listener callback function (the event handler).

The images.roi.ROIClickedEventData 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 images.roi.ROIClickedEventData object when called to trigger an event. images.roi.ROIClickedEventData does not accept input arguments.

Properties

expand all

Event source object, specified as a handle to the 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

Type of selection, specified as one of the following character vectors.

SelectionType ValueDescription
'left'Left mouse-click
'right'Right mouse-click
'double'Double-click
'shift'Shift-left mouse-click
'ctrl'Control-left mouse-click

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

Part of the ROI that was clicked, specified as one of the character vectors in this table.

SelectedPart ValueDescription
'edge'Clicked edge of ROI.
'face'Clicked face of ROI.
'label'Clicked ROI label.
'marker'Clicked marker used to reshape the ROI.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

ROI is currently selected, specified as a logical scalar. Returns 1 when the ROI is selected, otherwise, 0. To deselect an ROI, use Ctrl-click.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

ROI was previously selected, specified as a logical scalar. Returns 1 when the ROI was already selected and 0 when the ROI was not previously selected.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

Examples

collapse all

This callback function gets the event source object handle, the event name, and other properties from the images.roi.ROIClickedEventData object passed to it when the event is triggered.

function myCallbk(s,evtData)
   eventSource = evtData.Source;
   eventName = evtData.EventName;
   selectionType = evtData.SelectionType;
   selectedPart = evtData.SelectedPart;
   currselected = evtData.CurrentSelected;
   prevselected = evtData.PreviousSelected;
end

Version History

Introduced in R2018b