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

  >  Docs Center  >  ENVI API  >  Processing  >  ENVIForwardMNFTransformTask



This task performs a minimum noise fraction (MNF) transform to determine the inherent dimensionality of image data, to segregate noise in the data, and to reduce the computational requirements for subsequent processing.


This example performs the following steps:

  1. Opens an AVIRIS hyperspectral image subset.
  2. Runs a forward minimum noise transform (MNF) to reduce noise in the data.
  3. Defines three regions of interest (ROIs), each containing nine pixels of a common material.
  4. Retrieves the spectra from the ROIs and uses their means as endmembers for mixture tuned matched filtering (MTMF).
  5. Runs the MTMF task, which performs matched filtering and adds an infeasibility image to the results. The infeasibility image is used to reduce the number of false positives that are sometimes found when using matched filtering.
  6. Displays the result. To see all of the bands, open the Data Manager. ENVI creates three MF Score images (one for each ROI) and three Infeasibility images.
; Start the application
e = ENVI()
; Open an input file
File = Filepath('AVIRISReflectanceSubset.dat', $
  SUBDIR=['data', 'hyperspectral'], $
Raster = e.OpenRaster(File)
; First run a Forward MNF on the data
Task = ENVITask('ForwardMNFTransform')
Task.INPUT_RASTER = Raster
; Use the first 25 MNF bands to run a matched filter
Subset = ENVISubsetRaster(Task.OUTPUT_RASTER, BANDS=LINDGEN(25))
; Define three ROIs, each containing 9 pixels of a common material.
nSpectra = 9d
roi1 = ENVIROI(NAME='Green Field')
pixelAddr1 = [[77,182],[78,182],[79,182], $
  [77,183],[78,183],[79,183], $
roi1.AddPixels, pixelAddr1, SPATIALREF=Subset.SPATIALREF
roi2 = ENVIROI(NAME='Soil')
pixelAddr2 = [[386,285],[387,285],[388,285], $
  [386,286],[387,286],[388,286], $
roi2.AddPixels, pixelAddr2, SPATIALREF=Subset.SPATIALREF
roi3 = ENVIROI(NAME='Ground')
pixelAddr3 = [[296,326],[297,326],[298,326], $
  [296,327],[297,327],[298,327], $
roi3.AddPixels, pixelAddr3, SPATIALREF=Subset.SPATIALREF
; Retrieve the spectra from the ROIs and use their mean as 
; endmembers for the Mixture Tuned Matched Filter task
spectra1 = Subset.GetData(ROI=roi1)
mean1 = Total(spectra1,1) / nSpectra
spectra2 = Subset.Getdata(ROI=roi2)
mean2 = Total(spectra2,1) / nSpectra
spectra3 = Subset.GetData(ROI=roi3)
mean3 = Total(spectra3,1) / nSpectra
endmembers = [[mean1],[mean2],[mean3]]
; Get the task from the catalog of ENVITasks
Task = ENVITask('MixtureTunedMatchedFilter')
Task.INPUT_RASTER = Subset
Task.ENDMEMBERS = endmembers
Task.NAMES = ['Green Field', 'Soil', 'Ground']
; Run the task
; Get the data collection
dataColl = e.Data
; Add the output to the data collection
dataColl.Add, Task.OUTPUT_RASTER
; Display the result
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RASTER)


Result = ENVITask('ForwardMNFTransform')

Input properties (Set, Get): INPUT_RASTER, OUTPUT_RASTER_URI

Output properties (Get only): OUTPUT_RASTER

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.


This task inherits the following methods from ENVITask:







This task inherits the following properties from ENVITask:








This task also contains the following properties:

INPUT_RASTER (required)

Specify a raster on which to perform a MNF transform.


This is a reference to the output raster of filetype ENVI.


Specify a string with the fully qualified filename and path of the associated OUTPUT_RASTER. If you do not specify this property, or set it to an exclamation symbol (!), a temporary file will be created.

Version History

ENVI 5.2


API Version


See Also

ENVITask, ENVITask::Parameter, ENVIForwardICATransformTask, ENVIForwardPCATransformTask, ENVIDimensionalityExpansionRasterTask

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