Orfeo Toolbox  3.16
itkDerivativeOperator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkDerivativeOperator.h,v $
5  Language: C++
6  Date: $Date: 2008-10-07 09:09:39 $
7  Version: $Revision: 1.22 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkDerivativeOperator_h
18 #define __itkDerivativeOperator_h
19 
20 #include "itkExceptionObject.h"
22 
23 namespace itk {
24 
43 template<class TPixel, unsigned int VDimension=2,
44  class TAllocator = NeighborhoodAllocator<TPixel> >
46  : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
47 {
48 
49 public:
52  typedef NeighborhoodOperator<
53  TPixel, VDimension, TAllocator> Superclass;
54 
55  typedef typename Superclass::PixelType PixelType;
57 
59  DerivativeOperator() : m_Order(1) {}
60 
62  DerivativeOperator(const Self& other)
63  : NeighborhoodOperator<TPixel, VDimension, TAllocator>(other)
64  { m_Order = other.m_Order; }
65 
67  Self &operator=(const Self& other)
68  {
69  Superclass::operator=(other);
70  m_Order = other.m_Order;
71  return *this;
72  }
73 
75  void SetOrder(const unsigned int &order)
76  {
77  this->m_Order = order;
78  }
79 
81  unsigned int GetOrder() const { return m_Order; }
82 
84  virtual void PrintSelf(std::ostream &os, Indent i) const
85  {
86  os << i << "DerivativeOperator { this=" << this
87  << ", m_Order = " << m_Order << "}" << std::endl;
88  Superclass::PrintSelf(os, i.GetNextIndent());
89  }
90 
91 protected:
95 
97  CoefficientVector GenerateCoefficients();
98 
100  void Fill(const CoefficientVector &coeff)
101  { Superclass::FillCenteredDirectional(coeff); }
102 
103 private:
105  unsigned int m_Order;
106 };
107 
108 } // namespace itk
109 
110 // Define instantiation macro for this template.
111 #define ITK_TEMPLATE_DerivativeOperator(_, EXPORT, x, y) namespace itk { \
112  _(2(class EXPORT DerivativeOperator< ITK_TEMPLATE_2 x >)) \
113  namespace Templates { typedef DerivativeOperator< ITK_TEMPLATE_2 x > \
114  DerivativeOperator##y; } \
115  }
116 
117 #if ITK_TEMPLATE_EXPLICIT
118 # include "Templates/itkDerivativeOperator+-.h"
119 #endif
120 
121 #if ITK_TEMPLATE_TXX
122 # include "itkDerivativeOperator.txx"
123 #endif
124 
125 #endif

Generated at Sat Feb 2 2013 23:35:05 for Orfeo Toolbox with doxygen 1.8.1.1