previous

Index

next

Zonal Operators

A-Z

To be continued


Image Calculator - a multitalent

Well, you now got to know several tools for the analysis of map pairs (where I do not strictly want to stress this as a systematic nomenclature of spatial analysis functions!). Now I won't show you anything really new - disappointed?

No, wait! It is going to be a lean back case. Many of the analytical steps we took in the previous chapters can be performed with the help of a nice tool implemented since IfW 2 - the Image Calculator. Helps to compute expressions, that otherwise would require many single calls to several modules.

imagecalculator1.gif (33574 Byte)

Designed as a regular calculator you may compute with your images using all the operators and functionality otherwise found in OVERLAY, TRANSFOR, SCALAR and RECLASS. No wonder, as the tool calls these modules in the background.

Following below a few examples of expressions, as you might be using them and to give you an idea of what and how thing can be input here.

A common error is to forget the brackets enclosing the image names and a mismatch in the number of opening vs. closing brackets.

Save expressions especially if they grow very long and complex. The files created have the extension *.EXP and can be modified or created with any plain-text editor.

The samples (the left-side name symbolizes the Output file name) reflect some of the capabilities using mathematical expressions (for the logical part see later on):

  1. What's the minimum of the seven input images (IMAGE1 to IMAGE7)?

OUTPUT = MIN([IMAGE1], MIN([IMAGE2], MIN([IMAGE3], MIN([IMAGE4], MIN([IMAGE5], MIN([IMAGE6], [IMAGE7]))))))

Notice the nesting of the MIN function - computation starts from the innermost MIN pair.

  1. If you use trigonometric functions, angle values have to be converted to radians. This too can be easier by nesting the commands needed:

OUTPUT = RAD(COS([IMAGE1]))*RAD(SIN([IMAGE2]))

  1. Simple computations would take quite a long time doing it with the functions. 7 calls to OVERLAY and 9 to SCALAR would be necessary in the following case:

OUTPUT = ((([IMAGE1]*1.34-[IMAGE2]*3.45) / ([IMAGE1]*5.34+[IMAGE2]*7.21)) * (([IMAGE3]*1.24-[IMAGE4]*6.5) / ([IMAGE3]*8.7+[IMAGE4]*2.5))) + 25.13

Pay attention to the parentheses, they determine the sequence of the calculations. As you realize, some functions accept the mixing of numbers and images as input.

  1. If you really like, you may only use numbers with several of the functions, which turns the Image calculator into a normal calculator:

SQR(4)+SQR(4)

returns? Exactly 32.00000


imagecalculator2.gif (26863 Byte) Now after these mathematical expression examples have a look at the possibilities of the logical expressions part of the Image Calculator.

They may deserve as substitute for the RECLASS function partially.

The expression as shown in the figure to the left outputs from the input DEM a boolean image, where all pixels with original heights equal to or above 800 meters receive a 1, whereas all the others become 0.

As before, again some examples should demonstrate how to use the logical part of the Image Calculator:

  1. We are interested not only in the areas equal to or above 800 meters but also those below 1000 meters:

OUTPUT = ([GAISBERG]>=800) AND ([GAISBERG]<1000)

  1. Assign all pixels a value of 1 where IMAGE1 is greater than IMAGE2:

OUTPUT = [IMAGE1] >[ IMAGE2]

  1. Perform more complex queries:

OUTPUT = ([IMAGE1]>[IMAGE2]) AND ([IMAGE3]>100)  OR ([IMAGE2] >= [IMAGE3]) NOT ([IMAGE1] < 150)



previous

Index

next

Zonal Operators

A-Z

To be continued

last modified: | Comments to Eric J. LORUP