Contenu principal

ROI-Based Processing

R2026b
Define and operate on regions of interest (ROI)

A region of interest (ROI) is a portion of an image that you want to filter or operate on in some way. You can represent an ROI as a binary mask image. In the mask image, pixels that belong to the ROI are set to 1 and pixels outside the ROI are set to 0. The toolbox offers several options to specify ROIs and create binary masks.

The toolbox supports a set of objects that you can use to create ROIs of many shapes, such circles, ellipses, polygons, rectangles, and hand-drawn shapes. After you create the objects, you can modify their shape, position, appearance, and behavior. For more information about the ROI shapes, see Choose Approach to Annotate ROIs in Images.

Functions

expand all

Interactive Viewer-Based ROIs

AngleAngle annotation (Since R2026a)
CircleCircle annotation (Since R2026a)
EllipseEllipse annotation (Since R2026a)
FreehandFreehand annotation (Since R2026a)
LineLine annotation (Since R2024a)
PointPoint annotation (Since R2024a)
PolygonPolygon annotation (Since R2026a)
PolylinePolyline annotation (Since R2026a)
RectangleRectangle annotation (Since R2026a)

Static Viewer-Based ROIs

ArrowsStatic arrow annotation (Since R2026b)
CirclesStatic circle annotation (Since R2026b)
CuboidsStatic 3-D cuboid annotation (Since R2026b)
CylindersStatic 3-D cylinder annotation (Since R2026b)
EllipsesStatic ellipse annotation (Since R2026b)
EllipsoidsStatic 3-D ellipsoid annotation (Since R2026b)
LinesStatic line annotation (Since R2026b)
PlussesStatic plus-shaped annotation (Since R2026b)
PointsStatic point annotation (Since R2026b)
PolylinesStatic polyline annotation (Since R2026b)
RectanglesStatic rectangle annotation (Since R2026b)
SpheresStatic 3-D sphere annotation (Since R2026b)

Axes-Based ROIs

AssistedFreehandAssisted freehand region of interest
CircleCircular region of interest
CrosshairCrosshair region of interest
CuboidCuboidal region of interest
EllipseElliptical region of interest
FreehandFreehand region of interest
LineLine region of interest
PointPoint region of interest
PolygonPolygonal region of interest
PolylinePolyline region of interest
RectangleRectangular region of interest
uidrawInteractively draw ROI in viewer window (Since R2026a)
uiannotateDraw static ROIs in viewer window (Since R2026b)
drawassistedCreate customizable freehand ROI with assistance from object edges
drawcircleCreate customizable circular ROI
drawcrosshairCreate customizable crosshair ROI
drawcuboidCreate customizable cuboidal ROI
drawellipseCreate customizable elliptical ROI
drawfreehandCreate customizable freehand ROI
drawlineCreate customizable linear ROI
drawpointCreate customizable point ROI
drawpolygonCreate customizable polygonal ROI
drawpolylineCreate customizable polyline ROI
drawrectangleCreate customizable rectangular ROI
drawBegin drawing ROI interactively
reduceReduce density of points in ROI
beginDrawingFromPointBegin drawing ROI from specified point
inROIQuery if points are located in ROI
bringToFrontBring ROI to front of Axes stacking order
waitBlock MATLAB command line until ROI operation is finished
createMaskCreate binary mask image from ROI
roipolySpecify polygonal region of interest (ROI)
poly2maskConvert region of interest (ROI) polygon to region mask
regionfillFill specified regions in image using inward interpolation
inpaintCoherentRestore specific image regions using coherence transport based image inpainting
inpaintExemplarRestore specific image regions using exemplar-based image inpainting
roicolorSelect region of interest (ROI) based on color
roifilt2Filter region of interest (ROI) in grayscale image
reducepolyReduce density of points in ROI using Ramer–Douglas–Peucker algorithm

Topics

Specify ROIs

Filter ROIs

Create Interactive ROIs Using Events and Callback Functions

Featured Examples