This task creates a polyline shapefile from a single-band class activation raster generated by a deep learning model.

This task is part of ENVI Deep Learning, which requires a separate license and installation.

Example


This example uses Band Math to automatically locate rivers in a subset of a shaded-relief image over Africa. It uses the ClassActivationToPolylineShapefile task to create polylines from the river pixels.

; Start the application
e = ENVI()
 
; Open an input file
File = Filepath('natural_earth_shaded_relief.jp2', $
  Subdir=['data'], Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
 
; Get a 1-band subset containing rivers
subsetRaster = ENVISubsetRaster(Raster, $
  SUB_RECT=[10132, 4419, 10982, 4830], BANDS=0)
 
; Make the rivers
bmRaster = ENVIPixelwiseBandMathRaster(subsetRaster, '255-b1')
 
; Get the task from the catalog of ENVITasks
Task = ENVITask('ClassActivationToPolylineShapefile')
 
; Define inputs
Task.INPUT_RASTER = bmRaster
 
; Run the task
Task.Execute
 
; Add the output to the Data Manager
e.Data.Add, bmRaster
e.Data.Add, Task.OUTPUT_VECTOR
 
; Display the result
View = e.GetView()
Layer1 = View.CreateLayer(bmRaster)
Layer2 = View.CreateLayer(Task.OUTPUT_VECTOR)

Syntax


Result = ENVITask('ClassActivationToPolylineShapefile')

Input properties (Set, Get): INPUT_RASTER, METHOD, OUTPUT_VECTOR_URI, RESAMPLE, THRESHOLD

Output properties (Get only): OUTPUT_THRESHOLD, OUTPUT_VECTOR

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. See the ENVITask topic in ENVI Help.

  • AddParameter
  • Execute
  • Parameter
  • ParameterNames
  • RemoveParameters

Properties


This task inherits the following properties from ENVITask:

COMMUTE_ON_DOWNSAMPLE

COMMUTE_ON_SUBSET

DESCRIPTION

DISPLAY_NAME

NAME

REVISION

See the ENVITask topic in ENVI Help for details.

This task also contains the following properties:

INPUT_RASTER (required)

Specify a single-band class activation raster from which to generate a polyline shapefile. If you have a multi-band class activation raster, you must first define a spectral subset consisting of one band to use for INPUT_RASTER.

METHOD (optional)

Specify the thresholding method to use to differentiate feature and background pixels in INPUT_RASTER. If THRESHOLD is specified it will supersede METHOD. The following are the available values. The default value is Otsu.

  • Isodata
  • Mean
  • Maximum Entropy
  • Minimum Error
  • Moments
  • Otsu

OUTPUT_THRESHOLD

If THRESHOLD is not specified, then this will be the threshold calculated by METHOD. If THRESHOLD is specified, then this will be the threshold specified.

OUTPUT_VECTOR

This is a reference to the output vector.

OUTPUT_VECTOR_URI (optional)

Specify a string with the fully qualified path and filename for OUTPUT_VECTOR.

RESAMPLE (optional)

Specify an integer indicating the resampling value to use when computing the center lines of features in the class activation raster. The default value is 1. If you have a high-resolution class activation raster with thick features, setting RESAMPLE to a higher value (for example, 2 to 4) can reduce processing time while still accurately identifying the center lines of the features.

THRESHOLD (optional)

Specify a threshold to use to differentiate feature and background pixels in INPUT_RASTER. If THRESHOLD is specified it will supersede METHOD.

Version History


Deep Learning 1.1

Introduced

See Also


ClassActivationToPolygonShapefile Task, ClassActivationToClassification Task, ClassActivationToPixelROI Task, ClassActivationToPolygonROI Task