Main Content

setConstrainedPosition

Set ROI object to new position

setConstrainedPosition is not recommended. For information about setting position constraints, see Compatibility Considerations.

Description

setConstrainedPosition(h,pos) sets the ROI object h to a new position. The candidate position, pos, is subject to the position constraint function specified by setPositionConstraintFcn.

Input Arguments

collapse all

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

Candidate position of the ROI object, specified as a numeric array. The shape of the array depends on the type of ROI object, and is consistent with the form returned by the setPosition function.

ROI ObjectPosition
imellipse4-element vector of the form [xmin ymin width height], representing the new size and position of a bounding box around the ellipse. The new size of the bounding box is width-by-height pixels. The upper-left corner of the box is at the new (x,y) coordinate (xmin,ymin).
imline2-by-2 matrix of the form [x1 y1; x2 y2], representing the new position of the two endpoints of the line.
impoint1-by-2 vector of the form [x y].
impolyn-by-2 matrix. The two columns define the new x- and y-coordinates, respectively, of each of the n vertices.
imrect4-element vector of the form [xmin ymin width height]. The new size of the rectangle is width-by-height pixels. The upper-left corner of the rectangle is at the new (x,y) coordinate (xmin,ymin).

Version History

Introduced in R2008a

expand all