ITK  5.4.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType > Class Template Reference

#include <itkShapeDetectionLevelSetFunction.h>

Detailed Description

template<typename TImageType, typename TFeatureImageType = TImageType>
class itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >

This function is used in the ShapeDetectionLevelSetImageFilter to segment structures in an image based on a user supplied edge potential map.

IMPORTANT
The LevelSetFunction class contain additional information necessary to gain full understanding of how to use this function.

ShapeDetectionLevelSetFunction is a subclass of the generic LevelSetFunction. It is used to segment structures in an image based on a user supplied edge potential map \( g(I) \), which has values close to zero in regions near edges (or high image gradient) and values close to one in regions with relatively constant intensity. Typically, the edge potential map is a function of the image gradient, for example:

\[ g(I) = 1 / ( 1 + | (\nabla * G)(I)| ) \]

\[ g(I) = \exp^{-|(\nabla * G)(I)|} \]

where \( I \) is image intensity and \( (\nabla * G) \) is the derivative of Gaussian operator.

The edge potential image is set via the SetFeatureImage() method.

In this function both the propagation term \( P(\mathbf{x}) \) and the curvature spatial modifier term \( Z(\mathbf{x}) \) are taken directly from the edge potential image such that:

\[ P(\mathbf{x}) = g(\mathbf{x}) \]

\[ Z(\mathbf{x}) = g(\mathbf{x}) \]

Note that there is no advection term in this function.

This implementation is based on: "Shape Modeling with Front Propagation: A Level Set Approach", R. Malladi, J. A. Sethian and B. C. Vermuri. IEEE Trans. on Pattern Analysis and Machine Intelligence, Vol 17, No. 2, pp 158-174, February 1995

See also
LevelSetFunction
SegmentationLevelSetImageFunction
ShapeDetectionLevelSetImageFilter

Definition at line 72 of file itkShapeDetectionLevelSetFunction.h.

+ Inheritance diagram for itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >:
+ Collaboration diagram for itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using FeatureImageType = TFeatureImageType
 
using Pointer = SmartPointer< Self >
 
using Self = ShapeDetectionLevelSetFunction
 
using Superclass = SegmentationLevelSetFunction< TImageType, TFeatureImageType >
 
- Public Types inherited from itk::SegmentationLevelSetFunction< TImageType, TFeatureImageType >
using ConstPointer = SmartPointer< const Self >
 
using ContinuousIndexType = typename InterpolatorType::ContinuousIndexType
 
using FeatureImageType = TFeatureImageType
 
using FeatureScalarType = typename FeatureImageType::PixelType
 
using IndexType = typename ImageType::IndexType
 
using InterpolatorType = LinearInterpolateImageFunction< ImageType >
 
using Pointer = SmartPointer< Self >
 
using Self = SegmentationLevelSetFunction
 
using Superclass = LevelSetFunction< TImageType >
 
using VectorImageType = Image< VectorType, Self::ImageDimension >
 
using VectorInterpolatorType = VectorLinearInterpolateImageFunction< VectorImageType >
 
- Public Types inherited from itk::LevelSetFunction< TImageType >
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using ScalarValueType = PixelType
 
using Self = LevelSetFunction
 
using Superclass = FiniteDifferenceFunction< TImageType >
 
using TimeStepType = double
 
using VectorType = FixedArray< ScalarValueType, Self::ImageDimension >
 
- Public Types inherited from itk::FiniteDifferenceFunction< TImageType >
using ConstPointer = SmartPointer< const Self >
 
using DefaultBoundaryConditionType = ZeroFluxNeumannBoundaryCondition< ImageType >
 
using FloatOffsetType = Vector< float, Self::ImageDimension >
 
using ImageType = TImageType
 
using NeighborhoodScalesType = Vector< PixelRealType, Self::ImageDimension >
 
using NeighborhoodType = ConstNeighborhoodIterator< TImageType, DefaultBoundaryConditionType >
 
using PixelRealType = double
 
using PixelType = typename ImageType::PixelType
 
using Pointer = SmartPointer< Self >
 
using RadiusType = typename ConstNeighborhoodIterator< TImageType >::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

void CalculateSpeedImage () override
 
ScalarValueType CurvatureSpeed (const NeighborhoodType &neighborhood, const FloatOffsetType &offset, GlobalDataStruct *gd) const override
 
const char * GetNameOfClass () const override
 
void Initialize (const RadiusType &r) override
 
- Public Member Functions inherited from itk::SegmentationLevelSetFunction< TImageType, TFeatureImageType >
virtual void AllocateAdvectionImage ()
 
virtual void AllocateSpeedImage ()
 
virtual void CalculateAdvectionImage ()
 
virtual void ReverseExpansionDirection ()
 
virtual const FeatureImageTypeGetFeatureImage () const
 
virtual void SetFeatureImage (const FeatureImageType *f)
 
virtual ImageTypeGetSpeedImage ()
 
void SetSpeedImage (ImageType *s)
 
virtual VectorImageTypeGetAdvectionImage () const
 
void SetAdvectionImage (VectorImageType *s)
 
- Public Member Functions inherited from itk::LevelSetFunction< TImageType >
virtual ScalarValueType Compute3DMinimalCurvature (const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd=0)
 
virtual ScalarValueType ComputeCurvatureTerm (const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd=0)
 
TimeStepType ComputeGlobalTimeStep (void *GlobalData) const override
 
virtual ScalarValueType ComputeMeanCurvature (const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd=0)
 
virtual ScalarValueType ComputeMinimalCurvature (const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd=0)
 
PixelType ComputeUpdate (const NeighborhoodType &it, void *globalData, const FloatOffsetType &=FloatOffsetType(0.0)) override
 
void * GetGlobalDataPointer () const override
 
bool GetUseMinimalCurvature () const
 
virtual ScalarValueType LaplacianSmoothingSpeed (const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *=0) const
 
void ReleaseGlobalDataPointer (void *GlobalData) const override
 
void SetUseMinimalCurvature (bool b)
 
void UseMinimalCurvatureOff ()
 
void UseMinimalCurvatureOn ()
 
virtual void SetAdvectionWeight (const ScalarValueType a)
 
ScalarValueType GetAdvectionWeight () const
 
virtual void SetPropagationWeight (const ScalarValueType p)
 
ScalarValueType GetPropagationWeight () const
 
virtual void SetCurvatureWeight (const ScalarValueType c)
 
ScalarValueType GetCurvatureWeight () const
 
void SetLaplacianSmoothingWeight (const ScalarValueType c)
 
ScalarValueType GetLaplacianSmoothingWeight () const
 
void SetEpsilonMagnitude (const ScalarValueType e)
 
ScalarValueType GetEpsilonMagnitude () const
 
- Public Member Functions inherited from itk::FiniteDifferenceFunction< TImageType >
const NeighborhoodScalesType ComputeNeighborhoodScales () const
 
const RadiusTypeGetRadius () const
 
void GetScaleCoefficients (PixelRealType vals[ImageDimension]) const
 
virtual void InitializeIteration ()
 
void SetRadius (const RadiusType &r)
 
void SetScaleCoefficients (const PixelRealType vals[ImageDimension])
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual Pointer CreateAnother () 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::LevelSetFunction< TImageType >
static double GetMaximumCurvatureTimeStep ()
 
static double GetMaximumPropagationTimeStep ()
 
static Pointer New ()
 
static void SetMaximumCurvatureTimeStep (double n)
 
static void SetMaximumPropagationTimeStep (double n)
 
- 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::SegmentationLevelSetFunction< TImageType, TFeatureImageType >
static constexpr unsigned int ImageDimension = Superclass::ImageDimension
 
- Static Public Attributes inherited from itk::LevelSetFunction< TImageType >
static constexpr unsigned int ImageDimension = Superclass::ImageDimension
 
- Static Public Attributes inherited from itk::FiniteDifferenceFunction< TImageType >
static constexpr unsigned int ImageDimension = ImageType::ImageDimension
 

Protected Member Functions

 ShapeDetectionLevelSetFunction ()
 
 ~ShapeDetectionLevelSetFunction () override=default
 
- Protected Member Functions inherited from itk::SegmentationLevelSetFunction< TImageType, TFeatureImageType >
VectorType AdvectionField (const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd) const override
 
ScalarValueType PropagationSpeed (const NeighborhoodType &, const FloatOffsetType &, GlobalDataStruct *gd) const override
 
 SegmentationLevelSetFunction ()
 
 ~SegmentationLevelSetFunction () override=default
 
- Protected Member Functions inherited from itk::LevelSetFunction< TImageType >
 LevelSetFunction ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~LevelSetFunction () override=default
 
- Protected Member Functions inherited from itk::FiniteDifferenceFunction< TImageType >
 FiniteDifferenceFunction ()
 
 ~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 ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from itk::LevelSetFunction< TImageType >
static VectorType InitializeZeroVectorConstant ()
 
- Protected Attributes inherited from itk::SegmentationLevelSetFunction< TImageType, TFeatureImageType >
VectorImageType::Pointer m_AdvectionImage {}
 
FeatureImageType::ConstPointer m_FeatureImage {}
 
InterpolatorType::Pointer m_Interpolator {}
 
ImageType::Pointer m_SpeedImage {}
 
VectorInterpolatorType::Pointer m_VectorInterpolator {}
 
- Protected Attributes inherited from itk::LevelSetFunction< TImageType >
ScalarValueType m_AdvectionWeight {}
 
OffsetValueType m_Center { 0 }
 
ScalarValueType m_CurvatureWeight {}
 
ScalarValueType m_EpsilonMagnitude {}
 
ScalarValueType m_LaplacianSmoothingWeight {}
 
ScalarValueType m_PropagationWeight {}
 
bool m_UseMinimalCurvature { false }
 
OffsetValueType m_xStride [Self::ImageDimension] {}
 
std::slice x_slice [Self::ImageDimension]
 
- Protected Attributes inherited from itk::FiniteDifferenceFunction< TImageType >
RadiusType m_Radius {}
 
PixelRealType m_ScaleCoefficients [ImageDimension] {}
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount {}
 
- Static Protected Attributes inherited from itk::LevelSetFunction< TImageType >
static double m_DT
 
static double m_WaveDT
 
static VectorType m_ZeroVectorConstant
 

Member Typedef Documentation

◆ ConstPointer

template<typename TImageType , typename TFeatureImageType = TImageType>
using itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::ConstPointer = SmartPointer<const Self>

Definition at line 82 of file itkShapeDetectionLevelSetFunction.h.

◆ FeatureImageType

template<typename TImageType , typename TFeatureImageType = TImageType>
using itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::FeatureImageType = TFeatureImageType

Definition at line 83 of file itkShapeDetectionLevelSetFunction.h.

◆ Pointer

template<typename TImageType , typename TFeatureImageType = TImageType>
using itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::Pointer = SmartPointer<Self>

Definition at line 81 of file itkShapeDetectionLevelSetFunction.h.

◆ Self

template<typename TImageType , typename TFeatureImageType = TImageType>
using itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::Self = ShapeDetectionLevelSetFunction

Standard class type aliases.

Definition at line 79 of file itkShapeDetectionLevelSetFunction.h.

◆ Superclass

template<typename TImageType , typename TFeatureImageType = TImageType>
using itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::Superclass = SegmentationLevelSetFunction<TImageType, TFeatureImageType>

Definition at line 80 of file itkShapeDetectionLevelSetFunction.h.

Constructor & Destructor Documentation

◆ ShapeDetectionLevelSetFunction()

template<typename TImageType , typename TFeatureImageType = TImageType>
itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::ShapeDetectionLevelSetFunction ( )
inlineprotected

Definition at line 126 of file itkShapeDetectionLevelSetFunction.h.

◆ ~ShapeDetectionLevelSetFunction()

template<typename TImageType , typename TFeatureImageType = TImageType>
itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::~ShapeDetectionLevelSetFunction ( )
overrideprotecteddefault

Member Function Documentation

◆ CalculateSpeedImage()

template<typename TImageType , typename TFeatureImageType = TImageType>
void itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::CalculateSpeedImage ( )
overridevirtual

This method must be defined in a subclass to implement a working function object. This method is called before the solver begins its work to produce the speed image used as the level set function's Propagation speed term. See LevelSetFunction for more information.

Reimplemented from itk::SegmentationLevelSetFunction< TImageType, TFeatureImageType >.

◆ CurvatureSpeed()

template<typename TImageType , typename TFeatureImageType = TImageType>
ScalarValueType itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::CurvatureSpeed ( const NeighborhoodType neighborhood,
const FloatOffsetType offset,
GlobalDataStruct gd 
) const
inlineoverridevirtual

The curvature speed is same as the propagation speed.

Reimplemented from itk::LevelSetFunction< TImageType >.

Definition at line 108 of file itkShapeDetectionLevelSetFunction.h.

◆ GetNameOfClass()

template<typename TImageType , typename TFeatureImageType = TImageType>
const char* itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::GetNameOfClass ( ) const
overridevirtual

Run-time type information (and related methods)

Reimplemented from itk::SegmentationLevelSetFunction< TImageType, TFeatureImageType >.

◆ Initialize()

template<typename TImageType , typename TFeatureImageType = TImageType>
void itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::Initialize ( const RadiusType r)
inlineoverridevirtual

This method creates the appropriate member variable operators for the level-set calculations. The argument to this function is a the radius necessary for performing the level-set calculations.

Reimplemented from itk::SegmentationLevelSetFunction< TImageType, TFeatureImageType >.

Definition at line 116 of file itkShapeDetectionLevelSetFunction.h.

◆ New()

template<typename TImageType , typename TFeatureImageType = TImageType>
static Pointer itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::New ( )
static

Method for creation through the object factory.

Member Data Documentation

◆ ImageDimension

template<typename TImageType , typename TFeatureImageType = TImageType>
constexpr unsigned int itk::ShapeDetectionLevelSetFunction< TImageType, TFeatureImageType >::ImageDimension = Superclass::ImageDimension
staticconstexpr

Extract some parameters from the superclass.

Definition at line 101 of file itkShapeDetectionLevelSetFunction.h.


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