IMAGERD -- Non PCIDSK to PCIDSK Image Transfer

Reads non-PCIDSK format image data resident on disk, to a PCIDSK image database file.

  The non-PCIDSK formats supported are:
         BSQ (Band Sequential)
         BIL (Band Interleaved by Line)
         BIP (Band Interleaved by Pixel)
The main purpose of this program is to allow interchange of image data between EASI/PACE software and other software packages.

Warning: If the input file is not stored in 512 byte blocks, then errors may occur, especially when reading the last line. IMAGERD cannot read data off tape.

See Also: FIMPORT, IMAGEWR, LINK, NUMREAD, IPPI

Progress of this program can be monitored. See MONITOR section.

PARAMETERS

IMAGERD is controlled by the following global parameters:

Name     Prompt                                  Count     Type
FILI     Database Input File Name                1-64      Char
FILO     Database Output File Name               1-64      Char
DBIC     Database Input Channel List             1-1024    Int
DBOC     Database Output Channel List            1-1024    Int
DBIW     Database Input Window                   0-4       Int
DBOW     Database Output Window                  0-4       Int
STRUCTUR File Structure Information              2-5       Int
DATATYPE Data Type: 8U/16S/16U/32R               1-4       Char
FLIP     Flip image: ON/OFF                      2-3       Char
SWAPFL   Byte Swap Data Flag: YES/NO             0-3       Char

FILI

Specifies the input file name.

 EASI>FILI="file_specification"
The default file extension is .img.

FILO

Specifies the name of the PCIDSK file to which image data is to be written. FILO must exist before running IMAGERD.

 EASI>FILO="file_specification"

DBIC

Specifies the list of input channels to be read from FILI.

 EASI>DBIC = i,j,...,l

DBOC

Specifies the list of channels on FILO to receive output.

 EASI>DBOC = i,j,...,l
The total number of channels specified by DBOC must be equal to the total number of channels specified by DBIC.

DBIW

Specifies the window of data to be extracted from the input channel.

 EASI>DBIW=Xoffset,Yoffset,Xsize,Ysize
 EASI>DBIW=                             | use entire image

DBOW

Specifies the window in the output channel in which the image is to be embedded.

 EASI>DBOW=Xoffset,Yoffset,Xsize,Ysize
 EASI>DBOW=                             | use entire image
Xsize and Ysize need not be the same for DBIW and DBOW. Scaling and mapping of images is done automatically.

STRUCTUR

Specifies the structure of the input file.

 EASI>STRUCTUR = pixels,lines,bands,interleaving mode,header length
Each value has the following meaning:

 Pixels                 - Number of pixels (width) per line.

 Lines                  - Number of lines in the image.

 Bands                  - Number of bands (Channels) of imagery.
                          Default is number of channels in DBIC.

 Interleaving           - Mode of interleaving:
                          0: band sequential (default)
                          1: line interleaving
                          2: pixel interleaving 

 Header                 - Number of bytes of header information to skip
                          before first byte of imagery data.
                          Default is 0 bytes.

FLIP

  Valid Values:   ON, OFF
  Default:        OFF
Specifies whether the image should be flipped (turned upside-down) as it is written to the output file.

 FLIP = OFF         | don't flip imagery
 FLIP = ON          | flip imagery

SWAPFL

  Valid Values:   NO, YES
  Default:        NO
Specifies whether 16-bit and 32-bit image data should be byte-swapped when read from the file.

 SWAPFL = NO        | Do not swap bytes
 SWAPFL = YES       | Swap bytes

DATATYPE

  Valid Values:   8U, 16S, 16U, 32R
  Default:        8U
Specifies the image data type of the image channel.

  8U    |  8-bit unsigned integer
  16S   | 16-bit signed integer
  16U   | 16-bit unsigned integer
  32R   | 32-bit real

DETAILS

IMAGERD reads image data from a non-PCIDSK image file (FILI), resident on disk (floppy, optical, hard) to a PCIDSK image database file (FILO). This is useful in accessing image data files created by third-party software.

Up to 16 image channels (DBIC) may be converted to PCIDSK image channels (DBOC) at a time. Any arbitrary rectangular window (DBIW) may be extracted from the input file and inserted into a rectangular window (DBOW) on the output file. If the input and output windows do not have the same dimensions, shrinking or zooming is done automatically.

Before running IMAGERD, the user must know the length of the file header (in bytes), the number of pixels per scan line, the number of scan lines, the number of bands, and the interleaving mode (BSQ - band sequential, BIL - band interleaved by line, or BIP - band interleaved by pixel). The user inputs the above values using the file format descriptor parameter STRUCTUR.

The image can be flipped (FLIP=`ON') before being saved on the database. This turns the image upside-down but leaves the pixel order unchanged. By default, flipping is OFF.

SWAPFL (swap flag) specifies whether 16-bit and 32-bit image data should be byte swapped when data are read from the file. For 32-bit real data, the first and last bytes are swapped and the second and third bytes are swapped. For 16-bit integer data (signed or unsigned) the first and second bytes are swapped.

Note: If the number of pixels per line times the number of bands on the disk file exceeds 1048576 bytes, an error message "Work buffer too small" is printed, and the program terminates.

MONITOR

Program progress can be monitored by printing the percentage of completed processing in odometer fashion. A system parameter, MONITOR, controls this activity:

 EASI>MONITOR="ON"           | turn monitor ON  (default)
 EASI>MONITOR="OFF"          | turn monitor OFF (recommended if
                             | running in batch/background mode)

FILE FORMATS

This section discusses the various ways in which image data read by IMAGERD can be formatted on disk. It is the user's responsibility to know which type of structure is appropriate.

From a conceptual point of view, image data has the structure shown in the following figure.

                    +---------+
                    |  C C C  |
                    |  C C C  | channel 3
                 +---------+  |
                 |  B B B  |--+
                 |  B B B  | channel 2
              +---------+  |
              |  A A A  |--+
              |  A A A  | channel 1
              |         |
              +---------+

           Conceptual View of Image Data
The three ways to store image data in a disk file are: channel (or band) interleaved (BSQ), line interleaved (BIL), or pixel interleaved (BIP).

 channel interleaved:   AAA AAA BBB BBB CCC CCC

 Line interleaved:      AAA BBB CCC AAA BBB CCC

 Pixel interleaved:     ABCABCABC ABCABCABC
The most common type of structure tends to be BSQ with images being some multiple of 512 pixels and lines with no header data.

EXAMPLE

Transfer an EOSAT format thematic mapper image stored on floppy disk to a PCIDSK database format on hard disk. Image data on EOSAT floppy disks are organized in a BSQ format with no header. The image file is 512 pixels by 512 lines, and contains one band.

 EASI>FILI="A:\EOSAT_filename"
 EASI>FILO="PCI_filename"
 EASI>DBIC=1
 EASI>DBOC=1
 EASI>DBIW=
 EASI>DBOW=
 EASI>STRUCTUR=512,512
 EASI>FLIP="OFF"
 EASI>SWAPFL=
 EASI>RUN IMAGERD
Transfer a non-PCIDSK image file stored on hard disk to a PCIDSK database file. Image data on this file are organized as 1024 pixels by 2000 lines. The image file contains 12 bands, preceded by a header which is 122 bytes in length. The band interleaving mode is BIL.

 EASI>FILI="input_filename"
 EASI>FILO="PCI_filename"
 EASI>DBIC=1,-8                 | Same as DBIC=1,2,...,8
 EASI>DBOC=1,2,3,4,5,6,7,8      | Same as DBOC=1,-8
 EASI>DBIW=
 EASI>DBOW=
 EASI>STRUCTUR=1024,2000,12,1,122
 EASI>FLIP="OFF"
 EASI>SWAPFL=
 EASI>RUN IMAGERD
Transfer a non-PCIDSK image file stored on optical disk to a PCIDSK database file on hard disk. The image data are organized as 1000 pixels by 1000 lines. The image file contains 2 bands, preceded by a header which is 300 bytes in length. The band interleaving mode is BIP.

 EASI>FILI="input_filename"
 EASI>FILO="PCI_filename"
 EASI>DBIC=1,2
 EASI>DBOC=1,2
 EASI>DBIW=
 EASI>DBOW=
 EASI>STRUCTUR=1000,1000,2,2,300
 EASI>FLIP="OFF"
 EASI>SWAPFL=
 EASI>RUN IMAGERD

About PCI Help Gateway