SimpleITK  
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
itk::simple::ShapeDetectionLevelSetImageFilter Class Reference

Segments structures in images based on a user supplied edge potential map. More...

#include <sitkShapeDetectionLevelSetImageFilter.h>

+ Inheritance diagram for itk::simple::ShapeDetectionLevelSetImageFilter:
+ Collaboration diagram for itk::simple::ShapeDetectionLevelSetImageFilter:

Detailed Description

Segments structures in images based on a user supplied edge potential map.

IMPORTANT
The SegmentationLevelSetImageFilter class and the ShapeDetectionLevelSetFunction class contain additional information necessary to gain full understanding of how to use this filter.
OVERVIEW
This class is a level set method segmentation filter. An initial contour is propagated outwards (or inwards) until it ''sticks'' to the shape boundaries. This is done by using a level set speed function based on a user supplied edge potential map. This approach for segmentation follows that of Malladi et al (1995).
INPUTS
This filter requires two inputs. The first input is a initial level set. The initial level set is a real image which contains the initial contour/surface as the zero level set. For example, a signed distance function from the initial contour/surface is typically used. Note that for this algorithm the initial contour has to be wholly within (or wholly outside) the structure to be segmented.
The second input is the feature image. For this filter, this is the edge potential map. General characteristics of an edge potential map is that it has values close to zero in regions near the edges and values close to one inside the shape itself. Typically, the edge potential map is compute from 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.

See SegmentationLevelSetImageFilter and SparseFieldLevelSetImageFilter for more information on Inputs.
PARAMETERS
The PropagationScaling parameter can be used to switch from propagation outwards (POSITIVE scaling parameter) versus propagating inwards (NEGATIVE scaling parameter).

The smoothness of the resulting contour/surface can be adjusted using a combination of PropagationScaling and CurvatureScaling parameters. The larger the CurvatureScaling parameter, the smoother the resulting contour. The CurvatureScaling parameter should be non-negative for proper operation of this algorithm. To follow the implementation in Malladi et al paper, set the PropagationScaling to \(\pm 1.0\) and CurvatureScaling to \( \epsilon \) .

Note that there is no advection term for this filter. Setting the advection scaling will have no effect.

OUTPUTS
The filter outputs a single, scalar, real-valued image. Negative values in the output image represent the inside of the segmented region and positive values in the image represent the outside of the segmented region. The zero crossings of the image correspond to the position of the propagating front.
See SparseFieldLevelSetImageFilter and SegmentationLevelSetImageFilter for more information.
REFERENCES
"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
SegmentationLevelSetImageFilter
ShapeDetectionLevelSetFunction
SparseFieldLevelSetImageFilter
itk::simple::ShapeDetectionLevelSet for the procedural interface
itk::ShapeDetectionLevelSetImageFilter for the Doxygen on the original ITK class.

Definition at line 95 of file sitkShapeDetectionLevelSetImageFilter.h.

Public Types

using PixelIDTypeList = RealPixelIDTypeList
 
using Self = ShapeDetectionLevelSetImageFilter
 
- Public Types inherited from itk::simple::ImageFilter
using Self = ImageFilter
 
- Public Types inherited from itk::simple::ProcessObject
using Self = ProcessObject
 

Public Member Functions

Image Execute (const Image &initialImage, const Image &featureImage)
 
Image Execute (Image &&initialImage, const Image &featureImage)
 
double GetCurvatureScaling () const
 
uint32_t GetElapsedIterations () const
 Number of iterations run. More...
 
double GetMaximumRMSError () const
 
std::string GetName () const
 
uint32_t GetNumberOfIterations () const
 
double GetPropagationScaling () const
 
bool GetReverseExpansionDirection () const
 
double GetRMSChange () const
 The Root Mean Square of the levelset upon termination. More...
 
SelfReverseExpansionDirectionOff ()
 
SelfReverseExpansionDirectionOn ()
 
SelfSetCurvatureScaling (double CurvatureScaling)
 
SelfSetMaximumRMSError (double MaximumRMSError)
 
SelfSetNumberOfIterations (uint32_t NumberOfIterations)
 
SelfSetPropagationScaling (double PropagationScaling)
 
SelfSetReverseExpansionDirection (bool ReverseExpansionDirection)
 
 ShapeDetectionLevelSetImageFilter ()
 
std::string ToString () const
 
virtual ~ShapeDetectionLevelSetImageFilter ()
 
- Public Member Functions inherited from itk::simple::ImageFilter
 ImageFilter ()
 
virtual ~ImageFilter ()=0
 
- Public Member Functions inherited from itk::simple::ProcessObject
virtual void Abort ()
 
virtual int AddCommand (itk::simple::EventEnum event, const std::function< void()> &func)
 Directly add a callback to observe an event. More...
 
virtual int AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd)
 Add a Command Object to observer the event. More...
 
virtual float GetProgress () const
 An Active Measurement of the progress of execution. More...
 
virtual bool HasCommand (itk::simple::EventEnum event) const
 Query of this object has any registered commands for event. More...
 
 ProcessObject ()
 
virtual void RemoveAllCommands ()
 Remove all registered commands. More...
 
virtual ~ProcessObject ()
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
virtual bool GetDebug () const
 
virtual void SetDebug (bool debugFlag)
 
virtual void SetNumberOfThreads (unsigned int n)
 
virtual unsigned int GetNumberOfThreads () const
 
virtual void SetNumberOfWorkUnits (unsigned int n)
 
virtual unsigned int GetNumberOfWorkUnits () const
 

Private Types

using MemberFunctionType = Image(Self::*)(const Image *initialImage, const Image *featureImage)
 

Private Member Functions

template<class TImageType >
Image ExecuteInternal (const Image *initialImage, const Image *featureImage)
 

Private Attributes

double m_CurvatureScaling {1.0}
 
uint32_t m_ElapsedIterations {0}
 
bool m_InPlace {false}
 
double m_MaximumRMSError {0.02}
 
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
 
uint32_t m_NumberOfIterations {1000u}
 
double m_PropagationScaling {1.0}
 
bool m_ReverseExpansionDirection {false}
 
double m_RMSChange {0.0}
 

Friends

struct detail::MemberFunctionAddressor< MemberFunctionType >
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::simple::ProcessObject
static bool GetGlobalDefaultDebug ()
 
static void GlobalDefaultDebugOff ()
 
static void GlobalDefaultDebugOn ()
 
static void SetGlobalDefaultDebug (bool debugFlag)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static void SetGlobalWarningDisplay (bool flag)
 
static bool GetGlobalWarningDisplay ()
 
static double GetGlobalDefaultCoordinateTolerance ()
 Access the global tolerance to determine congruent spaces. More...
 
static void SetGlobalDefaultCoordinateTolerance (double)
 Access the global tolerance to determine congruent spaces. More...
 
static double GetGlobalDefaultDirectionTolerance ()
 Access the global tolerance to determine congruent spaces. More...
 
static void SetGlobalDefaultDirectionTolerance (double)
 Access the global tolerance to determine congruent spaces. More...
 
static bool SetGlobalDefaultThreader (const std::string &threader)
 Set/Get the default threader used for process objects. More...
 
static std::string GetGlobalDefaultThreader ()
 Set/Get the default threader used for process objects. More...
 
static void SetGlobalDefaultNumberOfThreads (unsigned int n)
 
static unsigned int GetGlobalDefaultNumberOfThreads ()
 Set/Get the default threader used for process objects. More...
 
- Protected Member Functions inherited from itk::simple::ImageFilter
void CheckImageMatchingDimension (const Image &image1, const Image &image2, const std::string &image2Name)
 
void CheckImageMatchingPixelType (const Image &image1, const Image &image2, const std::string &image2Name)
 
void CheckImageMatchingSize (const Image &image1, const Image &image2, const std::string &image2Name)
 
- Protected Member Functions inherited from itk::simple::ProcessObject
virtual unsigned long AddITKObserver (const itk::EventObject &, itk::Command *)
 
virtual itk::ProcessObjectGetActiveProcess ()
 
virtual void OnActiveProcessDelete ()
 
virtual void onCommandDelete (const itk::simple::Command *cmd) noexcept
 
virtual void PreUpdate (itk::ProcessObject *p)
 
virtual void RemoveITKObserver (EventCommand &e)
 
- Protected Member Functions inherited from itk::simple::NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
- Static Protected Member Functions inherited from itk::simple::ImageFilter
template<class TImageType >
static void FixNonZeroIndex (TImageType *img)
 
- Static Protected Member Functions inherited from itk::simple::ProcessObject
template<class TImageType >
static TImageType::ConstPointer CastImageToITK (const Image &img)
 
template<class TPixelType , unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector>
static Image CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img)
 
template<unsigned int VImageDimension, unsigned int VLength, template< unsigned int > class TVector>
static Image CastITKToImage (itk::Image< TVector< VLength >, VImageDimension > *img)
 
template<class TImageType >
static Image CastITKToImage (TImageType *img)
 
static const itk::EventObjectGetITKEventObject (EventEnum e)
 
template<typename T >
static std::ostream & ToStringHelper (std::ostream &os, const T &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const char &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const signed char &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const unsigned char &v)
 

Member Typedef Documentation

◆ MemberFunctionType

using itk::simple::ShapeDetectionLevelSetImageFilter::MemberFunctionType = Image (Self::*)( const Image * initialImage, const Image * featureImage )
private

Setup for member function dispatching

Definition at line 187 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ PixelIDTypeList

Define the pixels types supported by this filter

Definition at line 107 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ Self

Definition at line 97 of file sitkShapeDetectionLevelSetImageFilter.h.

Constructor & Destructor Documentation

◆ ~ShapeDetectionLevelSetImageFilter()

virtual itk::simple::ShapeDetectionLevelSetImageFilter::~ShapeDetectionLevelSetImageFilter ( )
virtual

Destructor

◆ ShapeDetectionLevelSetImageFilter()

itk::simple::ShapeDetectionLevelSetImageFilter::ShapeDetectionLevelSetImageFilter ( )

Default Constructor that takes no arguments and initializes default parameters

Member Function Documentation

◆ Execute() [1/2]

Image itk::simple::ShapeDetectionLevelSetImageFilter::Execute ( const Image initialImage,
const Image featureImage 
)

◆ Execute() [2/2]

Image itk::simple::ShapeDetectionLevelSetImageFilter::Execute ( Image &&  initialImage,
const Image featureImage 
)

Execute the filter on the input image

◆ ExecuteInternal()

template<class TImageType >
Image itk::simple::ShapeDetectionLevelSetImageFilter::ExecuteInternal ( const Image initialImage,
const Image featureImage 
)
private

◆ GetCurvatureScaling()

double itk::simple::ShapeDetectionLevelSetImageFilter::GetCurvatureScaling ( ) const
inline

Definition at line 132 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ GetElapsedIterations()

uint32_t itk::simple::ShapeDetectionLevelSetImageFilter::GetElapsedIterations ( ) const
inline

Number of iterations run.

This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution.

Definition at line 159 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ GetMaximumRMSError()

double itk::simple::ShapeDetectionLevelSetImageFilter::GetMaximumRMSError ( ) const
inline

Definition at line 116 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ GetName()

std::string itk::simple::ShapeDetectionLevelSetImageFilter::GetName ( ) const
inlinevirtual

Name of this class

Implements itk::simple::ProcessObject.

Definition at line 171 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ GetNumberOfIterations()

uint32_t itk::simple::ShapeDetectionLevelSetImageFilter::GetNumberOfIterations ( ) const
inline

Definition at line 140 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ GetPropagationScaling()

double itk::simple::ShapeDetectionLevelSetImageFilter::GetPropagationScaling ( ) const
inline

Definition at line 124 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ GetReverseExpansionDirection()

bool itk::simple::ShapeDetectionLevelSetImageFilter::GetReverseExpansionDirection ( ) const
inline

Definition at line 152 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ GetRMSChange()

double itk::simple::ShapeDetectionLevelSetImageFilter::GetRMSChange ( ) const
inline

The Root Mean Square of the levelset upon termination.

This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution.

Definition at line 167 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ ReverseExpansionDirectionOff()

Self& itk::simple::ShapeDetectionLevelSetImageFilter::ReverseExpansionDirectionOff ( )
inline

Definition at line 148 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ ReverseExpansionDirectionOn()

Self& itk::simple::ShapeDetectionLevelSetImageFilter::ReverseExpansionDirectionOn ( )
inline

Set the value of ReverseExpansionDirection to true or false respectfully.

Definition at line 147 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ SetCurvatureScaling()

Self& itk::simple::ShapeDetectionLevelSetImageFilter::SetCurvatureScaling ( double  CurvatureScaling)
inline

Definition at line 128 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ SetMaximumRMSError()

Self& itk::simple::ShapeDetectionLevelSetImageFilter::SetMaximumRMSError ( double  MaximumRMSError)
inline

Definition at line 112 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ SetNumberOfIterations()

Self& itk::simple::ShapeDetectionLevelSetImageFilter::SetNumberOfIterations ( uint32_t  NumberOfIterations)
inline

Definition at line 136 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ SetPropagationScaling()

Self& itk::simple::ShapeDetectionLevelSetImageFilter::SetPropagationScaling ( double  PropagationScaling)
inline

Definition at line 120 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ SetReverseExpansionDirection()

Self& itk::simple::ShapeDetectionLevelSetImageFilter::SetReverseExpansionDirection ( bool  ReverseExpansionDirection)
inline

Definition at line 144 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ ToString()

std::string itk::simple::ShapeDetectionLevelSetImageFilter::ToString ( ) const
virtual

Print ourselves out

Reimplemented from itk::simple::ProcessObject.

Friends And Related Function Documentation

◆ detail::MemberFunctionAddressor< MemberFunctionType >

Definition at line 191 of file sitkShapeDetectionLevelSetImageFilter.h.

Member Data Documentation

◆ m_CurvatureScaling

double itk::simple::ShapeDetectionLevelSetImageFilter::m_CurvatureScaling {1.0}
private

Definition at line 203 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ m_ElapsedIterations

uint32_t itk::simple::ShapeDetectionLevelSetImageFilter::m_ElapsedIterations {0}
private

Definition at line 212 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ m_InPlace

bool itk::simple::ShapeDetectionLevelSetImageFilter::m_InPlace {false}
private

Definition at line 217 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ m_MaximumRMSError

double itk::simple::ShapeDetectionLevelSetImageFilter::m_MaximumRMSError {0.02}
private

Definition at line 197 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ m_MemberFactory

std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType> > itk::simple::ShapeDetectionLevelSetImageFilter::m_MemberFactory
private

Definition at line 193 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ m_NumberOfIterations

uint32_t itk::simple::ShapeDetectionLevelSetImageFilter::m_NumberOfIterations {1000u}
private

Definition at line 206 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ m_PropagationScaling

double itk::simple::ShapeDetectionLevelSetImageFilter::m_PropagationScaling {1.0}
private

Definition at line 200 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ m_ReverseExpansionDirection

bool itk::simple::ShapeDetectionLevelSetImageFilter::m_ReverseExpansionDirection {false}
private

Definition at line 209 of file sitkShapeDetectionLevelSetImageFilter.h.

◆ m_RMSChange

double itk::simple::ShapeDetectionLevelSetImageFilter::m_RMSChange {0.0}
private

Definition at line 214 of file sitkShapeDetectionLevelSetImageFilter.h.


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