IMAGEWR -- PCIDSK to Non PCIDSK Image Transfer

Transfers up to 1024 image channels held in a PCIDSK database file to an output file whose structure is definable.

The main purpose of this program is to allow interchange of image data between EASI/PACE software and other software packages.

Warning: The created output file will always be padded to be a multiple of 512 bytes in length.

See Also: IMAGERD, LINK, NUMWRIT, IPPI

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

PARAMETERS

IMAGEWR 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
DBIW     Database Input Window                   0-4       Int
STRUCTUR File Structure Information              2-4       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 name of the PCIDSK file which holds the image data.

 EASI>FILI="file_specification"

DBIC

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

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

DBIW

Specifies the window of data to extract from the input channel(s).

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

STRUCTUR

Specifies the structure of the output file (FILO).

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

 Pixels         - Number of pixels (width) per line.

 Lines          - Number of lines in the image.

 Bands          - Number of bands in the image (this must match
                  the number of bands (channels) given in DBIC).
                  Default is number of channels in DBIC.

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

FILO

  Valid Values:   <filename, max. 64 characters>
  Default:        <none>
Specifies the filename of the non-PCIDSK output file to which image data are to be written.

An output file is created automatically, and it is advisable to specify a filename for it (the default filename extension is ".img").

DATATYPE

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

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

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 or not the data should be written in byte-swapped form. This is independent of the machine's local byte ordering.

 SWAPFL = YES       | Data written LSB first.
 SWAPFL = NO        | Data written MSB first.

DETAILS

IMAGEWR creates a non-PCIDSK image file (FILO) whose structure is definable (STRUCTUR) and transfers a window of image data from a PCIDSK database file (FILI) to it. This program is useful in allowing data to be transferred to other software packages.

Up to 1024 PCIDSK image channels (DBIC) may be converted to non-PCIDSK image channels (DBIC) at a time. Any arbitrary rectangular window (DBIW) may be extracted from the input file. This window will be scaled to fit the specified output image size (STRUCTUR).

The specified output file (FILO) is automatically created by IMAGEWR. If it already exists, IMAGEWR will exit with an error message.

The image can be flipped (FLIP=`ON') before being saved on the database, if desired. This turns the image upside-down. It means that the lines are recorded in reverse order from bottom to top and the pixel order is unchanged. By default, flipping is OFF.

SWAPFL specifies whether the tape should be written byte swapped or not. This is independent of machine local byte ordering, and defaults to SWAPFL="NO". This flag has no effect with 8 bit data. If SWAPFL="YES" for 16 or 32 bit data, the data is written out least significant byte (LSB) first, otherwise it is written most significant byte (MSB) first.

MONITOR

Program progress can be monitored by printing the percentage of processing completed 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 output by IMAGEWR can be formatted on disk. It is the user's responsibility to know what type of structure is most appropriate for the application.

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 output structure tends to be BSQ, with images being some multiple of 512 pixels and lines. Since no header data is written to the output file, it is the user's responsibility to record the structure.

EXAMPLE

The user wishes to transfer an overview of some data held in the PCIDSK database orange.pix to a second image processing software package. This second package expects all image files to be structured as three 512 pixel by 512 line 8-bit images arranged in a band sequential (BSQ) manner. Channels 4, 2, 1 of the PCIDSK file will be transferred to channels 1, 2 and 3 on the output file, exchange.img.

 EASI>FILI = "orange.pix"
 EASI>FILO = "exchange.img"
 EASI>DBIC = 4,2,1,
 EASI>DBIW =
 EASI>STRUCTUR= 512,512,3,0
 EASI>DATATYPE = "8U"
 EASI>FLIP = "OFF"
 EASI>SWAPFL="NO"
 EASI>RUN IMAGEWR
The user has been working with a PCIDSK file, hyper.pix, containing 16-bit hyperspectral imagery with dimensions of 384 pixels by 512 lines. A second software analysis package is available; however, it requires data to be line interleaved. The user wishes to use the first 288 channels on hyper.pix.

 EASI>FILI = "hyper.pix"
 EASI>FILO = "exchange.img"
 EASI>DBIC = 1,-288
 EASI>DBIW =
 EASI>STRUCTUR= 384,512,288,1
 EASI>DATATYPE = "16U"
 EASI>FLIP = "OFF"
 EASI>SWAPFL="NO"
 EASI>RUN IMAGEWR

About PCI Help Gateway