Ellipse
Description
An Ellipse object labels an ellipse in a
Viewer object. The properties of the object control the appearance and
behavior of the ellipse annotation.
Viewer-based ROIs provide high-performance interactions with images and volumes you
display in a Viewer object using imageshow and
volshow, respectively. To draw an ellipse on an
imshow image display, use drawellipse
instead.
![]()
Creation
You can create an Ellipse object in these ways:
Use the
uidrawfunction to interactively draw the ROI in a specified viewer and create the ROI object.Use the
images.ui.graphics.roi.Ellipsefunction described here. After you create the ROI, you can display it by adding the object to theAnnotationsproperty of aViewerobject.
Description
e = images.ui.graphics.roi.Ellipse creates an
Ellipse object with default property values. Use
e to query and modify properties of the
Ellipse object after you create it.
e = images.ui.graphics.roi.Ellipse(Name=Value) sets one or more
writable properties using
name-value arguments.
Example:
images.ui.graphics.roi.Ellipse(Position=[128 64 30 20)] creates an
ellipse annotation centered at the xy-coordinate (128, 64). The
ellipse has horizontal and vertical semiaxes of length 30 and
20, respectively.
Properties
Object Functions
createMask | Create binary mask image from ROI |
Examples
Tips
The
uidrawandimages.ui.graphics.roi.Ellipsefunctions create ROIs to display in aViewerobject. Viewer-based ROIs provide high-performance interactions with images and volumes you display in aViewerobject usingimageshowandvolshow, respectively. To draw an ellipse on animshowimage display, usedrawellipseinstead.The ROI supports this interactivity, including keyboard shortcuts.
Behavior Interaction Add annotation To enable interactive drawing of an ellipse, call the
uidrawfunction and specify the second argument as"ellipse". To draw the ellipse, click to place a point on the perimeter of the ellipse, drag to the opposite point on the perimeter, and release. To adjust the center, hold Ctrl while you drag.Make semiaxes directions snap at 15 degree angles Hold Shift while drawing. Resize (reshape) annotation Pause on the edge of the ROI until one of the four vertices defining the semiaxes appears. Drag the vertex to reposition it. Moving the vertex closer to or further from the center changes the corresponding semiaxis value. Moving the point along the perimeter rotates the ellipse.
Move annotation Hold Ctrl and drag the ROI. Edit annotation label Right-click the edge of the ROI. From the context menu, select Edit label. When the label text highlights, type new text for the label. To finish editing, click outside the label. Remove annotation Right-click the edge of the ROI and choose Remove annotation from the context menu. Select Remove all annotations to remove all annotations in the viewer.
Version History
Introduced in R2026a
