ITK  4.13.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Protected Types | Protected Member Functions | List of all members
itk::SobelOperator< TPixel, VDimension, TAllocator > Class Template Reference

#include <itkSobelOperator.h>

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

Detailed Description

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

A NeighborhoodOperator for performing a directional Sobel edge-detection operation at a pixel location.

SobelOperator is a directional NeighborhoodOperator that should be applied a NeighborhoodIterator using the NeighborhoodInnerProduct method. To create the operator:

1) Set the direction by calling

2) call

* itk::Size<2> radius;
* radius.Fill(1);
* sobelOperator.CreateToRadius(radius);
*

3) You may optionally scale the coefficients of this operator using the

method. This is useful if you want to take the spacing of the image into account when computing the edge strength. Apply the scaling only after calling to

.

The Sobel Operator in vertical direction for 2 dimensions is

*             -1  -2  -1
*             0    0   0
*             1    2   1
*
* 

The Sobel Operator in horizonal direction is for 2 dimensions is

*             -1   0   1
*             -2   0   2
*             -1   0   1
* 

The current implementation of the Sobel operator is for 2 and 3 dimensions only. The ND version is planned for future releases.

The extension to 3D is from the publication "Irwin Sobel. An Isotropic 3x3x3 Volume Gradient Operator. Technical report, Hewlett-Packard Laboratories, April 1995."

The Sobel operator in 3D has the kernel

* -1 -3 -1   0 0 0  1 3 1
* -3 -6 -3   0 0 0  3 6 3
* -1 -3 -1   0 0 0  1 3 1
*
*    x-1       x     x+1
* 

The x kernel is just rotated as required to obtain the kernel in the y and z directions.

See Also
NeighborhoodOperator
Neighborhood
ForwardDifferenceOperator
BackwardDifferenceOperator
Wiki Examples:
Examples:
Examples/Iterators/NeighborhoodIterators2.cxx, Examples/Iterators/NeighborhoodIterators3.cxx, WikiExamples/Images/MaskNeighborhoodOperatorImageFilter.cxx, WikiExamples/Images/NeighborhoodOperatorImageFilter.cxx, and WikiExamples/Operators/SobelOperator.cxx.

Definition at line 96 of file itkSobelOperator.h.

Public Types

typedef SobelOperator Self
 
typedef NeighborhoodOperator
< TPixel, VDimension,
TAllocator > 
Superclass
 
- Public Types inherited from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >
typedef NumericTraits< TPixel >
::RealType 
PixelRealType
 
typedef TPixel PixelType
 
typedef NeighborhoodOperator Self
 
typedef Superclass::SizeType SizeType
 
typedef SliceIterator< TPixel,
Self
SliceIteratorType
 
typedef Neighborhood< TPixel,
VDimension, TAllocator > 
Superclass
 
- Public Types inherited from itk::Neighborhood< TPixel, VDimension, TAllocator >
typedef TAllocator AllocatorType
 
typedef
AllocatorType::const_iterator 
ConstIterator
 
typedef unsigned int DimensionValueType
 
typedef AllocatorType::iterator Iterator
 
typedef SizeValueType NeighborIndexType
 
typedef Offset< VDimension > OffsetType
 
typedef TPixel PixelType
 
typedef Neighborhood Self
 
typedef SizeType::SizeValueType SizeValueType
 
typedef SliceIterator< TPixel,
Self
SliceIteratorType
 

Public Member Functions

virtual void CreateDirectional () override
 
virtual const char * GetNameOfClass () const
 
 SobelOperator ()
 
 SobelOperator (const Self &other)
 
Selfoperator= (const Self &other)
 
virtual void PrintSelf (std::ostream &os, Indent i) const override
 
- Public Member Functions inherited from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >
virtual void CreateToRadius (const SizeType &)
 
virtual void CreateToRadius (const SizeValueType)
 
virtual void FlipAxes ()
 
unsigned long GetDirection () const
 
 NeighborhoodOperator ()
 
 NeighborhoodOperator (const Self &orig)
 
void ScaleCoefficients (PixelRealType)
 
void SetDirection (const unsigned long &direction)
 
Selfoperator= (const Self &orig)
 
- 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
 
SizeValueType GetSize (DimensionValueType n) const
 
SizeType GetSize () const
 
std::slice GetSlice (unsigned int) const
 
OffsetValueType GetStride (DimensionValueType axis) const
 
 itkTypeMacroNoParent (Neighborhood)
 
 Neighborhood (const Self &other)
 
bool operator!= (const Self &other) const
 
Selfoperator= (const Self &other)
 
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 ()
 
 Neighborhood ()
 
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

typedef
Superclass::CoefficientVector 
CoefficientVector
 
typedef Superclass::PixelType PixelType
 
- Protected Types inherited from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >
typedef std::vector
< PixelRealType
CoefficientVector
 

Protected Member Functions

void Fill (const CoefficientVector &c) 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 ()
 

Additional Inherited Members

- Public Attributes inherited from itk::Neighborhood< TPixel, VDimension, TAllocator >
typedef::itk::Size< VDimension > RadiusType
 
typedef::itk::Size< VDimension > SizeType
 
- Static Public Attributes inherited from itk::Neighborhood< TPixel, VDimension, TAllocator >
static const unsigned int NeighborhoodDimension = VDimension
 

Member Typedef Documentation

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator< TPixel >>
typedef Superclass::CoefficientVector itk::SobelOperator< TPixel, VDimension, TAllocator >::CoefficientVector
protected

Typedef support for coefficient vector type. Necessary to work around compiler bug on VC++.

Definition at line 153 of file itkSobelOperator.h.

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator< TPixel >>
typedef Superclass::PixelType itk::SobelOperator< TPixel, VDimension, TAllocator >::PixelType
protected

Definition at line 154 of file itkSobelOperator.h.

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

Standard typedefs

Definition at line 102 of file itkSobelOperator.h.

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

Definition at line 103 of file itkSobelOperator.h.

Constructor & Destructor Documentation

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

Definition at line 107 of file itkSobelOperator.h.

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator< TPixel >>
itk::SobelOperator< TPixel, VDimension, TAllocator >::SobelOperator ( const Self other)
inline

Definition at line 108 of file itkSobelOperator.h.

Member Function Documentation

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

Creates the operator with length only in the specified direction. For the Sobel operator, this 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 from itk::NeighborhoodOperator< TPixel, VDimension, TAllocator >.

Definition at line 117 of file itkSobelOperator.h.

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

Arranges coefficients spatially in the memory buffer.

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

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

Calculates operator coefficients.

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

template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator< TPixel >>
virtual const char* itk::SobelOperator< TPixel, VDimension, TAllocator >::GetNameOfClass ( ) const
virtual
template<typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator< TPixel >>
Self& itk::SobelOperator< TPixel, VDimension, TAllocator >::operator= ( const Self other)
inline

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 Assignment operator

Definition at line 131 of file itkSobelOperator.h.

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

Prints some debugging information

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

Definition at line 141 of file itkSobelOperator.h.


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