ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Private Attributes | List of all members
itk::DerivativeOperator< TPixel, VDimension, TAllocator > Class Template Reference

#include <itkDerivativeOperator.h>

Detailed Description

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

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

DerivativeOperator's coefficients are a tightest-fitting convolution kernel for calculating the n-th order directional derivative at a pixel. DerivativeOperator is a directional NeighborhoodOperator that should be applied to a Neighborhood or NeighborhoodPointer using the inner product method.

An example operator to compute X derivatives of a 2D image can be created with:

using DerivativeOperatorType = itk::DerivativeOperator<float, 2>;
DerivativeOperatorType derivativeOperator;
derivativeOperator.SetDirection(0); // X dimension
constexpr auto radius = itk::Size<2>::Filled(1); // A radius of 1 in both dimensions is a 3x3 operator
derivativeOperator.CreateToRadius(radius);

and creates a kernel that looks like:

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

Definition at line 68 of file itkDerivativeOperator.h.

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

Public Types

using PixelRealType = typename NumericTraits< TPixel >::RealType
 
using Self = DerivativeOperator
 
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 SizeType = itk::Size< VDimension >
 
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

const char * GetNameOfClass () const override
 
unsigned int GetOrder () const
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
void SetOrder (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
 
const char * GetNameOfClass () const override
 
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
 
Selfoperator= (const Self &)=default
 
Selfoperator= (Self &&)=default
 
bool operator== (const Self &other) const
 
void Print (std::ostream &os) const
 
void SetRadius (const SizeType &)
 
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)
 
void SetRadius (const SizeValueType *rad)
 
AllocatorTypeGetBufferReference ()
 
const AllocatorTypeGetBufferReference () const
 
TPixel & operator[] (const OffsetType &o)
 
const TPixel & operator[] (const OffsetType &o) const
 

Protected Types

using CoefficientVector = typename std::vector< PixelRealType >
 
- 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 Attributes

unsigned int m_Order { 1 }
 

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::NeighborhoodOperator< TPixel, VDimension, TAllocator >::CoefficientVector = typename std::vector<PixelRealType>
protected

Type alias support for coefficient vector type. Necessary to fix bug in the microsoft VC++ compiler.

Definition at line 153 of file itkNeighborhoodOperator.h.

◆ PixelRealType

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
using itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::PixelRealType = typename NumericTraits<TPixel>::RealType

Definition at line 90 of file itkNeighborhoodOperator.h.

◆ Self

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

Standard class type aliases.

Definition at line 73 of file itkDerivativeOperator.h.

◆ Superclass

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

Definition at line 74 of file itkDerivativeOperator.h.

Member Function Documentation

◆ Fill()

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

Arranges coefficients spatially in the memory buffer.

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

Definition at line 114 of file itkDerivativeOperator.h.

◆ GenerateCoefficients()

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

Calculates operator coefficients.

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

◆ GetNameOfClass()

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

◆ GetOrder()

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

Returns the order of the derivative.

Definition at line 91 of file itkDerivativeOperator.h.

◆ PrintSelf()

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

Standard itk object method.

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

Definition at line 97 of file itkDerivativeOperator.h.

◆ SetOrder()

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

Sets the order of the derivative.

Definition at line 84 of file itkDerivativeOperator.h.

Member Data Documentation

◆ m_Order

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

Order of the derivative.

Definition at line 121 of file itkDerivativeOperator.h.


The documentation for this class was generated from the following file:
itk::Size::Filled
static constexpr Self Filled(const SizeValueType value)
Definition: itkSize.h:434
itk::DerivativeOperator
A NeighborhoodOperator for taking an n-th order derivative at a pixel.
Definition: itkDerivativeOperator.h:68
itk::NeighborhoodOperator::SetDirection
void SetDirection(const unsigned int direction)
Definition: itkNeighborhoodOperator.h:94