SimpleITK  2.1.0.dev86
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
itk::simple::RecursiveGaussianImageFilter Class Reference

Base class for computing IIR convolution with an approximation of a Gaussian kernel. More...

#include <sitkRecursiveGaussianImageFilter.h>

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

Public Types

enum  OrderType {
  ZeroOrder,
  FirstOrder,
  SecondOrder
}
 
using PixelIDTypeList = typelist::Append< BasicPixelIDTypeList, VectorPixelIDTypeList >::Type
 
using Self = RecursiveGaussianImageFilter
 
- 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 &image1)
 
Image Execute (Image &&image1)
 
unsigned int GetDirection () const
 
std::string GetName () const
 
bool GetNormalizeAcrossScale () const
 
OrderType GetOrder () const
 
double GetSigma () const
 
SelfNormalizeAcrossScaleOff ()
 
SelfNormalizeAcrossScaleOn ()
 
 RecursiveGaussianImageFilter ()
 
SelfSetDirection (unsigned int Direction)
 
SelfSetNormalizeAcrossScale (bool NormalizeAcrossScale)
 
SelfSetOrder (OrderType Order)
 
SelfSetSigma (double Sigma)
 
std::string ToString () const
 
virtual ~RecursiveGaussianImageFilter ()
 
- 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 &image1)
 

Private Member Functions

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

Private Attributes

unsigned int m_Direction {0u}
 
bool m_InPlace {false}
 
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
 
bool m_NormalizeAcrossScale {false}
 
OrderType m_Order {itk::simple::RecursiveGaussianImageFilter::ZeroOrder}
 
double m_Sigma {1.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<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)
 

Detailed Description

Base class for computing IIR convolution with an approximation of a Gaussian kernel.

\[ \frac{ 1 }{ \sigma \sqrt{ 2 \pi } } \exp{ \left( - \frac{x^2}{ 2 \sigma^2 } \right) } \]

RecursiveGaussianImageFilter is the base class for recursive filters that approximate convolution with the Gaussian kernel. This class implements the recursive filtering method proposed by R.Deriche in IEEE-PAMI Vol.12, No.1, January 1990, pp 78-87, "Fast Algorithms for Low-Level Vision"

Details of the implementation are described in the technical report: R. Deriche, "Recursively Implementing The Gaussian and Its Derivatives", INRIA, 1993, ftp://ftp.inria.fr/INRIA/tech-reports/RR/RR-1893.ps.gz

Further improvements of the algorithm are described in: G. Farneback & C.-F. Westin, "On Implementation of Recursive Gaussian Filters", so far unpublished.

As compared to itk::DiscreteGaussianImageFilter , this filter tends to be faster for large kernels, and it can take the derivative of the blurred image in one step. Also, note that we have itk::RecursiveGaussianImageFilter::SetSigma() , but itk::DiscreteGaussianImageFilter::SetVariance() .

See also
DiscreteGaussianImageFilter
itk::simple::RecursiveGaussian for the procedural interface
itk::RecursiveGaussianImageFilter for the Doxygen on the original ITK class.

Definition at line 53 of file sitkRecursiveGaussianImageFilter.h.

Member Typedef Documentation

◆ MemberFunctionType

Setup for member function dispatching

Definition at line 156 of file sitkRecursiveGaussianImageFilter.h.

◆ PixelIDTypeList

Define the pixels types supported by this filter

Definition at line 65 of file sitkRecursiveGaussianImageFilter.h.

◆ Self

Definition at line 55 of file sitkRecursiveGaussianImageFilter.h.

Member Enumeration Documentation

◆ OrderType

Enumerator
ZeroOrder 
FirstOrder 
SecondOrder 

Definition at line 107 of file sitkRecursiveGaussianImageFilter.h.

Constructor & Destructor Documentation

◆ ~RecursiveGaussianImageFilter()

virtual itk::simple::RecursiveGaussianImageFilter::~RecursiveGaussianImageFilter ( )
virtual

Destructor

◆ RecursiveGaussianImageFilter()

itk::simple::RecursiveGaussianImageFilter::RecursiveGaussianImageFilter ( )

Default Constructor that takes no arguments and initializes default parameters

Member Function Documentation

◆ Execute() [1/2]

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

◆ Execute() [2/2]

Image itk::simple::RecursiveGaussianImageFilter::Execute ( Image &&  image1)

Execute the filter on the input image

◆ ExecuteInternal()

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

◆ GetDirection()

unsigned int itk::simple::RecursiveGaussianImageFilter::GetDirection ( ) const
inline

Definition at line 137 of file sitkRecursiveGaussianImageFilter.h.

◆ GetName()

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

Name of this class

Implements itk::simple::ProcessObject.

Definition at line 140 of file sitkRecursiveGaussianImageFilter.h.

◆ GetNormalizeAcrossScale()

bool itk::simple::RecursiveGaussianImageFilter::GetNormalizeAcrossScale ( ) const
inline

Definition at line 105 of file sitkRecursiveGaussianImageFilter.h.

◆ GetOrder()

OrderType itk::simple::RecursiveGaussianImageFilter::GetOrder ( ) const
inline
     Set/Get the Order of the Gaussian to convolve with. 
  • ZeroOrder is equivalent to convolving with a Gaussian. This is the default.
  • FirstOrder is equivalent to convolving with the first derivative of a Gaussian.
  • SecondOrder is equivalent to convolving with the second derivative of a Gaussian.

Definition at line 129 of file sitkRecursiveGaussianImageFilter.h.

◆ GetSigma()

double itk::simple::RecursiveGaussianImageFilter::GetSigma ( ) const
inline

Set/Get the Sigma, measured in world coordinates, of the Gaussian kernel. The default is 1.0. An exception will be generated if the Sigma value is less than or equal to zero.

Definition at line 76 of file sitkRecursiveGaussianImageFilter.h.

◆ NormalizeAcrossScaleOff()

Self& itk::simple::RecursiveGaussianImageFilter::NormalizeAcrossScaleOff ( )
inline

Definition at line 101 of file sitkRecursiveGaussianImageFilter.h.

◆ NormalizeAcrossScaleOn()

Self& itk::simple::RecursiveGaussianImageFilter::NormalizeAcrossScaleOn ( )
inline

Set the value of NormalizeAcrossScale to true or false respectfully.

Definition at line 100 of file sitkRecursiveGaussianImageFilter.h.

◆ SetDirection()

Self& itk::simple::RecursiveGaussianImageFilter::SetDirection ( unsigned int  Direction)
inline

Definition at line 133 of file sitkRecursiveGaussianImageFilter.h.

◆ SetNormalizeAcrossScale()

Self& itk::simple::RecursiveGaussianImageFilter::SetNormalizeAcrossScale ( bool  NormalizeAcrossScale)
inline
     Set/Get the flag for normalizing the gaussian over scale-space.

This flag enables the analysis of the differential shape of features independent of their size ( both pixels and physical size ). Following the notation of Tony Lindeberg:

Let

\[ L(x; t) = g(x; t) \ast f(x) \]

be the scale-space representation of image

\[ f(x) \]

where

\[ g(x; t) = \frac{1}{ \sqrt{ 2 \pi t} } \exp{ \left( -\frac{x^2}{ 2 t } \right) } \]

is the Gaussian function and

\[\ast\]

denotes convolution. This is a change from above with

\[ t = \sigma^2 \]

.

Then the normalized derivative operator for normalized coordinates across scale is:

\[ \partial_\xi = \sqrt{t} \partial_x \]

The resulting scaling factor is

\[ \sigma^N \]

where N is the order of the derivative.

When this flag is ON the filter will be normalized in such a way that the values of derivatives are not biased by the size of the object. That is to say the maximum value a feature reaches across scale is independent of the scale of the object.

For analyzing an image across scale-space you want to enable this flag. It is disabled by default.

Note
Not all scale space axioms are satisfied by this filter, some are only approximated. Particularly, at fine scales ( say less than 1 pixel ) other methods such as a discrete Gaussian kernel should be considered.

Definition at line 97 of file sitkRecursiveGaussianImageFilter.h.

◆ SetOrder()

Self& itk::simple::RecursiveGaussianImageFilter::SetOrder ( OrderType  Order)
inline
     Set/Get the Order of the Gaussian to convolve with. 
  • ZeroOrder is equivalent to convolving with a Gaussian. This is the default.
  • FirstOrder is equivalent to convolving with the first derivative of a Gaussian.
  • SecondOrder is equivalent to convolving with the second derivative of a Gaussian.

Definition at line 118 of file sitkRecursiveGaussianImageFilter.h.

◆ SetSigma()

Self& itk::simple::RecursiveGaussianImageFilter::SetSigma ( double  Sigma)
inline

Set/Get the Sigma, measured in world coordinates, of the Gaussian kernel. The default is 1.0. An exception will be generated if the Sigma value is less than or equal to zero.

Definition at line 71 of file sitkRecursiveGaussianImageFilter.h.

◆ ToString()

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

Print ourselves out

Reimplemented from itk::simple::ProcessObject.

Friends And Related Function Documentation

◆ detail::MemberFunctionAddressor< MemberFunctionType >

Definition at line 160 of file sitkRecursiveGaussianImageFilter.h.

Member Data Documentation

◆ m_Direction

unsigned int itk::simple::RecursiveGaussianImageFilter::m_Direction {0u}
private

Definition at line 175 of file sitkRecursiveGaussianImageFilter.h.

◆ m_InPlace

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

Definition at line 178 of file sitkRecursiveGaussianImageFilter.h.

◆ m_MemberFactory

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

Definition at line 162 of file sitkRecursiveGaussianImageFilter.h.

◆ m_NormalizeAcrossScale

bool itk::simple::RecursiveGaussianImageFilter::m_NormalizeAcrossScale {false}
private

Definition at line 169 of file sitkRecursiveGaussianImageFilter.h.

◆ m_Order

OrderType itk::simple::RecursiveGaussianImageFilter::m_Order {itk::simple::RecursiveGaussianImageFilter::ZeroOrder}
private

Definition at line 172 of file sitkRecursiveGaussianImageFilter.h.

◆ m_Sigma

double itk::simple::RecursiveGaussianImageFilter::m_Sigma {1.0}
private

Definition at line 166 of file sitkRecursiveGaussianImageFilter.h.


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