Main Content


Return vertices on perimeter of ellipse ROI object

getVertices is not recommended. Using the new Ellipse ROI, access the value of the Vertices property instead. For more information, see Compatibility Considerations.


v = getVertices(h) returns a set of vertices that lie along the perimeter of an ellipse ROI object.

Input Arguments

collapse all

ROI object, specified as an imellipse object.

Output Arguments

collapse all

Vertices, returned as an n-by-2 matrix. The two columns define the x- and y-coordinates, respectively, of each of the n vertices.

Version History

Introduced in R2007b

collapse all

R2018b: getVertices is not recommended

Starting in R2018b, a new set of ROI objects replaces the existing set of ROI objects. The new objects provide more functional capabilities, such as face color transparency. The new classes also support events that you can use to respond to changes in your ROI such as moving or being clicked. Although there are no plans to remove the old ROI objects at this time, switch to the new ROIs to take advantage of the additional capabilities and flexibility. For more information on creating ROIs using the new ROI functions, see Create ROI Shapes.

To retrieve the vertices of a new Ellipse ROI, access the value of the Vertices property of the ROI.

Update Code

Update all instances of getVertices.

Discouraged UsageRecommended Replacement

This example creates an Ellipse ROI and uses getVertices to retrieve the vertices of the ROI.

h = imellipse(gca,[10 10 100 100]);
v = getVertices(h)

Here is equivalent code, creating a new Ellipse ROI and then accessing the value of the Ellipse ROIs Vertices property.

h = drawellipse(gca,'Center',[60,35],'SemiAxes',[50,25]);
v = h.Vertices