Previous ENVI User's Guide: Interactive Display Functions Next

Defining Regions of Interest

Regions of interest (ROIs) are portions of images, either selected graphically or selected by other means such as thresholding. The regions can be irregularly-shaped and are typically used to extract statistics for classification, masking, and other operations. ENVI allows selection of any combination of polygons, points, or vectors as a region of interest. Multiple regions of interest can be defined and drawn in any of the Image, Scroll, or Zoom windows. Regions of Interest can be grown to adjacent pixels that fall within a specified pixel value threshold.

Figure 4-12: Polygon, Polyline, and Rectangle ROIs in the Three Display Windows

Figure 4-12: Polygon, Polyline, and Rectangle ROIs in the Three Display Windows


Note
ROIs are explicitly related to the spatial size of the image in which they are defined. If you open, or have opened, images of equal spatial size with their associated ROI Tool dialogs, ROIs drawn in one image are displayed in all other image displays of the same spatial size. You can edit or delete shared ROIs from within any of the ROI Tools dialogs.

  1. Select one of the following options:
    • From the Image window menu bar of the image that you want to add ROIs to, select Overlay  Region of Interest or Tools  Region of Interest  ROI Tool.
    •  

    • Make the display group of the image you want to add ROIs to active and select Basic Tools  Region of Interest  ROI Tool from the ENVI main menu bar.

     

  2. The ROI Tool dialog appears.
  3.  

  4. Select whether ROI definition will take place in the Image window, the Scroll window, or the Zoom window of the selected display by selecting the Image, Scroll, or Zoom toggle button.
  5.  

  6. Draw ROIs as described in Drawing ROIs.

You can also add, edit, and create additional ROIs as described in the following sections.

Turning Off ROI Definition

When the ROI Definition function is enabled, actions such as zooming, panning and other display operations are not enabled.

To enable these interactive mouse operated functions without leaving ROI Definition, click the Off toggle button in the ROI Tool dialog.

Drawing ROIs

The following ROI types are available in ENVI:

A single region can contain any combination of the six ROI types. Each type has a different set of mouse button assignments.

The mouse assignments and drawing options are explained in the following sections and summarized in the following table.

Table 4-3: ROI Mouse Operations 

Table 4-3: ROI Mouse Operations 
ROI Type
Action
Mouse Button
Interaction
Polygon or Polyline
Define endpoints
Left
Click or Press and drag
Remove last endpoint
Middle
Click
Delete entire polygon/polyline
Middle
Click on defined polygon/polyline
Close polygon or end polyline
Right
Click
Accept polygon or polyline
Right
Click
Point
Select point
Left
Click on pixel
Delete point
Middle
Click on pixel
Delete all points in ROI
Right
Click
Rectangle or Ellipse
Define shape
Left
Press and drag
Delete shape
Middle
Click within shape
Accept shape
Right
Click
Multi Part
Accept multi part ROI
Right
Click three times after the ROI_Type  Multi Part: On option is set.


Note
If you have multiple images of the same size displayed and their associated ROI Tools dialogs open at the same time, any ROIs drawn in one image display also display in the other images.

Drawing Polygons

The polygon mode is the default method for ROI definition. Use polygons to outline a region of interest with connected line segments.

  1. In the ROI Tool dialog, select ROI_Type  Polygon.
  2.  

  3. Click the left mouse button in the active window to establish an initial endpoint for an outlining segment. As the mouse is moved to select another endpoint, a line is shown to exactly indicate the position of the current segment.
  4.  

  5. Click the left mouse button again to define the segment, which is drawn in the selected color.
  6.  


    Note
    For continuous drawing, hold the left mouse button down and move the cursor.

     

  7. Choose additional segments in the same manner until the entire region of interest is outlined.
  8.  


    Note
    To erase the last segment defined at any point during the segment selection process, click the middle mouse button.

     

  9. Click the right mouse button to draw the last segment and automatically close the polygon.
  10.  

  11. Move the polygon to the desired location by clicking on the diamond-shaped handle and dragging with the left mouse button.
  12.  

  13. Click the right mouse button to accept the polygon. As the polygon is completed, the total number of pixels contained in the ROI is listed in the ROI Tool table (along with other ROI properties). For more information on the ROI Tool table, see Editing ROI Attributes.
  14.  


    Note
    You may draw multiple polygons for each ROI. Each successive polygon is drawn as above and its pixels added to the total for the region. When completed, the polygon is filled with a solid color by default.

     

  15. To delete entire polygons from the ROI at any time, click the middle mouse button while the cursor is on the desired polygon.
  16.  

  17. When you are satisfied with the new ROI, select File  Cancel to dismiss the ROI Tool dialog or click New Region to define another region of interest.

Drawing Polylines

The polyline mode is similar to the polygon mode except that a multi-segment vector is drawn rather than a closed polygon. The regions enclosed by the defined line segments are not selected and filled upon completion. Only the pixels comprising the line segments themselves are selected.

  1. In the ROI Tool dialog, select ROI_Type  Polyline.
  2.  

  3. Left-click to define the endpoints of connected line segments.
    • To remove the previous segment, click the middle mouse button.
    •  

    • For continuous drawing hold down the left mouse button while drawing.

     

  4. Right-click to end the process of defining a polyline.
  5.  

  6. Use the handle on the polyline to move the line.
  7.  


    Note
    To erase the entire polyline, click the middle mouse button on any pixel of a previously-defined polyline.

     

  8. Right-click to accept the polyline.
  9.  

  10. When you are satisfied with the new ROI, select File  Cancel to dismiss the ROI Tool dialog or click New Region to define another region of interest.

Drawing Points

Use the point mode to select or delete individual pixels under the cursor.


Tip
For best results, add Point ROIs in the Zoom window.

  1. In the ROI Tool dialog, select ROI_Type  Point.
  2.  

  3. Click the left mouse button to add the pixel currently under the cursor to the ROI.
    • To delete a previously-selected pixel (currently under the cursor) from the ROI, click the middle mouse button.
    •  

    • To delete all pixels in the currently-selected point mode ROI, click the right mouse button.

     

  4. When you are satisfied with the new ROI, select File  Cancel to dismiss the ROI Tool dialog or click New Region to define another region of interest.

Drawing Rectangles and Ellipses

Use the rectangle and ellipse modes to draw rectangles and ellipses as ROIs.

  1. In the ROI Tool dialog, select ROI_Type  Rectangle or Ellipse.
  2.  

  3. Click the left mouse button and drag the cursor to the desired size of the rectangle or the ellipse.
  4.  


    Note
    To draw a square or circle, click and drag while holding the middle mouse button.

     

  5. Grab the diamond-shaped handle in the rectangle or ellipse and move the shape to the desired location.
  6.  


    Note
    To delete the shape, click the middle mouse button on the rectangle or ellipse.

     

  7. Click the right mouse button to accept the shape into the ROI.
  8.  

  9. When you are satisfied with the new ROI, select File  Cancel to dismiss the ROI Tool dialog or click New Region to define another region of interest.

Drawing Multi Part ROIs

Use multi part mode to draw ROIs with holes in them, or donut ROIs.

  1. Select ROI_Type  Polygon, Rectangle, or Ellipse.
  2.  


    Note
    You cannot draw Multi Part ROIs using point or polyline ROIs.

     

  3. Select ROI_Type  Multi Part:On.
  4.  

  5. Draw the base ROI using the drawing methods for the specific ROI type as described in the previous sections.
  6.  


    Note
    The ROI does not become filled in until you click the right mouse button a second time.

     

  7. Draw any number of additional ROIs or parts within the first ROI to create holes. Again, the ROIs do not become filled in when you click the right mouse button the second time.
  8.  


    Note
    Holes cannot cross the path of any other polygon within its group.

     

  9. After adding parts to the ROI, click the right mouse button a third time to accept the multi part ROI.

The base ROI becomes filled in, and the parts are removed to reveal holes in the base ROI.

Editing ROI Attributes

You can view or edit any ROI properties with the Available Regions of Interest table in the ROI Tool dialog. The table contains the following columns:

Creating New Regions

You can draw multiple regions of interest in any image display window.


Note
If you have multiple images of the same size displayed and their associated ROI Tools dialogs open at the same time, any ROIs drawn in one image display also display in the other images.

  1. To start a new ROI, click New Region in the ROI Tool dialog. A new name appears in the Available Regions of Interest table. The new region uses the next color in the graphics colors list by default.
  2.  

  3. Select the ROI type and draw the ROI.
  4.  

  5. Edit the ROI as needed.

ROI Options

In the ROI Tool dialog, you have many options to choose from when working with ROIs: inputting ASCII points into an ROI, creating multiple regions of interest, reporting ROI statistics, measuring distances and area, reporting the areas of the ROIs, loading, erasing, deleting, plotting means, merging regions, reconciling ROIs, and performing band thresholds to ROIs.


Note
If the ROI displays in more than one image (of the same spatial size), any edits are reflected in all of those images.

Hiding and Showing ROIs

Hiding an ROI removes it from the display, but the region of interest is still defined.

To hide a selected ROI overlay from the selected image, select one or more ROIs in the Available Regions of Interest table, then click Hide ROIs. To re-display these ROIs on the image, click Show ROIs. The Show ROIs dialog appears. This dialog enables you to select which ROIs are re-displayed on the image and in the table.

To hide all ROI overlays from the current display, click Select All then click Hide ROIs.

Deleting ROIs

Use the Tools menu on the Image window menu bar, the Delete button in the ROI Tool dialog, or the Basic Tools menu on the ENVI main menu bar to delete ROIs.


Warning
If the ROI to delete displays in more than one image (for images of the same spatial size), deleting it from one deletes it from all. When the ROIs are deleted, they cannot be recovered unless they are saved to a file.

Deleting ROIs from the ROI Tool Dialog

To delete a selected ROI, select one or more ROIs in the Available Regions of Interest table then click Delete.

To delete all ROIs listed in the ROI Tool dialog and remove them from the system, click Select All then click Delete.


Note
The ROIs are deleted from all displays of the same spatial size and from their associated ROI Tools dialogs.

The unsaved ROIs are erased from the displays and deleted from the system. The ROIs do not appear in the ROI Tool dialogs after being deleted.

Deleting Saved ROIs

To delete regions that are not currently displayed:

  1. Select one of the following options:
    • From the ENVI main menu bar, select Basic Tools  Region of Interest  Delete ROIs.
    •  

    • From the Image window menu bar, select Tools  Region of Interest  Delete ROIs.

     

  2. When the Delete Regions dialog appears, click on the names of the regions be delete.
  3.  

  4. Click OK to permanently delete those ROIs.

Locating Defined ROIs

To center the Zoom window over the first pixel defined in an ROI:

  1. In the ROI Tool dialog, select an ROI in the Available Regions of Interest table and click Goto.
  2.  

  3. Continue clicking on Goto to move the Zoom window over each pixel contained in that ROI.

Displaying ROI Statistics

  1. In the ROI Tool dialog, select one or more ROIs in the Available Regions of Interest table.
  2.  

  3. Click Stats.

The ROI Statistics Results dialog appears. This dialog is very similar to the Statistics Results dialog (see Producing Statistics Reports) and contains the same functions. However, the ROI Statistics Results dialog also contains additional sections for reporting multiple instances of statistical information:

The File pull-down menu contains the following additional options:

This Stats for pull-down menu button contains a list of the available ROIs. The ROI Statistics Results dialog reports the calculated statistics (in both the plot and text sections) of the ROI specified by this menu. To compare statistics for different ROIs with the current ROI shown in the Statistics Results dialog, use the Options  Copy results to new window option to create a copy of the ROI Statistics Results dialog for the current ROI, then use the Stats for menu to display a different ROI in the newly created dialog.

The Select Plot pull-down button also contains the following additional options:

Displaying ROI Statistics for All Regions

To display the statistics for all defined regions of interest, choose Select All then click Stats in the ROI Tool dialog. An ROI Statistics Results dialog containing the statistics for all the ROIs appears.

Growing ROIs

You can grow regions of interest to neighboring pixels using a specified threshold. The threshold is determined by specifying a number of standard deviations away from the mean of the drawn region. You can use either 4 or 8 neighboring pixels to determine the growth pattern. It is calculated using the displayed band for a grayscale display, or the red band for a color display.


Note
All grown regions of interest are output as points, regardless of the starting ROI type.

  1. In the Available Regions of Interest list, click on the name of the ROI to grow.
  2.  


    Note
    Within the current Image window, neighboring pixels that fall within the standard deviation threshold are included in the grown region. Adjacent pixels outside the current Image window, regardless of pixel value, are not included in the ROI.

     

  3. Click Grow. The new grown ROI is shown in the Image window. A prompt asks if you want to keep the resulting grown ROI.
  4.  

  5. Select Yes to grow the ROI with all of the points shown. Select No to return the ROI to its original size. If No is selected, the Region Growing dialog appears.
    • In the Region Growing dialog, change the values of the standard deviation multiplier and the number of neighbors, if desired, and click OK to grow the ROI with the new parameters.
    •  

    • Click on Cancel in the Region Growing dialog to exit the growing option without changing the original ROI.

Converting Shape-Based ROIs to Raster

Use the Pixel button to convert polygons, ellipses, rectangles, and polylines to a collection of editable points. This allows you to remove single points from polygons, rectangles, etc.

  1. Draw a polygon or other ROI shape, or select an existing ROI to convert into a collection of points.
  2.  

  3. Click Pixel in the ROI Tool dialog.
  4.  

  5. Select ROI_Type  Point from the ROI Tool dialog menu bar.
  6.  

    You can now edit individual pixels within the ROI using standard point editing techniques with the mouse.

Inputting ASCII Data into ROIs

You can input ASCII data points into a new or an existing ROI, select the ROI type, and select the associated map projection information if needed.


Tip
To input the ASCII data points into a new region, click New Region before completing the following procedure.

  1. In the ROI Tool dialog, select ROI_Type  Input Points from ASCII.
  2.  

  3. When the Enter ASCII Points Filename dialog appears, select an input ASCII filename.
  4.  

  5. When the Input ASCII File dialog appears, enter the column numbers for the X and Y point coordinates.
  6.  

  7. Select the type of ROI that the points define by clicking on the drop-down button next to the These points comprise label.
  8.  


    Note
    For polygon and polyline ROIs, the ASCII points define the vertices of the ROI.

     

  9. Select whether the input coordinates are Pixel Based or Map Based.
  10.  


    Note
    If you select Map Based, select the projection type and enter the zone and datum information as necessary by clicking on the Zone and Datum buttons.

     

  11. Click OK.

Loading all Regions

To load all regions currently defined for all images with the same spatial dimensions as the currently selected display as shown in the Display # field, select Options  Load All Regions.

Merging Regions

To merge multiple defined regions of interest into one:

  1. Select Options  Merge Regions. The Merge ROIs dialog appears with two lists of all defined regions.
  2.  

  3. Under Choose Base ROI to Merge, click on the name of a region.
  4.  

  5. Under the Choose ROIs to Merge list, select the names of the regions to merge into the base region.
  6.  

  7. Click the arrow toggle button next to Delete Merged ROIs? label to select whether or not you want to delete the individual regions being merged after they are merged. The color of the other ROIs change to that of the base ROI and the other names are removed from the Available Regions of Interest list.
  8.  

  9. Click OK.

Intersecting Regions

Use Intersect Regions to create a point type region of interest that contains only the points where two or more ROIs intersect in an image.

  1. In the ROI Tool dialog, select Options  Intersect Regions.
  2.  

  3. In the ROI Intersection dialog, click on the names of the intersecting ROIs to include in the new ROI, then click OK.
  4.  


    Note
    In the ROI Intersection dialog, only select regions that intersect. If a non-intersecting ROI is selected, an error occurs.

     

    The new ROI appears in the Available Regions of Interest list. It is a point type ROI and displays under any overlying polygon ROIs.

     


    Tip
    If you can't see the new point ROI in the Image window, erase all other ROIs and re-display the new ROI.

     


    Note
    You can calculate ROI intersections on-the-fly and use them when building a mask. For more information, see Including ROI Intersections.

Reporting ROI Areas

To get a report of the area covered by each ROI in one of these units: meters, kilometers, feet, yards, miles or nautical miles:

  1. In the ROI Tool dialog, select Options  Report Area of ROIs  desired units.
  2.  

  3. If the pixel size of the image is not stored in the header, a dialog appears. Enter the X and Y pixel size in meters.

The ROI Area Info dialog appears, listing each ROI name and corresponding area. To save ROI Area Information to an ASCII File, perform the following steps.

  1. In the ROI Area Info dialog, select File  Save Text to ASCII.
  2.  

  3. Enter a filename.

Reporting ROI Measurements

Use the ROI Measurement Tool to produce a report on the distance between points in a polygon or polyline, and to get perimeter and area measures for polygons, rectangles, and ellipses.


Note
To take measurements of an image without using the ROI functions, see Using the Measurement Tool.

  1. In the ROI Tool dialog, select Options  Measurement Report. The ROI Measurement Report dialog appears with the measurements reported. The measurements differ depending on the active ROI type.
  2.  

  3. Draw the ROIs as described in Drawing ROIs for specific ROI types.
    • For Polygon mode, the distance between the vertices are listed and the perimeter and total area are reported when the polygon is closed.
    •  

    • For Polylines, the distance between the vertices are listed and the total distance is given when the polyline is completed.
    •  

    • No distance measures are given when in Point mode.
    •  

    • In Rectangle mode, the lengths of the sides, the perimeter, and total area are reported.
    •  

    • In Ellipse mode, the circumference and total area are reported.
Selecting Measurement Units

In the ROI Measurement Report dialog, use the Units menu to select the unit the ROI is measured in. The choices are pixels, meters, kilometers, feet, yards, miles, and nautical miles.

  1. Select Units  the desired unit.
  2.  

  3. If the pixel size of the image is not stored in the header, and you select any unit except pixel, complete these steps when the Input Display Pixel Size dialog appears.
    1. In the X Pixel Size and Y Pixel Size text boxes, type the size of the pixels in your image.
    2.  

    3. From the Units drop-down button, select the unit type. Click OK.
Measuring ROI Area

In the ROI Measurement Report dialog, use the Area menu to measure the area of the ROI in acres, hectares, or units2 (e.g., meters2). Select Area  Acres or Hectares.

ROI Measurement Options

In the ROI Measurement Report dialog, use the Options menu to select whether the measurement information is reported as line segments (the default) or as point coordinates.

To get a listing of the vertices coordinates, select Options  Report as Points. The coordinates are reported as a pixel location (Pixel (x,y)).

To get a listing of the line segment distances, select Options  Report as Segments.

For images that are georeferenced, you may list the coordinates as map coordinates or as latitude and longitude coordinates by selecting Options  Georef Map (x,y) or Georef (Lat/Lon).

To output the list of coordinates to a file, select File  Save Points to ASCII.

Saving Measurement Reports

In the ROI Measurement Report dialog, use the File menu to save the ROI measurement report to an ASCII file and to close the dialog.

To save the measurement report:

  1. In the ROI Measurement Report dialog, select File  Save Points to ASCII.
  2.  

  3. Enter an output filename.

Reconciling ROIs

In the ROI Tool dialog, use Reconcile ROIs to apply ROIs defined in one image size to different sized images.


Note
Using Reconcile ROIs, ROIs can only be reconciled to images with the same pixel size as the original image. To reconcile ROIs to an image with a different pixel size, use Reconcile ROIs via Map.

  1. Select one of the following options:
    • In the ROI Tool dialog, select Options  Reconcile ROIs.
    •  

    • From the Image window menu bar, select Tools  Region of Interest  Reconcile ROIs.
    •  

    • From the ENVI main menu bar, select Basic Tools  Region of Interest  Reconcile ROIs.

     

  2. When the Reconcile ROIs Parameters dialog appears, choose the ROIs to reconcile by selecting from the following options:
  3.  

  4. To manually designate the spatial dimensions for the new ROIs:
    1. Enter the difference in pixels between the origin of the image where the ROIs were drawn and the origin of the new image into the xoffset and yoffset text boxes.
    2.  

    3. Enter the number of samples and lines in the new image into the appropriate text boxes.

     

  5. To have ENVI calculate the x and y offsets and the number of samples and lines automatically:
    1. Click Set Values from Source/Destination Files.
    2.  

    3. When the file selection dialog appears, choose the file where the ROI was originally drawn and click OK.
    4.  

    5. When the next file selection dialog appears, select a destination file for the ROIs and click OK.

     

  6. In the Reconcile ROIs Parameters dialog, click OK.

The ROIs are listed in the ROI Tool dialog and are automatically loaded onto the new image.

Reconciling ROIs via Map

Use Reconcile ROIs via Map to use ROIs defined in one georeferenced image in another overlapping georeferenced image, regardless of differences in image or pixel sizes between the two images.

  1. Select one of the following options:
    • In the ROI Tool dialog, select Options  Reconcile ROIs via Map.
    •  

    • From the Image window menu bar, select Tools  Region of Interest  Reconcile ROIs via Map.
    •  

    • From the ENVI main menu bar, select Basic Tools  Region of Interest  Reconcile ROIs via Map.

     

  2. When the Reconcile ROIs via Map Parameters dialog appears, select the desired ROIs by clicking on the names.
  3.  

  4. Click OK.
  5.  

  6. Select the georeferenced file to which you want the ROIs reconciled and click OK.

The ROIs are listed in the ROI Tool dialog and automatically loaded onto the new image.

Converting Band Values to ROIs

Use Band Threshold to ROI to convert specific image values and ranges of values to Regions of Interest.

  1. Select one of the following options:
    • In the ROI Tool dialog, select Options  Band Threshold to ROI.
    •  

    • From the Image window menu bar, select Tools  Region of Interest  Band Threshold to ROI.
    •  

    • From the ENVI main menu bar, select Basic Tools  Region of Interest  Band Threshold to ROI.

     

  2. When the Band Threshold to ROI Input Band dialog appears, select a band to threshold.
  3.  

  4. When the Band Threshold to ROI Parameters dialog appears, select from the following options.
    • To make an ROI using those pixels greater than or equal to the entered minimum value, enter only the Min Thresh Value.
    •  

    • To select those pixels less than or equal to the entered maximum value, enter only the Max Thresh Value.
    •  

    • To select pixels that fall within a specified range of values, enter both a minimum and a maximum threshold value.
    •  

    • To assign an ROI name, edit the ROI Name text entry.
    •  

    • To change the color of the ROI, select the desired color from ROI Color menu.

     

  5. Click OK to extract the thresholded pixels. A warning dialog appears and list the number of pixels that satisfy the threshold criteria.
  6.  

  7. Click OK to accept and load the ROI.

The region is listed in the ROI Tool dialog as a Thresh Bandname, where Bandname is the name of the band used to extract the ROI. The number of pixels in the region are also listed.

Calculating Buffer Zone Images for ROIs

Use Calculate Buffer Zone to calculate a buffer zone image from the original image. In the resulting buffer zone image, every pixel has a floating point or integer value that is defined as the distance from that pixel to the nearest pixel of the selected ROI. You designate a maximum distance value and the result is that any pixels with a distance larger than that value are set to the maximum distance value.

  1. In the ROI Tool dialog, select Options  Calculate Buffer Zone. The Buffer Zone Image Parameters dialog appears.
  2.  


    Note
    If the image has more than one ROI associated with it, the Input Buffer Zone ROIs dialog appears. Click on the names of the ROIs to include in the buffer zone image calculation and click OK.

     


    Note
    If you select more than one ROI, the distance calculated is from the pixel to the nearest selected ROI.

     

  3. Click the Maximum Distance arrow increment buttons to set the maximum distance to measure, or type the value (in pixels) into the corresponding text box.
  4.  


    Note
    Any pixels with a distance larger than this value is set to the maximum distance value +1.

     

  5. From the Distance Kernel drop-down button, select either Floating Point or Integer output.
  6.  

  7. Select output to File or Memory.
  8.  

  9. Click OK.

Creating Class Images from ROIs

Use Create Class Image from ROIs to convert selected ROIs into an ENVI classification image. The class colors are the same as the ROI colors.

  1. Select one of the following options:
    • From the Image window menu bar, select Tools  Regions of Interest  Create Class Image from ROIs.
    •  

    • In the ROI Tools dialog, select Options  Create Class Image from ROIs.
    •  

    • From the ENVI main menu bar, select Classification  Create Class Image from ROIs.
    •  

    • From the ENVI main menu bar, select Basic Tools  Region of Interest  Create Class Image from ROIs.
    •  

      The Classification Image from ROIs dialog appears.

     

  2. In the list of ROIs, select the ROIs to use by clicking on the ROI names.
  3.  

  4. Click OK. The Classification Image from ROIs Parameters dialog appears.
  5.  


    Note
    To change the output classification image DN (Digital Number) value of an ROI, click on the ROI and use the arrow toggle buttons to enter a new DN value.

     

  6. Enter an output filename and click OK.

The resulting classification image filename appears in the Available Bands List.

Computing ROI Separability

The Compute ROI Separability option computes the spectral separability between selected ROI pairs for a given input file. Both the Jeffries-Matusita and Transformed Divergence separability measures are reported. These values range from 0 to 2.0 and indicate how well the selected ROI pairs are statistically separate. Values greater than 1.9 indicate that the ROI pairs have good separability. For ROI pairs with lower separability values, you should attempt to improve the separability by editing the ROIs or by selecting new ROIs. For ROI pairs with very low separability values (less than 1), you might want to combine them into a single ROI. For more information, see the following reference:

J.A. Richards, 1999, Remote Sensing Digital Image Analysis, Springer-Verlag, Berlin, p. 240.

The following steps show how you can use the Compute ROI Separability option to compute the spectral separability between selected ROI pairs.

  1. Select one of the following options:
    • In the ROI Tools dialog, select Options  Compute ROI Separability.
    •  

    • From the Image window menu bar, select Tools  Regions of Interest  Compute ROI Separability.
    •  

    • From the ENVI main menu bar, select Basic Tools  Region of Interest  Compute ROI Separability.

     

  2. When the file selection dialog appears, select the input file and perform any spectral subsetting. For subsetting details, see Selecting a Spectral Subset. The ROI Separability Calculation dialog appears.
  3.  

  4. In the dialog, select ROIs for the separability calculation.
  5.  

  6. Click OK. The separabilities are calculated and reported in a report dialog. Both the Jeffries-Matusita and Transformed Divergence values are reported for every ROI pair. The bottom of the report shows the ROI pair separability values listed from the least separable pair to the most separable.
  7.  

  8. To save the report to an ASCII file, select File  Save Text to ASCII.

Managing ROI Files

Use the File menu in the ROI Tool dialog to save and restore ROI information to an ENVI ROI file (default file extension .roi) and to export ROIs to ENVI vector files (.evf).

Saving ROIs to Files

To save regions of interest currently in memory to a file:

  1. Select one of the following options:
    • In the ROI Tool dialog, select File  Save ROIs.
    •  

    • From the Image window menu bar, select Tools  Region of Interest  Save ROIs to File.
    •  

    • From the ENVI main menu bar, select Basic Tools  Region of Interest  Save ROIs to File.

     

  2. When the Save ROIs to File dialog appears, click on the desired ROI names in the scrollable list with the left mouse button.
  3.  


    Note
    Only ROIs that were defined in images with the same dimensions as those in the current display appear in the ROI list. ROIs of other dimensions remain in memory.

     

  4. Enter a filename or choose an existing output filename (with the extension .roi for consistency).
  5.  

  6. Click OK to save the ROI file.

Restoring Saved ROIs

  1. To restore all of the saved ROIs, select one of the following options:
    • In the ROI Tool dialog, select File  Restore ROIs.
    •  

    • From the Image window menu bar, select Tools  Region of Interest  Restore Saved ROI File.

     

  2. When the file selection dialog appears, select the ROI file.

The ROI is loaded into the display group and ROI Tool dialog of every image of the same spatial size.

You can also restore a saved ROI file from the ENVI main menu bar by selecting Basic Tools  Region of Interest  Restore Saved ROI File. The file selection dialog appears, and you can select your ROI file. A message appears when the file is restored, but no ROIs appear in the image until an ROI Tool is opened.

Selecting Multiple ROIs for Restoration

You can restore multiple selected regions of interest from the Enter ROIs Filenames dialog when restoring saved ROIs.

  1. Select one of the following options:
    • In the ROI Tool dialog, select File  Restore ROIs.
    •  

    • From the Image window menu bar, select Tools  Region of Interest  Restore Saved ROI File.
    •  

    • From the ENVI main menu bar, select Basic Tools  Region of Interest  Restore Saved ROI File.

     

  2. When the file selection dialog appears, choose from the following options to select multiple ROIs.
    • To select a group of files that are listed consecutively, click on the first file in the group, press and hold the Shift key, and click the last file in the group. Or, click and drag the cursor over the group of items with the left mouse button. The items are selected when they are highlighted.
    •  

    • To select multiple files that are not listed consecutively, press and hold the Ctrl key on your keyboard and click on each desired file.

The selected ROIs are loaded into the display group and ROI Tool dialog of every image of the same spatial size.

Subsetting Data via ROIs

To subset an image file based on the bounding box (i.e., the area encompassing) an ROI or group of ROIs currently drawn on an image, follow these steps:

  1. In the ROI Tool dialog, select File  Subset Data via ROIs.
  2.  

  3. When the Input File selection dialog appears, select the file to subset. The Spatial Subset via ROI Parameters dialog appears.
  4.  


    Note
    To apply spectral subsetting to the input file, click Spectral Subset. For subsetting details, see Selecting a Spectral Subset.

     

  5. Select the input ROIs by clicking on the ROI names.
  6.  

  7. Use the arrow toggle button to select whether or not to mask pixels that do not fall within the ROI. If you select Yes, enter a background value.
  8.  

  9. Select output to File or Memory.
  10.  

  11. Click OK.

The resulting subsetted file is listed in the Available Bands List.

Exporting ROIs to ENVI Vector Files

Use Export ROIs to EVF to export ROIs to ENVI vector files (.evf). All of the ROIs selected are exported as separate records in a single layer. If the file associated with the ROI is georeferenced, the vector layer is in the same projection.

  1. Select one of the following options:
    • In the ROI Tool dialog, select File  Export ROIs to EVF.
    •  

    • From the Image window menu bar, select Tools  Region of Interest  Export ROIs to EVF.
    •  

    • From the ENVI main menu bar, select Basic Tools  Region of Interest  Export ROIs to EVF.

     

  2. When the Export Regions to EVF dialog appears, select the desired ROIs to export by clicking on the ROI names.
  3.  

  4. Select how ROI points should be treated-each point as a separate vector record or with all points as one vector record.
  5.  

  6. Enter the desired layer name in the Layer Name text box.
  7.  

  8. Select output to File or Memory.

Exporting ROIs to the n-D Visualizer

Use Export ROIs to n-D Visualizer to export selected ROIs to the n-D Visualizer so you can see the distribution of the points within your ROIs and between your ROIs. This option is very useful for checking the separability of your classes when you use ROIs as input into supervised classifications.

  1. Select one of the following options:
    • In the ROI Tools dialog, select File  Export ROIs to n-D Visualizer.
    •  

    • From the ENVI main menu bar, select Basic Tools  Regions of Interest  Export ROIs to n-D Visualizer.

     

  2. When the Select Input Data File dialog appears, select the input file that the ROIs are associated with and click OK. The n-D Visualizer Input ROIs dialog appears.
  3.  

  4. Select a ROI to export by clicking on the ROI name. To select all of the ROIs, click Select All Items.
  5.  

  6. Click OK. An n-D Visualizer window and n-D Controls dialog appear.
  7.  

  8. Click on the band numbers to select those bands for rotation.
  9.  

  10. Click Start. The pixels for the selected ROIs appear in the n-D Visualizer window in the same colors as the ROIs.
  11.  


    Note
    For good classification results using these ROIs, the groups of pixels for the different ROIs should be separate from each other and should not overlap.

     


    Note
    If the pixels overlap, edit the groups of pixels by selecting the appropriate colors from the Class menu to add pixels to an ROI or by selecting White to remove pixels from an ROI.

     

  12. Select Options  Export Class or Export All to export the colored pixels back to the ROI Tool dialog so they can be imported into classifications.

For more information and detailed instructions for the n-D Visualizer, see The n-Dimensional Visualizer.

Exporting ROIs to ASCII

Use Output ROIs to ASCII to output ROIs to an ASCII text file. You can edit the ASCII file format prior to output by selecting the parameters to include in the file.

You can also output map information, latitude and longitudes, and band data values for every ROI location. Prior to output, you can select which parameters to include in the ASCII file. The output is formatted into columns for easy input into spread sheets. For an example of an ROI ASCII file, see Example of ASCII Output.

  1. Select one of the following options:
    • In the ROI Tool dialog, select File  Output ROIs to ASCII.
    •  

    • From the Image window menu bar, select Tools  Region of Interest  Output ROIs to ASCII.
    •  

    • From the ENVI main menu bar, select Basic Tools  Region of Interest  Output ROIs to ASCII.

     

  2. When the file selection dialog appears, select the input file and perform any spectral subsetting. For subsetting details, see "Selecting a Spatial Subset" and Selecting a Spectral Subset.
  3.  

  4. Click OK.
  5.  

  6. Select the ROIs to output.
  7.  


    Note
    To select which parameters to output, see the following section.

     

  8. Enter or choose an output filename and click OK.
Editing ASCII Output Format

You can specify which parameters are included in the ASCII output.

  1. In the Output ROIs to ASCII Parameters dialog, click Edit Output ASCII Form. The Output ROI Values to ASCII dialog appears. By default, all parameters are selected for output.
  2.  

  3. Set parameters by selecting/deselecting the corresponding check box:
    • To include a label with the output, leave the Point # check box selected.
    •  

    • To include the ROI location information in the output, leave the ROI Location check box selected. Use the ROI Location arrow toggle button to select whether the ROI location is output by one-dimensional locations or by sample/line. Pointers to each of the pixels contained in the selected ROIs are output to the ASCII file. The pointers are the one-dimensional addresses to the pixel locations in the file where a one-dimensional address equals the line number times the number of samples plus the sample number.
    •  

    • To include geographic location information for georeferenced data, leave the Map Location check box selected. Use the Map Location arrow toggle button to designate output of the geographic locations in normal or scientific notation. Use the arrow increment buttons to set the number of significant digits.
    •  

    • To include geographic (lat/lon) location information for georeferenced data, leave the Geo Location check box selected. Use the Geo Location arrow toggle button to designate output of the geographic locations in normal or scientific notation. Use the arrow increment buttons to set the number of significant digits.
    •  


      Note
      Map and Geo are not available for non-georeferenced data.

       

    • To include the band DN values for all input bands, leave the Bands check box selected. Each band value goes in its own column in the output ASCII file.
Example of ASCII Output

Here is an example of ROIs output to an ASCII file:

;ENVI Output of ROIs (3.4) [Mon Apr 17 17:00:26 2000]  
;Number of ROIs: 1  
;File Dimension: 512 x 512  
;  
; ROI name: Region #1  
; ROI rgb value: {255, 0, 0}  
; ROI npts: 409  
; ID X    Y      Map X       Map Y        Lat          Lon  B1  B2  
B3  B4  B5  B6  
1  179  243  282977.65  4899997.33  44.222839  -107.716970  11  10   
9  46  16  10  
2  180  243  283006.15  4899997.33  44.222848  -107.716614   9  10   
8  47  15   7  
3  178  243  282949.15  4899997.33  44.222831  -107.717327  10  10   
8  48  14   8  
4  178  244  282949.15  4899968.83  44.222574  -107.717315  10  10   
8  48  13   6  
5  179  244  282977.65  4899968.83  44.222583  -107.716959  10  11  
10  46  16   8  
6  177  244  282920.65  4899968.83  44.222566  -107.717671  10  10   
8  47  13   6  
7  180  244  283006.15  4899968.83  44.222591  -107.716602  10   9   
8  48  14   6  
8  181  244  283034.65  4899968.83  44.222600  -107.716246   9   9   
7  48  12   6  
9  182  244  283063.15  4899968.83  44.222608  -107.715889  10  10   
8  47  14   7  
10  183  244  283091.65  4899968.83  44.222617  -107.715533   9  10   
7  49  14   6  
11  184  244  283120.15  4899968.83  44.222625  -107.715177   9   9   
6  50  12   4  
12  176  245  282892.15  4899940.33  44.222301  -107.718016  10  10   
8  47  15   8  
13  177  245  282920.65  4899940.33  44.222310  -107.717660  10  10   
8  46  14   8  
14  178  245  282949.15  4899940.33  44.222318  -107.717303  10  10   
7  48  13   6  
15  179  245  282977.65  4899940.33  44.222327  -107.716947  10  10   
8  47  15   8  

Hiding the ROI Tool Dialog

To hide or show the ROI Tool dialog without erasing your ROIs, see Showing and Hiding Overlay Dialogs and Layers.

Closing the ROI Tool Dialog

To close the ROI Tool dialog and quit the function, select File  Cancel.


Note
Newly-created regions of interest are retained in memory even after the ROI Tool dialog is dismissed (unless regions were specifically deleted using the Delete button).

  ENVI Online Help (August 12, 2005)