00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkSobelOperator_h
00019 #define __itkSobelOperator_h
00020
00021 #include "itkExceptionObject.h"
00022 #include "itkNeighborhoodOperator.h"
00023
00024 namespace itk {
00025
00084 template<class TPixel, unsigned int VDimension=2,
00085 class TAllocator = NeighborhoodAllocator<TPixel> >
00086 class ITK_EXPORT SobelOperator
00087 : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
00088 {
00089 public:
00090
00092 typedef SobelOperator Self;
00093 typedef NeighborhoodOperator<TPixel, VDimension, TAllocator> Superclass;
00094
00095 itkTypeMacro(SobelOperator, NeighborhoodOperator);
00096
00097 SobelOperator() {}
00098 SobelOperator(const Self& other)
00099 : NeighborhoodOperator<TPixel, VDimension, TAllocator>(other)
00100 { }
00101
00107 virtual void CreateDirectional()
00108 {
00109 this->CreateToRadius(1);
00110 }
00111
00116
00117
00121 Self &operator=(const Self& other)
00122 {
00123 Superclass::operator=(other);
00124 return *this;
00125 }
00126
00130 virtual void PrintSelf(std::ostream &os, Indent i) const
00131 {
00132 os << i << "SobelOperator { this=" << this << "}" << std::endl;
00133 Superclass::PrintSelf(os, i.GetNextIndent());
00134 }
00136
00137 protected:
00142 typedef typename Superclass::CoefficientVector CoefficientVector;
00143 typedef typename Superclass::PixelType PixelType;
00144
00148 CoefficientVector GenerateCoefficients();
00149
00153 void Fill(const CoefficientVector &c);
00154
00155 };
00156
00157 }
00158
00159
00160 #define ITK_TEMPLATE_SobelOperator(_, EXPORT, x, y) namespace itk { \
00161 _(2(class EXPORT SobelOperator< ITK_TEMPLATE_2 x >)) \
00162 namespace Templates { typedef SobelOperator< ITK_TEMPLATE_2 x > \
00163 SobelOperator##y; } \
00164 }
00165
00166 #if ITK_TEMPLATE_EXPLICIT
00167 # include "Templates/itkSobelOperator+-.h"
00168 #endif
00169
00170 #if ITK_TEMPLATE_TXX
00171 # include "itkSobelOperator.txx"
00172 #endif
00173
00174 #endif
00175
00176
00177