Understanding the basic modeling logic

In addition to using simple assignment equations, you can also construct simple logical operations in the EASI Modeling window. These operations take the form of 'IF' statements.

The following command sets the numeric value of image layer 2 to 255 anywhere the value of image layer 1 is between 32 and 64. Line breaks are significant; each statement must be on its own line.

if (%1 >= 32 AND %1 <= 64) then

%2 = 255

endif

The following example shows a more complex procedure to turn on bitmap layer 2 (%%2), where image layers 1, 2, and 3 are equal to 255.

if (%1 = 255) and (%2 = 255) and (%3 = 255) then

%%2 = 1

else

%%2 = 0

endif

The possible comparison and logical functions are:

a > b a greater than b

a < b a less than b

a = b a equals b

a <> b a not equal b

a <= b a less than or equal b

a >= b a greater than or equal b

a OR b a is true or b is true

a AND b a is true and b is true

!a a is not true

You can also use brackets to ensure operations take place in the expected order.

Detailed Examples

In the following example, a 'Vegetative Index' calculation using image layers 1 and 2 is performed and the results are saved to image layer 13 of the same file. Next, a 32-bit real image layer is added to the sample data file 'irvine.pix' to store the results.

  1. With irvine.pix open, click the File tab.
  2. Right-click irvine.pix and click New and then click Raster Layer.
  3. In the Add Image Channels window, enter a 1 in the 32 bit real box and click Add.
  4. From the Tools menu in the Focus window, click EASI Modeling.
  5. In the EASI Modeling window, enter the following model in the model box:
    • %13=(%1-%2)/(%1+%2);
    To output to an 8-bit image layer, some scaling and adjustment is necessary.
  6. Click Run.

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