Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


  >  Docs Center  >  ENVI API  >  Processing  >  ENVIExportColorSlicesTask

ENVIExportColorSlicesTask

ENVIExportColorSlicesTask

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.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
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]]
 
; Define outputs
Task.OUTPUT_DSR_URI = e.GetTemporaryFilename('dsr')
 
; 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
View1 = e.GetView()
Layer1 = View1.CreateLayer(SITask.OUTPUT_RASTER)
Layer2 = View1.CreateLayer(ClassTask.OUTPUT_RASTER)

Syntax


Result = ENVITask('ExportColorSlices')

Input properties (Set, Get): COLORS, OUTPUT_DSR_URI, RANGES

Output properties (Get only): None

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:

COLORS (required)

Specify a (3 x n) byte array of RGB color triplets, where n is the number of ranges set in the RANGES property.

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 property.

Version History


ENVI 5.3

Introduced

API Version


3.2

See Also


ENVITask, ENVITask::Parameter, ENVIGetColorSlicesTask, ENVIColorSliceClassificationTask



© 2018 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us