This task computes statistics on a raster.

Example


The following example performs an ISODATA classification on the raster, then computes the statistics.

; Start the application
e = ENVI()
 
; Open an input file
File = Filepath('qb_boulder_msi', Subdir=['data'], $
  Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
 
; Run an ISOData classification on the input raster
IsoTask = EnviTask('IsodataClassification')
IsoTask.INPUT_RASTER = Raster
IsoTask.Execute
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('ClassificationStatistics')
 
; Define inputs
Task.INPUT_RASTER = Raster
Task.INPUT_CLASS_RASTER = IsoTask.OUTPUT_RASTER
Task.OUTPUT_REPORT_URI = e.GetTemporaryFilename('txt')
 
; Run the task
Task.Execute
 
; Print Statistics
Print, Task.MAX
Print, Task.MEAN
Print, Task.MIN
Print, Task.NPIXELS
Print, Task.STDDEV

Syntax


Result = ENVITask('ClassificationStatistics')

Input properties (Get, Set): CLASSES, COMPUTE_COVARIANCE, COMPUTE_HISTOGRAMS, INPUT_CLASS_RASTER, INPUT_RASTER, OUTPUT_REPORT_URI

Output properties (Get only): CORRELATION, COVARIANCE, EIGENVALUES, EIGENVECTORS, MAX, MEAN, MIN, NPIXELS, STDDEV

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:

CLASSES (optional)

Specify which classes to use to generate statistics.

COMPUTE_COVARIANCE (optional)

Set this to true to compute covariance matrix, eigenvectors, eigenvalues, and correlation. The default is false.

COMPUTE_HISTOGRAMS (optional)

Set this to true to compute histograms.

CORRELATION (optional)

This is the correlation matrix of the data for each class.

COVARIANCE (optional)

This is the covariance matrix of the data for each class.

EIGENVALUES (optional)

This is the eigenvalues of the data for each class.

EIGENVECTORS (optional)

This is the eigenvectors of the data for each class.

INPUT_CLASS_RASTER (required)

Specify a classification raster to use for statistics generation. The pixels from each selected class will produce its own set of statistics.

INPUT_RASTER

Specify a raster to use for statistics generation.

MAX (required)

This is the maximum data value of each band.

MEAN (required)

This is the mean data value of each band.

MIN (required)

This is the minimum data value of each band.

NPIXELS (required)

This is the number of pixels for each class.

OUTPUT_REPORT_URI (optional)

Specify a string with the fully-qualified path and filename of a text file that will contain the statistics.

STDDEV (required)

This is the standard deviation data value of each band.

Version History


ENVI 6.1

Introduced

API Version


4.3

See Also


ENVITask, ISODATAClassification Task, RasterStatistics Task