Image Algebra - Formula

The formula is applied to the input images on a pixel-by-pixel basis. The formula tells the Algebra tool how to combine the input images. A simple example would be to take an average of three input images. With the default variable names of the input images being I1, I2 and I3, the formula to do that would be:

(I1+I2+I3)/3

In the formula, you can use:

You can either type in the formula, or you can build up the formula from the Operators, Functions and Constants menus: clicking on one of the items in the menus inserts an appropriate piece of text at the cursor position to help build up the formula.

You type in or modify the formula in the Formula field: this example shows the correct formula for calculating the magnetisation transfer ratio.

algebra_formula

Note that this formula has a scaling factor of 100 applied. The output image created by the Algebra tool is always of the same type as the first input image. In fact, the output image is a clone of the first input image, but with the pixel values replaced. Since medical images are normally of integer type, it is important to scale the output appropriately for representation by an integer value. For example, if the formula is expected to give output values between 0.0 and 1.0 (as some sort of normalisation operation would give), then an appropriate scaling factor might be 1000, so that the intensity resolution of the output image is 1/1000th of the dynamic range. If no scaling factor were applied, then output pixels would have values of either 0 or 1, with nothing in between.

All algebraic operations are performed using double-precision arithmetic, and the output pixel intensity is rounded and truncated appropriately according to the data type of the output image. In addition, you can further restrict the dynamic range of the output by setting the limits on output pixel values.

If the formula contains any illegal elements, you will be notified when you try to apply the formula.

Built-in Functions

Algebra tool has the following built-in functions:

Built-in Constants

Algebra tool has the following built-in constants:

Jim Home