ExportColorSlices Task
This task exports raster color slices to a density slice range (DSR) file.
Example
; Start the application
e = ENVI()
; Open an AVIRIS hyperspectral image
File = FILEPATH('AVIRISReflectanceSubset.dat', $
ROOT_DIR=e.ROOT_DIR, $
SUBDIRECTORY=['data', 'hyperspectral'])
Raster = e.OpenRaster(File)
; Compute a Red Edge NDVI spectral index
SITask = ENVITask('SpectralIndex')
SITask.INPUT_RASTER = Raster
SITask.INDEX = 'Red Edge Normalized Difference Vegetation Index'
SITask.Execute
; Get the collection of data objects currently available in the Data Manager
DataColl = e.Data
DataColl.Add, SITask.OUTPUT_RASTER
; Get the export color slice task from the catalog of ENVITasks
Task = ENVITask('ExportColorSlices')
; Define inputs
Task.COLORS = $
[[127,255,0], $
[34,204,4], $
[44,122,25], $
[202,229,25],$
[255,255,0], $
[255,165,0], $
[209,104,29], $
[159,81,44]]
Task.RANGES = $
[[0.6, 0.676519], $
[0.55, 0.6], $
[0.5, 0.55], $
[0.45, 0.5], $
[0.4, 0.45], $
[0.35, 0.4], $
[0.3, 0.35], $
[0.2, 0.3]]
; Run the task
Task.Execute
; Create a classification raster from the raster color slice
ClassTask = ENVITask('ColorSliceClassification')
ClassTask.INPUT_RASTER = SITask.OUTPUT_RASTER
ClassTask.CLASS_COLORS = Task.COLORS
ClassTask.CLASS_RANGES = Task.RANGES
ClassTask.Execute
DataColl.Add, ClassTask.OUTPUT_RASTER
; Display the result
View = e.GetView()
Layer1 = View.CreateLayer(SITask.OUTPUT_RASTER)
Layer2 = View.CreateLayer(ClassTask.OUTPUT_RASTER)
Syntax
Result = ENVITask('ExportColorSlices')
Input parameters (Set, Get): COLORS, OUTPUT_DSR_URI, RANGES
Output parameters (Get only): None
Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.
Input Parameters
COLORS (required)
Specify a (3 x n) byte array of RGB color triplets, where n is the number of ranges set in the RANGES parameter.
OUTPUT_DSR_URI (required)
Specify a string with the fully qualified path and filename for the exported DSR file.
RANGES (required)
Specify a (2 x n) double-precision array of color slice ranges, where n is the number of colors set in the COLORS parameter.
Methods
Properties
Version History
|
ENVI 5.3 |
Introduced |
See Also
ENVITask, GetColorSlices Task, ColorSliceClassification Task