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

#include <itkLaplacianOperator.h>

Detailed Description

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

A NeighborhoodOperator for use in calculating the Laplacian at a pixel.

A NeighborhoodOperator for use in calculating the Laplacian at a pixel. The LaplacianOperator's coefficients are a tightest-fitting convolution kernel.

For example, the simplest Laplacian Operator for 2D has the form:

0 1 0
1 -4 1
0 1 0
The LaplacianOperator is a non-directional NeighborhoodOperator that should be applied to a Neighborhood or NeighborhoodIterator using an inner product method (itkNeighborhoodInnerProduct). To initialize the operator, you need call CreateOperator() before using it.
By default the operator will be created for an isotropic image, but you can modify the operator to handle different pixel spacings by calling SetDerivativeScalings. The argument to SetDerivativeScalings is an array of doubles that is of length VDimension (the dimensionality of the image). Make sure to use 1/pixel_spacing to properly scale derivatives.
Note
LaplacianOperator does not have any user-declared "special member function" for copy, move, or destruction, following the C++ Rule of Zero: the compiler will generate them if necessary.
See also
NeighborhoodOperator
Neighborhood
ITK Sphinx Examples:
Examples
SphinxExamples/src/Core/Common/CreateLaplacianKernel/Code.cxx, and SphinxExamples/src/Core/Common/DemonstrateAllOperators/Code.cxx.

Definition at line 67 of file itkLaplacianOperator.h.

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

Public Types

using Self = LaplacianOperator
 
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

void CreateOperator ()
 
const char * GetNameOfClass () const override
 
 LaplacianOperator ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
void SetDerivativeScalings (const double *s)
 
virtual const double * GetDerivativeScalings () const
 
- 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
 
const char * GetNameOfClass () const override
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
void ScaleCoefficients (PixelRealType)
 
void SetDirection (const unsigned long 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 &) 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

double m_DerivativeScalings [VDimension] {}
 

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.

◆ Self

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

Standard class type aliases.

Definition at line 72 of file itkLaplacianOperator.h.

◆ Superclass

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

Definition at line 73 of file itkLaplacianOperator.h.

Constructor & Destructor Documentation

◆ LaplacianOperator()

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

Definition at line 80 of file itkLaplacianOperator.h.

Member Function Documentation

◆ CreateOperator()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::LaplacianOperator< TPixel, VDimension, TAllocator >::CreateOperator ( )

Create the operator.

◆ Fill()

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

Arranges coefficients spatially in the memory buffer, default function was NOT used.

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

◆ GenerateCoefficients()

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

Calculates operator coefficients.

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

◆ GetDerivativeScalings()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
virtual const double* itk::LaplacianOperator< TPixel, VDimension, TAllocator >::GetDerivativeScalings ( ) const
virtual

Sets the weights that are applied to the derivative in each axial direction when the kernel is computed. These weights are all 1.0 by default. This method must be called BEFORE CreateOperator

◆ GetNameOfClass()

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

◆ PrintSelf()

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

Standard itk object method.

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

Definition at line 93 of file itkLaplacianOperator.h.

◆ SetDerivativeScalings()

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
void itk::LaplacianOperator< TPixel, VDimension, TAllocator >::SetDerivativeScalings ( const double *  s)

Sets the weights that are applied to the derivative in each axial direction when the kernel is computed. These weights are all 1.0 by default. This method must be called BEFORE CreateOperator

Member Data Documentation

◆ m_DerivativeScalings

template<typename TPixel , unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
double itk::LaplacianOperator< TPixel, VDimension, TAllocator >::m_DerivativeScalings[VDimension] {}
private

Weights applied to derivatives in each axial direction

Definition at line 123 of file itkLaplacianOperator.h.


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