ITK  5.1.0
Insight Toolkit
Public Types | Public Member Functions | List of all members
itk::NeighborhoodOperator< TPixel, VDimension, TAllocator > Class Template Referenceabstract

#include <itkNeighborhoodOperator.h>

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

Public Types

using PixelType = TPixel
 
using Self = NeighborhoodOperator
 
using SizeType = typename Superclass::SizeType
 
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
 
 NeighborhoodOperator ()
 
 NeighborhoodOperator (const Self &orig)
 
- 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 PixelRealType = typename NumericTraits< TPixel >::RealType
 
using CoefficientVector = std::vector< PixelRealType >
 
unsigned long m_Direction
 
Selfoperator= (const Self &orig)
 
void SetDirection (const unsigned long &direction)
 
unsigned long GetDirection () const
 
virtual void CreateDirectional ()
 
virtual void CreateToRadius (const SizeType &)
 
virtual void CreateToRadius (const SizeValueType)
 
virtual void FlipAxes ()
 
void PrintSelf (std::ostream &os, Indent i) const override
 
void ScaleCoefficients (PixelRealType)
 
virtual CoefficientVector GenerateCoefficients ()=0
 
virtual void Fill (const CoefficientVector &)=0
 
virtual void FillCenteredDirectional (const CoefficientVector &)
 
void InitializeToZero ()
 

Additional Inherited Members

- Static Public Attributes inherited from itk::Neighborhood< TPixel, VDimension, TAllocator >
static constexpr unsigned int NeighborhoodDimension = VDimension
 
- 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, typename TAllocator = NeighborhoodAllocator<TPixel>>
class itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >

Virtual class that defines a common interface to all neighborhood operator subtypes.

A NeighborhoodOperator is a set of pixel values that can be applied to a Neighborhood to perform a user-defined operation (i.e. convolution kernel, morphological structuring element). A NeighborhoodOperator is itself a specialized Neighborhood, with functionality to generate its coefficients according to user-defined parameters. Because the operator is a subclass of Neighborhood, it is a valid operand in any of the operations defined on the Neighborhood object (convolution, inner product, etc.).

NeighborhoodOperator is a pure virtual object that must be subclassed to be used. A user's subclass must implement two methods:

(1) GenerateCoefficients – the algorithm that computes the scalar coefficients of the operator.

(2) Fill – the algorithm that places the scalar coefficients into the memory buffer of the operator (arranges them spatially in the neighborhood).

NeighborhoodOperator supports the concept of a "directional operator." A directional operator is defined in this context to be an operator that is applied along a single dimension. Examples of this type of operator are directional derivatives and the individual, directional components of separable processes such as Gaussian smoothing.

How a NeighborhoodOperator is applied to data is up to the user who defines it. One possible use of an operator would be to take its inner product with a neighborhood of values to produce a scalar result. This process effects convolution when applied to successive neighborhoods across a region of interest in an image.

ITK Sphinx Examples:
\li All ITK Sphinx Examples

Definition at line 69 of file itkNeighborhoodOperator.h.

Member Typedef Documentation

◆ CoefficientVector

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
using itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::CoefficientVector = std::vector<PixelRealType>
protected

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

Definition at line 165 of file itkNeighborhoodOperator.h.

◆ PixelRealType

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

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

Definition at line 156 of file itkNeighborhoodOperator.h.

◆ PixelType

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

External support for pixel type

Definition at line 82 of file itkNeighborhoodOperator.h.

◆ Self

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

Standard class type aliases.

Definition at line 73 of file itkNeighborhoodOperator.h.

◆ SizeType

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

Size object type alias support

Definition at line 79 of file itkNeighborhoodOperator.h.

◆ SliceIteratorType

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
using itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::SliceIteratorType = SliceIterator<TPixel, Self>

Slice iterator type alias support

Definition at line 85 of file itkNeighborhoodOperator.h.

◆ Superclass

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

Definition at line 74 of file itkNeighborhoodOperator.h.

Constructor & Destructor Documentation

◆ NeighborhoodOperator() [1/2]

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::NeighborhoodOperator ( )
inline

Constructor.

Definition at line 88 of file itkNeighborhoodOperator.h.

◆ NeighborhoodOperator() [2/2]

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::NeighborhoodOperator ( const Self orig)
inline

Copy constructor

Definition at line 91 of file itkNeighborhoodOperator.h.

Member Function Documentation

◆ CreateDirectional()

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
virtual void itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::CreateDirectional ( )
virtual

Creates the operator with length only in the specified direction. The radius of the operator will be 0 except along the axis on which the operator will work.

See also
CreateToRadius
FillCenteredDirectional
SetDirection()
GetDirection()

Reimplemented in itk::SobelOperator< TPixel, VDimension, TAllocator >, itk::SobelOperator< FixedGradientPixelType, Self::FixedImageDimension >, and itk::SobelOperator< MovedGradientPixelType, Self::MovedImageDimension >.

◆ CreateToRadius() [1/2]

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
virtual void itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::CreateToRadius ( const SizeType )
virtual

Creates the operator with a specified radius. The spatial location of the coefficients within the operator is defined by the subclass implementation of the Fill method.

See also
CreateDirectional
Fill

◆ CreateToRadius() [2/2]

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
virtual void itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::CreateToRadius ( const  SizeValueType)
virtual

Creates the operator with a specified radius ("square", same length on each side). The spatial location of the coefficients within the operator is defined by the subclass implementation of the Fill method.

See also
CreateDirectional
Fill

◆ Fill()

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
virtual void itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::Fill ( const CoefficientVector )
protectedpure virtual

◆ FillCenteredDirectional()

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
virtual void itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::FillCenteredDirectional ( const CoefficientVector )
protectedvirtual

A pre-defined Fill function that can be called by a subclass Fill function to center coefficients along the axis specified by the SetDirection method. Useful for creating directional operators, or centering coefficients in an N-dimensional neighborhood.

◆ FlipAxes()

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
virtual void itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::FlipAxes ( )
virtual

Reverses the direction of all axes of the operator by reversing the order of the coefficients.

◆ GenerateCoefficients()

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
virtual CoefficientVector itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::GenerateCoefficients ( )
protectedpure virtual

◆ GetDirection()

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
unsigned long itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::GetDirection ( ) const
inline

Returns the direction (dimension number) of a directional operator.

Definition at line 116 of file itkNeighborhoodOperator.h.

◆ GetNameOfClass()

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

◆ InitializeToZero()

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::InitializeToZero ( )
inlineprotected

Initializes all the coefficients in the neighborhood to zero values

Definition at line 187 of file itkNeighborhoodOperator.h.

◆ operator=()

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

Assignment operator.

Definition at line 99 of file itkNeighborhoodOperator.h.

◆ PrintSelf()

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

◆ ScaleCoefficients()

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::ScaleCoefficients ( PixelRealType  )

Multiplies all of the coefficients of the kernel by a single scalar value.

◆ SetDirection()

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::SetDirection ( const unsigned long &  direction)
inline

Member Data Documentation

◆ m_Direction

template<typename TPixel, unsigned int VDimension, typename TAllocator = NeighborhoodAllocator<TPixel>>
unsigned long itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::m_Direction
private

Direction (dimension number) of the derivative.

Definition at line 198 of file itkNeighborhoodOperator.h.


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