ITK  5.0.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< typename TPixel, unsigned int VDimension = 2,
66  typename TAllocator = NeighborhoodAllocator< TPixel > >
67 class ITK_TEMPLATE_EXPORT DerivativeOperator:
68  public NeighborhoodOperator< TPixel, VDimension, TAllocator >
69 {
70 public:
71 
75  TPixel, VDimension, TAllocator >;
76 
77  using PixelType = typename Superclass::PixelType;
79 
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  void PrintSelf(std::ostream & os, Indent i) const override
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() override;
125 
127  void Fill(const CoefficientVector & coeff) override
128  { Superclass::FillCenteredDirectional(coeff); }
129 
130 private:
132  unsigned int m_Order{1};
133 };
134 } // namespace itk
135 
136 #ifndef ITK_MANUAL_INSTANTIATION
137 #include "itkDerivativeOperator.hxx"
138 #endif
139 
140 #endif
Self & operator=(const Self &other)
A NeighborhoodOperator for taking an n-th order derivative at a pixel.
void Fill(const CoefficientVector &coeff) override
unsigned int GetOrder() const
Virtual class that defines a common interface to all neighborhood operator subtypes.
void SetOrder(const unsigned int &order)
void PrintSelf(std::ostream &os, Indent i) const override
DerivativeOperator(const Self &other)
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Indent GetNextIndent()