PCTREAD -- Read PCT from Text File

Reads a pseudocolour table from a text file, then transfers the data to the pseudocolour table segment on a database file.

See Also: PCTWRIT

PARAMETERS

PCTREAD is controlled by the following global parameters:

Name     Prompt                                  Count     Type
FILE     Database File Name                      1-64      Char
DBPCT    Database Pseudocolour Segment           0-1       Int
DBSN     Database Segment Name                   1-8       Char
DBSD     Database Segment Description            0-64      Char
PCTFORM  PCT Text Form: ATT/INOUT/OUT            3-5       Char
TFILE    Text File                               1-64      Char

The following parameter receives output:

LASC     Last Segment Created                    0-1       Int

FILE

Specifies the name of the PCIDSK image file.

 EASI>FILE="filespec"

DBPCT

Specifies the database segment that contains the pseudocolour table (type 171).

 EASI>DBPCT=i
If DBPCT is unspecified, a new pseudocolour table segment is created.

TFILE

  Valid Values:   <filename, max. 64 characters>
  Default:        <none>
Specifies the name of the input text file, from which the pseudocolour table data are read.

DBSN

  Valid Values:   <string, max. 8 characters>
  Default:        PCTREAD
Specifies an identifier that is assigned to the output pseudocolour table segment. This string is displayed by ASL, and may be changed with the MAS program.

DBSN is only required if a new segment is created.

DBSD

  Valid Values:   <string, max. 64 characters>
  Default:        <none>
Optionally specifies a descriptor that is associated with the output segment (string describing contents or origin of data).

This string is displayed by ASL if LTYP = "SHORT" or "FULL", and may be changed with MAS.

DBSD may only be used if a new segment is created.

PCTFORM

  Valid Values:   ATT, INOUT, OUT
  Default:        ATT
Specifies the format for the pseudocolour table data in the text file.

 ATT            | Attribute format      (range r g b)
 INOUT          | Input/Output format   (level r g b
 OUT            | Output format         (r g b)

LASC

If a new segment is created, then LASC is assigned the number for the new segment, after PCTREAD finishes executing.

DETAILS

PCTREAD transfers pseudocolour table data from a specified text file (TFILE) to a pseudocolour table segment (DBPCT) on a database (FILE), assuming a given text file format (PCTFORM).

There are three formats (PCTFORM) available:

               start : end ; red green blue ; comment

     example:      5 :   5 ; 255     0  255 ; magenta
                 input   red green  blue

     example:      5     255     0   255
                 red green  blue

     example:    255     0   255
Note: It is not essential that all 256 entries in a pseudocolour 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 which are read in are modified.

EXAMPLE

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

 ! Pseudocolour 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 (grey)
          8  ;   255   128    64  ; class 8 (orange)
    9 : 255  ;   255   255   255  ; all other (white)
Read the text file into a new pseudocolour table segment, checking for the attribute data format.

 EASI>FILE="local.pix"
 EASI>DBPCT=
 EASI>PCTFORM="ATT"
 EASI>DBSN="CLASSPCT"
 EASI>DBSD="PCT for showing results of 8-class classification"
 EASI>TFILE="classpct.txt"
 EASI>RUN PCTREAD
Run PCTREP to verify that the pseudocolour table was read in.

 EASI>DBPCT=LASC
 EASI>REPORT=
 EASI>RUN PCTREP
PCTREP Pseudocolour Table Report V5.3 EASI/PACE 14:47 11-JUN-90

6:CLASSPCT Type:171 [Pseudocolour] Last Update: 14:46 11-JUN-90 Contents: PCT for showing results of 8-class classification

             0               1               2               3
     +---------------------------------------------------------------
   0 |   0r   0g   0b  255r   0g   0b    0r 255g   0b    0r   0g 255b
   4 | 255r 255g   0b    0r 255g 255b  255r   0g 255b  128r 128g 128b
   8 | 255r 128g  64b  255r 255g 255b  255r 255g 255b  255r 255g 255b
  12 | 255r 255g 255b  255r 255g 255b  255r 255g 255b  255r 255g 255b
  16 | 255r 255g 255b  255r 255g 255b  255r 255g 255b  255r 255g 255b
  24 | 255r 255g 255b  255r 255g 255b  255r 255g 255b  255r 255g 255b
 .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 252 | 255r 255g 255b  255r 255g 255b  255r 255g 255b  255r 255g 255b

About PCI Help Gateway