A region of interest (ROI) is a portion of an image that you want to filter or perform some
other operation on. You can create ROIs of many shapes using the
high-level ROI functions, such as
drawpolygon. You can also use ROI creation
classes, such as
image.roi.Polygon. The ROI classes support
properties, methods, and events that you can use to customize the
behavior of the ROI.
A common use of an ROI is to create 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 ROI classes and functions support a
createMask method. You can define more than one
ROI in an image. Commonly, ROIs are groups of contiguous pixels but you
can also define ROIs by intensity values, in which case the regions are
not necessarily contiguous.
|Create freehand ROI on image with assistance from image edges|
|Create customizable circular ROI|
|Create customizable cuboidal ROI|
|Create customizable elliptical ROI|
|Create customizable freehand ROI|
|Create customizable linear ROI|
|Create customizable point ROI|
|Create customizable polygonal ROI|
|Create customizable polyline ROI|
|Create customizable rectangular ROI|
|Create binary mask image from ROI|
|Query if points are located in ROI|
|Bring ROI to the front of the Axes stacking order|
|Specify polygonal region of interest (ROI)|
|Convert region of interest (ROI) polygon to region mask|
|Fill in specified regions in image using inward interpolation|
|Restore specific image regions using coherence transport based image inpainting|
|Select region of interest (ROI) based on color|
|Filter region of interest (ROI) in image|
|Assisted freehand region of interest|
|Circular region of interest|
|Cuboidal region of interest|
|Elliptical region of interest|
|Freehand region of interest|
|Line region of interest|
|Point region of interest|
|Polygonal region of interest|
|Polyline region of interest|
|Rectangular region of interest|
|Begin drawing ROI interactively|
|Begin drawing ROI from specified point|
To filter a region of interest (ROI), first define a mask to separate the ROI from the background, then apply the filter to the ROI only.
A binary mask classifies image pixels as belonging to either the region of interest or the background.
This example shows how to use masked filtering to increase the sharpness of a specific region of interest.
This example shows how to define your own function and mask to filter a region of interest.
The process of filling a region of interest involves replacing all pixels in the region by interpolating inward from the boundary of the region.
The toolbox provides a set of classes to create regions of interest of various shapes, including circles, ellipses, polygons, lines, polylines, points, and rectangles.
This example shows how to subsample or reduce the number of points in a Freehand ROI object.
This example shows the steps need to create a three-point measurement tool using a Polyline ROI
This example shows how to use line ROIs to measure distances in an image.
This example shows how to define a custom wait function that blocks the MATLAB® command line until you finish positioning a rectangle.