The DEFROI function defines an irregular region of interest of an image using the image display system and the cursor and mouse. The result is a vector of subscripts of the pixels inside the region. The lowest bit in which the write mask is enabled is changed.
DEFROI only works for interactive, pixel oriented devices with a cursor and an exclusive or writing mode. Regions may have at most 1000 vertices.
CAUTION: DEFROI does not function correctly when used with draw widgets. See CW_DEFROI .
This routine is written in the IDL language. Its source code can be found in the file
defroi.pro
in the
lib
subdirectory of the IDL distribution.
After calling DEFROI, click in the image with the left mouse button to mark points on the boundary of the region of interest. The points are connected in sequence. Alternatively, press and hold the left mouse button and drag to draw a curved region. Click the middle mouse button to erase points. The most recently-placed point is erased first. Click the right mouse button to close the region. The function returns after the region has been closed.
TVSCL, DIST(200,200) ; Create an image.
X = DEFROI(200, 200) ; Call DEFROI. The cursor becomes active in the graphics window. Define a region and click the right mouse button.
PRINT, X ; Print subscripts of points included in the defined region.