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

#include <itkDerivativeOperator.h>

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

Public Types

using PixelRealType = typename Superclass::PixelRealType
 
using PixelType = typename Superclass::PixelType
 
using Self = DerivativeOperator
 
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 >
 

Public Member Functions

unsigned int GetOrder () const
 
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 long GetDirection () const
 
virtual const char * GetNameOfClass () 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
 
using CoefficientVector = typename Superclass::CoefficientVector
 
unsigned int m_Order { 1 }
 
void PrintSelf (std::ostream &os, Indent i) const override
 
CoefficientVector GenerateCoefficients () override
 
void Fill (const CoefficientVector &coeff) override
 

Additional Inherited Members

- 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::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
itk::Size<2> radius;
radius.Fill(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 69 of file itkDerivativeOperator.h.

Member Typedef Documentation

◆ CoefficientVector

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
using itk::DerivativeOperator< 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 106 of file itkDerivativeOperator.h.

◆ PixelRealType

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

Definition at line 78 of file itkDerivativeOperator.h.

◆ PixelType

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

Definition at line 77 of file itkDerivativeOperator.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 74 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 75 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)
inlineoverrideprotected

Arranges coefficients spatially in the memory buffer.

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 >.

◆ 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 89 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 &  os,
Indent  i 
) const
inlineoverridevirtual

Prints some debugging information

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

Definition at line 96 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 82 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< 2 >
itk::Size::Fill
void Fill(SizeValueType value)
Definition: itkSize.h:211
itk::DerivativeOperator
A NeighborhoodOperator for taking an n-th order derivative at a pixel.
Definition: itkDerivativeOperator.h:69
itk::NeighborhoodOperator::SetDirection
void SetDirection(const unsigned long &direction)
Definition: itkNeighborhoodOperator.h:92