This task collects endmembers from a variety of sources, resamples them to match a given raster, and outputs the spectra to be used in other tasks.

Example


; Start the application
e = ENVI(/HEADLESS)
 
; Open an input file
File = Filepath('qb_boulder_msi', Subdir=['data'], $
  Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
 
; Open a file with Regions of Interest
RoiFile = Filepath('qb_boulder_roi.xml', $
  ROOT_DIR=e.Root_Dir, $
  SUBDIRECTORY=['data'])
Rois = e.OpenRoi(RoiFile)
 
; Open a Spectral Library file
specLibFile = FILEPATH('vegetation_beckman_3132.sli', ROOT_DIR=e.ROOT_DIR, $
  SUBDIR=['resource', 'speclib', 'usgs_v6'])
specLib = ENVISpectralLibrary(specLibFile)
 
; Get the task from the catalog of ENVITasks
EndmemberCollectionTask = ENVITask('EndmemberCollection')
 
; Set parameters
EndmemberCollectionTask.input_raster = Raster
EndmemberCollectionTask.rois = Rois
EndmemberCollectionTask.spectral_library = specLib
EndmemberCollectionTask.spectra_names = ['Aspen_Leaf-B DW92-3 [W1R1Ba AREF]', $
  'Cheatgrass ANP92-11A [W1R1Ba AREF]', $
  'Juniper_Bush IH91-4B [W1R1Ba AREF]']
 
; Run endmember collection
EndmemberCollectionTask.Execute
 
; Classify raster
SAMTask = ENVITask('SpectralAngleMapperClassification')
SAMTask.mean = EndmemberCollectionTask.endmembers
SAMTask.class_names = EndmemberCollectionTask.endmember_names
SAMTask.class_colors = EndmemberCollectionTask.endmember_colors
SAMTask.input_raster = Raster
SAMTask.Execute
 
; Get the collection of data objects currently available in the Data Manager
DataColl = e.Data
 
; Add the output to the Data Manager
DataColl.Add, SAMTask.OUTPUT_RASTER
 
; Display the result
View = e.GetView()
Layer = View.CreateLayer(SAMTask.OUTPUT_RASTER)

Syntax


Result = ENVITask('EndmemberCollection')

Input properties (Set, Get): INPUT_RASTER, ROIS, SPECTRA_NAMES, SPECTRAL_LIBRARY, SPECTRAL_SIGNATURES

Output properties (Get only): ENDMEMBER_COLORS, ENDMEMBER_NAMES, ENDMEMBERS

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


ENDMEMBER_COLORS

This is an array of RGB triplets representing the endmember colors.

ENDMEMBER_NAMES

The output endmember names.

ENDMEMBERS

A double array representing the selected and resampled spectra.

INPUT_RASTER

Specify the raster to use as a base for extracting endmembers.

ROIS

Specify one or more Regions of Interest. Endmembers will be generated by averaging the spectral signatures of the input raster at each ROI.

SPECTRA_NAMES

A string array representing the library spectra to retrieve.

SPECTRAL_LIBRARY

Specify a spectral library from which to retrieve a particular spectrum.

SPECTRAL_SIGNATURES

Specify an array of spectral signatures.

Version History


ENVI 6.1

Introduced

API Version


4.3

See Also


ENVITask