ARICONST

Image channel plus constant arithmetic


EnvironmentsMODELER
Batch ModeYes
Quick linksDescription :: Parameters :: Parameter descriptions :: Details :: Related

Back to top

Description


Performs arithmetic operations between an image channel and a scalar constant. Addition, subtraction, multiplication, division, logical AND, and logical OR operations are supported.
Back to top

Parameters


Name Type Length Value range
InputA: Input image channel A * Raster port 1 -    
Mask: Area mask Bitmap port 0 -    
Output: Output image channel Raster port 0 -    
Port Settings Integer 1 - 1024 Nearest | Bilinear | Cubic
Default: Nearest
Operation Stromg 1 - 1024 ADD | SUB | MUL | DIV | AND | OR
Default: ADD
Autoscaling mode String 1 -   ON | OFF | USER
Default: ON
Constant * String 1 -    
Zero divide value String 0 -    
Minimum input String 0 -    
Maximum input String 0 -    
Minimum output String 0 -    
Maximum output String 0 -    
Minimum String 0 -    
Maximum String 0 -    

* Required parameter
Back to top

Parameter descriptions

InputA: Input image channel A

Specifies the channel that contains the input image channel A.

Mask: Area mask

Optionally specifies the segmetn that contains the input Area Mask; this is a bitmap that indicates the area under which the input raster should be processed. If no bitmap is specified, the entire input chanel is processed.

Output: Output image channel

Optionally specifies the output channel to receive the arithmetic or logical results.

Port Settings

Specifies the type of image resampling desired.

Supported methods include:

Operation

Specifies the arithmetic or logical operation to be performed.

Available operations include:

Logical operations are performed in a bitwise manner on binary representations of integers by comparing corresponding bit values with corresponding bit valuess to generate the output pixel value.

The OR sets a bit value to 1 if one or both of the corresponding bits in its operands have a value of 1, and it sets a bit value to 0 if both of the corresponding bits have a value of 0. The OR always returns a value of 1 unless the corresponding bit values of both operands are 0.

The AND sets a bit value to 1 only if both of the corresponding bit values in its operands are 1, and it sets a bit value to 0 if the bits differ or both are 0. A 1 combined with AND with a second bit value is that second bit, and a zero combined with AND with a second bit is zero.

Autoscaling mode

Specifies the scaling method used to modify the results of the arithmetic operation, to preserve dynamic range. This parameter has no effect on logical operations ('AND' or 'OR').

If the output layer is 8-bit, this parameter is typically set to ON.

If the output layer is real, this parameter is usually set to OFF.

Constant

Specifies a constant to be applied for the operation.

The constant value can be a real number for an arithmetic operation. For logical operations, the constant value is truncated.

A value for the constant must be specified.

Zero divide value

Optionally specifies the value to be used for the result of a division by zero.

Minimum input

Specifies the minimum input range for scaling the results of image arithmetic operations, when the autoscaling mode is set to USER.

The minimum input range must be less than or equal to the maximum input range.

This parameter is ignored if:

See the Scaling section in the Function Details for more information.

Maximum input

Specifies the maximum input range for scaling the results of image arithmetic operations, when the autoscaling mode is set to USER.

The maxiumum input range must be greater than or equal to the minumum input range.

This parameter is ignored if:

See the Scaling section in the Function Details for more information.

Minimum output

Specifies the minimum output range for scaling the results of image arithmetic operations, when the autoscaling mode is set to USER.

The minimum output range must be less than or equal to the maximum output range.

This parameter is ignored if:

See the Scaling section in the Function Details for more information.

Maximum output

Specifies the maximum output range for scaling the results of image arithmetic operations, when the autoscaling mode is set to USER.

The maxiumum output range must be greater than or equal to the minumum output range.

This parameter is ignored if:

See the Scaling section in the Function Details for more information.

Minimum

Specifies the minimum result of the operation. ARICONST saves the actual range of output values that resulted from the specified arithmetic operation before any scaling was performed. This parameter stores the minimum result of the operation.

Maximum

Specifies the maximum result of the operation. ARICONST saves the actual range of output values that resulted from the specified arithmetic operation before any scaling was performed. This parameter stores the maxiimum result of the operation.

Back to top

Details

ARICONST performs an arithmetic or a logical operation on image data stored in the input channel (InputA) and a specified constant. The result is saved to the a specified output channel (Output).

One of the following arithmetic or logical operations can be performed:
  • InputA + Constant
  • InputA - Constant
  • InputA * Constant
  • InputA / Constant
  • InputA AND Constant
  • InputA OR Constant

For logical operations, real pixel values are truncated to integers, then each bit in the input layer is ANDed or ORed with the corresponding bit in the constant.

The value for the Constant parameter must be specified; otherwise, ARICONST exits with an error message.

A bitmap can specify the area to process within the input channels. Only the areas covered by the bitmap are processed; the rest of the pixels are set to 0. If no area mask is specified, the entire image is processed by default.

Scaling

Scaling can be performed for arithmetic operations (ADD, SUB, MUL or DIV). Scaling is never performed for logical operations (AND or OR).

ARICONST can perform arithmetic operations on 8-bit unsigned integer, 16-bit signed integer, 16-bit unsigned integer, and 32-bit real channels. These channels have the following ranges for data:
Type				   Min			   Max

8-bit unsigned integer		     0			    255
16-bit signed integer		-32768			  32767
16-bit unsigned integer		     0			  65535
32-bit real			1.0E38			+1.0E38

Because the results of arithmetic operations may be outside of the range of the values that the output layer can store, it is often necessary to scale the results to fit into the output layer. The user can control this scaling using autoscaling, and input and output range specifications. Three options exist for scaling.

If autoscaling is OFF, no scaling is performed. If the resulting value is less than the output layer can hold, it will be set to the smallest value the output layer can hold. If the resulting value is greater than the output layer can hold, it will be set to the greatest value the output layer can hold. This option is most commonly used if the output layer is real.

If autoscaling is ON, automatic scaling is performed. This is accomplished by performing two passes on the data. The first pass is used to determine the minimum and maximum values resulting from the arithmetic operation. In the second pass, these values are used to scale the results to the full range of the output layer.

Note: Setting autoscaling ON has no effect if the output layer is real; no scaling is performed.

If autoscaling is USER, scaling is determined by the specified input and output ranges. Result values between the minimum and maximum input values are linearly scaled to fit in the range of minimum and maximum output values. Result values less than the minimum input value are set to the minimum output values; and values greater than the maximum input value are set to the maximum output value.

You MUST specify the minimum and maximum input values. The minimum and maximum output values can be defaulted. In the case of 8-bit or 16-bit output layers, the defaults are the minimum and maximum range for the layer. In the case of a real output layer, the minimum output value defaults to the minimum input value, and the maximum output value defaults to the the maximum input value.

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