Image Math

From MIPAV
Revision as of 15:59, 15 February 2012 by Angelfish100 (Talk)

(diff) <previousrevision> | Latest revision (diff) | <nextrevision> (diff)
Jump to: navigation, search

Image Math

Algorithm that adds, subtracts, multiplies, or divides an image by some user specified value. In addition, the square root, absolute value, or log of an image can be calculated. If the new image exceeds the range that can be stored in an image of that type, the data is either clipped and stored in the original image or a new image of a type (int, float...) that can store the range of new data is generated.

See also: [MIPAV_Utilities.html#1207373 ''Image Calculator''], Sections [MIPAV_Utilities.html#1176469 ''clip mode''] and [MIPAV_Utilities.html#1176475 ''promotion mode''] on [MIPAV_Utilities.html#1176475 page 438].

image types

You can apply Image Calculator to all 2D and 3D grayscale images. And here is the difference between Image Math and Image Calculator (refer to [MIPAV_Utilities.html#1207373 "Image Calculator" on page 438]). The last one you can ally to all types of images 2D, 3D, 4D color and grayscale.

Applying the Image Math to images

To run this algorithm, complete the following steps:

1 Open an image of interest.
2 Select Utilities >Image Math. The dialog box opens. See [MIPAV_Utilities.html#1177697 Figure 259].
3 Use the Operator list box to select the math operator (Absolute value, Add, Average, etc.).
4 Use the Value text box to enter a numerical value.
5 Select the Clip option if you want to clamp result data to the bounds of the input image type. Select the Promote option to promote image type so that the range of the result fits into the new image type. Select the Convert to Float option to convert the result into float image type.
6 Click OK. The algorithm begins to run.
7 Depending on whether you selected New Image or Replace Image, the result appears in a new window or replaces the image to which the algorithm was applied. See also [MIPAV_Utilities.html#1177697 Figure 259].

Value
Enter the numerical value here. Note that the text box become available after you select the math operator.
Â
Â
Â
Â
Â
Â
Â
Â
Â

{| align="center"

ImageMathDialogBox.jpg



|- |

Operator

|

Select the math operator from the list.

|- |

Clip

|

Select this option if you want the result image to be clamped at the maximum (minimum) value of the original image data type.

|- |

Â

| rowspan="1" colspan="2" |

See also [MIPAV_Utilities.html#1176469 "clip mode" on page 438].

|- |

Promote image type

| rowspan="1" colspan="2" |

When this mode is selected and the result value is out of the legal range of the original image data type, then the result image type is promoted to a new data type with a data type range capable of expressing the minimum and maximum values. See also [MIPAV_Utilities.html#1176475 "promotion mode" on page 438].

|- |

Convert to float

| rowspan="1" colspan="2" |

When this mode is selected and the result value is out of the legal range of the original image data type, then the result image type is converted to float data type.

|- | rowspan="1" colspan="3" |

Destination

|- |

New image

| rowspan="1" colspan="2" |

The result image will open in a new image frame.

|- |

Replace image

| rowspan="1" colspan="2" |

The result image will replace the original image.

|- | rowspan="1" colspan="3" |

Process

|- |

Whole image

| rowspan="1" colspan="2" |

The algorithm applies to the selected VOI(s) region.

|- |

VOI region

| rowspan="1" colspan="2" |

The algorithm applies to the whole image.

|- |

OK

| rowspan="1" colspan="2" |

Applies the algorithm according to the specifications in this dialog box.

|- |

Advanced

| rowspan="1" colspan="2" |

Calls the Enter Advanced Operator dialog box.

|- |

Cancel

| rowspan="1" colspan="2" |

Disregards any changes that you made in this dialog box and closes it.

|- |

Help

| rowspan="1" colspan="2" |

Displays online help for this dialog box.

|- | rowspan="1" colspan="3" |

Figure 259. The Image Math dialog box optionsÂ

|}


Examples of using Image Math

Figure 260. Applying Image Math to imagesÂ


{| align="center"

ImageMathOriginal.jpg



Original

|


{| align="center"

| ImageMathAbsoluteValue.jpg

|}

Absolute value

|- |


{| align="center"

| ImageMathAdd100.jpg

|}

Add 100

|


{| align="center"

| ImageMathAverage.jpg

|}

Average

|- |


{| align="center"

| ImageMathConstantToVOI.jpg

|}

Constant

|


{| align="center"

| ImageMathDivideBy100.jpg

|}

Divide by 100

|- |


{| align="center"

| ImageMathLog.jpg

|}

Log

|


{| align="center"

| ImageMathMultilyBy5.jpg

|}

Multiply by 5

|- |


{| align="center"

| ImageMathSamplesSquare.jpg

|}

Square

|


{| align="center"

| ImageMathSquareRoot.jpg

|}

Square root

|- |


{| align="center"

| ImageMathSubtract5.jpg

|}

Subtract 5

|


{| align="center"

| ImageMathSum.jpg

|}

Sum

|}


Inverting the image