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


  >  Docs Center  >  ENVI API  >  Processing  >  ENVITrainingClassificationStatisticsTask

ENVITrainingClassificationStatisticsTask

ENVITrainingClassificationStatisticsTask

This task computes statistics from classification training regions. The mean spectra for all vector records are grouped by unique CLASS_ID, CLASS_NAME, or CLASS_CLR attribute values, if any of these attributes exists.

Example


; Start the application
e = ENVI()
 
; Open an input file
File1 = Filepath('qb_boulder_msi', Subdir=['data'], $
  Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File1)
File2 = Filepath('qb_boulder_msi_vectors.shp', Subdir=['data'], $
  Root_Dir=e.Root_Dir)
Vector = e.OpenVector(File2)
 
; Get training statistics
StatTask = ENVITask('TrainingClassificationStatistics')
StatTask.INPUT_RASTER = Raster
StatTask.INPUT_VECTOR = Vector
StatTask.Execute
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('SpectralAngleMapperClassification')
 
; Define inputs
Task.INPUT_RASTER = Raster
Task.MEAN = StatTask.Mean
Task.CLASS_NAMES = StatTask.Class_Names
 
; Define outputs
Task.OUTPUT_RASTER_URI = e.GetTemporaryFilename()
 
; Run the task
Task.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, Task.Output_Raster
 
; Display the result
View1 = e.GetView()
Layer1 = View1.CreateLayer(Task.Output_Raster)

Syntax


Result = ENVITask('TrainingClassificationStatistics')

Input properties (Set, Get): INPUT_RASTER, INPUT_VECTOR

Output properties (Get only): CLASS_COLORS, CLASS_NAMES, CLASS_PIXEL_COUNT, COVARIANCE, MEAN, 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:

CLASS_COLORS

This is an array of RGB triplets representing the class colors as defined by the input vector.

CLASS_NAMES

This is an array of class names as defined by the input vector.

CLASS_PIXEL_COUNT

This is the number of pixels used to compute the training statistics, returned as a long-integer array [number of classes].

COVARIANCE

This is the covariance matrix of the training data, returned as a double-precision array [number of bands, number of bands, number of classes].

INPUT_RASTER (required)

Specify a raster from which to generate statistics.

INPUT_VECTOR (required)

Specify a vector that defines training regions for a raster. Statistics will be calculated from this vector. The vector attributes should include CLASS_NAME and CLASS_CLRS fields, if class names and class colors are desired. The CLASS_CLRS field should contain one RGB triplet representing a color for each class.

MEAN

This is the mean of the training data, returned as a double-precision array [number of bands, number of classes].

STDDEV

This is the standard deviation of the training data, returned as a double-precision array [number of bands, number of classes].

Version History


ENVI 5.2

Introduced

API Version


3.2

See Also


ENVITask, ENVITask::Parameter, ENVISubsetRaster, ENVIROIStatisticsTask



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