PCTREAD

Read PCT from text file


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

Back to top

Description


Reads a pseudocolor table from a text file, then transfers the data to a pseudocolor table segment (PCT type 171 or BPCT type 173) in a database file.
Back to top

Parameters


Name Type Caption Length Value range
FILE * String Output file name 1 - 192  
DBPCT Integer Output PCT segment 0 - 1  
DBSN * String Output PCT segment name 1 - 8  
DBSD String Output segment description 0 - 64  
PCTFORM String PCT text format 0 - 5 ATT | INOUT | OUT
Default: ATT
TFILE * String PCT text file name 1 - 192  

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the PCIDSK image file to receive the PCT segment.

DBPCT

Specifies the output segment to receive the pseudocolor table (PCT type 171 or BPCT type 173).

If this parameter is not unspecified, a new PCT segment is created.

DBSN

Specifies a name (up to 8 characters) for the output PCT segment.

This parameter is required only if a new output segment is created.

DBSD

Describes (in up to 64 characters) the contents or origins of the output PCT segment.

This parameter may be used ony if a new output segment is created.

PCTFORM

Specifies the text format of the pseudocolor table data in the text file.

Supported options are:

TFILE

Specifies the name of the input text file that contains the pseudocolor table data to read.

Back to top

Details

PCTREAD transfers pseudocolor table data from a specified text file (TFILE) to a pseudocolor table segment (DBPCT with PCT type 171 or BPCT type 173) in a database file (FILE), assuming a specified text file format (PCTFORM).

Three text file formats are available:
Note: It is not essential that all 256 entries in a pseudocolor table be specified in the text file. If a new segment is created, the output values for any missing entries default to 0. If an existing segment was specified, only the table entries that are read in are modified.
Back to top

Example

Read a pseudocolor table from the text file 'classpct.txt', which stores a pseudocolor table in attribute format. This table can be used to display the results of a multispectral classification, where eight classes are assigned different colors. The text file is shown below:

 ! pseudocolor table for showing results of classification.
 !
 ! min : max  ;   red green  blue  ; comments
 !
          0  ;     0     0     0  ; null class (black)
          1  ;   255     0     0  ; class 1 (red)
          2  ;     0   255     0  ; class 2 (green)
          3  ;     0     0   255  ; class 3 (blue)
          4  ;     255 255     0  ; class 4 (yellow)
          5  ;     0   255   255  ; class 5 (cyan)
          6  ;   255     0   255  ; class 6 (magenta)
          7  ;   128   128   128  ; class 7 (gray)
          8  ;   255   128    64  ; class 8 (orange)
    9 : 255  ;   255   255   255  ; all other (white)

Read the text file into a new pseudocolor table segment, checking for the attribute data format.

EASI>file	=	'local.pix'
EASI>dbpct	=	
EASI>dbsn	=	'CLASSPCT'
EASI>dbsd	=	'PCT for showing results of 8-class classification'
EASI>pctform	=	'ATT'
EASI>tfile	=	'classpct.txt'

EASI> run PCTREAD

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