Line region of interest
The Line
object is a linear region-of-interest
(ROI).
To draw the ROI, position the cursor on the axes and click and drag to draw the ROI shape. To finish the ROI, release the mouse button. For more information about using this ROI, including keyboard shortcuts, see Tips.
To create a Line
object, use the images.roi.Line
creation function. After creating the object, call the draw
object
function to begin drawing. As a convenience, you can also use the drawline
function to create a Line
ROI. The drawline
function creates the ROI object and automatically calls the draw
object
function.
creates an instance of
the roi
= images.roi.Lineimages.roi.Line
class with default properties.
creates the ROI on the axes specified by roi
= images.roi.Line(ax
)ax
.
sets
properties using
name-value pairs. For example, roi
= images.roi.Line(___,Name,Value
)images.roi.Line('Color','y')
sets the
color of the Line
object to yellow. You can specify multiple name-value
pairs. Enclose each property name in single quotes.
addlistener | Create event listener bound to event source |
beginDrawingFromPoint | Begin drawing ROI from specified point |
bringToFront | Bring ROI to front of Axes stacking order |
createMask | Create binary mask image from ROI |
draw | Begin drawing ROI interactively |
wait | Block MATLAB command line until ROI operation is finished |
The ROI supports the following interactivity, including keyboard shortcuts.
Behavior | Keyboard shortcut |
---|---|
Make drawn line snap to 15 degree angles. | Hold the Shift key while drawing. |
Cancel drawing the ROI. | Press Esc. The function returns a valid ROI object with an
empty Position field. |
Resize the ROI. | Position pointer over either endpoint and then click and drag to resize the ROI. Hold the Shift key while resizing to snap the line drawn at 15 degree angles. |
Move the ROI. | Position the pointer over the ROI. The pointer changes to the fleur shape. Then click and drag the ROI. |
For information about using an ROI in an app created with App Designer, see Using ROIs in Apps Created with App Designer.
AssistedFreehand
| Circle
| Crosshair
| Cuboid
| drawline
| Ellipse
| Freehand
| Point
| Polygon
| Polyline
| Rectangle