| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Example :: Related |
| Back to top |
| Back to top |
pyramid(file, dboc, force, olevels, poption)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILE * | str | Input file | 1 - | |
| DBOC | List[int] | Channels to build pyramids | 0 - | |
| FORCE | str | Force replacement of existing pyramid levels | 0 - 3 | Yes | No Default: No |
| OLEVELS | List[int] | List of overview levels to build | 0 - 16 | |
| POPTION | str | Pyramid options | 0 - 20 | Default: AVER |
| Back to top |
FILE
The name of the raster file to be modified. The format of the file must be supported by PCI. With some common formats, such as PCIDSK (.pix), TIFF (.tif) and Imagine (.img), the input file will be updated directly to store the overviews, provided the file is writable. With all other files, a new .pox file will be created with the same base name as the input file and stored in the same folder.
DBOC
The list of channels for which to build pyramid overviews based on the input file specified for FILE (Input file). When no value is specified for this parameter, overviews are built for all channels in the input file. Duplicate output channels are not allowed.
FORCE
Specifies whether to replace existing overview levels.
This parameter is normally set to the default value of No. However, you can select Yes in rare circumstances in which the image is altered by a tool that does not mark the pyramid levels as being out of date.
When Force is set to No, and a level specified would result in an overview that is too small, then the overview will be ignored. When Force is set to Yes, and a level specified would result in an overview that is too small, then an exception is thrown.
OLEVELS
The decimation levels for which to build overviews. For example, specifying values of 2,4 indicates an overview level that is one-half the resolution in each dimension, and an overview that is one-fourth the resolution in each dimension.
When not specified explicitly, this parameter is determined automatically based on the raster dimensions. By default, the overview levels will be powers of two (that is, 2, 4, 8, 16...), provided the smaller dimension of the overview is still greater than 64 pixels. For example, if the input file was 8000 x 600 pixels, this would result in levels of 2, 4, and 8 corresponding to overviews that would be 4000 x 300, 2000 x 150, and 1000 x 75 pixels, respectively. CATALYST Professional visualization tools, such as Focus, are optimized to use base-2 overviews.
This parameter specifies new overviews that are created; it does not remove existing overviews. Therefore, when PYRAMID is run with this parameter set to 3,9, and then run again with a setting of 27, it associates three overviews with the channel. Specified overview levels that do not match existing ones are added to the existing pyramid.
This parameter also supports two special values: -2 and -3. When -2 is specified, all of the powers-of-two overview levels will be created.
Similarly, when -3 is specified, all of the power-of-three overview levels will be created.
Assuming that the raster data is uncompressed, the files size will increase by approximately 33 percent when using -2, and approximately 12.5 percent when using -3.
POPTION
The option specifies the resampling method to use to compute the pixel values in the overviews or to delete the overviews.
Building overviews with MODE (Block mode) or AVER (Block average) can be significantly slower than computing them using NEAR (Nearest neighbor) or BILIN (Bilinear)
If the nature of the raster is unknown, or if the speed of preparing the overviews is important, use NEAR (Nearest neighbor). For a sharper raster, use CUBIC (Cubic). The default is AVER (Block average).
| Back to top |
PYRAMID is typically used to generate image pyramids (raster overviews) to accelerate loading the raster.
The simplest way to use PYRAMID is to use the default values for each parameter, except FILE (Input file). With these settings, a default set of pyramid levels is built for all channels that do not have up-to-date overviews.
The storage of image pyramids that are generated with this function depends on the type of image file. For example, pyramids generated for images in a raw file are stored as external files with a .pox extension, while those generated for images in a PCIDSK file are stored internally in SYS segments in the same PCIDSK file. Some formats, such as JP2, inherently have overviews; therefore, running PYRAMID on files of these types is unnecessary.
| Back to top |
Generate the default overview levels for irvine.pix, which, since the file is 512 x 512 pixels, will be levels 2, 4, and 8. Use average resampling to reduce speckle in the overview images.
The original image is stored in a PCIDSK file; therefore, the image pyramids will also be stored in that file.
from pci.pyramid import pyramid file = "irvine.pix" dboc = [] # build an image pyramid for each image in the file force = "" # default, no forced replacement of existing levels olevels = [] # default overview levels (2, 4, 8) poption = "AVER" # average resampling pyramid( file, dboc, force, olevels, poption )
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.