This is an old revision of the document!


PHP's gd library is missing or unable to create PNG images

Image Expression Type

The Image Expression Language is used by the five calculator functors to evaluate algebraic and logical expressions. The complete operator reference — including full syntax tables, availability notes, null value handling, EGO Script examples, and practical examples — is in Calculate Functors — Complete Operator Documentation.

GUI Editor

Graphical representation of the image expression editor

Identifiers

In expressions, operands are referenced by type-specific identifiers:

  • iX — a connected map, where X is an integer from 1 to 100
  • tX — a connected table or lookup table, where X is an integer from 1 to 100
  • vX — a connected scalar value, where X is an integer from 1 to 100

Maps are connected via Number Map hook functors, tables via Number Table, and scalar values via Number Value.

In the abbreviated (shorthand) syntax, operands are referenced directly by variable name using type sigils: # for maps, % for tables and lookup tables, $ for values — eliminating the hook block entirely. See Calculator functor shorthand for details.

During logical expression evaluation, zero is false and any non-zero value is true.

Null Value Handling

A null value in any operand poisons the entire expression result. Two operators interrupt propagation: isNull() and ?. See Null Value Handling for the complete rules, exceptions specific to map calculators, and defensive patterns.

Operators

General Operators

Arithmetic, logical, and conditional operators with full precedence rules, including if/then/else, boolean and/or/not, comparison operators, +, -, *, /, %, ^, and the catch-error operator ?.

General Operators

General Functions

Mathematical functions (sqrt, sin, cos, ln, exp, abs, ceil, floor, round, max, min, clamp, clampMod, signal, pi), stochastic functions (rand, rUniform, rNormal, rPoisson), and control functions (abort).

General Functions

Value Operators

Retrieves a scalar value connected to a vX port.

Value Operators

Image Operators and Functions

Operators that work at the current cell: iX (cell value), iX[line, col] (coordinate lookup), null, isNull(), line, and column. Available in Calculate Map and Calculate Categorical Map only; line and column are also available in the two lookup table calculators with row-oriented meanings.

Image Operators and Functions

Lookup Table Operators

Single-key lookup table queries using rule-operators: exact match, lower/upper bounds, closest key, linear interpolation, key existence test, and named attribute lookup.

Lookup Table Operators

Table Operators

Multi-key table queries using a set of composite keys, returning values from a named, indexed, or default data column.

Table Operators

Image Neighborhood Functions

Window-based spatial aggregation: nbMin, nbMax, nbSum, nbProd, nbCount, nbAverage, nbMedian, nbMode, nbVar, nbStdDev. Available in Calculate Map and Calculate Categorical Map only.

Image Neighborhood Functions

Image Neighborhood Indexing Functions

Neighbourhood statistics used as indices to retrieve values from a lookup table or a second image: nbMinRef, nbMaxRef. Available in Calculate Map and Calculate Categorical Map only.

Image Neighborhood Indexing Functions

Convolution

Kernel-weighted convolution via nbConvol. Available in Calculate Map and Calculate Categorical Map only.

Convolution Operator

EGO Script

In an EGO Script .ego file, an image expression is enclosed in square brackets [ ]:

[
  if i1 <= (v3 - v1) / (v2 - v1) then
    v1 + sqrt(i1 * (v2 - v1) * (v3 - v1))
  else
    v2 - sqrt((1 - i1) * (v2 - v1) * (v2 - v3))
]

For the full EGO Script syntax — including the abbreviated form using #, %, and $ sigils, the verbose hook-block form, and conversion between the two — see Calculator functor shorthand.