Defining Regions of Interest
The XROI utility allows you to quickly load an image file, define single or multiple ROIs, and obtain geometry and statistical data about the ROIs. While regions can be defined programmatically (see Programmatically Defining ROIs and Growing a Region), the XROI utility enables the interactive creation and selection of an ROI using the mouse.
For a quick introduction to creating ROIs using XROI, complete the following steps:
- Open XROI by typing the following at the command line:
- Load an image using the image file selection dialog. Select
earth.jpgfrom theexamples/demo/demodatadirectory. Click Open.The image appears in the XROI utility. - Select the Draw Freehand button and use the mouse to interactively define an ROI encompassing the African continent. Your image should be similar to the following figure.
- After releasing the mouse button, the ROI Information dialog appears, displaying ROI statistics. You can now define another ROI, save the defined ROI as a
.savfile or exit the XROI utility.
See Using XROI under "XROI" (IDL Reference Guide) for details on the interface elements.Flip the image vertically to display it right-side-up by clicking the Flip button.
Using XROI syntax allows you to programmatically load an image and specify a variable for REGIONS_OUT that will contain the ROI data. The region data can then undergo further analysis and processing. The following code lines open the previously opened image for ROI creation and selection and specify to save the region data as oROIAfrica.
; Select the file, read the data and load the image's color table. imgFile = FILEPATH('earth.jpg', $ SUBDIRECTORY = ['examples', 'demo', 'demodata']) image = READ_IMAGE(imgFile, R, G, B) TVLCT, R, G, B ; Display the image using XROI. Specify a variable for REGIONS_OUT ; to save the ROI information. XROI, image, R, G, B, REGIONS_OUT = oROIAfrica
The ROI information, oROIAfrica, can then be analyzed using IDLanROI methods or the REGION_GROW procedure. The ROI data can also be displayed using DRAW_ROI or as an IDLgrROI object. Such tasks are covered in the following sections.
