PCIMOD

PCIDSK database file modification


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

Back to top

Description


Allows modification of PCIDSK database files. These modifications include adding new image channels, deleting image channels, and compressing PCIDSK files (removing deleted segments) to release disk space.
Back to top

Parameters


pcimod(file, pciop, pcival)

Name Type Caption Length Value range
FILE * str Database file name 1 -    
PCIOP * str Modification option 1 - 3 ADD | DEL | COM
PCIVAL List[int] Input channel number or list 0 -    

* Required parameter
Back to top

Parameter descriptions

FILE

Specifies the name of the PCIDSK file to modify.

PCIOP

Specifies the type of modification operation to perform.

Options include:

PCIVAL

Specifies channel or segment numbers for the selected PCIOP option.
Back to top

Details

PCIMOD adds or deletes image channels, or compresses (removes) segments on an existing PCIDSK database file (FILE). The type of operation (add, delete, compress) is specified by PCIOP, with further information provided through PCIVAL.

If there is insufficient free disk space to add the requested number of image channels to the PCIDSK file, the program aborts with an error message, and the PCIDSK file is not changed.

Important: While performing the specified operation, PCIMOD rearranges data on the PCIDSK file and requires time to complete. Aborting the execution before it is complete may corrupt the PCISDK file and render it unusable.

Modification options

Add

Specifying PCIOP="ADD" adds new (empty) image channels to the existing database file. In this case, the first six values of PCIVAL specify the number of 8-bit unsigned, 16-bit signed, 16-bit unsigned, 32-bit real, 16-bit signed complex, and 32-bit real complex image channels to add to the file. Any (but not all) of these six values may be set to zero. Image channels are sequentially renumbered so that all new empty channels within each channel type are inserted in their proper place. There must be sufficient disk space available for the additional channels, otherwise PCIMOD may fail (although this should not harm existing data in the file).

For FILE interleaved PCIDSK files (created by CIM, LINK, or IMAGELN), PCIMOD adds new channels in a band sequential format to the PCIDSK file itself, instead of placing them in separate files (as with PCIADD2). Unlike PIXEL interleaved files, image channels are NOT renumbered within each channel type. Deleted channels, however, (deleted by PCIDEL2) are removed and the existing channels renumbered before new channels are added.

Up to 4096 PIXEL or BAND interleaved channels, or 1024 FILE interleaved channels are allowed on a PCIDSK file.

Delete

Specifying PCIOP="DEL" deletes selected image channels from the PCIDSK database file. In this case, PCIVAL specifies a list of 1 to 1024 channel numbers to delete. The remaining channels (if any) are sequentially renumbered.

For FILE interleaved PCIDSK files, only channels which are stored on the PCIDSK file itself (created by PCIMOD) may be deleted. Use PCIDEL2 to delete channels on separate files.

Compress

Specifying PCIOP="COM" removes deleted segments and unused space between segments. It does not renumber segments.

Note: On some systems, deleting channels or segments from a file may not reduce the disk space used by the file.
Back to top

Examples

A PCIDSK file, "mywork.pix", was originally created by CIM with four 8-bit, one 16-bit signed, one 16-bit unsigned, and two 32-bit real image channels (a total of eight channels). The user wants to add one channel of each type to the file. The result would be a database file where the original eight channels are renumbered to channels 1, 2, 3, 4, 6, 8, 10, and 11, and four new empty channels (one of each type) are numbered 5, 7, 9, and 12.

from pci.pcimod import pcimod

file		=	'mywork.pix'
pciop		=	'ADD'
pcival		=	[1,1,1,1]

pcimod( file,pciop,pcival )

To reduce disk space, channels 3, 7, and 8 must be deleted, and all deleted segments must be removed. The result would be a database file where channels 1, 2, 4, 5, 6, 9, 10, 11, and 12 are renumbered sequentially from 1 to 9, and all segments are renumbered from 1 to the total number of segments on the file.

from pci.pcimod import pcimod

file		=	'mywork.pix'
pciop		=	'DEL'
pcival		=	[3,7,8]
pcimod( file,pciop,pcival )

file		=	'mywork.pix'
pciop		=	'com'
pcimod( file,pciop,pcival )
        

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