PCTWRIT

Write PCT to text file


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

Back to top

Description


Writes pseudocolor table data from a pseudocolor table segment or breakpoint pseudocolor table segment to a text file.
Back to top

Parameters


Name Type Caption Length Value range
FILE * String Input file name 1 - 192  
DBPCT * Integer Input PCT segment 1 - 1  
PCTFORM * String PCT text format 3 - 10 ATT | INOUT | OUT
Default: ATT
TFILE * String Output PCT text file name 1 - 192  

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the PCIDSK image file that contains the PCT segment.

DBPCT

Specifies the input segment that contains the pseudocolor table (type 171) or breakpoint pseudocolor table (type 173).

PCTFORM

Specifies the text format to use when writing the pseudocolor table to the text file.

Supported options are:

For INOUT and OUT formats, 'n' specifies the number of table entries written per line in the text file. For the INOUT format, there are four integer values per table entry (input value, red output value, green output value, and blue output value). For OUT format, there are three output values per table entry. If 'n' is not specified, it defaults to 4 for the INOUT format, and to 5 for the OUT format.

For INOUTn format maximum size of n is 9.

For OUTn format maximum size of n is 12.

TFILE

Specifies the name of the output text file to receive the pseudocolor table data.

The specified text file must NOT exist before running PCTWRIT.

Back to top

Details

PCTWRIT transfers pseudocolor table data from the specified PCT segment (DBPCT) in the input file to an output text file (TFILE). This allows you to create, edit, and exchange pseudocolor table data between this and other image analysis systems, using a text file.

Three text file formats are available:
Note: The specified output text file (TFILE) must NOT exist before running PCTWRIT.
Back to top

Examples

ATT format

Create a text file in attribute format.

EASI>file	=	"irvine_seg.pix"	! input file
EASI>dbpct	=	8	! PCT segment
EASI>pctform	=	"ATT"	! PCT text format
EASI>tfile	=	"att.txt"	! output text file

EASI>run PCTWRIT

A portion of the resulting text file is shown below:

 ! pseudocolor table (attribute format)
 !
 ! min: max  ;  red  green  blue
 !
          0 ;    0     0      0
          1 ;    0     0    255
          2 ;    0     8    255
          3 ;    0    16    255
          4 ;    0    24    255
          5 ;    0    30    255
          .  .  .  .  .  .  . .  .
        100 ;    0   255      5
        101 ;    0   255      0
        102 ;    5   255      0
        103 ;   10   255      0
        104 ;   15   255      0
        105 ;   20   255      0
          .  .  .  .  .  .  . .  .
        255 ;  255     0      0

INOUT format

Create a text file using input/output format.

EASI>file	=	"irvine_seg.pix"	! input file
EASI>dbpct	=	8	! PCT segment
EASI>pctform	=	"INOUT"	! PCT text format
EASI>tfile	=	"inout.txt"	! output text file

EASI>run PCTWRIT

A portion of the resulting text file is shown below:

    0   0   0   0   1   0   0 255   2   0   8 255   3   0  16 255
    4   0  24 255   5   0  30 255   6   0  35 255   7   0  40 255
    8   0  45 255   9   0  50 255  10   0  55 255  11   0  60 255
   12   0  65 255  13   0  70 255  14   0  75 255  15   0  80 255
   16   0  85 255  17   0  90 255  18   0  95 255  19   0 100 255
   20   0 105 255  21   0 110 255  22   0 115 255  23   0 120 255
   .  .  .  .  .  .  . .  .
  240 255   0 185 241 255   0 190 242 255   0 195 243 255   0 200
  244 255   0 205 245 255   0 210 246 255   0 215 247 255   0 220
  248 255   0 225 249 255   0 231 250 255   0 237 251 255   0 243
  252 255   0 249 253 255   0 255 254 255 160 255 255 255 255 255

OUT format

Write a text file using output-only format.

EASI>file	=	"irvine_seg.pix"	! input file
EASI>dbpct	=	8	! PCT segment
EASI>pctform	=	"OUT"	! PCT text format
EASI>tfile	=	"out.txt"	! output text file

EASI>run PCTWRIT

A portion of the resulting text file is shown below:

    0   0   0   0   0 255   0   8 255   0  16 255   0  24 255
    0  30 255   0  35 255   0  40 255   0  45 255   0  50 255
    0  55 255   0  60 255   0  65 255   0  70 255   0  75 255
    0  80 255   0  85 255   0  90 255   0  95 255   0 100 255
    0 105 255   0 110 255   0 115 255   0 120 255   0 125 255
    0 130 255   0 135 255   0 140 255   0 145 255   0 150 255
   . . .  .  .  .   .  .  .  .  . .  .  .  .  .  .  . .  .
  255   0 135 255   0 140 255   0 145 255   0 150 255   0 155
  255   0 160 255   0 165 255   0 170 255   0 175 255   0 180
  255   0 185 255   0 190 255   0 195 255   0 200 255   0 205
  255   0 210 255   0 215 255   0 220 255   0 225 255   0 231
  255   0 237 255   0 243 255   0 249 255   0 255 255 160 255
  255 255 255

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