ITK
5.0.0
Insight Segmentation and Registration Toolkit
|
#include <itkNeighborhoodOperator.h>
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.
Definition at line 66 of file itkNeighborhoodOperator.h.
Public Types | |
using | PixelRealType = typename NumericTraits< TPixel >::RealType |
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 > |
Protected Types | |
using | CoefficientVector = std::vector< PixelRealType > |
Protected Member Functions | |
virtual void | Fill (const CoefficientVector &)=0 |
virtual void | FillCenteredDirectional (const CoefficientVector &) |
virtual CoefficientVector | GenerateCoefficients ()=0 |
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 long | m_Direction |
Additional Inherited Members | |
Static Public Attributes inherited from itk::Neighborhood< TPixel, VDimension, TAllocator > | |
static constexpr unsigned int | NeighborhoodDimension = VDimension |
|
protected |
Typedef support for coefficient vector type. Necessary to fix bug in the microsoft VC++ compiler.
Definition at line 151 of file itkNeighborhoodOperator.h.
using itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::PixelRealType = typename NumericTraits< TPixel >::RealType |
Definition at line 142 of file itkNeighborhoodOperator.h.
using itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::PixelType = TPixel |
External support for pixel type
Definition at line 80 of file itkNeighborhoodOperator.h.
using itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::Self = NeighborhoodOperator |
Standard class type aliases.
Definition at line 71 of file itkNeighborhoodOperator.h.
using itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::SizeType = typename Superclass::SizeType |
Size object type alias support
Definition at line 77 of file itkNeighborhoodOperator.h.
using itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::SliceIteratorType = SliceIterator< TPixel, Self > |
Slice iterator type alias support
Definition at line 83 of file itkNeighborhoodOperator.h.
using itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::Superclass = Neighborhood< TPixel, VDimension, TAllocator > |
Definition at line 72 of file itkNeighborhoodOperator.h.
|
inline |
Constructor.
Definition at line 86 of file itkNeighborhoodOperator.h.
|
inline |
Copy constructor
Definition at line 90 of file itkNeighborhoodOperator.h.
|
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.
Reimplemented in itk::SobelOperator< TPixel, VDimension, TAllocator >, itk::SobelOperator< FixedGradientPixelType, itk::GradientDifferenceImageToImageMetric::FixedImageDimension >, and itk::SobelOperator< MovedGradientPixelType, itk::GradientDifferenceImageToImageMetric::MovedImageDimension >.
|
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.
|
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.
|
protectedpure virtual |
A subclass-specific algorithm that positions the coefficients spatially in the operator.
Implemented in itk::SobelOperator< TPixel, VDimension, TAllocator >, itk::SobelOperator< FixedGradientPixelType, itk::GradientDifferenceImageToImageMetric::FixedImageDimension >, itk::SobelOperator< MovedGradientPixelType, itk::GradientDifferenceImageToImageMetric::MovedImageDimension >, and itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >.
|
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.
Referenced by itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >::Fill().
|
virtual |
Reverses the direction of all axes of the operator by reversing the order of the coefficients.
|
protectedpure virtual |
A subclass-specific algorithm that computes the coefficients of the operator.
Implemented in itk::GaussianOperator< TPixel, VDimension, TAllocator >, itk::GaussianOperator< ScalarType, NDimensions >, itk::GaussianOperator< ScalarType, Superclass::Dimension >, itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >, itk::SobelOperator< TPixel, VDimension, TAllocator >, itk::SobelOperator< FixedGradientPixelType, itk::GradientDifferenceImageToImageMetric::FixedImageDimension >, itk::SobelOperator< MovedGradientPixelType, itk::GradientDifferenceImageToImageMetric::MovedImageDimension >, itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >, itk::LaplacianOperator< TPixel, VDimension, TAllocator >, itk::DerivativeOperator< TPixel, VDimension, TAllocator >, itk::DerivativeOperator< OutputImagePixelType, itk::CannyEdgeDetectionImageFilter::ImageDimension >, itk::DerivativeOperator< PixelType, itk::GPUGradientNDAnisotropicDiffusionFunction::ImageDimension >, itk::DerivativeOperator< ScalarValueType, itk::VectorCurvatureNDAnisotropicDiffusionFunction::ImageDimension >, itk::DerivativeOperator< PixelType, itk::CurvatureNDAnisotropicDiffusionFunction::ImageDimension >, itk::DerivativeOperator< ScalarValueType, itk::VectorGradientNDAnisotropicDiffusionFunction::ImageDimension >, itk::DerivativeOperator< PixelType, itk::GradientNDAnisotropicDiffusionFunction::ImageDimension >, itk::DerivativeOperator< OutputImagePixelType, itkGetStaticConstMacro(ImageDimension)>, itk::ImageKernelOperator< TPixel, VDimension, TAllocator >, itk::ForwardDifferenceOperator< TPixel, VDimension, TAllocator >, and itk::BackwardDifferenceOperator< TPixel, TDimension, TAllocator >.
|
inline |
Returns the direction (dimension number) of a directional operator.
Definition at line 108 of file itkNeighborhoodOperator.h.
|
virtual |
Reimplemented in itk::GaussianDerivativeOperator< TPixel, VDimension, TAllocator >, itk::SobelOperator< TPixel, VDimension, TAllocator >, itk::SobelOperator< FixedGradientPixelType, itk::GradientDifferenceImageToImageMetric::FixedImageDimension >, itk::SobelOperator< MovedGradientPixelType, itk::GradientDifferenceImageToImageMetric::MovedImageDimension >, itk::GaussianOperator< TPixel, VDimension, TAllocator >, itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >, itk::GaussianOperator< ScalarType, NDimensions >, itk::GaussianOperator< ScalarType, Superclass::Dimension >, and itk::ImageKernelOperator< TPixel, VDimension, TAllocator >.
|
inlineprotected |
Initializes all the coefficients in the neighborhood to zero values
Definition at line 169 of file itkNeighborhoodOperator.h.
|
inline |
Assignment operator.
Definition at line 95 of file itkNeighborhoodOperator.h.
Referenced by itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >::operator=().
|
inlineoverridevirtual |
Prints some debugging information.
Reimplemented from itk::Neighborhood< TPixel, VDimension, TAllocator >.
Reimplemented in itk::SobelOperator< TPixel, VDimension, TAllocator >, itk::SobelOperator< FixedGradientPixelType, itk::GradientDifferenceImageToImageMetric::FixedImageDimension >, itk::SobelOperator< MovedGradientPixelType, itk::GradientDifferenceImageToImageMetric::MovedImageDimension >, and itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >.
Definition at line 134 of file itkNeighborhoodOperator.h.
Referenced by itk::HigherOrderAccurateDerivativeOperator< TPixel, VDimension, TAllocator >::PrintSelf().
void itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >::ScaleCoefficients | ( | PixelRealType | ) |
Multiplies all of the coefficients of the kernel by a single scalar value.
|
inline |
Sets the dimensional direction of a directional operator.
Definition at line 104 of file itkNeighborhoodOperator.h.
|
private |
Direction (dimension number) of the derivative.
Definition at line 180 of file itkNeighborhoodOperator.h.