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

Solve an Eikonal equation using Fast Marching. More...

#include <sitkFastMarchingImageFilter.h>

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

Public Types

typedef BasicPixelIDTypeList PixelIDTypeList
 
typedef FastMarchingImageFilter Self
 
- Public Types inherited from itk::simple::ImageFilter< 1 >
typedef ImageFilter Self
 
- Public Types inherited from itk::simple::ProcessObject
typedef ProcessObject Self
 

Public Member Functions

SelfAddTrialPoint (const std::vector< unsigned int > &point)
 Add TrialPoints point. More...
 
SelfClearTrialPoints ()
 Remove all TrialPoints points. More...
 
Image Execute (const Image &image1)
 
Image Execute (const Image &image1, const std::vector< std::vector< unsigned int > > &trialPoints, double normalizationFactor, double stoppingValue)
 
 FastMarchingImageFilter ()
 
std::string GetName () const
 
double GetNormalizationFactor () const
 
double GetStoppingValue () const
 
std::vector< std::vector< unsigned int > > GetTrialPoints () const
 
SelfSetNormalizationFactor (double NormalizationFactor)
 
SelfSetStoppingValue (double StoppingValue)
 
SelfSetTrialPoints (const std::vector< std::vector< unsigned int > > &TrialPoints)
 
std::string ToString () const
 
 ~FastMarchingImageFilter ()
 
- Public Member Functions inherited from itk::simple::ImageFilter< 1 >
 ImageFilter ()
 
virtual ~ImageFilter ()=0
 
- Public Member Functions inherited from itk::simple::ProcessObject
virtual void Abort ()
 
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
 

Private Types

typedef Image(Self::* MemberFunctionType) (const Image &image1)
 

Private Member Functions

template<class TImageType >
Image ExecuteInternal (const Image &image1)
 

Private Attributes

nsstd::auto_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
 
double m_NormalizationFactor
 
double m_StoppingValue
 
std::vector< std::vector< unsigned int > > m_TrialPoints
 

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 void SetGlobalDefaultNumberOfThreads (unsigned int n)
 
static unsigned int GetGlobalDefaultNumberOfThreads ()
 
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...
 
- 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) throw ()
 
virtual void PreUpdate (itk::ProcessObject *p)
 
virtual void RemoveITKObserver (EventCommand &e)
 
- Protected Member Functions inherited from itk::simple::NonCopyable
 NonCopyable ()
 
- Static Protected Member Functions inherited from itk::simple::ImageFilter< 1 >
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 TImageType >
static Image CastITKToImage (TImageType *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)
 
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)
 

Detailed Description

Solve an Eikonal equation using Fast Marching.

Fast marching solves an Eikonal equation where the speed is always non-negative and depends on the position only. Starting from an initial position on the front, fast marching systematically moves the front forward one grid point at a time.

Updates are preformed using an entropy satisfy scheme where only "upwind" neighborhoods are used. This implementation of Fast Marching uses a std::priority_queue to locate the next proper grid position to update.

Fast Marching sweeps through N grid points in (N log N) steps to obtain the arrival time value as the front propagates through the grid.

Implementation of this class is based on Chapter 8 of "Level Set Methods and Fast Marching Methods", J.A. Sethian, Cambridge Press, Second edition, 1999.

This class is templated over the level set image type and the speed image type. The initial front is specified by two containers: one containing the known points and one containing the trial points. Alive points are those that are already part of the object, and trial points are considered for inclusion. In order for the filter to evolve, at least some trial points must be specified. These can for instance be specified as the layer of pixels around the alive points.

The speed function can be specified as a speed image or a speed constant. The speed image is set using the method SetInput() . If the speed image is ITK_NULLPTR, a constant speed function is used and is specified using method the SetSpeedConstant() .

If the speed function is constant and of value one, fast marching results in an approximate distance function from the initial alive points. FastMarchingImageFilter is used in the ReinitializeLevelSetImageFilter object to create a signed distance function from the zero level set.

The algorithm can be terminated early by setting an appropriate stopping value. The algorithm terminates when the current arrival time being processed is greater than the stopping value.

There are two ways to specify the output image information ( LargestPossibleRegion, Spacing, Origin): (a) it is copied directly from the input speed image or (b) it is specified by the user. Default values are used if the user does not specify all the information.

The output information is computed as follows. If the speed image is ITK_NULLPTR or if the OverrideOutputInformation is set to true, the output information is set from user specified parameters. These parameters can be specified using methods SetOutputRegion() , SetOutputSpacing() , SetOutputDirection() , and SetOutputOrigin() . Else if the speed image is not ITK_NULLPTR, the output information is copied from the input speed image.

For an alternative implementation, see itk::FastMarchingImageFilter .

Possible Improvements: In the current implementation, std::priority_queue only allows taking nodes out from the front and putting nodes in from the back. To update a value already on the heap, a new node is added to the heap. The defunct old node is left on the heap. When it is removed from the top, it will be recognized as invalid and not used. Future implementations can implement the heap in a different way allowing the values to be updated. This will generally require some sift-up and sift-down functions and an image of back-pointers going from the image to heap in order to locate the node which is to be updated.

See also
FastMarchingImageFilterBase
LevelSetTypeDefault
itk::simple::FastMarching for the procedural interface
itk::FastMarchingImageFilter for the Doxygen on the original ITK class.

Definition at line 68 of file sitkFastMarchingImageFilter.h.

Member Typedef Documentation

typedef Image(Self::* itk::simple::FastMarchingImageFilter::MemberFunctionType) (const Image &image1)
private

Setup for member function dispatching

Definition at line 137 of file sitkFastMarchingImageFilter.h.

Define the pixels types supported by this filter

Definition at line 80 of file sitkFastMarchingImageFilter.h.

Definition at line 70 of file sitkFastMarchingImageFilter.h.

Constructor & Destructor Documentation

itk::simple::FastMarchingImageFilter::FastMarchingImageFilter ( )

Default Constructor that takes no arguments and initializes default parameters

itk::simple::FastMarchingImageFilter::~FastMarchingImageFilter ( )

Destructor

Member Function Documentation

Self& itk::simple::FastMarchingImageFilter::AddTrialPoint ( const std::vector< unsigned int > &  point)
inline

Add TrialPoints point.

Definition at line 94 of file sitkFastMarchingImageFilter.h.

Self& itk::simple::FastMarchingImageFilter::ClearTrialPoints ( )
inline

Remove all TrialPoints points.

Definition at line 96 of file sitkFastMarchingImageFilter.h.

Image itk::simple::FastMarchingImageFilter::Execute ( const Image image1)

Execute the filter on the input image

Image itk::simple::FastMarchingImageFilter::Execute ( const Image image1,
const std::vector< std::vector< unsigned int > > &  trialPoints,
double  normalizationFactor,
double  stoppingValue 
)

Execute the filter on the input image with the given parameters

template<class TImageType >
Image itk::simple::FastMarchingImageFilter::ExecuteInternal ( const Image image1)
private
std::string itk::simple::FastMarchingImageFilter::GetName ( ) const
inlinevirtual

Name of this class

Implements itk::simple::ProcessObject.

Definition at line 119 of file sitkFastMarchingImageFilter.h.

double itk::simple::FastMarchingImageFilter::GetNormalizationFactor ( ) const
inline

Set/Get the Normalization Factor for the Speed Image . The values in the Speed Image is divided by this factor. This allows the use of images with integer pixel types to represent the speed.

Definition at line 107 of file sitkFastMarchingImageFilter.h.

double itk::simple::FastMarchingImageFilter::GetStoppingValue ( ) const
inline

Get the Fast Marching algorithm Stopping Value.

Definition at line 117 of file sitkFastMarchingImageFilter.h.

std::vector< std::vector<unsigned int> > itk::simple::FastMarchingImageFilter::GetTrialPoints ( ) const
inline

Get the container of Trial Points representing the initial front.

Definition at line 92 of file sitkFastMarchingImageFilter.h.

Self& itk::simple::FastMarchingImageFilter::SetNormalizationFactor ( double  NormalizationFactor)
inline

Set/Get the Normalization Factor for the Speed Image . The values in the Speed Image is divided by this factor. This allows the use of images with integer pixel types to represent the speed.

Definition at line 102 of file sitkFastMarchingImageFilter.h.

Self& itk::simple::FastMarchingImageFilter::SetStoppingValue ( double  StoppingValue)
inline

Set the Fast Marching algorithm Stopping Value. The Fast Marching algorithm is terminated when the value of the smallest trial point is greater than the stopping value.

Definition at line 112 of file sitkFastMarchingImageFilter.h.

Self& itk::simple::FastMarchingImageFilter::SetTrialPoints ( const std::vector< std::vector< unsigned int > > &  TrialPoints)
inline

Set the container of Trial Points representing the initial front. Trial points are represented as a VectorContainer of LevelSetNodes.

Definition at line 87 of file sitkFastMarchingImageFilter.h.

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

Print ourselves out

Reimplemented from itk::simple::ProcessObject.

Friends And Related Function Documentation

Definition at line 142 of file sitkFastMarchingImageFilter.h.

Member Data Documentation

nsstd::auto_ptr<detail::MemberFunctionFactory<MemberFunctionType> > itk::simple::FastMarchingImageFilter::m_MemberFactory
private

Definition at line 144 of file sitkFastMarchingImageFilter.h.

double itk::simple::FastMarchingImageFilter::m_NormalizationFactor
private

Definition at line 148 of file sitkFastMarchingImageFilter.h.

double itk::simple::FastMarchingImageFilter::m_StoppingValue
private

Definition at line 149 of file sitkFastMarchingImageFilter.h.

std::vector< std::vector<unsigned int> > itk::simple::FastMarchingImageFilter::m_TrialPoints
private

Definition at line 147 of file sitkFastMarchingImageFilter.h.


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