Filters (Spatial): Unsharp Mask and Filters (Spatial) Anisotropic Diffusion: Difference between pages

From MIPAV
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
m (1 revision imported)
 
Line 1: Line 1:
When applied to an image, this algorithm produces a sharpened version of the image or the image volume defined by [[Delineating volumes of interest (VOIs)|a VOI of the image]].


The sharpening process works by utilizing a low-pass filtered (blurred) version of the original image. This is then subtracted away from the original to detect the presence of edges, creating the unsharp mask (effectively a high-pass filter). Contrast is then selectively increased along these edges using this mask — leaving behind a sharper final image.
=== Summary ===
This algorithm anisotropically diffuses an image. That is, it blurs over regions of an image where the gradient magnitude is relatively small (homogenous regions) but diffuses little over areas of the image where the gradient magnitude is large (i.e., edges). Therefore, objects are blurred, but their edges are blurred by a lesser amount.


The effect of a high-pass filter, like the unsharp mask technique, is to enhance sharp intensity transitions (i.e., edges) but at the cost of enhancing noise.
{| width="90%" border="1" frame="hsides" frame="hsides"
|-
| width="9%" valign="top" |
[[Image:exampleicon.gif]]
| width="81%" bgcolor="#B0E0E6" |
Figure 1 illustrates the relationship between anisotropic diffusion and gradient magnitude. In the figure, the original signal is noisy but two major peaks are still visible. Applying the diffusion process to the original signal and using the gradient magnitude to attenuate the diffusion process at places where the edge is strong produces a signal in which the overall signal-to-noise ratio has improved.
|}
 
<br /><div>
 
{| border="1" cellpadding="5"
|+ <div>'''Figure 1. A 1D example of anisotropic diffusion ''' </div><div>Note how the noise of the diffused signal is removed while only blurring the edge a small amount. The diffusion at the edge of the signals is attenuated by using a function of the gradient magnitude. </div>
|-
|
<div><div><center>[[Image:AnisotropicDiffusionLineChart.jpg]]</center></div> </div>
|}
 
</div>
 
=== Background ===
 
The following is the anisotropic diffusion equation:
 
Equation 1 <div align "left"> </div><br />
 
{| border="1" cellpadding="5"
|+
|-
|
<div><div align="left">[[Image:FiltersSpatialAnisotropicDiffusion4.jpg]]</div> </div>
|}


== Image types ==
where [[Image:FiltersSpatialAnisotropicDiffusion5.jpg]] is the variable conductance term. Typically, a function of the gradient magnitude [[Image:FiltersSpatialAnisotropicDiffusion6.jpg]], if [[Image:FiltersSpatialAnisotropicDiffusion7.jpg]] is a constant, then [[Image:FiltersSpatialAnisotropicDiffusion8.jpg]] which is the isotropic heat diffusion equation (Gaussian blurring).


You can apply this algorithm to all image data types, except complex and RGB images, and to 2D, 2.5D, 3D, and 4D images.
In simple terms, the image ''I'' at some time ''t'' is given by the diffusion of the image where conductance term limits the diffusion process. This program uses a conductance term calculated by dividing a constant (''k'') divided by the square root of the sum of the squares of the normalized first order derivatives of the Gaussian function as an approximate gradient function. Figure 2 shows the result of applying this technique. The image on the left is a CT image before processing. The image on the right of it was diffused. Note the image was diffused within object boundary but to a much lesser amount near the boundaries of the objects.


== Applying the algorithm ==
==== Image types ====
 
You can apply this algorithm just to gray-scale images.
 
<div>
 
{| border="1" cellpadding="5"
|+ <div>'''Figure 2. An image before and after applying the Anisotropic Diffusion algorithm  ''' </div><div> </div>
|-
|
<div><div><center>[[Image:exampleAnisotropicDiffusion.jpg]]</center></div> </div>
|}
 
</div>
 
==== Special notes ====
 
Refer to the section on Filters (Spatial): Nonlinear Noise Reduction.
 
==== References ====
 
Refer to the following references for more information:
 
P. Perona and J. Malik. "Scale-Space and Edge Detection Using Anisotropic Diffusion," ''IEEE ''''Trans. Pattern Analysis and Machine Intelligence'', 12(7):629-639, July 1990.
 
Bart M. Ter Romeney, ed. ''Geometry-Driven Diffusion in Computer Vision''. (Dordrecht, The Netherlands: Kluwer Academic Publishers, 1994).
 
<div id="ApplyingAnisotropicDiffusion"><div>
=== Applying the Anisotropic Diffusion algorithm ===


To run this algorithm, complete the following steps:
To run this algorithm, complete the following steps:


# Select Algorithms &gt; Filter (spatial) &gt; Unsharp mask. The Unsharp Mask dialog box (Figure 1) opens.
# Open an image.
# Perform, as an option, any image processing, such as improving the contrast, eliminating noise, etc., on the image.
# Select Algorithms &gt; Filters (spatial) &gt; Anisotropic Diffusion. The Anisotropic Diffusion dialog box (Figure 3) opens.
# Complete the information in the dialog box.
# Complete the information in the dialog box.
# Click OK.


; The algorithm begins to run, and a pop-up window appears with the status. The following message appears: "Unsharp Masking Image."
{| width="90%" border="1" frame="hsides" frame="hsides"
; When the algorithm finishes running, the pop-up window closes, and the results either appear in a new window or replace the image to which the algorithm was applied.
|-
| width="9%" valign="top" |
[[Image:noteicon.gif]]
| width="81%" bgcolor="#B0E0E6" | '''Note:''' Diffusing an image is a lengthy process. Give some consideration to the values you type into the Iterations and ''k'' boxes. The higher the number of iterations slows processing speed as does a small ''k'' value.
|}
 
<br />
 
# Click OK. The algorithm begins to run.
 
; A pop-up window appears with the status. The following message appears: "Diffusing image."
; When the algorithm finishes running, the pop-up window closes.
; Depending on whether you selected New image or Replace image, the results appear in a new window or replace the image to which the algorithm was applied.


<div>
<div>


{| border="1" cellpadding="5"
{| border="1" cellpadding="5"
|+ <div>'''Figure 1. Unsharp Mask dialog box''' </div>
|+ <div>'''Figure 3. Anisotropic Diffusion dialog box ''' </div>
|-
|-
|
|
<div>'''X Dimension''' </div>
<div>'''X dimension <br />(0.5 - 5.0)*''' </div>
|
|
<div>Specifies the standard deviation (SD) of Gaussian in the ''X'' direction. </div>
<div>Indicates the standard deviation (SD) of Gaussian in the ''X'' direction. </div>
| rowspan="6" colspan="1" |
| rowspan="6" colspan="1" |
<div><div align="left">[[Image:dialogboxUnsharpMask.jpg]]</div> </div><div> </div>
<div><div><center>[[Image:dialogboxAnisotropicDiffusion.jpg]]</center></div> </div><div> </div>
|-
|-
|
|
<div>'''Y Dimension''' </div>
<div>'''Y dimension <br />(0.5 - 5.0)*''' </div>
|
|
<div>Specifies the SD of Gaussian in the ''Y'' direction. </div>
<div>Indicates the SD of Gaussian in the ''Y'' direction. </div>
|-
|-
|
|
<div>'''Z Dimension''' </div>
<div>'''Z dimension <br />(0.5 - 5.0)*''' </div>
|
|
<div>Specifies the SD of Gaussian in the ''Z'' direction. </div>
<div>Indicates the SD of Gaussian in the ''Z'' direction. </div>
|-
|-
|
|
<div>'''Use image resolutions to normalize Z scale''' </div>
<div>'''Use image resolutions to normalize Z scale''' </div>
|
|
<div>Normalizes the Gaussian to compensate for the difference if the voxel resolution is less between slides than the voxel resolution in-plaine. This option is selected by default. </div>
<div>Normalizes the Gaussian to compensate for the difference if the voxel resolution is less between slices than the voxel resolution in-plane. This option is selected by default. </div>
|-
|-
|
|
<div>'''Process each slice independently (2.5D)''' </div>
<div>'''Process each slice independently (2.5D)''' </div>
|
|
<div>Filters each slice of the dataset independently of adjacent slices. </div>
<div>Blurs each slice of the dataset independently. </div>
|-
|-
|
|
<div>'''Image - (k&lt;1) * blurred image''' </div>
<div>'''Iterations <br />(1-1000)''' </div>
|
|
<div>Determines the amount of filtering, or sharpening, applied to the edges of the image or a VOI of the image. Low values sharpen image edges but increase noise. The default value is 0.75. </div>
<div>Specifies the number of times the process is run. </div>
|-
|
<div>'''k (k &gt; 1 slows diffusion)''' </div>
| rowspan="1" colspan="2" |
<div>Specifies the constant used to control the blurring rate. A small value slows the diffusion process (especially across edges) per iteration. A large value speeds the diffusion process but also allows for diffusion (blurring across edges); it also makes this function act similar to Gaussian blurring. See equation above. </div>
|-
|-
|
|
Line 73: Line 149:
|-
|-
|
|
<div>'''VOI region(s)''' </div>
<div>'''VOI regions''' </div>
| rowspan="1" colspan="2" |
| rowspan="1" colspan="2" |
<div>Applies the algorithm to the volumes (regions) delineated by the VOIs. </div>
<div>Applies the algorithm to the volumes (regions) delineated by the VOIs. </div>
Line 80: Line 156:
<div>'''OK''' </div>
<div>'''OK''' </div>
| rowspan="1" colspan="2" |
| rowspan="1" colspan="2" |
<div>Applies the algorithm according to the specifications in this dialog box. </div>
<div>Applies the algorithm according to the specifications in this dialog box. </div>
|-
|-
|
|
<div>'''Cancel''' </div>
<div>'''Cancel''' </div>
| rowspan="1" colspan="2" |
| rowspan="1" colspan="2" |
<div>Disregards any changes that you made in this dialog box and closes the dialog box. </div>
<div>Disregards any changes you made in this dialog box and closes the dialog box. </div>
|-
|-
|
|
Line 91: Line 167:
| rowspan="1" colspan="2" |
| rowspan="1" colspan="2" |
<div>Displays online help for this dialog box. </div>
<div>Displays online help for this dialog box. </div>
|-
| rowspan="1" colspan="3" |
<div><nowiki>*An SD greater than 1 attenuates small scale edges typically caused by noise, but reduces edge accuracy.</nowiki> </div>
|}
|}


== See also: ==
</div>
**[[Filters (Spatial): Adaptive Noise Reduction]]
**[[Filters (Frequency)]]
**[[Filters (Spatial): Adaptive Path Smooth]]
**[[Filters (Spatial) Anisotropic Diffusion]]
**[[Filters (Spatial): Coherence-Enhancing Diffusion]]
**[[Filters (Spatial): Gaussian Blur]]
**[[Filters (Spatial): Gradient Magnitude]]
**[[Filters (Spatial): Haralick Texture]]
**[[Filters (Spatial) Laplacian]]
**[[Filters (Spatial): Local Normalization]]
**[[Filters (Spatial): Mean]]
**[[Filters (Spatial): Median]]
**[[Filters (Spatial): Mode]]
**[[Filters (Spatial): Nonmaximum Suppression]]
**[[Filters (Spatial): Nonlinear Noise Reduction|Nonlinear Noise Reduction]]
**[[Filters (Spatial): Regularized Isotropic (Nonlinear) Diffusion]]
**[[Filters (Spatial): Slice Averaging]]
 
[[Category:Help]]
[[Category:Help]]
[[Category:Help:Algorithms]]
[[Category:Help:Algorithms]]

Latest revision as of 16:28, 9 February 2024

Summary

This algorithm anisotropically diffuses an image. That is, it blurs over regions of an image where the gradient magnitude is relatively small (homogenous regions) but diffuses little over areas of the image where the gradient magnitude is large (i.e., edges). Therefore, objects are blurred, but their edges are blurred by a lesser amount.

Exampleicon.gif

Figure 1 illustrates the relationship between anisotropic diffusion and gradient magnitude. In the figure, the original signal is noisy but two major peaks are still visible. Applying the diffusion process to the original signal and using the gradient magnitude to attenuate the diffusion process at places where the edge is strong produces a signal in which the overall signal-to-noise ratio has improved.


Figure 1. A 1D example of anisotropic diffusion
Note how the noise of the diffused signal is removed while only blurring the edge a small amount. The diffusion at the edge of the signals is attenuated by using a function of the gradient magnitude.
AnisotropicDiffusionLineChart.jpg

Background

The following is the anisotropic diffusion equation:

Equation 1


FiltersSpatialAnisotropicDiffusion4.jpg

where FiltersSpatialAnisotropicDiffusion5.jpg is the variable conductance term. Typically, a function of the gradient magnitude FiltersSpatialAnisotropicDiffusion6.jpg, if FiltersSpatialAnisotropicDiffusion7.jpg is a constant, then FiltersSpatialAnisotropicDiffusion8.jpg which is the isotropic heat diffusion equation (Gaussian blurring).

In simple terms, the image I at some time t is given by the diffusion of the image where conductance term limits the diffusion process. This program uses a conductance term calculated by dividing a constant (k) divided by the square root of the sum of the squares of the normalized first order derivatives of the Gaussian function as an approximate gradient function. Figure 2 shows the result of applying this technique. The image on the left is a CT image before processing. The image on the right of it was diffused. Note the image was diffused within object boundary but to a much lesser amount near the boundaries of the objects.

Image types

You can apply this algorithm just to gray-scale images.

Figure 2. An image before and after applying the Anisotropic Diffusion algorithm
ExampleAnisotropicDiffusion.jpg

Special notes

Refer to the section on Filters (Spatial): Nonlinear Noise Reduction.

References

Refer to the following references for more information:

P. Perona and J. Malik. "Scale-Space and Edge Detection Using Anisotropic Diffusion," IEEE 'Trans. Pattern Analysis and Machine Intelligence, 12(7):629-639, July 1990.

Bart M. Ter Romeney, ed. Geometry-Driven Diffusion in Computer Vision. (Dordrecht, The Netherlands: Kluwer Academic Publishers, 1994).

Applying the Anisotropic Diffusion algorithm

To run this algorithm, complete the following steps:

  1. Open an image.
  2. Perform, as an option, any image processing, such as improving the contrast, eliminating noise, etc., on the image.
  3. Select Algorithms > Filters (spatial) > Anisotropic Diffusion. The Anisotropic Diffusion dialog box (Figure 3) opens.
  4. Complete the information in the dialog box.

Noteicon.gif

Note: Diffusing an image is a lengthy process. Give some consideration to the values you type into the Iterations and k boxes. The higher the number of iterations slows processing speed as does a small k value.


  1. Click OK. The algorithm begins to run.
A pop-up window appears with the status. The following message appears
"Diffusing image."
When the algorithm finishes running, the pop-up window closes.
Depending on whether you selected New image or Replace image, the results appear in a new window or replace the image to which the algorithm was applied.
Figure 3. Anisotropic Diffusion dialog box
X dimension
(0.5 - 5.0)*
Indicates the standard deviation (SD) of Gaussian in the X direction.
DialogboxAnisotropicDiffusion.jpg
Y dimension
(0.5 - 5.0)*
Indicates the SD of Gaussian in the Y direction.
Z dimension
(0.5 - 5.0)*
Indicates the SD of Gaussian in the Z direction.
Use image resolutions to normalize Z scale
Normalizes the Gaussian to compensate for the difference if the voxel resolution is less between slices than the voxel resolution in-plane. This option is selected by default.
Process each slice independently (2.5D)
Blurs each slice of the dataset independently.
Iterations
(1-1000)
Specifies the number of times the process is run.
k (k > 1 slows diffusion)
Specifies the constant used to control the blurring rate. A small value slows the diffusion process (especially across edges) per iteration. A large value speeds the diffusion process but also allows for diffusion (blurring across edges); it also makes this function act similar to Gaussian blurring. See equation above.
New image
Shows the results of the algorithm in a new image window.
Replace image
Replaces the current active image with the results of the algorithm.
Whole image
Applies the algorithm to the whole image.
VOI regions
Applies the algorithm to the volumes (regions) delineated by the VOIs.
OK
Applies the algorithm according to the specifications in this dialog box.
Cancel
Disregards any changes you made in this dialog box and closes the dialog box.
Help
Displays online help for this dialog box.
*An SD greater than 1 attenuates small scale edges typically caused by noise, but reduces edge accuracy.