| Environments | PYTHON :: EASI :: MODELER |
| Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Examples :: Related |
| Back to top |
| Back to top |
regut(fili, filo, dbic, dboc, resample, dbutc, usegeo, memsize)
| Name | Type | Caption | Length | Value range |
|---|---|---|---|---|
| FILI * | str | Input file name | 1 - | |
| FILO * | str | Output file name | 1 - | |
| DBIC * | List[int] | Input raster image channel(s) | 1 - | |
| DBOC * | List[int] | Output transformed image channel(s) | 1 - | |
| RESAMPLE | str | Resampling method | 0 - 5 | NEAR | BILIN | CUBIC | 8PT | 16PT Default: NEAR |
| DBUTC * | List[int] | Input user transformation channel(s) | 2 - 2 | 1 - |
| USEGEO | str | Apply georeferencing to transformed output | 0 - 3 | ON | OFF Default: OFF |
| MEMSIZE | List[float] | Working memory size (MB) | 0 - 1 | 0 - Default: 0.0 |
| Back to top |
FILI
Specifies the name of the input image file that contains the uncorrected image data and the GCP segment.
FILO
Specifies the name of the output file to receive the corrected image data. This file must already exist before running REGUT.
DBIC
Specifies the image channels from the input file (FILI) to correct.
Duplicate channels are NOT allowed.
DBOC
Specifies the channels in the output file (FILO) to receive the corrected image data.
Duplicate channels are NOT allowed.
RESAMPLE
Specifies the resampling method to use during the registration process.
DBUTC
Specifies the channels from the output file (FILO) that contain the user-supplied transformation values.
The first of these channels should contain the X pixel coordinate of the corresponding pixel on the input image; the second channel should contain the Y line coordinate of the corresponding pixel on the input image.
That is, to assign pixel 2,3 on the output image (DBOC), the function will fetch the values from DBUTC at the same pixel (2,3). The first value fetched (DBUTC[1]) will be used as the pixel value (x'), and the second value fetched (DBUTC[2]) will be used as the line value (y'). These values will then be used to sample a pixel from the input channel (DBIC).
USEGEO
Specifies whether the input user transformation coordinates (DBUTC) are assumed to be in georeferenced coordinates.
MEMSIZE
Specifies the amount, in megabytes (as a floating-point number), of internal memory allocated to REGPRO.
The default value of 0.0 Mbytes allows REGUT to automatically determine the appropriate amount of memory to allocate. If the user-entered value is less than 0.25 MB, the memory size will be rounded up to 0.25 MB. This parameter must not have a negative value.
| Back to top |
REGUT transforms an image from one coordinate space to another, based on user-supplied transformation data.
REGUT performs a user-defined image warping (registration). This function operates in a manner similar to REG.
Selected input image channels (DBIC) from the input file (FILI) are registered/corrected using a user-defined transformation (DBUTC). The registered image is stored in the specified output image channels (DBOC) in the output file (FILO).
The user-defined transformation is provided as two channels on the output file (FILO). The user transformation channels (DBUTC) specify the pixel/line, or georeferenced X/Y positions on the input file that should be transformed to that pixel on the output file. The values of DBUTC[1], and DBUTC[2] are treated as georeferenced if USEGEO is "ON", and as pixel/line coordinates if it is "OFF" (default).
In other words, for every pixel location on the output channel (DBOC), REGUT finds the pixel values at the same pixel location on the input user-transformation channel (DBUTC). These pixel values provide an x,y pixel location on the input channel (DBIC). The pixel value at this x,y location on DBIC is then read into the original pixel location on DBOC.
Thus, if the top-left pixel in the output file's DBUTC channels contained the values 4 and 10, the pixel value at (4,10) on the input file would get transformed into the top-left pixel of the output channel.
The user transformation is typically set up using modeling equations or a specialized transformation setup function. Also, when imported, some data sets (such as NASA EOSDIS HDF files) include two channels that contain the lat/long locations of each pixel. These can be transformed through modeling equations to refer to source pixels in lat/long on other databases.
REGUT only outputs actual resampled pixels to the output channels (DBOC). While this allows mosaicking of more than one image into the same channels, it does require the user to CLEAR the channels initially (see CLR).
| Back to top |
A model is used to set up a user-defined transformation that horizontally compresses pixels on the right side of the image, and stretches pixels on the left side of the image. This output is then used by REGUT to transform the image.
from pci.cim import cim file = "smear.pix" tex1 = '' tex2 = '' dbsz = [512,512] pxsz = [] dbnc = [1,0,0,2] # image and X, and Y channels dblayout = '' cim( file, tex1, tex2, dbsz, pxsz, dbnc, dblayout )
Model to setup transformation exponential warp in X and no change in Y direction:
%2=(@x/512)^1.5 * 512 %3=@y
Perform warp:
from pci.regut import regut fili = 'irvine.pix' # input file name filo = 'smear.pix' dbic = [1] dboc = [1] resample = 'CUBIC' dbutc = [2,3] # user transformation channels usegeo = '' memsize = [] regut( fili, filo, dbic, dboc, resample, dbutc, usegeo, memsize )
A similar approach can be used to perform a rotation of the same input image. In this case, all steps are the same as in the previous example, except for the modeling step, which define a 45-degree rotation around the image center point (256,256)
Some of the pixel values in channel 2 and channel 3 will take on values that refer to pixels not available on the source database. When REGUT runs, the values in the output channels (DBOC) will not be modified for these pixels.
from pci.rot import rot from pci.regut import regut filo = 'smear.pix' dbic = [1] dboc = [1] resample = 'CUBIC' usegeo = '' memsize = [] angle = [45.0] rcentre = [256, 256] rot(filo, filo. dbic, dboc, angle=angle, rcentre=rcentre) dbutc = [2,3] # user transformation channels regut( filo, filo, dbic, dboc, resample, dbutc)
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.