ROT

Channel and GCP rotation


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

Back to top

Description


Rotates rectangular image data in image channels between two image files or within one file. Optionally, a ground control point (GCP) segment may be rotated along with the image.
Back to top

Parameters


Name Type Caption Length Value range
FILI * String Input file name 1 - 192  
FILO * String Output file name 1 - 192  
DBIC Integer Input raster channels 0 -    
DBOC Integer Output raster channels 0 -    
DBGC Integer Input GCP segment 0 - 1  
DBIW Integer Raster input window 0 - 4 Xoffset, Yoffset, Xsize, Ysize
ANGLE Float Rotation angle 0 - 1 0 - 360
Default: 90
RCENTRE Float center of rotation 0 - 2  
RESAMPLE String Resampling method 0 - 5 See Details
Default: NEAR
MEMSIZE Integer Working memory size (MB) 0 - 1 1 - 2000
Default: 64
REPORT String Report mode 0 - 192 Quick links
MONITOR String Monitor mode 0 - 3 ON, OFF
Default: ON

* Required parameter
Back to top

Parameter descriptions

FILI

Specifies the name of the PCIDSK file that contain data to be rotated.

FILO

Specifies the name of the PCIDSK file to receive the rotated image data.

The output file can be the same as the input file. If FILO specifies a file that does not exist, ROT automatically creates a file that will fit the rotated image. FILO must be an existing file when rotating GCPs.

DBIC

Optionally specifies the input channels to be rotated.

If this parameter is not specified, no input channels are rotated. Duplicate channels are NOT allowed.

If the output file does not exist, this parameter must be specified in ascending order.

Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.

DBOC

Optionally specifies output channels to receive the rotated images.

Duplicate channels are NOT allowed.

If the output file is the same as the input file and the rotation angle (ANGLE) is 180 degrees, the output channels (DBOC) can be the same as the input channels (DBIC).

If the output file is the same as the input file and the rotation angle (ANGLE) is NOT 180 degrees, the output channels (DBOC) cannot be the same as the input channels (DBIC).

If the specified output file does not exist, this parameter will be ignored and ROT will create the channels automatically.

Ranges of channels or segments can be specified with negative values. For example, {1,-4,10} is internally expanded to {1,2,3,4,10}. When you are not specifying a range in this way, only 48 numbers can be specified explicitly.

DBGC

Optionally specifies the GCP segment to be rotated along with the input image.

If this parameter is specified, a new GCP segment will be created in the output file. If it is not specified, no GCP segments are rotated.

Only the image coordinates inside the GCP segment will be rotated.

DBIW

Optionally specifies a rectangular window (Xoffset, Yoffset, Xsize, Ysize) to be read from the input image. If this parameter is not specified, the entire image is processed by default.

Xoffset, Yoffset define the upper-left starting pixel coordinates of the window. Xsize is the number of pixels that define the window width. Ysize is the number of lines that define the window height.

ANGLE

Specifies the clockwise angle of rotation, in degrees.

RCENTRE

Optionally specifies the center of rotation, in pixel and line coordinates. If this parameter is not specified, it defaults to the center of the input image.

RESAMPLE

Specifies the resampling method to use to determine the ouput pixel values.

Supported values are:

MEMSIZE

Specifies the amount, in megabytes, of internal memory allocated to ROT.

The default is 64 MB; a typical amount of memory to allocate is approximately half of the system memory available per processing thread.

REPORT

Specifies where to direct the generated report.

Available options are:

MONITOR

The program progress can be monitored by printing the percentage of processing completed. A system parameter, MONITOR, controls this activity.

Available options are:

Back to top

Details

ROT rotates the specified rectangular image channels (DBIC) and optionally a GCP segment (DBGC) in the input file by a user-defined angle (ANGLE), or simply rotates a GCP segment from the input file to the output file. For image rotation, the result is saved in the specified output image channels (DBOC) in the output file. If the output file is not specified, it defaults to the input file. If the output file is specified but does not exist, ROT automatically creates an output file that fits the rotated image.

The rotation can be restricted within a specified window (DBIW), if desired. By default, the entire image is rotated.

This function requires a minimum of 64MB of internal memory.

You can specify the center of rotation (RCENTRE) in pixel and line coordinates. By default, the center of rotation is the center of the input image.

The RESAMPLE (Resampling Method) parameter specifies the resampling method used during rotation.

Note: If a GCP segment is to be rotated as well, the DBIW parameter should be defaulted to the entire image. Only the image coordinates in the GCP segment are rotated.

If the rotation angle is 180 degrees and the center of rotation (RCENTRE) is not specified, it will be treated as a special case and ROT will run much faster.

Back to top

Examples

Rotate channel 1 of the demo file "irvine.pix" by 45 degrees and save the result in channel 7.

EASI>fili	=	"irvine.pix"	! input file
EASI>filo	=	"irvine.pix"	! update the input file
EASI>dbic	=	1	! channels to rotate
EASI>dboc	=	7	! output channel
EASI>dbgc	=		! no GCP segment
EASI>dbiw	=		! process entire image
EASI>angle	=	45	! rotation angle
EASI>rcentre	=		! use center of image
EASI>resample	=	"CUBIC"	! cubic convolution
EASI>memsize	=		! use default 64MB

EASI>RUN ROT

The user has a 400x200 file "file1.pix" and wants to rotate channel 1 of the file by 90 degrees. The result is to be saved in channel 1 of a 200x400 file "file2.pix".

EASI>fili	=	"file1.pix"
EASI>filo	=	"file2.pix"
EASI>dbic	=	1	! channel to rotate
EASI>dboc	=	1	! output channel
EASI>dbgc	=		! no GCP segment
EASI>dbiw	=		! process entire image
EASI>angle	=	90	! rotation angle
EASI>rcentre	=		! use center of image
EASI>resample	=	"CUBIC"	! cubic convolution
EASI>memsize	=		! use default 64MB

EASI>RUN ROT
	

The user has a 400x200 file "file1.pix" and wants to rotate channels 1 and 2 of the file by 45 degrees. The result is to be saved in channels 1 and 2 of a file "file2.pix", which does not exist.

EASI>fili	=	"file1.pix"
EASI>filo	=	"file2.pix"	! file to be created automatically
EASI>dbic	=	1,2	! channels to rotate
EASI>dboc	=	1,2	! output channels
EASI>dbgc	=	2	! rotate GCP segment 2
EASI>dbiw	=		! process entire image
EASI>angle	=	45	! rotation angle
EASI>rcentre	=		! use center of image
EASI>resample	=	"CUBIC"	! cubic convolution
EASI>memsize	=		! use default 64MB

EASI>RUN ROT
	

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