PCIADD2 -- Add Image Channel to Database

Adds one new image channel to a BAND, or FILE interleaved PCIDSK database, with that channel stored in an external file. An image channel can be added either by creating a new empty image file or by using an existing image file.

See Also: CIM, PCIDEL2, PCIMOD, IMAGELN, LINK

PARAMETERS

PCIADD2 is controlled by the following global parameters:

Name     Prompt                                  Count     Type
FILE     Database File Name                      1-64      Char
DATATYPE Data Type: 8U/16S/16U/32R               1-8       Char
ADDMODE  Add File Mode: CREATE/EXIST             1-6       Char
IFILE    Image File Name                         0-64      Char
CHANINFO Channel Layout Information              0-4       Int

FILE

Specifies the name of the PCIDSK database file to modify.

 EASI>FILE="filespec"

DATATYPE

Specifies the image data type for the new image channel.

 EASI>DATATYPE="8U"             |  8-bit unsigned integer
 EASI>DATATYPE="16S"            | 16-bit   signed integer
 EASI>DATATYPE="16U"            | 16-bit unsigned integer
 EASI>DATATYPE="32R"            | 32-bit real

ADDMODE

Specifies the mode for adding a new image channel.

 EASI>ADDMODE="CREATE"          | create new empty image file
 EASI>ADDMODE="EXIST"           | use existing image file

IFILE

Specifies the name of the image file to add to the PCIDSK header file. If ADDMODE="CREATE" and IFILE is not specified, the new image file will have the same file name as the PCIDSK database file and will use the three-digit channel number (with leading zeroes) as the file extension (.nnn). If ADDMODE="EXIST", IFILE must be specified.

 EASI>IFILE="filespec"          | user-specified file name
 EASI>IFILE=                    | defaults to PCIDSK file name

CHANINFO

Optionally specifies information on the layout of the channel of image data within the file specified by IFILE. For `raw' files (i.e., those that have no header information and only a single packed channel) this parameter should be defaulted. CHANINFO is only used if ADDMODE="EXIST".

 EASI>CHANINFO=                                  |for RAW files
 EASI>CHANINFO=header,pixelgroup,linelength,swap |for other files
where:

 header        number of bytes before first byte of channel data.
               default: 0 bytes

 pixelgroup    number of bytes in each group of pixels.
               default: from DATATYPE (8U=1, 16S=2, 16U=2, 32R=4)

 linelength    number of bytes in one line of image data.
               default: pixelgroup * database size in X (pixels)

 swap          16-bit or 32-bit real data swap flag.  If swap=1 then
               data is byte swapped (that is, low order byte first).
               Byte swapped data is common on PCs and DEC machines.
               default: native byte order for this system.

DETAILS

PCIADD2 adds one image channel to a PCIDSK database file (FILE). That database must be either BAND, or FILE interleaved. PIXEL interleaved databases may not have external image channels added. The image data type (DATATYPE) can be 8-bit unsigned (8U), 16-bit signed (16S), 16-bit unsigned (16U), or 32-bit real (32R). The disk file (IFILE) which stores the image data is either created (ADDMODE="CREATE") or already exists (ADDMODE="EXIST").

The channel number for the new image is the first available channel on the database file, which could either be a channel previously deleted by PCIDEL2, or the next sequential channel after the last channel on the database. A PCIDSK database file can handle a maximum of 1024 channels.

If ADDMODE="CREATE", a new image file of the appropriate size is created, and initially contains zeros (no useful data). If IFILE is not specified, the image file is created having the same name as the database file and using the three-digit channel number (with leading zeroes) as the file extension (.nnn). If the image file already exists, the new channel is not created.

If ADDMODE="EXIST", an image file of appropriate size and type must already exist, and must contain valid image data. IFILE must be specified; there is no default file name in this case. The image file is assumed to have the same number of pixels and lines as all other image channels on the database.

The CHANINFO parameter can be used to specify how the channel of information in an existing file (when ADDMODE="EXIST") is organized. In many cases this parameter can be defaulted since the data is in `raw' format (that is no header information, single packed channel of data). If the file is not in `raw' format, careful use of the CHANINFO parameter can allow access to the channel of data.

Warning: Ensure that the size and data type for existing image files are correct for the specified database file. Otherwise, programs which access data on the image channel may not work as expected.

Unlike pixel-interleaved PCIDSK files created by CIM, the data type for image channels on band, or file interleaved PCIDSK files do not have to follow any particular order. The data type (DATATYPE) for additional image channels can be anything, and does not depend on the data types of existing channels on the database. In other words, data types of channels can be mixed-up, and do NOT have to follow the 8U/16S/16U/32R order that is required for pixel-interleaved database files.

EXAMPLE

Add a new 16-bit signed image channel to a 512 by 512 PCIDSK file created by CIM2, which already contains six image channels. The file name for the new image file will be image.007 by default.

 EASI>FILE="image.pix"
 EASI>DATATYPE="16S"
 EASI>ADDMODE="CREATE"
 EASI>IFILE=
 EASI>RUN PCIADD2
Create a PCIDSK file with no image data, then add three existing 512 x 512 pixel 8-bit image channels to the database. The file names for these image files must be explicitly specified.

 EASI>FILE="image.pix"
 EASI>TEX1=
 EASI>TEX2=
 EASI>DBSZ=512,512
 EASI>PXSZ=30,30
 EASI>DBNC=0
 EASI>RUN CIM2

 EASI>DATATYPE="8U"
 EASI>DATATYPE="EXIST"
 EASI>CHANINFO=
 EASI>IFILE="image.red"
 EASI>RUN PCIADD2
 EASI>IFILE="image.grn"
 EASI>RUN PCIADD2
 EASI>IFILE="image.blu"
 EASI>RUN PCIADD2
Fourth and fifth channels are added to the above file. The data file data.x11 has four pixel-interleaved 8-bit channels and 1536 bytes of header data. We wish to add the 1st and 2nd channels on data.x11 as the fourth and fifth channels on image.pix.

 EASI>IFILE   ="data.x11"
 EASI>CHANINFO=1536,4,2048
 EASI>RUN PCIADD2
 EASI>CHANINFO=1537,4,2048              | NOTE: 1537 = 1536+1
 EASI>RUN PCIADD2
Sixth and seventh channels are then added to the same file. The data file data.band has three band-interleaved 16-bit channels and 2048 bytes of header data. Again, we want to add the 1st and 2nd channels.

 EASI>IFILE   ="data.band"
 EASI>DATATYPE="32S"
 EASI>CHANINFO=2048,4,4*512
 EASI>RUN PCIADD2
 EASI>CHANINFO=2048+4*512*512,4,4*512
 EASI>RUN PCIADD2

About PCI Help Gateway