This task computes statistics on a raster.
Example
The following example performs an ISODATA classification on the raster, then computes the statistics.
e = ENVI()
File = Filepath('qb_boulder_msi', Subdir=['data'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
IsoTask = EnviTask('IsodataClassification')
IsoTask.INPUT_RASTER = Raster
IsoTask.Execute
Task = ENVITask('ClassificationStatistics')
Task.INPUT_RASTER = Raster
Task.INPUT_CLASS_RASTER = IsoTask.OUTPUT_RASTER
Task.OUTPUT_REPORT_URI = e.GetTemporaryFilename('txt')
Task.Execute
Print, Task.MAX
Print, Task.MEAN
Print, Task.MIN
Print, Task.NPIXELS
Print, Task.STDDEV
Syntax
Result = ENVITask('ClassificationStatistics')
Input parameters (Set, Get): CLASSES, COMPUTE_COVARIANCE, COMPUTE_HISTOGRAMS, INPUT_CLASS_RASTER, INPUT_RASTER, OUTPUT_REPORT_URI
Output parameters (Get only): CORRELATION, COVARIANCE, EIGENVALUES, EIGENVECTORS, MAX, MEAN, MIN, NPIXELS, STDDEV
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
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.
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.
OUTPUT_REPORT_URI (optional)
Specify a string with the fully-qualified path and filename of a text file that will contain the statistics.
Output Parameters
CORRELATION
This is the correlation matrix of the data for each class.
COVARIANCE
This is the covariance matrix of the data for each class.
EIGENVALUES
This is the eigenvalues of the data for each class.
EIGENVECTORS
This is the eigenvectors of the data for each class.
MEAN
This is the mean data value of each band.
MIN
This is the minimum data value of each band.
NPIXELS
This is the number of pixels for each class.
STDDEV
This is the standard deviation data value of each band.
Methods
Execute
Parameter
ParameterNames
Properties
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
Version History
See Also
ENVITask, ISODATAClassification Task, RasterStatistics Task