SPECLINCMB

Spectral Linear Combination


EnvironmentsPYTHON :: EASI
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Example

Back to top

Description


SPECLINCMB performs a spectral linear combination of image channels using the coefficients you specify.
Back to top

Parameters


speclincmb(fili, dbic, filo, ftype, foptions, coef)

Name Type Caption Length Value range
FILI * str Input file name 1 -    
DBIC List[int] Input channels 0 -   1 -
FILO * str Output file name 1 -    
FTYPE str Output file type 0 - 4  
FOPTIONS str Output file options 0 - 64  
COEF * str Coefficients for image channels 1 -    

* Required parameter
Back to top

Parameter descriptions

FILI

The name of the input file.

The file must be GDB-supported type that contains the image data to use in the linear combination.

DBIC

The channel or channels in the input file to process.

If you do not specify a value, all channels in the input file are used.

This parameter is optional.

FILO

The path and file name of the output file to which to write the results of the process.

You cannot overwrite the input file.

Note: The bit depth of the output image channels is that of the input channels.

FTYPE

The format of the output file.

The format must be a GDB-supported type.

If you do not specify a value, the format of the input file is used, if supported. If you specify a file name, but not the file name extension, the PCIDSK format (.pix) is used.

FOPTIONS

The options to use when creating the output file, which are specific to each format.

For example, with some formats, you can select compression schemes, subtypes, and more.

For a complete list of GDB-recognized file types, including the available options for each, see GDB-supported file formats.

This parameter is optional.

COEF

The coefficients to apply to the input file during processing.

You can specify the value as either a list or a text file.

The format for the list is as follows:
In the preceding example, a unique set of coefficients for four image channels is specified. The order of the coefficient sets follows the order of the image channels in the input file. Typically, the order is as follows:
  1. Blue
  2. Green
  3. Red
  4. Near infrared (NIR)

You must provide coefficients for each input channel. Separate each coefficient set of an image channel with a semicolon (;). By default, all image raster channels are included.

If you do not provide coefficients for an input channel, a blank channel will be created and each pixel will be assigned a value of one (1).

In the following example, the third channel is replaced with a blank channel for each pixel assigned a value of one (1):
In the next example, following, a new blank channel is created after the four input channels:

When you specify a text file, you must specify the coefficients for each input raster channel on a separate line, as shown in the following figure:

In the preceding figure, a text file shows a unique set of coefficients specified for four image channels, each on a separate line. The order of the coefficient sets follows the order of the image channels in the input file. Typically, the order is as follows:
  1. Blue
  2. Green
  3. Red
  4. Near infrared (NIR)

The order of the channels you specify must be the same as the order of the channels in the input file.

Back to top

Details

SPECLINCMB performs a spectral linear combination of channels in an input image using the coefficients you specify, and then generates a new set of image channels.

The linear-combination process uses coefficients to determine the percentage of each image channel to combine to produce a single image channel.

If necessary, you can combine multiple image channels to a single image channel in the output file.

Back to top

Example

In the following example, a new green image channel is generated by combining the green and NIR image channels based on the specified coefficients.

from pci.speclincmb import speclincmb
fili = "irvine.pix"
dbic = [1,2,3,4]
filo = "irvine_rgb.pix"
ftype = "PIX"
foptions = ""
coef = "1.0,0.0,0.0,0.0; 0.0,0.91,0.0,0.09; 0.0,0.0,1.0,0.0; 0.0,0.0,0.0,1.0"
speclincmb(fili, dbic, filo, ftype, foptions, coef)

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