Region-of-interest (ROI) base class
imroi class is abstract, creating
an instance of the
imroi class is not allowed.
imroi supports the following methods. Type
imroi to see a complete list.
id = addNewPositionCallback(h,fcn) adds the
fcn to the list of new-position
callback functions of the ROI object
the ROI object changes its position each function in the list is called
with the syntax:
pos is of the form returned by the
The return value,
id, is used only with
BW = createMask(h) returns a mask, or binary
image, that is the same size as the input image with 1s inside the
h and 0s everywhere else. The input
image must be contained within the same axes as the ROI.
BW = createMask(h,h_im) returns a mask the
same size as the image
h_im with 1s inside the
h and 0s outside. This syntax is required
when the axes that contain the ROI hold more than one image.
delete(h) deletes the ROI object
color = getColor(h) gets the color used to
draw the ROI object
h. The three-element vector
an RGB triplet.
pos = getPosition(h) returns current position
of the ROI object
fcn = getPositionConstraintFcn(h) returns
a function handle
fcn to the current position constraint
function of the ROI object
removeNewPositionCallback(h,id) removes the
corresponding function from the new-position callback list of the
id is the identifier
returned by the
resume(h) resumes execution of the MATLAB
command line. When called after a call to
return an accepted position. The
is useful when you need to exit
wait from a callback
setColor(h,new_color) sets the color used
to draw the ROI object
be a three-element vector specifying an RGB triplet, or the long or
short name of a predefined color, such as
ColorSpec for a list of
the ROI object
h to a new position. The candidate
position is subject to the position constraint function.
of the form expected by the setPosition method.
setPositionConstraintFcn(h,fcn) sets the
position constraint function of the ROI object
be the specified function handle,
the object is moved because of a mouse drag, the constraint function
is called using the syntax:
constrained_position = fcn(new_position)
new_position is of the form returned
getPosition method. You can use the
create this function.
accepted_pos = wait(h) blocks execution of
the MATLAB command line until you finish positioning the ROI object
You indicate completion by double-clicking on the ROI object. The
accepted_pos, is of the form
returned by the object's