00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkDerivativeOperator_h
00018 #define __itkDerivativeOperator_h
00019
00020 #include "itkExceptionObject.h"
00021 #include "itkNeighborhoodOperator.h"
00022
00023 namespace itk {
00024
00043 template<class TPixel, unsigned int VDimension=2,
00044 class TAllocator = NeighborhoodAllocator<TPixel> >
00045 class ITK_EXPORT DerivativeOperator
00046 : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
00047 {
00048
00049 public:
00051 typedef DerivativeOperator Self;
00052 typedef NeighborhoodOperator<TPixel, VDimension, TAllocator> Superclass;
00053
00054 typedef typename Superclass::PixelType PixelType;
00055
00057 DerivativeOperator() : m_Order(1) {}
00058
00060 DerivativeOperator(const Self& other)
00061 : NeighborhoodOperator<TPixel, VDimension, TAllocator>(other)
00062 { m_Order = other.m_Order; }
00063
00065 Self &operator=(const Self& other)
00066 {
00067 Superclass::operator=(other);
00068 m_Order = other.m_Order;
00069 return *this;
00070 }
00072
00074 void SetOrder(const unsigned int &order)
00075 { m_Order = order; }
00076
00078 unsigned int GetOrder() const { return m_Order; }
00079
00081 virtual void PrintSelf(std::ostream &os, Indent i) const
00082 {
00083 os << i << "DerivativeOperator { this=" << this
00084 << ", m_Order = " << m_Order << "}" << std::endl;
00085 Superclass::PrintSelf(os, i.GetNextIndent());
00086 }
00088
00089 protected:
00092 typedef typename Superclass::CoefficientVector CoefficientVector;
00093
00095 CoefficientVector GenerateCoefficients();
00096
00098 void Fill(const CoefficientVector &coeff)
00099 { Superclass::FillCenteredDirectional(coeff); }
00100
00101 private:
00103 unsigned int m_Order;
00104 };
00105
00106 }
00107
00108
00109 #define ITK_TEMPLATE_DerivativeOperator(_, EXPORT, x, y) namespace itk { \
00110 _(2(class EXPORT DerivativeOperator< ITK_TEMPLATE_2 x >)) \
00111 namespace Templates { typedef DerivativeOperator< ITK_TEMPLATE_2 x > \
00112 DerivativeOperator##y; } \
00113 }
00114
00115 #if ITK_TEMPLATE_EXPLICIT
00116 # include "Templates/itkDerivativeOperator+-.h"
00117 #endif
00118
00119 #if ITK_TEMPLATE_TXX
00120 # include "itkDerivativeOperator.txx"
00121 #endif
00122
00123 #endif
00124
00125
00126