ITK  5.0.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
itk::NormalVectorDiffusionFunction< TSparseImageType > Class Template Reference

#include <itkNormalVectorDiffusionFunction.h>

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

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

Public Types

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

Public Member Functions

NormalVectorType ComputeSparseUpdate (NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset) const override
 
virtual ::itk::LightObject::Pointer CreateAnother () const
 
NodeValueType GetConductanceParameter () const
 
NodeValueType GetFluxStopConstant () const
 
virtual const char * GetNameOfClass () const
 
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
 
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
 
virtual PixelType ComputeUpdate (const NeighborhoodType &neighborhood, void *globalData, const FloatOffsetType &offset=FloatOffsetType(0.0))=0
 
const RadiusTypeGetRadius () const
 
void GetScaleCoefficients (PixelRealType vals[ImageDimension]) const
 
virtual void InitializeIteration ()
 
void SetRadius (const RadiusType &r)
 
void SetScaleCoefficients (PixelRealType vals[ImageDimension])
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
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
 

Protected Member Functions

 NormalVectorDiffusionFunction ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~NormalVectorDiffusionFunction () override=default
 
NodeValueType FluxStopFunction (const NodeValueType v) const
 
- 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 ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~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
 
PixelRealType m_ScaleCoefficients [ImageDimension]
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Member Typedef Documentation

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

Definition at line 70 of file itkNormalVectorDiffusionFunction.h.

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

Definition at line 86 of file itkNormalVectorDiffusionFunction.h.

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

Definition at line 87 of file itkNormalVectorDiffusionFunction.h.

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

Definition at line 85 of file itkNormalVectorDiffusionFunction.h.

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

Definition at line 84 of file itkNormalVectorDiffusionFunction.h.

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

Definition at line 89 of file itkNormalVectorDiffusionFunction.h.

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

Definition at line 90 of file itkNormalVectorDiffusionFunction.h.

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

Definition at line 91 of file itkNormalVectorDiffusionFunction.h.

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

Definition at line 69 of file itkNormalVectorDiffusionFunction.h.

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

Definition at line 83 of file itkNormalVectorDiffusionFunction.h.

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

Standard class type alias.

Definition at line 67 of file itkNormalVectorDiffusionFunction.h.

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

Definition at line 88 of file itkNormalVectorDiffusionFunction.h.

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

Definition at line 68 of file itkNormalVectorDiffusionFunction.h.

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

Typedefs from the superclass.

Definition at line 82 of file itkNormalVectorDiffusionFunction.h.

Constructor & Destructor Documentation

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

Member Function Documentation

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

The actual update rule for the normal vectors.

Implements itk::FiniteDifferenceSparseImageFunction< TSparseImageType >.

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.

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 145 of file itkNormalVectorDiffusionFunction.h.

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

This method returns the conductance parameter.

Definition at line 120 of file itkNormalVectorDiffusionFunction.h.

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

This method returns the internal variable FluxStopConstant.

Definition at line 124 of file itkNormalVectorDiffusionFunction.h.

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

Run-time type information (and related methods)

Reimplemented from itk::NormalVectorFunctionBase< TSparseImageType >.

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

This method returns the isotropic/anisotropic filtering parameter.

Definition at line 101 of file itkNormalVectorDiffusionFunction.h.

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

Standard New macro.

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

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

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 109 of file itkNormalVectorDiffusionFunction.h.

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

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

Image dimension derived from the superclass.

Definition at line 76 of file itkNormalVectorDiffusionFunction.h.

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

The conductance parameter used for anisotropic diffusion.

Definition at line 155 of file itkNormalVectorDiffusionFunction.h.

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 159 of file itkNormalVectorDiffusionFunction.h.

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

The isotropic/anisotropic filtering choice parameter.

Definition at line 162 of file itkNormalVectorDiffusionFunction.h.


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