itkDerivativeOperator.h
Go to the documentation of this file.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<
00053 TPixel, VDimension, TAllocator> Superclass;
00054
00055 typedef typename Superclass::PixelType PixelType;
00056 typedef typename Superclass::PixelRealType PixelRealType;
00057
00059 DerivativeOperator() : m_Order(1) {}
00060
00062 DerivativeOperator(const Self& other)
00063 : NeighborhoodOperator<TPixel, VDimension, TAllocator>(other)
00064 { m_Order = other.m_Order; }
00065
00067 Self &operator=(const Self& other)
00068 {
00069 Superclass::operator=(other);
00070 m_Order = other.m_Order;
00071 return *this;
00072 }
00074
00076 void SetOrder(const unsigned int &order)
00077 {
00078 this->m_Order = order;
00079 }
00080
00082 unsigned int GetOrder() const { return m_Order; }
00083
00085 virtual void PrintSelf(std::ostream &os, Indent i) const
00086 {
00087 os << i << "DerivativeOperator { this=" << this
00088 << ", m_Order = " << m_Order << "}" << std::endl;
00089 Superclass::PrintSelf(os, i.GetNextIndent());
00090 }
00092
00093 protected:
00096 typedef typename Superclass::CoefficientVector CoefficientVector;
00097
00099 CoefficientVector GenerateCoefficients();
00100
00102 void Fill(const CoefficientVector &coeff)
00103 { Superclass::FillCenteredDirectional(coeff); }
00104
00105 private:
00107 unsigned int m_Order;
00108 };
00109
00110 }
00111
00112
00113 #define ITK_TEMPLATE_DerivativeOperator(_, EXPORT, x, y) namespace itk { \
00114 _(2(class EXPORT DerivativeOperator< ITK_TEMPLATE_2 x >)) \
00115 namespace Templates { typedef DerivativeOperator< ITK_TEMPLATE_2 x > \
00116 DerivativeOperator##y; } \
00117 }
00118
00119 #if ITK_TEMPLATE_EXPLICIT
00120 # include "Templates/itkDerivativeOperator+-.h"
00121 #endif
00122
00123 #if ITK_TEMPLATE_TXX
00124 # include "itkDerivativeOperator.txx"
00125 #endif
00126
00127 #endif
00128