CNTGTHMR

Creates a contiguous thematic raster


EnvironmentsPYTHON :: EASI :: MODELER
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example

Back to top

Description


CNTGTHMR converts a raster to a thematic raster that has contiguous areas, and assigns a unique group value to the pixels.
Back to top

Parameters


cntgthmr(fili, filo, dbic, dboc, diagonal)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
FILO str Output file name 0 -    
DBIC * List[int] Input raster image channel 1 - 1  
DBOC List[int] Output thematic raster channel 0 - 1  
DIAGONAL str Diagonal method 0 - 15 One Group | Separate Groups
Default: One Group

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the PCIDSK file that contains the raster channel to process.

FILO

Specifies the name of the PCIDSK file to receive the output thematic raster layer.

If FILO is not specified, FILI is used for the new thematic raster layer. If FILO is specified but does not exist, a new file is created.

DBIC

Specifies the raster channel that contains the image for which the thematic raster will be constructed.

DBOC

Specifies the channel to receive the output thematic raster with its associated raster attributes.

If FILO is an existing file, DBOC must be specified with a CHN_32R type. If FILO does not exist, DBOC is ignored.

DBOC cannot be the same as DBIC (input layer).

DIAGONAL

Specifies how to combine two or more pixels with the same value that are joined anywhere at a diagonal.

Supported values are:
Back to top

Details

CNTGTHMR converts a normal thematic raster or a regular raster into a contiguous thematic raster. A contiguous thematic raster is is a raster where only contiguous pixel regions have the same value.

For example, all the lake pixels for a classified image have the same value. Although the lakes are disconnected (because they have the same pixel value), they point to the same record when they become thematic (that is, an attribute table is generated).

In some cases, an analysis should be performed on contiguous areas only. For example, if all lakes that have more than a specified Area are found, a normal thematic raster cannot be used. After running CNTGTHMR, all lakes have separate records and the Area values are given for each lake.

Back to top

Example

Read raster channel 6 from "irvine.pix" and store the output thematic raster channel in a new file named "oirvine.pix". DBOC is 1 for the new file and the "One Group" method is used.

from pci.cntgthmr import cntgthmr

fili      =  "irvine.pix"
filo      =  "oirvine.pix"      # specifies the new output file
dbic      =  [6]                # uses input raster channel 6
dboc      = []                  # uses output channel 1 for the new file
diagonal  =  ""                 # defaults to "One Group"

cntgthmr( fili, filo, dbic, dboc, diagonal )

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.