ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator > Class Template Reference

#include <itkHigherOrderAccurateDerivativeOperator.h>

Detailed Description

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

A NeighborhoodOperator for calculating an n-th order accurate derivative at a pixel.

Calculate the image derivative from a higher order accurate central-difference derivative kernel.

Based on the work here:

Khan, IR and Ohba, Ryoji. "Closed-form expressions for the finite difference approximations of first and higher derivatives based on Taylor series." Journal of Computational and Applied Mathematics. vol 107. p. 179-193. 1999.

Khan, IR and Ohba, Ryoji. "Taylor series based finite difference approximations of higher-degree derivatives." Journal of Computational and Applied Mathematics. vol 154. p. 115-124. 2003.

To specify the order of accuracy, use SetOrderOfAccuracy(). The approximation will be accurate to two times the OrderOfAccuracy in terms of Taylor series terms.

Todo
: implement support for higher order derivatives.
See also
DerivativeOperator
NeighborhoodOperator
Neighborhood
ForwardDifferenceOperator
BackwardDifferenceOperator

Definition at line 61 of file itkHigherOrderAccurateDerivativeOperator.h.

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

Public Types

using PixelRealType = typename Superclass::PixelRealType
 
using PixelType = typename Superclass::PixelType
 
using Self = HigherOrderAccurateDerivativeOperator
 
using Superclass = NeighborhoodOperator<TPixel, VDimension, TAllocator>
 
- Public Types inherited from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >
using PixelRealType = typename NumericTraits<TPixel>::RealType
 
using PixelType = TPixel
 
using Self = NeighborhoodOperator
 
using SliceIteratorType = SliceIterator<TPixel, Self>
 
using Superclass = Neighborhood<TPixel, VDimension, TAllocator>
 
- 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>
 

Public Member Functions

virtual const char * GetNameOfClass () const
 
unsigned int GetOrder () const
 
unsigned int GetOrderOfAccuracy () const
 
 HigherOrderAccurateDerivativeOperator ()=default
 
 HigherOrderAccurateDerivativeOperator (const Self &other)
 
Self & operator= (const Self &other)
 
void PrintSelf (std::ostream &os, Indent i) const override
 
void SetOrder (const unsigned int &order)
 
void SetOrderOfAccuracy (const unsigned int &order)
 
- 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 int GetDirection () const
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
void ScaleCoefficients (PixelRealType)
 
void SetDirection (const unsigned int direction)
 
- Public Member Functions inherited from itk::Neighborhood< TPixel, VDimension, TAllocator >
NeighborIndexType GetCenterNeighborhoodIndex () const
 
TPixel GetCenterValue () const
 
virtual NeighborIndexType GetNeighborhoodIndex (const OffsetType &) const
 
OffsetType GetOffset (NeighborIndexType i) const
 
const SizeType GetRadius () const
 
SizeValueType GetRadius (DimensionValueType n) const
 
SizeType GetSize () const
 
SizeValueType GetSize (DimensionValueType n) const
 
std::slice GetSlice (unsigned int) const
 
OffsetValueType GetStride (DimensionValueType axis) const
 
 ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION (Self)
 
 Neighborhood ()=default
 
 Neighborhood (const Self &)=default
 
 Neighborhood (Self &&)=default
 
Self & operator= (const Self &)=default
 
Self & operator= (Self &&)=default
 
bool operator== (const Self &other) const
 
void Print (std::ostream &os) const
 
void SetRadius (const SizeType &)
 
void SetRadius (const SizeValueType *rad)
 
void SetRadius (const SizeValueType)
 
NeighborIndexType Size () const
 
virtual ~Neighborhood ()=default
 
Iterator End ()
 
Iterator Begin ()
 
ConstIterator End () const
 
ConstIterator Begin () const
 
TPixel & operator[] (NeighborIndexType i)
 
const TPixel & operator[] (NeighborIndexType i) const
 
TPixel & GetElement (NeighborIndexType i)
 
AllocatorType & GetBufferReference ()
 
const AllocatorType & GetBufferReference () const
 
TPixel & operator[] (const OffsetType &o)
 
const TPixel & operator[] (const OffsetType &o) const
 

Protected Types

using CoefficientVector = typename Superclass::CoefficientVector
 
- Protected Types inherited from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >
using CoefficientVector = typename std::vector<PixelRealType>
 

Protected Member Functions

void Fill (const CoefficientVector &coeff) override
 
CoefficientVector GenerateCoefficients () override
 
- Protected Member Functions inherited from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >
virtual void FillCenteredDirectional (const CoefficientVector &)
 
void InitializeToZero ()
 
- Protected Member Functions inherited from itk::Neighborhood< TPixel, VDimension, TAllocator >
virtual void Allocate (NeighborIndexType i)
 
virtual void ComputeNeighborhoodOffsetTable ()
 
virtual void ComputeNeighborhoodStrideTable ()
 
void SetSize ()
 

Private Member Functions

CoefficientVector GenerateFirstOrderCoefficients ()
 

Private Attributes

unsigned int m_Order { 1 }
 
unsigned int m_OrderOfAccuracy { 2 }
 

Additional Inherited Members

- Static Public Attributes inherited from itk::Neighborhood< TPixel, VDimension, TAllocator >
static constexpr unsigned int NeighborhoodDimension = VDimension
 

Member Typedef Documentation

◆ CoefficientVector

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

Typedef support for coefficient vector type. Necessary to work around compiler bug on VC++.

Definition at line 136 of file itkHigherOrderAccurateDerivativeOperator.h.

◆ PixelRealType

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

Definition at line 69 of file itkHigherOrderAccurateDerivativeOperator.h.

◆ PixelType

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

Definition at line 68 of file itkHigherOrderAccurateDerivativeOperator.h.

◆ Self

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

Standard class type alias.

Definition at line 65 of file itkHigherOrderAccurateDerivativeOperator.h.

◆ Superclass

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

Definition at line 66 of file itkHigherOrderAccurateDerivativeOperator.h.

Constructor & Destructor Documentation

◆ HigherOrderAccurateDerivativeOperator() [1/2]

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >::HigherOrderAccurateDerivativeOperator ( )
default

Constructor.

Referenced by GetNameOfClass().

◆ HigherOrderAccurateDerivativeOperator() [2/2]

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >::HigherOrderAccurateDerivativeOperator ( const Self & other)
inline

Copy constructor.

Definition at line 78 of file itkHigherOrderAccurateDerivativeOperator.h.

References m_Order.

Member Function Documentation

◆ Fill()

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

◆ GenerateCoefficients()

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

Calculates operator coefficients.

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

◆ GenerateFirstOrderCoefficients()

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
CoefficientVector itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >::GenerateFirstOrderCoefficients ( )
private

◆ GetNameOfClass()

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

Run-time type information (and related methods).

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

References HigherOrderAccurateDerivativeOperator().

◆ GetOrder()

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

Returns the order of the derivative.

Definition at line 104 of file itkHigherOrderAccurateDerivativeOperator.h.

References m_Order.

◆ GetOrderOfAccuracy()

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

Definition at line 119 of file itkHigherOrderAccurateDerivativeOperator.h.

References m_OrderOfAccuracy.

◆ operator=()

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
Self & itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >::operator= ( const Self & other)
inline

◆ PrintSelf()

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

◆ SetOrder()

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

Sets the order of the derivative. Only order == 1 is currently implemented; any other value triggers a runtime exception in GenerateCoefficients().

Definition at line 97 of file itkHigherOrderAccurateDerivativeOperator.h.

References m_Order.

◆ SetOrderOfAccuracy()

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

Sets the order of accuracy of the derivative. The derivative estimate will be accurate out to two times the given order in terms of Taylor Series terms. The radius of the neighborhood operator is also equal to the given order.

Definition at line 113 of file itkHigherOrderAccurateDerivativeOperator.h.

References m_OrderOfAccuracy.

Member Data Documentation

◆ m_Order

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

Order of the derivative.

Definition at line 154 of file itkHigherOrderAccurateDerivativeOperator.h.

Referenced by GetOrder(), HigherOrderAccurateDerivativeOperator(), operator=(), PrintSelf(), and SetOrder().

◆ m_OrderOfAccuracy

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
unsigned int itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >::m_OrderOfAccuracy { 2 }
private

Order of accuracy.

Definition at line 157 of file itkHigherOrderAccurateDerivativeOperator.h.

Referenced by GetOrderOfAccuracy(), PrintSelf(), and SetOrderOfAccuracy().


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