SimpleITK  
itk::simple::FastMarchingUpwindGradientImageFilter Class Reference

Generates the upwind gradient field of fast marching arrival times. More...

#include <sitkFastMarchingUpwindGradientImageFilter.h>

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

Detailed Description

Generates the upwind gradient field of fast marching arrival times.

This filter adds some extra functionality to its base class. While the solution T(x) of the Eikonal equation is being generated by the base class with the fast marching method, the filter generates the upwind gradient vectors of T(x), storing them in an image.

Since the Eikonal equation generates the arrival times of a wave traveling at a given speed, the generated gradient vectors can be interpreted as the slowness (1/velocity) vectors of the front (the quantity inside the modulus operator in the Eikonal equation).

Gradient vectors are computed using upwind finite differences, that is, information only propagates from points where the wavefront has already passed. This is consistent with how the fast marching method works.

One more extra feature is the possibility to define a set of Target points where the propagation stops. This can be used to avoid computing the Eikonal solution for the whole domain. The front can be stopped either when one Target point is reached or all Target points are reached. The propagation can stop after a time TargetOffset has passed since the stop condition is met. This way the solution is computed a bit downstream the Target points, so that the level sets of T(x) corresponding to the Target are smooth.

For an alternative implementation, see itk::FastMarchingUpwindGradientImageFilterBase .

Author
Luca Antiga Ph.D. Biomedical Technologies Laboratory, Bioengineering Department, Mario Negri Institute, Italy.
See also
itk::simple::FastMarchingUpwindGradient for the procedural interface
itk::FastMarchingUpwindGradientImageFilter for the Doxygen on the original ITK class.

Definition at line 63 of file sitkFastMarchingUpwindGradientImageFilter.h.

Public Types

using PixelIDTypeList = BasicPixelIDTypeList
 
using Self = FastMarchingUpwindGradientImageFilter
 
- Public Types inherited from itk::simple::ImageFilter
using Self = ImageFilter
 
- Public Types inherited from itk::simple::ProcessObject
using Self = ProcessObject
 

Public Member Functions

void AddTargetPoint (std::vector< unsigned int > point)
 Add TargetPoints point.
 
void AddTrialPoint (std::vector< unsigned int > point)
 Add TrialPoints point.
 
void ClearTargetPoints ()
 Remove all TargetPoints points.
 
void ClearTrialPoints ()
 Remove all TrialPoints points.
 
Image Execute (const Image &image1)
 
 FastMarchingUpwindGradientImageFilter ()
 
Image GetGradientImage () const
 
std::vector< double > GetInitialTrialValues () const
 
std::string GetName () const
 
double GetNormalizationFactor () const
 
unsigned int GetNumberOfTargets () const
 
double GetTargetOffset () const
 
std::vector< std::vector< unsigned int > > GetTargetPoints () const
 
double GetTargetValue () const
 
std::vector< std::vector< unsigned int > > GetTrialPoints () const
 
void SetInitialTrialValues (std::vector< double > InitialTrialValues)
 Set the initial seed values for corresponding trial point.
 
void SetNormalizationFactor (double NormalizationFactor)
 
void SetNumberOfTargets (unsigned int NumberOfTargets)
 
void SetTargetOffset (double TargetOffset)
 
void SetTargetPoints (std::vector< std::vector< unsigned int > > TargetPoints)
 
void SetTrialPoints (std::vector< std::vector< unsigned int > > TrialPoints)
 
std::string ToString () const
 
virtual ~FastMarchingUpwindGradientImageFilter ()
 
- 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.
 
virtual int AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd)
 Add a Command Object to observer the event.
 
virtual float GetProgress () const
 An Active Measurement of the progress of execution.
 
virtual bool HasCommand (itk::simple::EventEnum event) const
 Query of this object has any registered commands for event.
 
 ProcessObject ()
 
virtual void RemoveAllCommands ()
 Remove all registered commands.
 
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 &image1)
 

Private Member Functions

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

Static Private Member Functions

static const detail::MemberFunctionFactory< MemberFunctionType > & GetMemberFunctionFactory ()
 

Private Attributes

Image m_GradientImage { Image() }
 
std::vector< double > m_InitialTrialValues { std::vector<double>() }
 
double m_NormalizationFactor { 1.0 }
 
unsigned int m_NumberOfTargets { 0u }
 
double m_TargetOffset { 1.0 }
 
std::vector< std::vector< unsigned int > > m_TargetPoints { std::vector< std::vector<unsigned int > >() }
 
double m_TargetValue { 0.0 }
 
std::vector< std::vector< unsigned int > > m_TrialPoints { std::vector< std::vector<unsigned int > >() }
 

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.
 
static void SetGlobalDefaultCoordinateTolerance (double)
 Access the global tolerance to determine congruent spaces.
 
static double GetGlobalDefaultDirectionTolerance ()
 Access the global tolerance to determine congruent spaces.
 
static void SetGlobalDefaultDirectionTolerance (double)
 Access the global tolerance to determine congruent spaces.
 
static bool SetGlobalDefaultThreader (const std::string &threader)
 Set/Get the default threader used for process objects.
 
static std::string GetGlobalDefaultThreader ()
 Set/Get the default threader used for process objects.
 
static void SetGlobalDefaultNumberOfThreads (unsigned int n)
 
static unsigned int GetGlobalDefaultNumberOfThreads ()
 Set/Get the default threader used for process objects.
 
- 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

Setup for member function dispatching

Definition at line 199 of file sitkFastMarchingUpwindGradientImageFilter.h.

◆ PixelIDTypeList

Define the pixels types supported by this filter

Definition at line 75 of file sitkFastMarchingUpwindGradientImageFilter.h.

◆ Self

Constructor & Destructor Documentation

◆ ~FastMarchingUpwindGradientImageFilter()

virtual itk::simple::FastMarchingUpwindGradientImageFilter::~FastMarchingUpwindGradientImageFilter ( )
virtual

Destructor

◆ FastMarchingUpwindGradientImageFilter()

itk::simple::FastMarchingUpwindGradientImageFilter::FastMarchingUpwindGradientImageFilter ( )

Default Constructor that takes no arguments and initializes default parameters

Member Function Documentation

◆ AddTargetPoint()

void itk::simple::FastMarchingUpwindGradientImageFilter::AddTargetPoint ( std::vector< unsigned int > point)
inline

Add TargetPoints point.

Definition at line 123 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_TargetPoints.

◆ AddTrialPoint()

void itk::simple::FastMarchingUpwindGradientImageFilter::AddTrialPoint ( std::vector< unsigned int > point)
inline

Add TrialPoints point.

Definition at line 91 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_TrialPoints.

◆ ClearTargetPoints()

void itk::simple::FastMarchingUpwindGradientImageFilter::ClearTargetPoints ( )
inline

Remove all TargetPoints points.

Definition at line 126 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_TargetPoints.

◆ ClearTrialPoints()

void itk::simple::FastMarchingUpwindGradientImageFilter::ClearTrialPoints ( )
inline

Remove all TrialPoints points.

Definition at line 94 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_TrialPoints.

◆ Execute()

Image itk::simple::FastMarchingUpwindGradientImageFilter::Execute ( const Image & image1)

Execute the filter on the input image

◆ ExecuteInternal()

template<class TImageType>
Image itk::simple::FastMarchingUpwindGradientImageFilter::ExecuteInternal ( const Image & image1)
private

◆ GetGradientImage()

Image itk::simple::FastMarchingUpwindGradientImageFilter::GetGradientImage ( ) const
inline

Get the gradient image.

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 176 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_GradientImage.

◆ GetInitialTrialValues()

std::vector< double > itk::simple::FastMarchingUpwindGradientImageFilter::GetInitialTrialValues ( ) const
inline

Definition at line 167 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_InitialTrialValues.

◆ GetMemberFunctionFactory()

static const detail::MemberFunctionFactory< MemberFunctionType > & itk::simple::FastMarchingUpwindGradientImageFilter::GetMemberFunctionFactory ( )
staticprivate

◆ GetName()

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

Name of this class

Implements itk::simple::ProcessObject.

Definition at line 187 of file sitkFastMarchingUpwindGradientImageFilter.h.

◆ GetNormalizationFactor()

double itk::simple::FastMarchingUpwindGradientImageFilter::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 155 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_NormalizationFactor.

◆ GetNumberOfTargets()

unsigned int itk::simple::FastMarchingUpwindGradientImageFilter::GetNumberOfTargets ( ) const
inline

Get the number of targets.

Definition at line 106 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_NumberOfTargets.

◆ GetTargetOffset()

double itk::simple::FastMarchingUpwindGradientImageFilter::GetTargetOffset ( ) const
inline

Get the TargetOffset ivar.

Definition at line 140 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_TargetOffset.

◆ GetTargetPoints()

std::vector< std::vector< unsigned int > > itk::simple::FastMarchingUpwindGradientImageFilter::GetTargetPoints ( ) const
inline

Get the container of Target Points.

Definition at line 120 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_TargetPoints.

◆ GetTargetValue()

double itk::simple::FastMarchingUpwindGradientImageFilter::GetTargetValue ( ) const
inline

Get the arrival time corresponding to the last reached target. If TargetReachedMode is set to TargetConditionEnum::NoTargets , TargetValue contains the last (aka largest) Eikonal solution value generated.

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 184 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_TargetValue.

◆ GetTrialPoints()

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

Definition at line 88 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_TrialPoints.

◆ SetInitialTrialValues()

void itk::simple::FastMarchingUpwindGradientImageFilter::SetInitialTrialValues ( std::vector< double > InitialTrialValues)
inline

Set the initial seed values for corresponding trial point.

Definition at line 162 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_InitialTrialValues.

◆ SetNormalizationFactor()

void itk::simple::FastMarchingUpwindGradientImageFilter::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 148 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_NormalizationFactor.

◆ SetNumberOfTargets()

void itk::simple::FastMarchingUpwindGradientImageFilter::SetNumberOfTargets ( unsigned int NumberOfTargets)
inline

Definition at line 100 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_NumberOfTargets.

◆ SetTargetOffset()

void itk::simple::FastMarchingUpwindGradientImageFilter::SetTargetOffset ( double TargetOffset)
inline

Set how long (in terms of arrival times) after targets are reached the front must stop. This is useful to ensure that the level set of target arrival time is smooth.

Definition at line 134 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_TargetOffset.

◆ SetTargetPoints()

void itk::simple::FastMarchingUpwindGradientImageFilter::SetTargetPoints ( std::vector< std::vector< unsigned int > > TargetPoints)
inline

Backwards compatibility for enum values Set the container of Target Points. If a target point is reached, the propagation stops. Trial points are represented as a VectorContainer of LevelSetNodes.

Definition at line 114 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_TargetPoints.

◆ SetTrialPoints()

void itk::simple::FastMarchingUpwindGradientImageFilter::SetTrialPoints ( std::vector< std::vector< unsigned int > > TrialPoints)
inline

Definition at line 83 of file sitkFastMarchingUpwindGradientImageFilter.h.

References m_TrialPoints.

◆ ToString()

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

Print ourselves out

Reimplemented from itk::simple::ProcessObject.

Friends And Related Symbol Documentation

◆ detail::MemberFunctionAddressor< MemberFunctionType >

Member Data Documentation

◆ m_GradientImage

Image itk::simple::FastMarchingUpwindGradientImageFilter::m_GradientImage { Image() }
private

Definition at line 219 of file sitkFastMarchingUpwindGradientImageFilter.h.

Referenced by GetGradientImage().

◆ m_InitialTrialValues

std::vector<double> itk::simple::FastMarchingUpwindGradientImageFilter::m_InitialTrialValues { std::vector<double>() }
private

◆ m_NormalizationFactor

double itk::simple::FastMarchingUpwindGradientImageFilter::m_NormalizationFactor { 1.0 }
private

◆ m_NumberOfTargets

unsigned int itk::simple::FastMarchingUpwindGradientImageFilter::m_NumberOfTargets { 0u }
private

◆ m_TargetOffset

double itk::simple::FastMarchingUpwindGradientImageFilter::m_TargetOffset { 1.0 }
private

◆ m_TargetPoints

std::vector< std::vector<unsigned int> > itk::simple::FastMarchingUpwindGradientImageFilter::m_TargetPoints { std::vector< std::vector<unsigned int > >() }
private

◆ m_TargetValue

double itk::simple::FastMarchingUpwindGradientImageFilter::m_TargetValue { 0.0 }
private

Definition at line 220 of file sitkFastMarchingUpwindGradientImageFilter.h.

Referenced by GetTargetValue().

◆ m_TrialPoints

std::vector< std::vector<unsigned int> > itk::simple::FastMarchingUpwindGradientImageFilter::m_TrialPoints { std::vector< std::vector<unsigned int > >() }
private

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