Ellipse
R2026bDescription
An Ellipse object labels an interactive ellipse in a
Viewer object. The properties of the object control the appearance and
behavior of the ellipse annotation.
Interactive viewer-based ROIs enable you to draw, edit, and
measure regions of interest on images and volumes displayed using imageshow
and volshow. Interactive ROIs support dragging, resizing, event callbacks,
and measurement labels. Use interactive viewer-based ROIs to manually annotate an image, build
annotation workflows in apps, or respond to user interactions with ROI shapes. For a comparison
of interactive viewer-based ROIs with other ROIs, see Choose Approach to Annotate ROIs in Images.
![]()
Creation
You can create an Ellipse object in these ways. For more information,
see Create Interactive Viewer-Based ROIs.
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 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
