This is a reference to an ROI object.
Example
e = ENVI()
file = FILEPATH('qb_boulder_msi', ROOT_DIR=e.ROOT_DIR, $
SUBDIRECTORY = ['data'])
raster = e.OpenRaster(file)
roi1 = ENVIROI(NAME='Region 1', COLOR='Blue')
Print, roi1
IDL prints:
ENVIROI <244676>
COLOR = 0, 0, 255
NAME = 'Region 1'
N_DEFINITIONS = 0
See More Examples.
Syntax
Result = ENVIROI([, Keywords=value])
Methods
AddGeometry
AddPixels
AddThreshold
AddVectorRecords
ClearGeometry
ClearPixels
ClearThresholds
ClearVectorRecords
Close
Dehydrate
GetExtent
GrowRegion
Hydrate
PixelAddresses
Pixelate
PixelCount
Revert
Save
Properties
Properties can be set as keywords to functions during creation, or retrieved or changed using the "." notation after creation.
COLOR
Set this property to a string or RGB vector that specifies the color of the ROI. If this property is not set, then it will use a default color.
The following table lists the single characters that you can use as the color modifier in either the COLOR property or the Format string argument. You must use the lower-case character.
Color Name |
Character |
Blue |
b |
Green |
g |
Red |
r |
Cyan |
c |
Magenta |
m |
Yellow |
y |
Black |
k |
White |
w |
When setting the COLOR property, you can also use any of the string values defined by the !COLOR system variable, as shown in the following image:
NAME
Use this property to specify a named variable that contains a ROI name. If this property is not set, then it will use a default name that is currently not in use, starting with Region 1.
More Examples
This example shows how to get the properties of multiple ROI records within a single ROI file:
e = ENVI()
file = FILEPATH('qb_boulder_msi', ROOT_DIR=e.ROOT_DIR, $
SUBDIRECTORY = ['data'])
raster = e.OpenRaster(file)
ROIFile = FILEPATH('qb_boulder_roi.xml', $
ROOT_DIR=e.ROOT_DIR, SUBDIRECTORY = ['data'])
rois = e.OpenROI(ROIFile)
For i=0, n_elements(rois)-1 do $
Print, rois[i]
IDL prints:
ENVIROI <231489>
COLOR = 240, 240, 0
NAME = 'Disturbed Earth'
N_DEFINITIONS = 1
ENVIROI <231490>
COLOR = 255, 0, 0
NAME = 'Bright Roof'
N_DEFINITIONS = 1
ENVIROI <231491>
COLOR = 29, 29, 255
NAME = 'Water'
N_DEFINITIONS = 1
Also see How do I process the pixels within a region of interest (ROI)?
Version History
ENVI 5.1 |
Introduced |
ENVI 5.3.1 |
Added Dehydrate method
|
ENVI 5.4 |
Added Hydrate method
|
API Version
4.2
See Also
ENVI function, ENVI::OpenRaster, ENVIRasterLayer::AddROI, ENVI::OpenROI, VectorAttributeToROIs Task, VectorRecordsToSeparateROI Task, VectorRecordsToROI Task