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

itk::NormalVectorDiffusionFunction< TSparseImageType > Class Template Reference

#include <itkNormalVectorDiffusionFunction.h>

Inheritance diagram for itk::NormalVectorDiffusionFunction< TSparseImageType >:

Inheritance graph
[legend]
Collaboration diagram for itk::NormalVectorDiffusionFunction< TSparseImageType >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class TSparseImageType>
class itk::NormalVectorDiffusionFunction< TSparseImageType >

This class defines all the necessary functionality for performing isotropic and anisotropic diffusion operations on vector neighborhoods from a sparse image.

This class implements the actual computations for performing isotropic and anisotropic diffusion operations on a neighborhood of unit length vectors. Moreover, this processing is intrinsic to a manifold as specified by the ManifoldNormal member variables in the nodes of the sparse image.
Since the only difference between isotropic and anisotropic diffusion is the exectution of 1 extra line of code, we have implemented both in this class and made the choice between the two depend on a parameter (see below).
PARAMETERS
The choice between is isotropic/anisotropic diffusion is made by the parameter NormalProcessType. A value of 0 corresponds to isotropic diffusion whereas a value of 1 corresponds to anisotropic diffusion. If anisotropic diffusion is chosen, the parameter ConductanceParameter should be set. This conductance parameter determines the level of feature preservation.
IMPORTANT
This class works on SparseImage neighborhoods. Before using this class please read the documentation for SparseImage. Also the documentation for ImplicitManifoldNormalVectorField class will be helpful in understanding how to use this class as a function object.

Definition at line 58 of file itkNormalVectorDiffusionFunction.h.

Public Types

typedef SmartPointer< const
Self
ConstPointer
typedef ZeroFluxNeumannBoundaryCondition<
ImageType
DefaultBoundaryConditionType
typedef Superclass::FloatOffsetType FloatOffsetType
typedef TSparseImageType ImageType
typedef Superclass::IndexType IndexType
typedef Superclass::NeighborhoodType NeighborhoodType
typedef NodeType::NodeDataType NodeDataType
typedef Superclass::NodeType NodeType
typedef Superclass::NodeValueType NodeValueType
typedef Superclass::NormalVectorType NormalVectorType
typedef double PixelRealType
typedef Superclass::PixelType PixelType
typedef SmartPointer< SelfPointer
typedef Superclass::RadiusType RadiusType
typedef NormalVectorDiffusionFunction Self
typedef Superclass::SparseImageType SparseImageType
typedef NormalVectorFunctionBase<
TSparseImageType > 
Superclass
typedef Superclass::TimeStepType TimeStepType

Public Member Functions

virtual TimeStepType ComputeGlobalTimeStep (void *) const
virtual NormalVectorType ComputeSparseUpdate (NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset) const
virtual PixelType ComputeUpdate (const NeighborhoodType &, void *, const FloatOffsetType &)
virtual Pointer CreateAnother () const
virtual void Delete ()
NodeValueType GetConductanceParameter () const
NodeValueType GetFluxStopConstant () const
Globaldata methods are not
needed in this class *virtual
void * 
GetGlobalDataPointer () const
virtual const char * GetNameOfClass () const
int GetNormalProcessType () const
const RadiusTypeGetRadius () const
virtual int GetReferenceCount () const
TimeStepType GetTimeStep () const
virtual void InitializeIteration ()
 itkStaticConstMacro (ImageDimension, unsigned int, ImageType::ImageDimension)
 itkStaticConstMacro (ImageDimension, unsigned int, Superclass::ImageDimension)
virtual void PrecomputeSparseUpdate (NeighborhoodType &it) const
void Print (std::ostream &os, Indent indent=0) const
virtual void Register () const
virtual void ReleaseGlobalDataPointer (void *) const
This method sets the conductance
parameter used in anisotropic
*filtering Useful values for
processing D and D shapes
are between *and Lower values
preserve more shape higher
values *smooth more As the
conductance parameter the
processing becomes *isotropic
Default is *void 
SetConductanceParameter (NodeValueType cp)
void SetNormalProcessType (int npt)
void SetRadius (const RadiusType &r)
virtual void SetReferenceCount (int)
Set the ScaleCoefficients
for the difference *operators
The defaults a These can be
set to take the image *spacing
into account *void 
SetScaleCoefficients (PixelRealType vals[ImageDimension])
void SetTimeStep (const TimeStepType &ts)
virtual void UnRegister () const

Static Public Member Functions

static void BreakOnError ()
static Pointer New ()

Public Attributes

This method sets the conductance
parameter used in anisotropic
*filtering Useful values for
processing D and D shapes
are between *and Lower values
preserve more shape 
features
This method sets the conductance
parameter used in anisotropic
*filtering Useful values for
processing D and D shapes
are between *and Lower values
preserve more shape higher
values *smooth more As the
conductance parameter 
large

Protected Member Functions

 FiniteDifferenceFunction ()
The method called in anisotropic
diffusion to inhibit diffusion
across areas with large curvature
*NodeValueType 
FluxStopFunction (const NodeValueType v) const
 NormalVectorDiffusionFunction ()
void PrintSelf (std::ostream &os, Indent indent) const
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 ~NormalVectorDiffusionFunction ()

Protected Attributes

RadiusType m_Radius
int m_ReferenceCount
SimpleFastMutexLock m_ReferenceCountLock
PixelRealType m_ScaleCoefficients [ImageDimension]
Methods invoked by virtual
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.*/virtual
void PrintSelf(std voi 
PrintHeader )(std::ostream &os, Indent indent) const


Member Typedef Documentation

template<class TSparseImageType>
typedef SmartPointer<const Self> itk::NormalVectorDiffusionFunction< TSparseImageType >::ConstPointer
 

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 66 of file itkNormalVectorDiffusionFunction.h.

typedef ZeroFluxNeumannBoundaryCondition<ImageType> itk::FiniteDifferenceFunction< TSparseImageType >::DefaultBoundaryConditionType [inherited]
 

The default boundary condition for finite difference functions that is used unless overridden in the Evaluate() method.

Definition at line 93 of file itkFiniteDifferenceFunction.h.

template<class TSparseImageType>
typedef Superclass::FloatOffsetType itk::NormalVectorDiffusionFunction< TSparseImageType >::FloatOffsetType
 

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

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 81 of file itkNormalVectorDiffusionFunction.h.

typedef TSparseImageType itk::FiniteDifferenceFunction< TSparseImageType >::ImageType [inherited]
 

Extract some parameters from the image type

Definition at line 77 of file itkFiniteDifferenceFunction.h.

template<class TSparseImageType>
typedef Superclass::IndexType itk::NormalVectorDiffusionFunction< TSparseImageType >::IndexType
 

The index type for the sparse image.

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 82 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
typedef Superclass::NeighborhoodType itk::NormalVectorDiffusionFunction< TSparseImageType >::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::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 80 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
typedef NodeType::NodeDataType itk::FiniteDifferenceSparseImageFunction< TSparseImageType >::NodeDataType [inherited]
 

The type for the variables of NodeType. Scalar or vector.

Definition at line 77 of file itkFiniteDifferenceSparseImageFunction.h.

template<class TSparseImageType>
typedef Superclass::NodeType itk::NormalVectorDiffusionFunction< TSparseImageType >::NodeType
 

The node type for the sparse image.

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 84 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
typedef Superclass::NodeValueType itk::NormalVectorDiffusionFunction< TSparseImageType >::NodeValueType
 

The basic floating point type for the variables.

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 85 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
typedef Superclass::NormalVectorType itk::NormalVectorDiffusionFunction< TSparseImageType >::NormalVectorType
 

The vector type for the normals.

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 86 of file itkNormalVectorDiffusionFunction.h.

typedef double itk::FiniteDifferenceFunction< TSparseImageType >::PixelRealType [inherited]
 

Definition at line 82 of file itkFiniteDifferenceFunction.h.

template<class TSparseImageType>
typedef Superclass::PixelType itk::FiniteDifferenceSparseImageFunction< TSparseImageType >::PixelType [inherited]
 

Typedefs from the superclass.

Reimplemented from itk::FiniteDifferenceFunction< TSparseImageType >.

Definition at line 63 of file itkFiniteDifferenceSparseImageFunction.h.

template<class TSparseImageType>
typedef SmartPointer<Self> itk::NormalVectorDiffusionFunction< TSparseImageType >::Pointer
 

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 65 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
typedef Superclass::RadiusType itk::NormalVectorDiffusionFunction< TSparseImageType >::RadiusType
 

Neighborhood radius type

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 79 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
typedef NormalVectorDiffusionFunction itk::NormalVectorDiffusionFunction< TSparseImageType >::Self
 

Standard class typedef.

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 63 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
typedef Superclass::SparseImageType itk::NormalVectorDiffusionFunction< TSparseImageType >::SparseImageType
 

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 83 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
typedef NormalVectorFunctionBase<TSparseImageType> itk::NormalVectorDiffusionFunction< TSparseImageType >::Superclass
 

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 64 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
typedef Superclass::TimeStepType itk::NormalVectorDiffusionFunction< TSparseImageType >::TimeStepType
 

Typedefs from the superclass.

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

Definition at line 75 of file itkNormalVectorDiffusionFunction.h.


Constructor & Destructor Documentation

template<class TSparseImageType>
itk::NormalVectorDiffusionFunction< TSparseImageType >::NormalVectorDiffusionFunction  )  [protected]
 

template<class TSparseImageType>
itk::NormalVectorDiffusionFunction< TSparseImageType >::~NormalVectorDiffusionFunction  )  [inline, protected]
 

Definition at line 143 of file itkNormalVectorDiffusionFunction.h.


Member Function Documentation

static void itk::LightObject::BreakOnError  )  [static, inherited]
 

This method is called when itkExceptionMacro executes. It allows the debugger to break on error.

template<class TSparseImageType>
virtual TimeStepType itk::NormalVectorFunctionBase< TSparseImageType >::ComputeGlobalTimeStep void *   )  const [inline, virtual, inherited]
 

For the global time step, we return the time step parameter.

Implements itk::FiniteDifferenceFunction< TSparseImageType >.

Definition at line 89 of file itkNormalVectorFunctionBase.h.

template<class TSparseImageType>
virtual NormalVectorType itk::NormalVectorDiffusionFunction< TSparseImageType >::ComputeSparseUpdate NeighborhoodType neighborhood,
void *  globalData,
const FloatOffsetType offset
const [virtual]
 

The actual update rule for the normal vectors.

Implements itk::FiniteDifferenceSparseImageFunction< TSparseImageType >.

template<class TSparseImageType>
virtual PixelType itk::FiniteDifferenceSparseImageFunction< TSparseImageType >::ComputeUpdate const NeighborhoodType ,
void *  ,
const FloatOffsetType
[inline, virtual, inherited]
 

This function is not called from the FiniteDifferenceSparseImageFilter class because we need to work with neighborhoods of pointers to data variables instead of neighborhoods of data directly. This function is replaced by the ComputeSparseUpdate function.

Implements itk::FiniteDifferenceFunction< TSparseImageType >.

Definition at line 83 of file itkFiniteDifferenceSparseImageFunction.h.

virtual Pointer itk::LightObject::CreateAnother  )  const [virtual, inherited]
 

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented in itk::Object.

virtual void itk::LightObject::Delete  )  [virtual, inherited]
 

Delete an itk object. This method should always be used to delete an object when the new operator was used to create it. Using the C delete method will not work with reference counting.

itk::FiniteDifferenceFunction< TSparseImageType >::FiniteDifferenceFunction  )  [inline, protected, inherited]
 

Definition at line 182 of file itkFiniteDifferenceFunction.h.

References itk::m_Radius.

template<class TSparseImageType>
The method called in anisotropic diffusion to inhibit diffusion across areas with large curvature* NodeValueType itk::NormalVectorDiffusionFunction< TSparseImageType >::FluxStopFunction const NodeValueType  v  )  const [inline, protected]
 

Definition at line 148 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
NodeValueType itk::NormalVectorDiffusionFunction< TSparseImageType >::GetConductanceParameter  )  const [inline]
 

This method returns the conductance parameter.

Definition at line 115 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
NodeValueType itk::NormalVectorDiffusionFunction< TSparseImageType >::GetFluxStopConstant  )  const [inline]
 

This method returns the internal variable FluxStopConstant.

Definition at line 119 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
Globaldata methods are not needed in this class* virtual void* itk::NormalVectorFunctionBase< TSparseImageType >::GetGlobalDataPointer  )  const [inline, virtual, inherited]
 

Returns a pointer to a global data structure that is passed to this object from the solver at each calculation. The idea is that the solver holds the state of any global values needed to calculate the time step, while the equation object performs the actual calculations.

The global data should also be initialized in this method.

Implements itk::FiniteDifferenceFunction< TSparseImageType >.

Definition at line 84 of file itkNormalVectorFunctionBase.h.

template<class TSparseImageType>
virtual const char* itk::NormalVectorDiffusionFunction< TSparseImageType >::GetNameOfClass  )  const [virtual]
 

Run-time type information (and related methods)

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

template<class TSparseImageType>
int itk::NormalVectorDiffusionFunction< TSparseImageType >::GetNormalProcessType  )  const [inline]
 

This method returns the isotropic/anisotropic filtering parameter.

Definition at line 96 of file itkNormalVectorDiffusionFunction.h.

const RadiusType& itk::FiniteDifferenceFunction< TSparseImageType >::GetRadius void   )  const [inline, inherited]
 

Returns the radius of the neighborhood this FiniteDifferenceFunction needs to perform its calculations.

Definition at line 142 of file itkFiniteDifferenceFunction.h.

References itk::m_Radius.

virtual int itk::LightObject::GetReferenceCount  )  const [inline, virtual, inherited]
 

Gets the reference count on this object.

Definition at line 98 of file itkLightObject.h.

template<class TSparseImageType>
TimeStepType itk::NormalVectorFunctionBase< TSparseImageType >::GetTimeStep  )  const [inline, inherited]
 

Returns the time step.

Definition at line 97 of file itkNormalVectorFunctionBase.h.

virtual void itk::FiniteDifferenceFunction< TSparseImageType >::InitializeIteration  )  [inline, virtual, inherited]
 

This method allows the function to set its state before each iteration of the finite difference solver (image filter) that uses it. This is a thread-safe time to manipulate the object's state.

An example of how this can be used: the Anisotropic diffusion class of FiniteDifferenceFunctions use this method to pre-calculate an average gradient magnitude across the entire image region. This value is set in the function object and used by the ComputeUpdate methods that are called at each pixel as a constant.

Definition at line 115 of file itkFiniteDifferenceFunction.h.

itk::FiniteDifferenceFunction< TSparseImageType >::itkStaticConstMacro ImageDimension  ,
unsigned  int,
ImageType::ImageDimension 
[inherited]
 

Save image dimension.

template<class TSparseImageType>
itk::NormalVectorDiffusionFunction< TSparseImageType >::itkStaticConstMacro ImageDimension  ,
unsigned  int,
Superclass::ImageDimension 
 

Image dimension derived from the superclass.

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

template<class TSparseImageType>
static Pointer itk::NormalVectorDiffusionFunction< TSparseImageType >::New  )  [static]
 

Standard New macro.

Reimplemented from itk::LightObject.

template<class TSparseImageType>
virtual void itk::NormalVectorDiffusionFunction< TSparseImageType >::PrecomputeSparseUpdate NeighborhoodType it  )  const [virtual]
 

This function is called from LevelSetNormalImageFilter for all of the nodes to compute and store the flux vectors (first derivatives of the normal vectors. ComputeUpdateNormal then takes derivatives of the flux vectors. This way we avoid repeating the same flux computations.

Reimplemented from itk::FiniteDifferenceSparseImageFunction< TSparseImageType >.

void itk::LightObject::Print std::ostream &  os,
Indent  indent = 0
const [inherited]
 

Cause the object to print itself out.

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

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

virtual void itk::LightObject::PrintTrailer std::ostream &  os,
Indent  indent
const [protected, virtual, inherited]
 

virtual void itk::LightObject::Register  )  const [virtual, inherited]
 

Increase the reference count (mark as used by another object).

Reimplemented in itk::Object.

template<class TSparseImageType>
virtual void itk::NormalVectorFunctionBase< TSparseImageType >::ReleaseGlobalDataPointer void *   )  const [inline, virtual, inherited]
 

When the finite difference solver filter has finished using a global data pointer, it passes it to this method, which frees the memory.

The solver cannot free the memory because it does not know the type to which the pointer points.

Implements itk::FiniteDifferenceFunction< TSparseImageType >.

Definition at line 85 of file itkNormalVectorFunctionBase.h.

template<class TSparseImageType>
This method sets the conductance parameter used in anisotropic* filtering Useful values for processing D and D shapes are between* and Lower values preserve more shape higher values* smooth more As the conductance parameter the processing becomes* isotropic Default is* void itk::NormalVectorDiffusionFunction< TSparseImageType >::SetConductanceParameter NodeValueType  cp  )  [inline]
 

Definition at line 104 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
void itk::NormalVectorDiffusionFunction< TSparseImageType >::SetNormalProcessType int  npt  )  [inline]
 

This method is used to choose between isotropic/anisotropic filtering. A parameter value of 0 indicates isotropic diffusion and is the default. Parameter value 1 is anisotropic diffusion. When using anisotropic diffusion the conductance parameter should also be set.

Definition at line 92 of file itkNormalVectorDiffusionFunction.h.

void itk::FiniteDifferenceFunction< TSparseImageType >::SetRadius const RadiusType r  )  [inline, inherited]
 

Sets the radius of the neighborhood this FiniteDifferenceFunction needs to perform its calculations.

Definition at line 137 of file itkFiniteDifferenceFunction.h.

References itk::m_Radius.

virtual void itk::LightObject::SetReferenceCount int   )  [virtual, inherited]
 

Sets the reference count on this object. This is a dangerous method, use it with care.

Reimplemented in itk::Object.

Set the ScaleCoefficients for the difference* operators The defaults a These can be set to take the image* spacing into account* void itk::FiniteDifferenceFunction< TSparseImageType >::SetScaleCoefficients PixelRealType  vals[ImageDimension]  )  [inline, inherited]
 

Definition at line 148 of file itkFiniteDifferenceFunction.h.

template<class TSparseImageType>
void itk::NormalVectorFunctionBase< TSparseImageType >::SetTimeStep const TimeStepType ts  )  [inline, inherited]
 

Sets the time step.

Definition at line 93 of file itkNormalVectorFunctionBase.h.

virtual void itk::LightObject::UnRegister  )  const [virtual, inherited]
 

Decrease the reference count (release by another object).

Reimplemented in itk::Object.


Member Data Documentation

template<class TSparseImageType>
This method sets the conductance parameter used in anisotropic* filtering Useful values for processing D and D shapes are between* and Lower values preserve more shape itk::NormalVectorDiffusionFunction< TSparseImageType >::features
 

Definition at line 101 of file itkNormalVectorDiffusionFunction.h.

template<class TSparseImageType>
This method sets the conductance parameter used in anisotropic* filtering Useful values for processing D and D shapes are between* and Lower values preserve more shape higher values* smooth more As the conductance parameter itk::NormalVectorDiffusionFunction< TSparseImageType >::large
 

Definition at line 101 of file itkNormalVectorDiffusionFunction.h.

RadiusType itk::FiniteDifferenceFunction< TSparseImageType >::m_Radius [protected, inherited]
 

Definition at line 194 of file itkFiniteDifferenceFunction.h.

int itk::LightObject::m_ReferenceCount [mutable, protected, inherited]
 

Number of uses of this object by other objects.

Definition at line 119 of file itkLightObject.h.

SimpleFastMutexLock itk::LightObject::m_ReferenceCountLock [mutable, protected, inherited]
 

Mutex lock to protect modification to the reference count

Definition at line 122 of file itkLightObject.h.

PixelRealType itk::FiniteDifferenceFunction< TSparseImageType >::m_ScaleCoefficients[ImageDimension] [protected, inherited]
 

Definition at line 195 of file itkFiniteDifferenceFunction.h.

Methods invoked by virtual 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. */ virtual void PrintSelf(std voi itk::LightObject::PrintHeader)(std::ostream &os, Indent indent) const [protected, inherited]
 


The documentation for this class was generated from the following file:
Generated at Sun Jul 9 20:59:29 2006 for ITK by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2000