RasterStatistics Task
This task computes statistics on a raster.
Use the RasterHistogram task to compute a histogram for a raster.
Example
; 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)
; Get the task from the catalog of ENVITasks
Task = ENVITask('RasterStatistics')
; Define inputs
Task.INPUT_RASTER = 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('RasterStatistics')
Input parameters (Set, Get): COMPUTE_COVARIANCE, COMPUTE_HISTOGRAMS, INPUT_RASTER, OUTPUT_REPORT_URI
Output parameters (Get only): AUTOCORRELATION, 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
COMPUTE_COVARIANCE (optional)
Set this parameter to true to compute covariance matrix, eigenvectors, eigenvalues, and correlation on the raster. The options are true or false (default).
COMPUTE_HISTOGRAMS (optional)
Set this parameter to true to compute histograms. The result will be added to the report file specified by OUTPUT_REPORT_URI.
INPUT_RASTER (required)
Specify a raster from which to generate statistics.
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
AUTOCORRELATION
This is the autocorrelation matrix of the data.
CORRELATION
This is the correlation matrix of the data.
COVARIANCE
This is the covariance matrix of the data.
EIGENVALUES
This is an array of eigenvalues from the data.
EIGENVECTORS
This is an array of eigenvectors from the data.
MAX
This is the maximum data value of each band.
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 in the raster.
STDDEV
This is the standard deviation data value of each band.
Methods
Properties
Version History
|
ENVI 5.2 |
Introduced |
|
ENVI 5.5.3 |
Added COMPUTE_HISTOGRAMS and OUTPUT_REPORT_URI parameters |
|
ENVI 6.2 |
Added AUTOCORRELATION parameter |
See Also
ENVITask, ENVIRasterStatistics, ENVISubsetRaster, RasterHistogram Task, Masking Support in ENVITasks