Difference between revisions of "Image Math"

From MIPAV
Jump to: navigation, search
(Created page with '== Image Math == <div style="font-style: normal; font-weight: normal; margin-bottom: 6pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration...')
 
m
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
== 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.<br />
  
<div style="font-style: normal; font-weight: normal; margin-bottom: 6pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 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.<br /></font></div>
+
== 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 "Image Calculator"). The last one you can ally to all types of images 2D, 3D, 4D color and grayscale.<br />
  
<span style="font-style: normal; text-decoration: none; text-transform: none; vertical-align: baseline">'''<font color="#000000">See also:</font>'''</span> [MIPAV_Utilities.html#1207373 <nowiki>''Image Calculator''</nowiki>], Sections [MIPAV_Utilities.html#1176469 <nowiki>''clip mode''</nowiki>] and [MIPAV_Utilities.html#1176475 <nowiki>''promotion mode''</nowiki>] on [MIPAV_Utilities.html#1176475 page 438].
+
== Applying the Image Math to images ==
 
+
==== image types ====
+
 
+
<div style="font-style: normal; font-weight: normal; margin-bottom: 6pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> 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.<br /></font></div>
+
 
+
=== Applying the Image Math to images ===
+
  
 
To run this algorithm, complete the following steps:
 
To run this algorithm, complete the following steps:
 +
1 Open an image of interest.<br />
 +
2 Select Utilities &gt;Image Math. The dialog box opens. See Figure 39.<br />
 +
3 Use the Operator list box to select the math operator (Absolute value, Add, Average, etc.).<br />
 +
4 Use the Value text box to enter a numerical value.<br />
 +
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.<br />
 +
6 Click OK. The algorithm begins to run.<br />
 +
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 Figure 39.<br />
  
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000">  1 Open an image of interest.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000">  2 Select Utilities &gt;Image Math. The dialog box opens. See [MIPAV_Utilities.html#1177697 Figure 259].<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000">  3 Use the Operator list box to select the math operator (Absolute value, Add, Average, etc.).<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000">  4 Use the Value text box to enter a numerical value.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000">  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.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000">  6 Click OK. The algorithm begins to run.<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 18pt; margin-right: 0pt; margin-top: 6pt; text-align: left; text-decoration: none; text-indent: -18pt; text-transform: none; vertical-align: baseline"><font color="#000000">  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].<br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000">
 
  
 
{| border="1" cellpadding="5"
 
{| border="1" cellpadding="5"
|+
+
|+ '''Figure 39. The Image Math dialog box options '''
 
|-
 
|-
 
|
 
|
Line 23: Line 24:
 
<div class="CellBody">Enter the numerical value here. Note that the text box become available after you select the math operator.</div>
 
<div class="CellBody">Enter the numerical value here. Note that the text box become available after you select the math operator.</div>
 
| rowspan="3" colspan="1" |
 
| rowspan="3" colspan="1" |
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Â <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Â <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Â <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Â <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Â <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Â <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Â <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Â <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> Â <br /></font></div><div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
 
|
 
 
[[Image:ImageMathDialogBox.jpg]]
 
[[Image:ImageMathDialogBox.jpg]]
|}<br clear="all" /><br /></font></div>
 
 
|-
 
|-
 
|
 
|
Line 39: Line 37:
 
|-
 
|-
 
|
 
|
<div class="CellHeading">Â </div>
+
<div class="CellHeading"> </div>
 
| rowspan="1" colspan="2" |
 
| rowspan="1" colspan="2" |
<div class="CellBody">See also [MIPAV_Utilities.html#1176469 "clip mode" on page 438].</div>
+
<div class="CellBody">See also "clip mode".</div>
 
|-
 
|-
 
|
 
|
 
<div class="CellHeading">Promote image type</div>
 
<div class="CellHeading">Promote image type</div>
 
| rowspan="1" colspan="2" |
 
| rowspan="1" colspan="2" |
<div class="CellBody">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].</div>
+
<div class="CellBody">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 "promotion mode".</div>
 
|-
 
|-
 
|
 
|
Line 98: Line 96:
 
| rowspan="1" colspan="2" |
 
| rowspan="1" colspan="2" |
 
<div class="CellBody">Displays online help for this dialog box.</div>
 
<div class="CellBody">Displays online help for this dialog box.</div>
|-
 
| rowspan="1" colspan="3" |
 
<div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 259. The Image Math dialog box options <br /></font>'''</div>
 
 
|}
 
|}
  
<br /></font></div>
 
  
 
==== Examples of using Image Math ====
 
==== Examples of using Image Math ====
 
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000">
 
  
 
{| border="1" cellpadding="5"
 
{| border="1" cellpadding="5"
|+ <div style="font-style: normal; margin-bottom: 3pt; margin-left: 0pt; margin-right: 0pt; margin-top: 9pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline">'''<font color="#000000"> Figure 260. Applying Image Math to images <br /></font>'''</div>
+
|+ '''Figure 40. Applying Image Math to images '''
 
|-
 
|-
|
 
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
 
 
|
 
|
 
[[Image:ImageMathOriginal.jpg]]
 
[[Image:ImageMathOriginal.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Original</div>
 
|
 
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
 
 
|
 
|
 
[[Image:ImageMathAbsoluteValue.jpg]]
 
[[Image:ImageMathAbsoluteValue.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Absolute value</div>
+
<br /><div class="CellBody">Absolute value</div>
 
|-
 
|-
|
 
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
 
 
|
 
|
 
[[Image:ImageMathAdd100.jpg]]
 
[[Image:ImageMathAdd100.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Add 100</div>
+
<br /><div class="CellBody">Add 100</div>
|
+
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
+
 
|
 
|
 
[[Image:ImageMathAverage.jpg]]
 
[[Image:ImageMathAverage.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Average</div>
+
<br /><div class="CellBody">Average</div>
 
|-
 
|-
|
 
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
 
 
|
 
|
 
[[Image:ImageMathConstantToVOI.jpg]]
 
[[Image:ImageMathConstantToVOI.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Constant</div>
+
<br /><div class="CellBody">Constant</div>
|
+
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
+
 
|
 
|
 
[[Image:ImageMathDivideBy100.jpg]]
 
[[Image:ImageMathDivideBy100.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Divide by 100</div>
+
<br /><div class="CellBody">Divide by 100</div>
 
|-
 
|-
|
 
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
 
 
|
 
|
 
[[Image:ImageMathLog.jpg]]
 
[[Image:ImageMathLog.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Log</div>
+
<br /> <div class="CellBody">Log</div>
|
+
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
+
 
|
 
|
 
[[Image:ImageMathMultilyBy5.jpg]]
 
[[Image:ImageMathMultilyBy5.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Multiply by 5</div>
+
<br /><div class="CellBody">Multiply by 5</div>
 
|-
 
|-
|
 
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
 
 
|
 
|
 
[[Image:ImageMathSamplesSquare.jpg]]
 
[[Image:ImageMathSamplesSquare.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Square</div>
+
<br /><div class="CellBody">Square</div>
|
+
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
+
 
|
 
|
 
[[Image:ImageMathSquareRoot.jpg]]
 
[[Image:ImageMathSquareRoot.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Square root</div>
+
<br /><div class="CellBody">Square root</div>
 
|-
 
|-
|
 
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
 
 
|
 
|
 
[[Image:ImageMathSubtract5.jpg]]
 
[[Image:ImageMathSubtract5.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Subtract 5</div>
+
<br /><div class="CellBody">Subtract 5</div>
|
+
<div style="font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"><font color="#000000"> <br clear="all" />{| align="center"
+
 
|
 
|
 
[[Image:ImageMathSum.jpg]]
 
[[Image:ImageMathSum.jpg]]
|}<br clear="all" /><br /></font></div> <div class="CellBody">Sum</div>
+
<br /><div class="CellBody">Sum</div>
 
|}
 
|}
  
<br /></font></div>
+
== See also: ==
  
 
[[Inverting the image]]
 
[[Inverting the image]]
 +
 +
[[Category:Help]]

Latest revision as of 13:04, 9 August 2012

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.

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 "Image Calculator"). 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 Figure 39.
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 Figure 39.


Figure 39. The Image Math dialog box options
Value
Enter the numerical value here. Note that the text box become available after you select the math operator.

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.
See also "clip mode".
Promote image type
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 "promotion mode".
Convert to float
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.
Destination
New image
The result image will open in a new image frame.
Replace image
The result image will replace the original image.
Process
Whole image
The algorithm applies to the selected VOI(s) region.
VOI region
The algorithm applies to the whole image.
OK
Applies the algorithm according to the specifications in this dialog box.
Advanced
Calls the Enter Advanced Operator dialog box.
Cancel
Disregards any changes that you made in this dialog box and closes it.
Help
Displays online help for this dialog box.


Examples of using Image Math

Figure 40. Applying Image Math to images

ImageMathOriginal.jpg

ImageMathAbsoluteValue.jpg


Absolute value

ImageMathAdd100.jpg


Add 100

ImageMathAverage.jpg


Average

ImageMathConstantToVOI.jpg


Constant

ImageMathDivideBy100.jpg


Divide by 100

ImageMathLog.jpg


Log

ImageMathMultilyBy5.jpg


Multiply by 5

ImageMathSamplesSquare.jpg


Square

ImageMathSquareRoot.jpg


Square root

ImageMathSubtract5.jpg


Subtract 5

ImageMathSum.jpg


Sum

See also:

Inverting the image