Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::AnisotropicDiffusionFunction< TImage > Class Template Reference
[Finite Difference FunctionsImage Enhancement Filters]

#include <itkAnisotropicDiffusionFunction.h>

Inheritance diagram for itk::AnisotropicDiffusionFunction< TImage >:

Inheritance graph
[legend]
Collaboration diagram for itk::AnisotropicDiffusionFunction< TImage >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef AnisotropicDiffusionFunction Self
typedef FiniteDifferenceFunction<
TImage > 
Superclass
typedef SmartPointer< SelfPointer
typedef SmartPointer< const
Self
ConstPointer
typedef Superclass::ImageType ImageType
typedef Superclass::PixelType PixelType
typedef Superclass::RadiusType RadiusType
typedef Superclass::NeighborhoodType NeighborhoodType
typedef Superclass::TimeStepType TimeStepType
typedef Superclass::FloatOffsetType FloatOffsetType

Public Member Functions

virtual const char * GetClassName () const
 itkStaticConstMacro (ImageDimension, unsigned int, Superclass::ImageDimension)
virtual void CalculateAverageGradientMagnitudeSquared (ImageType *)=0
virtual TimeStepType ComputeGlobalTimeStep (void *) const
virtual void * GetGlobalDataPointer () const
virtual void ReleaseGlobalDataPointer (void *) const
void SetTimeStep (const TimeStepType &t)
const TimeStepTypeGetTimeStep () const
void SetConductanceParameter (const double &c)
const double & GetConductanceParameter () const
const double & GetAverageGradientMagnitudeSquared () const
void SetAverageGradientMagnitudeSquared (const double &c)

Protected Member Functions

 AnisotropicDiffusionFunction ()
 ~AnisotropicDiffusionFunction ()
void PrintSelf (std::ostream &os, Indent indent) const

Detailed Description

template<class TImage>
class itk::AnisotropicDiffusionFunction< TImage >

This class is a virtual base for anisotropic diffusion function objects. It is a component object in the finite difference solver hierarchy (see itkFiniteDifferenceImageFilter for an overview). AnisotropicDiffusionFunction objects are used by AnisotropicDiffusionImageFilter objects to perform non-linear diffusion on itk::Images.

Overview of anisotropic diffusion
Anisotropic diffusion methods are formulated to reduce noise (or unwanted detail) in images while preserving specific image features. For many applications, there is an assumption that light-dark transitions (edges) are interesting. Standard isotropic diffusion methods move and blur light-dark boundaries. Anisotropic diffusion methods are formulated to specifically preserve edges.

Anisotropic diffusion methods can be thought of as tools for calculating multi-scale descriptions of images. Embed an image $U(\mathbf{x})$ in a higher dimensional function of derived images, $U(\mathbf{x}, t)$. This higher dimensional function represents the solution of the heat diffusion equation,

\[\frac{d U(\mathbf{x})}{d t} = \nabla \cdot c \nabla U(\mathbf{x})\]

with constant $c$ and initial condition $U(\mathbf{x}, 0) = U_0(\mathbf{x})$, the original image.
Extending to the case where $c$ is not a constant, but a function of $\mathbf{x}$, gives

\[\frac{d U(\mathbf{x})}{d t} = C(\mathbf{x})\Delta U(\mathbf{x}) + \nabla C(\mathbf{x}) \nabla U(\mathbf{x})\]

Our choice of $C$ now varies the strength of diffusion anisotropically. Typically, $C$ is chosen as some function of image features to selectively preserve or remove those features. For example, edges tend to be preserved over smoother regions where $C$ is inversely scaled according to gradient magnitude as in

\[C(\mathbf{x}) = e^{-(\frac{\parallel \nabla U(\mathbf{x}) \parallel}{K})^2}\]

.

Several variations on the scheme presented above are implemented in Itk as subclasses of this equation. The equations are solved using an iterative, finite forward difference technique (see the FiniteDifferenceImageFilter class).
How to use this class
This class must be subclassed to provide the CalculateUpdate() methods of FiniteDifferenceFunction and the function CalculateAverageGradientMagnitudeSquared(), which is called before each iteration to recalibrate the conductance term.
Parameters
The parameters defined in this class apply to the basic anisotropic diffusion equation described in AnisotropicDiffusionFunction. Variations on the basic equation will be more or less sensitive to these parameters. For example, functions that perform higher-order derivative calculations may require smaller time-steps than those that only do first-derivative calculations. Wherever possibe, reasonable parameters settings are suggested in the documentation of a specific equation implementation.
TimeStep
In the anisotropic diffusion filter hierarchy, the time step is set explicitly by the user. The time step referred to here corresponds exactly to $ \Delta t $ in the finite difference update equation described in FiniteDifferenceImageFilter (see itkFiniteDifferenceImageFilter for more information). Appropriate time steps for solving this type of p.d.e. depend on the dimensionality of the image and the order of the equation. Typical values are less than 0.250. A stable value for most 2 and 3d functions is 0.125. In general, you should keep the time step below 1/2^N, where N is the number of image dimensions. A filter will automatically attempt to constrain its time step to a stable value and generate a run-time warning if the time step is set too high.
Conductance Parameter
The conductance parameter controls the sensitivity of the conductance term in the basic anisotropic diffusion equation. It affect the conductance term in different ways depending on the particular variation on the basic equation. As a general rule, the lower the value, the more strongly the diffusion equation preserves image features (such as high gradients or curvature). A high value for conductance will cause the filter to diffuse image features more readily. Typical values range from 0.5 to 2.0 for data like the Visible Human color data, but the correct value for your application is wholly dependent on the results you want from a specific data set and the number or iterations you perform.
References
Pietro Perona and Jalhandra Malik, ``Scale-space and edge detection using anisotropic diffusion,'' IEEE Transactions on Pattern Analysis Machine Intelligence, vol. 12, pp. 629-639, 1990.
See also:
VectorAnisotropicDiffusionFunction

ScalarAnisotropicDiffusionFunction

GradientAnisotropicDiffusionFunction

CurvatureAnisotropicDiffusionFunction

VectorGradientAnisotropicDiffusionFunction

Todo:
Automatically generate the time step value from image dimensionality and order of the equations

Definition at line 135 of file itkAnisotropicDiffusionFunction.h.


Member Typedef Documentation

template<class TImage>
typedef SmartPointer<const Self> itk::AnisotropicDiffusionFunction< TImage >::ConstPointer
 

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

Definition at line 144 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
typedef Superclass::FloatOffsetType itk::AnisotropicDiffusionFunction< TImage >::FloatOffsetType
 

A floating point offset from an image grid location. Used for interpolation among grid values in a neighborhood.

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

Definition at line 155 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
typedef Superclass::ImageType itk::AnisotropicDiffusionFunction< TImage >::ImageType
 

Inherit some parameters from the superclass type

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

Definition at line 150 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
typedef Superclass::NeighborhoodType itk::AnisotropicDiffusionFunction< TImage >::NeighborhoodType
 

The type of data structure that is passed to this function object to evaluate at a pixel that does not lie on a data set boundary.

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

Definition at line 153 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
typedef Superclass::PixelType itk::AnisotropicDiffusionFunction< TImage >::PixelType
 

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

Definition at line 151 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
typedef SmartPointer<Self> itk::AnisotropicDiffusionFunction< TImage >::Pointer
 

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

Definition at line 143 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
typedef Superclass::RadiusType itk::AnisotropicDiffusionFunction< TImage >::RadiusType
 

Neighborhood radius type

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

Definition at line 152 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
typedef AnisotropicDiffusionFunction itk::AnisotropicDiffusionFunction< TImage >::Self
 

Standard class typedefs.

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

Definition at line 141 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
typedef FiniteDifferenceFunction<TImage> itk::AnisotropicDiffusionFunction< TImage >::Superclass
 

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

Definition at line 142 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
typedef Superclass::TimeStepType itk::AnisotropicDiffusionFunction< TImage >::TimeStepType
 

Define the TimeStepType to always be double.

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

Definition at line 154 of file itkAnisotropicDiffusionFunction.h.


Constructor & Destructor Documentation

template<class TImage>
itk::AnisotropicDiffusionFunction< TImage >::AnisotropicDiffusionFunction  )  [inline, protected]
 

Definition at line 205 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
itk::AnisotropicDiffusionFunction< TImage >::~AnisotropicDiffusionFunction  )  [inline, protected]
 

Definition at line 211 of file itkAnisotropicDiffusionFunction.h.


Member Function Documentation

template<class TImage>
virtual void itk::AnisotropicDiffusionFunction< TImage >::CalculateAverageGradientMagnitudeSquared ImageType  )  [pure virtual]
 

This method is called before each iteration. It calculates a scalar value that is the average of the gradient magnitude squared at each pixel in the output image (intermediate solution). The average gradient magnitude value is typically used in the anisotropic diffusion equations to calibrate the conductance term.

template<class TImage>
virtual TimeStepType itk::AnisotropicDiffusionFunction< TImage >::ComputeGlobalTimeStep void *   )  const [inline, virtual]
 

Returns the time step supplied by the user. We don't need to use the global data supplied since we are returning a fixed value.

Implements itk::FiniteDifferenceFunction< TImage >.

Definition at line 192 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
const double& itk::AnisotropicDiffusionFunction< TImage >::GetAverageGradientMagnitudeSquared  )  const [inline]
 

Set/Get the average gradient magnitude squared. Definition at line 184 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
virtual const char* itk::AnisotropicDiffusionFunction< TImage >::GetClassName  )  const [virtual]
 

Run-time type information (and related methods)

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

template<class TImage>
const double& itk::AnisotropicDiffusionFunction< TImage >::GetConductanceParameter  )  const [inline]
 

Set/Get the conductance parameter. The conductance parameter Definition at line 179 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
virtual void* itk::AnisotropicDiffusionFunction< TImage >::GetGlobalDataPointer  )  const [inline, virtual]
 

The anisotropic diffusion classes don't use this particular parameter so it's safe to return a null value.

Implements itk::FiniteDifferenceFunction< TImage >.

Definition at line 197 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
const TimeStepType& itk::AnisotropicDiffusionFunction< TImage >::GetTimeStep  )  const [inline]
 

Set/Get the time step. For this class of anisotropic diffusion filters, the time-step is supplied by the user and remains fixed for all updates. Definition at line 172 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
itk::AnisotropicDiffusionFunction< TImage >::itkStaticConstMacro ImageDimension  ,
unsigned  int,
Superclass::ImageDimension 
 

Inherit some parameters from the superclass type

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >, and itk::VectorGradientNDAnisotropicDiffusionFunction< TImage >.

template<class TImage>
void itk::AnisotropicDiffusionFunction< TImage >::PrintSelf std::ostream &  os,
Indent  indent
const [inline, protected, virtual]
 

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::FiniteDifferenceFunction< TImage >.

Reimplemented in itk::CurvatureNDAnisotropicDiffusionFunction< TImage >, itk::GradientNDAnisotropicDiffusionFunction< TImage >, itk::ScalarAnisotropicDiffusionFunction< TImage >, itk::VectorAnisotropicDiffusionFunction< TImage >, and itk::VectorCurvatureNDAnisotropicDiffusionFunction< TImage >.

Definition at line 213 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
virtual void itk::AnisotropicDiffusionFunction< TImage >::ReleaseGlobalDataPointer void *   )  const [inline, virtual]
 

Does nothing. No global data is used in this class of equations.

Implements itk::FiniteDifferenceFunction< TImage >.

Definition at line 201 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
void itk::AnisotropicDiffusionFunction< TImage >::SetAverageGradientMagnitudeSquared const double &  c  )  [inline]
 

Set/Get the average gradient magnitude squared. Definition at line 186 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
void itk::AnisotropicDiffusionFunction< TImage >::SetConductanceParameter const double &  c  )  [inline]
 

Set/Get the conductance parameter. The conductance parameter Definition at line 177 of file itkAnisotropicDiffusionFunction.h.

template<class TImage>
void itk::AnisotropicDiffusionFunction< TImage >::SetTimeStep const TimeStepType t  )  [inline]
 

Set/Get the time step. For this class of anisotropic diffusion filters, the time-step is supplied by the user and remains fixed for all updates. Definition at line 170 of file itkAnisotropicDiffusionFunction.h.


The documentation for this class was generated from the following file:
Generated at Sat Mar 31 02:40:33 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000