ITK  4.4.0
Insight Segmentation and Registration Toolkit
itkDerivativeOperator.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkDerivativeOperator_h
19 #define __itkDerivativeOperator_h
20 
22 
23 namespace itk
24 {
65 template< class TPixel, unsigned int VDimension = 2,
66  class TAllocator = NeighborhoodAllocator< TPixel > >
67 class ITK_EXPORT DerivativeOperator:
68  public NeighborhoodOperator< TPixel, VDimension, TAllocator >
69 {
70 public:
71 
74  typedef NeighborhoodOperator<
75  TPixel, VDimension, TAllocator > Superclass;
76 
77  typedef typename Superclass::PixelType PixelType;
79 
81  DerivativeOperator():m_Order(1) {}
82 
84  DerivativeOperator(const Self & other):
85  NeighborhoodOperator< TPixel, VDimension, TAllocator >(other)
86  { m_Order = other.m_Order; }
87 
89  Self & operator=(const Self & other)
90  {
91  if(this != &other)
92  {
93  Superclass::operator=(other);
94  m_Order = other.m_Order;
95  }
96  return *this;
97  }
99 
101  void SetOrder(const unsigned int & order)
102  {
103  this->m_Order = order;
104  }
105 
107  unsigned int GetOrder() const { return m_Order; }
108 
110  virtual void PrintSelf(std::ostream & os, Indent i) const
111  {
112  os << i << "DerivativeOperator { this=" << this
113  << ", m_Order = " << m_Order << "}" << std::endl;
114  Superclass::PrintSelf( os, i.GetNextIndent() );
115  }
117 
118 protected:
122 
124  CoefficientVector GenerateCoefficients();
125 
127  void Fill(const CoefficientVector & coeff)
128  { Superclass::FillCenteredDirectional(coeff); }
129 
130 private:
132  unsigned int m_Order;
133 };
134 } // namespace itk
135 
136 #ifndef ITK_MANUAL_INSTANTIATION
137 #include "itkDerivativeOperator.hxx"
138 #endif
139 
140 #endif
141