Angle
Description
An Angle object labels an angle in a Viewer
object. The properties of the object control the appearance and behavior of the angle
annotation.
![]()
Creation
You can create an Angle object in these ways:
Interactively draw an angle in a 2-D
Viewerobject. From the viewer toolbar, select the draw annotations icon
, then select the measure angle icon
. Click to place the vertex of the angle, then
select two endpoints that define the rays of the angle. To export the angle to the
workspace as an Angleobject, right-click the ROI and select Export annotation to workspace.Use the
uidrawfunction to interactively draw the ROI in a specified viewer and create the ROI object.Use the
images.ui.graphics.roi.Anglefunction described here. After you create the ROI, you can display it by adding the object to theAnnotationsproperty of aViewerobject.
Description
a = images.ui.graphics.roi.Angle creates an
Angle object with default property values. Use
a to query and modify properties of the
Angle object after you create it.
a = images.ui.graphics.roi.Angle(Name=Value) sets one or more
writable properties using
name-value arguments.
Example:
images.ui.graphics.roi.Angle(Position=[500 150; 390 230; 520 200])
creates an Angle object whose vertex is at the
xyz-coordinates (390, 230, 1) and whose endpoints are at the
coordinates (500, 150, 1) and (520, 200, 1).
Properties
Object Functions
createMask | Create binary mask image from ROI |
Examples
Tips
The
uidrawandimages.ui.graphics.roi.Anglefunctions create ROIs to display in aViewerobject. Viewer-based ROIs provide high-performance interactions with images and volumes you display in aViewerobject usingimageshowandvolshow, respectively. For an example that shows how to build an interactive angle measurement tool in animshowimage display, see Use Polyline to Create Angle Measurement Tool.The ROI supports this interactivity, including keyboard shortcuts.
Behavior Interaction Add annotation From the viewer toolbar, select the draw annotations icon
, then select the measure angle icon
. Click to place the vertex of the
angle, then click to place the two endpoints that define the rays of
the angle.Make drawn line snap at 15-degree angles Hold Shift while drawing.
Hold Shift while resizing the ROI to snap the size of the angle in 15-degree increments.
Cancel drawing annotation Press Esc. Resize (reshape) annotation Drag the vertex or endpoints.
Move annotation Hold Ctrl and drag the ROI. Edit annotation label Right-click 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 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
