Main Content

images.roi.ROIClickedEventData class

Package:images.roi

Event data passed when ROI is clicked

Since R2018b

Description

Theimages.roi.ROIClickedEventDataclass is the class passed to listeners when a region-of-interest (ROI) is clicked. When the ROI class triggers an event using thenotify哈ndle class method, MATLAB®assigns values to the properties of animages.roi.ROIClickedEventDataobject and passes that object to the listener callback function (the event handler).

Theimages.roi.ROIClickedEventDataclass is a哈ndleclass.

Class Attributes

ConstructOnLoad
true
HandleCompatible
true

For information on class attributes, seeClass Attributes.

Creation

Thenotify哈ndle class method creates animages.roi.ROIClickedEventDataobject when called to trigger an event.images.roi.ROIClickedEventDatadoes 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 Value Description
'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 Value Description
“边缘” 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. Returns1when the ROI is selected, otherwise,0. To deselect an ROI, useCtrl-click.

Attributes:

GetAccess
public
SetAccess
private
GetObservable
true
SetObservable
true

ROI was previously selected, specified as a logical scalar. Returns1when the ROI was already selected and0when 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 theimages.roi.ROIClickedEventDataobject passed to it when the event is triggered.

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

版本历史

Introduced in R2018b