IMAGELN

Live link to BSQ/BIL/BIP image file


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

Back to top

Description


Creates a PCIDSK file header that allows indirect access to imagery in a non-PCIDSK file, given that the file's structure is known. This allows most programs to operate on imagery stored in non-PCIDSK files.
Back to top

Parameters


imageln(fili, filo, structur, datatype, swapfl)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
FILO str Output file name 0 -    
STRUCTUR * List[int] File structure information 3 - 5  
DATATYPE * str Output raster data type 2 - 3 8U | 16S | 16U | 32R
Default: 8U
SWAPFL str Byte swap flag 0 - 3 YES | NO
Default: NO

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the input non-PCIDSK file.

FILO

Specifies the name of the output PCIDSK file to be created. This file must not exist before running IMAGELN.

STRUCTUR

Specifies the structure of the non-PCIDSK input file.

Each value has the following meaning:

DATATYPE

Specifies the data type for the output image channel.

Valid data types are:

SWAPFL

Specifies whether 16-bit and 32-bit image data should be byte-swapped when read from the input file.

For 32-bit real data, the first and last bytes are swapped, as well as the second and third bytes. For 16-bit integer data (signed or unsigned) the first and second bytes are swapped.

Acceptable values are:
Back to top

Details

IMAGELN creates a PCIDSK image file header allowing indirect access to imagery on a non-PCIDSK file, given that the input file's structure is known.

Compressed files cannot be linked. This function allows other application to operate on imagery stored in non-PCIDSK files.

When IMAGELN is run, a PCIDSK file is created and links point to the input image file.

The PCIDSK file created by IMAGELN is FILE interleaved, similarly to PCIDSK files created by CIM (with DBLAYOUT="FILE") and LINK. This means that the actual image data is stored in a separate file (FILI). No additional copies of the imagery are created. The FILE-interleaved PCIDSK file created by IMAGELN contains a description of the data stored in the non-PCIDSK file, similar to the procedure used when running PCIADD2.

Only raw data files organized as band sequential, band interleaved by line, or band interleaved by pixel may be linked. Compressed imagery, or image data that are not 8-bit, 16-bit unsigned, 16-bit signed or 32-bit real cannot be linked.

The SWAPFL (Byte Swap) parameter specifies whether 16-bit and 32-bit image data should be byte-swapped when data is 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.

IMAGELN prints information regarding the imagery size and number of channels.

Back to top

Examples

Create a PCIDSK file linked to a large hyperspectral 614 pixel x 878 line, 208-channel image file. This file stores channels in line-interleaved (BIL) format, the image data is 16-bit signed integer, and the file has no header.

from pci.imageln import imageln

fili	=	'cupriteb.dat'	# file to be linked to PCIDSK file
filo	=	'cupriteb.pix'	# PCIDSK file to be created for linking
structur	=	[614,878,208,1,0]	# input file structure
datatype	=	'16S'	# input file data type
swapfl	=	'NO'	# no swapping

imageln( fili, filo, structur, datatype, swapfl )

Create a sample raw image, taking the first five channels from the file 'irvine.pix'. The new raw image is 512 pixels x 512 lines, with five band-interleaved channels of 8-bit unsigned data.

from pci.fexport import fexport

fili	=	'irvine.pix'	# input file to be exported
filo	=	'testimage.raw'	# raw image
dbiw	=	[]	# process entire image
dbic	=	list(range(1,6))	# channels 1 to 5
dbib	=	[]	# no bitmap
dbvs	=	[]	# no vector segment
dblut	=	[]	# no lut segment
dbpct	=	[]	# no pct segment
ftype	=	'RAW'	# export to raw image file
foptions	=	'BAND'	# raw file option

fexport( fili, filo, dbiw, dbic, dbib, dbvs, dblut, dbpct, ftype, foptions )

Create a new PCIDSK file, linked to the raw image.

from pci.imageln import imageln

fili	=	'testimage.raw'	# raw file to be linked to PCIDSK file
filo	=	'testimage.pix'	# PCIDSK file to be created for linking
structur	=	[512,512,5]	# input file structure
datatype	=	'8U'	# input file data type
swapfl	=	'NO'	# no swapping

imageln( fili, filo, structur, datatype, swapfl )
	

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