This task performs a union or intersection of multiple ROI geometries into a single output ROI, Note that this task only works with geometry and will ignore ROIs that contain pixels or thresholds in their definitions.
Example
e = ENVI()
File = Filepath('qb_boulder_roi.xml', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Regions = e.OpenROI(File)
Task = ENVITask('MergeROI')
Task.INPUT_ROIS = Regions
Task.OPERATION = 'Union'
Task.ROI_COLOR = [200,0,0]
Task.ROI_NAME = 'Union Example'
Task.Execute
e.Data.Add, Task.OUTPUT_ROI
RasterFile = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
View = e.GetView()
BaseRaster = e.OpenRaster(RasterFile)
Layer = View.CreateLayer(BaseRaster)
roiLayer = Layer.AddRoi(Task.OUTPUT_ROI)
Syntax
Result = ENVITask('MergeROI')
Input properties (Set, Get): INPUT_ROIS, OPERATION, OUTPUT_ROI_URI, ROI_COLOR, ROI_NAME
Output properties (Get only): OUTPUT_ROI
Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.
Methods
This task inherits the following methods from ENVITask:
AddParameter
Execute
Parameter
ParameterNames
RemoveParameter
Properties
This task inherits the following properties from ENVITask:
COMMUTE_ON_DOWNSAMPLE
COMMUTE_ON_SUBSET
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
This task also contains the following properties:
INPUT_ROIS (required)
Specify the ROIs to merge.
OPERATION (required)
Specify which method used to merge the ROIs:
The default value is Union.
OUTPUT_ROI
This is a reference to the output ROI.
OUTPUT_ROI_URI (optional)
Specify a string with the fully-qualified path and filename of the associated OUTPUT_ROI.
ROI_COLOR (optional)
Specify the RGB triplet values for the output ROI color.
ROI_NAME (optional)
Specify the name of the output ROI.
Version History
API Version
4.2
See Also
ENVITask, ENVITask::Parameter