ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itk::NormalVectorDiffusionFunction< TSparseImageType > Class Template Reference

#include <itkNormalVectorDiffusionFunction.h>

Detailed Description

template<typename 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 execution 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 60 of file itkNormalVectorDiffusionFunction.h.

+ Inheritance diagram for itk::NormalVectorDiffusionFunction< TSparseImageType >:
+ Collaboration diagram for itk::NormalVectorDiffusionFunction< TSparseImageType >:

Public Types

using ConstPointer = SmartPointer<const Self>
 
using NodeType
 
using NodeValueType
 
using NormalVectorType
 
using Pointer = SmartPointer<Self>
 
using Self = NormalVectorDiffusionFunction
 
using Superclass = NormalVectorFunctionBase<TSparseImageType>
 
- Public Types inherited from itk::NormalVectorFunctionBase< TSparseImageType >
using ConstPointer = SmartPointer<const Self>
 
using IndexType
 
using NodeType = typename SparseImageType::NodeType
 
using NodeValueType = typename NodeType::NodeValueType
 
using NormalVectorType = typename NodeType::NodeDataType
 
using Pointer = SmartPointer<Self>
 
using Self = NormalVectorFunctionBase
 
using SparseImageType
 
using Superclass = FiniteDifferenceSparseImageFunction<TSparseImageType>
 
- Public Types inherited from itk::FiniteDifferenceSparseImageFunction< TSparseImageType >
using ConstPointer = SmartPointer<const Self>
 
using IndexType = typename SparseImageType::IndexType
 
using NodeDataType = typename NodeType::NodeDataType
 
using NodeType = typename SparseImageType::NodeType
 
using Pointer = SmartPointer<Self>
 
using Self = FiniteDifferenceSparseImageFunction
 
using SparseImageType = typename Superclass::ImageType
 
using Superclass = FiniteDifferenceFunction<TSparseImageType>
 
- Public Types inherited from itk::FiniteDifferenceFunction< TSparseImageType >
using ConstPointer
 
using DefaultBoundaryConditionType
 
using FloatOffsetType
 
using ImageType
 
using NeighborhoodScalesType
 
using NeighborhoodType
 
using PixelRealType
 
using PixelType
 
using Pointer
 
using RadiusType
 
using Self
 
using Superclass
 
using TimeStepType
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer<const Self>
 
using Pointer = SmartPointer<Self>
 
using Self = LightObject
 

Public Member Functions

NormalVectorType ComputeSparseUpdate (NeighborhoodType &it, void *globalData, const FloatOffsetType &offset) const override
 
virtual::itk::LightObject::Pointer CreateAnother () const
 
NodeValueType GetConductanceParameter () const
 
NodeValueType GetFluxStopConstant () const
 
const char * GetNameOfClass () const override
 
int GetNormalProcessType () const
 
void PrecomputeSparseUpdate (NeighborhoodType &it) const override
 
void SetNormalProcessType (int npt)
 
void SetConductanceParameter (NodeValueType cp)
 
- Public Member Functions inherited from itk::NormalVectorFunctionBase< TSparseImageType >
TimeStepType ComputeGlobalTimeStep (void *) const override
 
const char * GetNameOfClass () const override
 
TimeStepType GetTimeStep () const
 
void SetTimeStep (const TimeStepType &ts)
 
void * GetGlobalDataPointer () const override
 
void ReleaseGlobalDataPointer (void *) const override
 
- Public Member Functions inherited from itk::FiniteDifferenceSparseImageFunction< TSparseImageType >
PixelType ComputeUpdate (const NeighborhoodType &, void *, const FloatOffsetType &) override
 
- Public Member Functions inherited from itk::FiniteDifferenceFunction< TSparseImageType >
const NeighborhoodScalesType ComputeNeighborhoodScales () const
 
const NeighborhoodScalesType ComputeNeighborhoodScales () const
 
const RadiusTypeGetRadius () const
 
const RadiusTypeGetRadius () const
 
void GetScaleCoefficients (PixelRealType vals[ImageDimension]) const
 
void GetScaleCoefficients (PixelRealType vals[ImageDimension]) const
 
virtual void InitializeIteration ()
 
virtual void InitializeIteration ()
 
void SetRadius (const RadiusType &r)
 
void SetRadius (const RadiusType &r)
 
void SetScaleCoefficients (const PixelRealType vals[ImageDimension])
 
void SetScaleCoefficients (const PixelRealType vals[ImageDimension])
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 
virtual void Register () const
 
virtual void SetReferenceCount (int)
 
virtual void UnRegister () const noexcept
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Static Public Attributes

static constexpr unsigned int ImageDimension = Superclass::ImageDimension
 
- Static Public Attributes inherited from itk::NormalVectorFunctionBase< TSparseImageType >
static constexpr unsigned int ImageDimension = Superclass::ImageDimension
 
- Static Public Attributes inherited from itk::FiniteDifferenceSparseImageFunction< TSparseImageType >
static constexpr unsigned int ImageDimension = Superclass::ImageDimension
 
- Static Public Attributes inherited from itk::FiniteDifferenceFunction< TSparseImageType >
static constexpr unsigned int ImageDimension
 
static constexpr unsigned int ImageDimension
 

Protected Member Functions

NodeValueType FluxStopFunction (const NodeValueType v) const
 
 NormalVectorDiffusionFunction ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~NormalVectorDiffusionFunction () override=default
 
- Protected Member Functions inherited from itk::NormalVectorFunctionBase< TSparseImageType >
 NormalVectorFunctionBase ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~NormalVectorFunctionBase () override=default
 
- Protected Member Functions inherited from itk::FiniteDifferenceSparseImageFunction< TSparseImageType >
 FiniteDifferenceSparseImageFunction ()=default
 
 ~FiniteDifferenceSparseImageFunction () override=default
 
- Protected Member Functions inherited from itk::FiniteDifferenceFunction< TSparseImageType >
 FiniteDifferenceFunction ()
 
 FiniteDifferenceFunction ()
 
 ~FiniteDifferenceFunction () override=default
 
 ~FiniteDifferenceFunction () override=default
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Private Attributes

NodeValueType m_ConductanceParameter {}
 
NodeValueType m_FluxStopConstant {}
 
int m_NormalProcessType {}
 

Additional Inherited Members

- Protected Attributes inherited from itk::FiniteDifferenceFunction< TSparseImageType >
RadiusType m_Radius
 
RadiusType m_Radius
 
PixelRealType m_ScaleCoefficients [ImageDimension]
 
PixelRealType m_ScaleCoefficients [ImageDimension]
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ ConstPointer

template<typename TSparseImageType>
using itk::NormalVectorDiffusionFunction< TSparseImageType >::ConstPointer = SmartPointer<const Self>

Definition at line 69 of file itkNormalVectorDiffusionFunction.h.

◆ NodeType

template<typename TSparseImageType>
using itk::NormalVectorFunctionBase< TSparseImageType >::NodeType

The node type for the sparse image.

Definition at line 78 of file itkNormalVectorFunctionBase.h.

◆ NodeValueType

template<typename TSparseImageType>
using itk::NormalVectorFunctionBase< TSparseImageType >::NodeValueType

The basic floating point type for the variables.

Definition at line 81 of file itkNormalVectorFunctionBase.h.

◆ NormalVectorType

template<typename TSparseImageType>
using itk::NormalVectorFunctionBase< TSparseImageType >::NormalVectorType

The vector type for the normals.

Definition at line 84 of file itkNormalVectorFunctionBase.h.

◆ Pointer

template<typename TSparseImageType>
using itk::NormalVectorDiffusionFunction< TSparseImageType >::Pointer = SmartPointer<Self>

Definition at line 68 of file itkNormalVectorDiffusionFunction.h.

◆ Self

template<typename TSparseImageType>
using itk::NormalVectorDiffusionFunction< TSparseImageType >::Self = NormalVectorDiffusionFunction

Standard class type alias.

Definition at line 66 of file itkNormalVectorDiffusionFunction.h.

◆ Superclass

template<typename TSparseImageType>
using itk::NormalVectorDiffusionFunction< TSparseImageType >::Superclass = NormalVectorFunctionBase<TSparseImageType>

Definition at line 67 of file itkNormalVectorDiffusionFunction.h.

Constructor & Destructor Documentation

◆ NormalVectorDiffusionFunction()

template<typename TSparseImageType>
itk::NormalVectorDiffusionFunction< TSparseImageType >::NormalVectorDiffusionFunction ( )
protected

◆ ~NormalVectorDiffusionFunction()

template<typename TSparseImageType>
itk::NormalVectorDiffusionFunction< TSparseImageType >::~NormalVectorDiffusionFunction ( )
overrideprotecteddefault

Member Function Documentation

◆ ComputeSparseUpdate()

template<typename TSparseImageType>
NormalVectorType itk::NormalVectorDiffusionFunction< TSparseImageType >::ComputeSparseUpdate ( NeighborhoodType & it,
void * globalData,
const FloatOffsetType & offset ) const
overridevirtual

The actual update rule for the normal vectors.

Implements itk::FiniteDifferenceSparseImageFunction< TSparseImageType >.

◆ CreateAnother()

template<typename TSparseImageType>
virtual::itk::LightObject::Pointer itk::NormalVectorDiffusionFunction< TSparseImageType >::CreateAnother ( ) const
virtual

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 from itk::LightObject.

◆ FluxStopFunction()

template<typename TSparseImageType>
NodeValueType itk::NormalVectorDiffusionFunction< TSparseImageType >::FluxStopFunction ( const NodeValueType v) const
inlineprotected

The method called in anisotropic diffusion to inhibit diffusion across areas with large curvature.

Definition at line 158 of file itkNormalVectorDiffusionFunction.h.

◆ GetConductanceParameter()

template<typename TSparseImageType>
NodeValueType itk::NormalVectorDiffusionFunction< TSparseImageType >::GetConductanceParameter ( ) const
inline

This method returns the conductance parameter.

Definition at line 126 of file itkNormalVectorDiffusionFunction.h.

◆ GetFluxStopConstant()

template<typename TSparseImageType>
NodeValueType itk::NormalVectorDiffusionFunction< TSparseImageType >::GetFluxStopConstant ( ) const
inline

This method returns the internal variable FluxStopConstant.

Definition at line 133 of file itkNormalVectorDiffusionFunction.h.

◆ GetNameOfClass()

template<typename TSparseImageType>
const char * itk::NormalVectorDiffusionFunction< TSparseImageType >::GetNameOfClass ( ) const
overridevirtual

◆ GetNormalProcessType()

template<typename TSparseImageType>
int itk::NormalVectorDiffusionFunction< TSparseImageType >::GetNormalProcessType ( ) const
inline

This method returns the isotropic/anisotropic filtering parameter.

Definition at line 104 of file itkNormalVectorDiffusionFunction.h.

◆ New()

template<typename TSparseImageType>
static Pointer itk::NormalVectorDiffusionFunction< TSparseImageType >::New ( )
static

Standard New macro.

◆ PrecomputeSparseUpdate()

template<typename TSparseImageType>
void itk::NormalVectorDiffusionFunction< TSparseImageType >::PrecomputeSparseUpdate ( NeighborhoodType & it) const
overridevirtual

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 >.

◆ PrintSelf()

template<typename TSparseImageType>
void itk::NormalVectorDiffusionFunction< TSparseImageType >::PrintSelf ( std::ostream & os,
Indent indent ) const
overrideprotectedvirtual

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::FiniteDifferenceSparseImageFunction< TSparseImageType >.

◆ SetConductanceParameter()

template<typename TSparseImageType>
void itk::NormalVectorDiffusionFunction< TSparseImageType >::SetConductanceParameter ( NodeValueType cp)
inline

This method sets the conductance parameter used in anisotropic filtering. Useful values for processing 2D and 3D shapes are between 0.1 and 0.25. Lower values preserve more shape features, higher values smooth more. As the conductance parameter large, the processing becomes isotropic. Default is 0.

Definition at line 115 of file itkNormalVectorDiffusionFunction.h.

◆ SetNormalProcessType()

template<typename 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 97 of file itkNormalVectorDiffusionFunction.h.

Member Data Documentation

◆ ImageDimension

template<typename TSparseImageType>
unsigned int itk::NormalVectorDiffusionFunction< TSparseImageType >::ImageDimension = Superclass::ImageDimension
staticconstexpr

Image dimension derived from the superclass.

Definition at line 75 of file itkNormalVectorDiffusionFunction.h.

◆ m_ConductanceParameter

template<typename TSparseImageType>
NodeValueType itk::NormalVectorDiffusionFunction< TSparseImageType >::m_ConductanceParameter {}
private

The conductance parameter used for anisotropic diffusion.

Definition at line 171 of file itkNormalVectorDiffusionFunction.h.

◆ m_FluxStopConstant

template<typename TSparseImageType>
NodeValueType itk::NormalVectorDiffusionFunction< TSparseImageType >::m_FluxStopConstant {}
private

The internal variable used in the FluxStopFunction. It is computed from ConductanceParameter.

Definition at line 175 of file itkNormalVectorDiffusionFunction.h.

◆ m_NormalProcessType

template<typename TSparseImageType>
int itk::NormalVectorDiffusionFunction< TSparseImageType >::m_NormalProcessType {}
private

The isotropic/anisotropic filtering choice parameter.

Definition at line 178 of file itkNormalVectorDiffusionFunction.h.


The documentation for this class was generated from the following file: