ITK  5.2.0
Insight Toolkit
Public Types | List of all members
itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator > Class Template Reference

#include <itkGaussianDerivativeOperator.h>

+ Inheritance diagram for itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >:
+ Collaboration diagram for itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >:

Public Types

using DerivativeOperatorType = DerivativeOperator< TPixel, VDimension, TAllocator >
 
using GaussianOperatorType = GaussianOperator< TPixel, VDimension, TAllocator >
 
using InterpolationModeEnum = GaussianDerivativeOperatorEnums::InterpolationMode
 
using Self = GaussianDerivativeOperator
 
using Superclass = NeighborhoodOperator< TPixel, VDimension, TAllocator >
 
- Public Types inherited from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >
using PixelType = TPixel
 
using Self = NeighborhoodOperator
 
using SizeType = typename Superclass::SizeType
 
using SliceIteratorType = SliceIterator< TPixel, Self >
 
using Superclass = Neighborhood< TPixel, VDimension, TAllocator >
 
using PixelRealType = typename NumericTraits< TPixel >::RealType
 
- Public Types inherited from itk::Neighborhood< TPixel, VDimension, TAllocator >
using AllocatorType = TAllocator
 
using ConstIterator = typename AllocatorType::const_iterator
 
using DimensionValueType = unsigned int
 
using Iterator = typename AllocatorType::iterator
 
using NeighborIndexType = SizeValueType
 
using OffsetType = Offset< VDimension >
 
using PixelType = TPixel
 
using RadiusType = ::itk::Size< VDimension >
 
using Self = Neighborhood
 
using SizeType = ::itk::Size< VDimension >
 
using SizeValueType = typename SizeType::SizeValueType
 
using SliceIteratorType = SliceIterator< TPixel, Self >
 
using CoefficientVector = typename Superclass::CoefficientVector
 
bool m_NormalizeAcrossScale { true }
 
double m_Variance { 1.0 }
 
double m_MaximumError { 0.005 }
 
unsigned int m_MaximumKernelWidth { 30 }
 
unsigned int m_Order { 1 }
 
double m_Spacing { 1.0 }
 
void SetNormalizeAcrossScale (bool flag)
 
bool GetNormalizeAcrossScale () const
 
virtual void NormalizeAcrossScaleOn ()
 
virtual void NormalizeAcrossScaleOff ()
 
void SetVariance (const double variance)
 
double GetVariance () const
 
void SetSpacing (const double spacing)
 
double GetSpacing () const
 
void SetMaximumError (const double maxerror)
 
double GetMaximumError ()
 
void SetMaximumKernelWidth (unsigned int n)
 
void SetOrder (const unsigned int order)
 
unsigned int GetOrder () const
 
void PrintSelf (std::ostream &os, Indent i) const override
 
static double ModifiedBesselI0 (double)
 
static double ModifiedBesselI1 (double)
 
static double ModifiedBesselI (int, double)
 
CoefficientVector GenerateCoefficients () override
 
void Fill (const CoefficientVector &coeff) override
 
CoefficientVector GenerateGaussianCoefficients () const
 
const char * GetNameOfClass () const override
 

Additional Inherited Members

- Public Member Functions inherited from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >
virtual void CreateDirectional ()
 
virtual void CreateToRadius (const SizeType &)
 
virtual void CreateToRadius (const SizeValueType)
 
virtual void FlipAxes ()
 
unsigned long GetDirection () const
 
void SetDirection (const unsigned long &direction)
 
void PrintSelf (std::ostream &os, Indent i) const override
 
void ScaleCoefficients (PixelRealType)
 
- Public Member Functions inherited from itk::Neighborhood< TPixel, VDimension, TAllocator >
 itkTypeMacroNoParent (Neighborhood)
 
 Neighborhood ()
 
virtual ~Neighborhood ()=default
 
 Neighborhood (const Self &other)
 
 Neighborhood (Self &&)=default
 
Selfoperator= (const Self &other)
 
Selfoperator= (Self &&)=default
 
bool operator== (const Self &other) const
 
bool operator!= (const Self &other) const
 
const SizeType GetRadius () const
 
SizeValueType GetRadius (DimensionValueType n) const
 
SizeValueType GetSize (DimensionValueType n) const
 
SizeType GetSize () const
 
OffsetValueType GetStride (DimensionValueType axis) const
 
Iterator End ()
 
Iterator Begin ()
 
ConstIterator End () const
 
ConstIterator Begin () const
 
NeighborIndexType Size () const
 
TPixel & operator[] (NeighborIndexType i)
 
const TPixel & operator[] (NeighborIndexType i) const
 
TPixel & GetElement (NeighborIndexType i)
 
TPixel GetCenterValue () const
 
void SetRadius (const SizeType &)
 
void SetRadius (const SizeValueType *rad)
 
void SetRadius (const SizeValueType)
 
void Print (std::ostream &os) const
 
AllocatorTypeGetBufferReference ()
 
const AllocatorTypeGetBufferReference () const
 
TPixel & operator[] (const OffsetType &o)
 
const TPixel & operator[] (const OffsetType &o) const
 
OffsetType GetOffset (NeighborIndexType i) const
 
virtual NeighborIndexType GetNeighborhoodIndex (const OffsetType &) const
 
NeighborIndexType GetCenterNeighborhoodIndex () const
 
std::slice GetSlice (unsigned int) const
 
- Static Public Attributes inherited from itk::Neighborhood< TPixel, VDimension, TAllocator >
static constexpr unsigned int NeighborhoodDimension = VDimension
 
- Protected Types inherited from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >
using CoefficientVector = std::vector< PixelRealType >
 
- Protected Member Functions inherited from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >
virtual void Fill (const CoefficientVector &)=0
 
virtual void FillCenteredDirectional (const CoefficientVector &)
 
void InitializeToZero ()
 
- Protected Member Functions inherited from itk::Neighborhood< TPixel, VDimension, TAllocator >
void SetSize ()
 
virtual void Allocate (NeighborIndexType i)
 
virtual void ComputeNeighborhoodStrideTable ()
 
virtual void ComputeNeighborhoodOffsetTable ()
 

Detailed Description

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
class itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >

A NeighborhoodOperator whose coefficients are a one dimensional, discrete derivative Gaussian kernel.

GaussianDerivativeOperator can be used to calculate Gaussian derivatives by taking its inner product with to a Neighborhood (NeighborhooIterator) that is swept across an image region. It is a directional operator. N successive applications oriented along each dimensional direction will calculate separable, efficient, N-D Gaussian derivatives of an image region.

GaussianDerivativeOperator takes three parameters:

(1) The floating-point variance of the desired Gaussian function.

(2) The order of the derivative to be calculated (zero order means it performs only smoothing as a standard itk::GaussianOperator)

(3) The "maximum error" allowed in the discrete Gaussian function. "Maximum errror" is defined as the difference between the area under the discrete Gaussian curve and the area under the continuous Gaussian. Maximum error affects the Gaussian operator size. Care should be taken not to make this value too small relative to the variance lest the operator size become unreasonably large.

References: The Gaussian kernel contained in this operator was described by Tony Lindeberg (Discrete Scale-Space Theory and the Scale-Space Primal Sketch. Dissertation. Royal Institute of Technology, Stockholm, Sweden. May 1991.).

Author
Ivan Macia, Vicomtech, Spain, https://www.vicomtech.org/en

This implementation is derived from the Insight Journal paper: https://www.insight-journal.org/browse/publication/179

Note
GaussianDerivativeOperator does not have any user-declared "special member function", following the C++ Rule of Zero: the compiler will generate them if necessary.
See also
GaussianOperator
NeighborhoodOperator
NeighborhoodIterator
Neighborhood
ITK Sphinx Examples:
Examples
SphinxExamples/src/Core/Common/CreateGaussianDerivativeKernel/Code.cxx, and SphinxExamples/src/Core/Common/DemonstrateAllOperators/Code.cxx.

Definition at line 106 of file itkGaussianDerivativeOperator.h.

Member Typedef Documentation

◆ CoefficientVector

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
using itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::CoefficientVector = typename Superclass::CoefficientVector
protected

Normalize derivatives across scale space

Definition at line 215 of file itkGaussianDerivativeOperator.h.

◆ DerivativeOperatorType

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
using itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::DerivativeOperatorType = DerivativeOperator<TPixel, VDimension, TAllocator>

Definition at line 118 of file itkGaussianDerivativeOperator.h.

◆ GaussianOperatorType

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
using itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::GaussianOperatorType = GaussianOperator<TPixel, VDimension, TAllocator>

Neighborhood operator types.

Definition at line 117 of file itkGaussianDerivativeOperator.h.

◆ InterpolationModeEnum

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
using itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::InterpolationModeEnum = GaussianDerivativeOperatorEnums::InterpolationMode

Definition at line 114 of file itkGaussianDerivativeOperator.h.

◆ Self

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
using itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::Self = GaussianDerivativeOperator

Standard class type aliases.

Definition at line 111 of file itkGaussianDerivativeOperator.h.

◆ Superclass

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
using itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::Superclass = NeighborhoodOperator<TPixel, VDimension, TAllocator>

Definition at line 112 of file itkGaussianDerivativeOperator.h.

Member Function Documentation

◆ Fill()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::Fill ( const CoefficientVector coeff)
inlineoverrideprotected

Arranges coefficients spatially in the memory buffer.

Definition at line 238 of file itkGaussianDerivativeOperator.h.

◆ GenerateCoefficients()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
CoefficientVector itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::GenerateCoefficients ( )
overrideprotectedvirtual

Calculates operator coefficients.

Implements itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >.

◆ GenerateGaussianCoefficients()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
CoefficientVector itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::GenerateGaussianCoefficients ( ) const
private

Normalize derivatives across scale space

◆ GetMaximumError()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
double itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::GetMaximumError ( )
inline

Normalize derivatives across scale space

Definition at line 182 of file itkGaussianDerivativeOperator.h.

◆ GetNameOfClass()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
const char* itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::GetNameOfClass ( ) const
inlineoverrideprivatevirtual

For compatibility with itkWarningMacro

Reimplemented from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >.

Definition at line 251 of file itkGaussianDerivativeOperator.h.

◆ GetNormalizeAcrossScale()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
bool itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::GetNormalizeAcrossScale ( ) const
inline

Normalize derivatives across scale space

Definition at line 134 of file itkGaussianDerivativeOperator.h.

◆ GetOrder()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
unsigned int itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::GetOrder ( ) const
inline

Normalize derivatives across scale space

Definition at line 204 of file itkGaussianDerivativeOperator.h.

◆ GetSpacing()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
double itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::GetSpacing ( ) const
inline

Normalize derivatives across scale space

Definition at line 163 of file itkGaussianDerivativeOperator.h.

◆ GetVariance()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
double itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::GetVariance ( ) const
inline

Normalize derivatives across scale space

Definition at line 150 of file itkGaussianDerivativeOperator.h.

◆ ModifiedBesselI()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
static double itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::ModifiedBesselI ( int  ,
double   
)
staticprotected

Returns the value of the modified Bessel function Ik(x) at a point x>=0, where k>=2.

◆ ModifiedBesselI0()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
static double itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::ModifiedBesselI0 ( double  )
staticprotected

Returns the value of the modified Bessel function I0(x) at a point x >= 0.

◆ ModifiedBesselI1()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
static double itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::ModifiedBesselI1 ( double  )
staticprotected

Returns the value of the modified Bessel function I1(x) at a point x, x real.

◆ NormalizeAcrossScaleOff()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
virtual void itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::NormalizeAcrossScaleOff ( )
virtual

Normalize derivatives across scale space

◆ NormalizeAcrossScaleOn()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
virtual void itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::NormalizeAcrossScaleOn ( )
virtual

Normalize derivatives across scale space

◆ PrintSelf()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::PrintSelf ( std::ostream &  os,
Indent  i 
) const
overridevirtual

Prints member variables

Reimplemented from itk::Neighborhood< TPixel, VDimension, TAllocator >.

◆ SetMaximumError()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::SetMaximumError ( const double  maxerror)
inline

Set/Get the desired maximum error of the gaussian approximation. Maximum error is the difference between the area under the discrete Gaussian curve and the area under the continuous Gaussian. Maximum error affects the Gaussian operator size. The value is clamped between 0.00001 and 0.99999.

Definition at line 174 of file itkGaussianDerivativeOperator.h.

◆ SetMaximumKernelWidth()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::SetMaximumKernelWidth ( unsigned int  n)
inline

Sets/Get a limit for growth of the kernel. Small maximum error values with large variances will yield very large kernel sizes. This value can be used to truncate a kernel in such instances. A warning will be given on truncation of the kernel.

Definition at line 192 of file itkGaussianDerivativeOperator.h.

◆ SetNormalizeAcrossScale()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::SetNormalizeAcrossScale ( bool  flag)
inline

Set/Get the flag for calculating scale-space normalized derivatives.

Normalized derivatives are obtained multiplying by the scale parameter $t^1/order$. This use useful for scale-space selection algorithms such as blob detection. The scaling results in the value of the derivatives being independent of the size of an object.

Definition at line 129 of file itkGaussianDerivativeOperator.h.

◆ SetOrder()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::SetOrder ( const unsigned int  order)
inline

Sets/Get the order of the derivative.

Definition at line 199 of file itkGaussianDerivativeOperator.h.

◆ SetSpacing()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::SetSpacing ( const double  spacing)
inline

Set/Get the spacing for the direction of this kernel.

Definition at line 158 of file itkGaussianDerivativeOperator.h.

◆ SetVariance()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::SetVariance ( const double  variance)
inline

Set/Get the variance of the Gaussian kernel.

Definition at line 145 of file itkGaussianDerivativeOperator.h.

Member Data Documentation

◆ m_MaximumError

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
double itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::m_MaximumError { 0.005 }
private

Difference between the areas under the curves of the continuous and discrete Gaussian functions.

Definition at line 264 of file itkGaussianDerivativeOperator.h.

◆ m_MaximumKernelWidth

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
unsigned int itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::m_MaximumKernelWidth { 30 }
private

Maximum kernel size allowed. This value is used to truncate a kernel that has grown too large. A warning is given when the specified maximum error causes the kernel to exceed this size.

Definition at line 269 of file itkGaussianDerivativeOperator.h.

◆ m_NormalizeAcrossScale

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
bool itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::m_NormalizeAcrossScale { true }
private

Normalize derivatives across scale space

Definition at line 257 of file itkGaussianDerivativeOperator.h.

◆ m_Order

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
unsigned int itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::m_Order { 1 }
private

Order of the derivative.

Definition at line 272 of file itkGaussianDerivativeOperator.h.

◆ m_Spacing

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
double itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::m_Spacing { 1.0 }
private

Spacing in the direction of this kernel.

Definition at line 275 of file itkGaussianDerivativeOperator.h.

◆ m_Variance

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
double itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >::m_Variance { 1.0 }
private

Desired variance of the discrete Gaussian function.

Definition at line 260 of file itkGaussianDerivativeOperator.h.


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