This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

getPosition

Return current position of ROI object

getPosition is not recommended. Use one of the ROI classes instead, described in ROI Creation Overview.

Syntax

pos = getPosition(h)

Description

pos = getPosition(h) returns the current position of the ROI object, h.

Input Arguments

collapse all

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

Output Arguments

collapse all

Position of the ROI object, returned as a numeric array. The shape of the array depends on the type of ROI object.

ROI ObjectReturned position
imellipse4-element vector of the form [xmin ymin width height], representing the size and position of a bounding box around the ellipse. The initial size of the bounding box is width-by-height pixels. The upper-left corner of the box is at the (x,y) coordinate (xmin,ymin).
imfreehandn-by-2 matrix. The two columns define the x- and y-coordinates, respectively, of the n points along the boundary of the freehand region.
imline2-by-2 matrix of the form [x1 y1; x2 y2], representing the 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 x- and y-coordinates, respectively, of each of the n vertices.
imrect4-element vector of the form [xmin ymin width height]. The initial size of the rectangle is width-by-height pixels. The upper-left corner of the rectangle is at the (x,y) coordinate (xmin,ymin).

Introduced in R2008a