removeNewPositionCallback

Remove new-position callback from ROI object

removeNewPositionCallback is not recommended. With the new ROIs, use the addlistener object function instead. For more information, see Compatibility Considerations.

Description

example

removeNewPositionCallback(h,id) removes the corresponding function from the new-position callback list of the ROI object, h.

Examples

Add and Remove New Position Callback

Create a line ROI object. Display the position of the line in the title. Use addNewPositionCallback to update the title each time you move the line.

imshow('pout.tif')
h = imline(gca,[10 100],[100 100]);
id = addNewPositionCallback(h,@(pos) title(mat2str(pos,3)));

Move the line to observe the callback behavior.

After observing the callback behavior, remove the callback. The title no longer changes when you move the line.

removeNewPositionCallback(h,id);

Input Arguments

collapse all

ROI object, specified as an imellipse, imline, impoint, impoly, or imrect object.

Identifier of new-position callback function, specified as a struct.

Compatibility Considerations

expand all

Not recommended starting in R2018b

Introduced in R2008a