RuleRasterClassification Task

This task creates a classification raster by thresholding on each band of the raster.

Example

This example uses the default parameter settings:

; 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 raster statistics

StatTask = ENVITask('RasterStatistics')

StatTask.INPUT_RASTER = Raster

StatTask.Execute

 

; Get the task from the catalog of ENVITasks

Task = ENVITask('RuleRasterClassification')

 

; Define inputs

Task.INPUT_RASTER = Raster

Task.THRESHOLD = StatTask.MEAN

 

; 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

View = e.GetView()

Layer = View.CreateLayer(Task.OUTPUT_RASTER)

Syntax

Result = ENVITask('RuleRasterClassification')

Input parameters (Set, Get): CLASS_COLORS, CLASS_NAMES, INPUT_RASTER, MINIMUM_RULE, OUTPUT_RASTER_URI, THRESHOLD

Output parameters (Get only): OUTPUT_RASTER

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

CLASS_COLORS (optional)

Specify a (3,n) byte array with the RGB colors for the given ranges, where n is the number of classes

CLASS_NAMES (optional)

This is a string array of class names.

INPUT_RASTER (required)

Specify a raster on which to perform supervised classification.

MINIMUM_RULE (optional)

To use MINIMUM_RULE for the classification, set this value to 1. This uses the lowest score values of each pixel class for the final classification. If 0 (the default of MAXIMUM_RULE), the highest score values of each pixel class are used for the final classification.

For example, a rule image pixel with 3 bands could be classified into grass, water, or dirt when all meet the THRESHOLD. The pixel values are grass: 0.75, water: 0.63, and dirt: 0.46.

OUTPUT_RASTER_URI (optional)

Specify a string with the fully qualified filename and path of the associated OUTPUT_RASTER.

THRESHOLD (optional)

Specify a value or array of the thresholds. If only a value, it will be used for every band. Pixels lower than this value will be set to unclassified.

Output Parameters

OUTPUT_RASTER

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

Methods

Execute

Parameter

ParameterNames

Properties

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

Version History

ENVI 6.0

Introduced