ITK  5.3.0
Insight Toolkit
itkDerivativeOperator.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
68 template <typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
69 class ITK_TEMPLATE_EXPORT DerivativeOperator : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
70 {
71 public:
72 
76 
77  using PixelType = typename Superclass::PixelType;
79 
81  void
82  SetOrder(const unsigned int & order)
83  {
84  this->m_Order = order;
85  }
86 
88  unsigned int
89  GetOrder() const
90  {
91  return m_Order;
92  }
93 
95  void
96  PrintSelf(std::ostream & os, Indent i) const override
97  {
98  os << i << "DerivativeOperator { this=" << this << ", m_Order = " << m_Order << "}" << std::endl;
99  Superclass::PrintSelf(os, i.GetNextIndent());
100  }
102 
103 protected:
107 
110  GenerateCoefficients() override;
111 
113  void
114  Fill(const CoefficientVector & coeff) override
115  {
116  Superclass::FillCenteredDirectional(coeff);
117  }
118 
119 private:
121  unsigned int m_Order{ 1 };
122 };
123 } // namespace itk
124 
125 #ifndef ITK_MANUAL_INSTANTIATION
126 # include "itkDerivativeOperator.hxx"
127 #endif
128 
129 #endif
itk::DerivativeOperator< OutputImagePixelType, Self::ImageDimension >::CoefficientVector
typename Superclass::CoefficientVector CoefficientVector
Definition: itkDerivativeOperator.h:106
itk::Indent::GetNextIndent
Indent GetNextIndent() const
itk::NeighborhoodOperator< OutputImagePixelType, VDimension, NeighborhoodAllocator< OutputImagePixelType > >::PixelRealType
typename NumericTraits< OutputImagePixelType >::RealType PixelRealType
Definition: itkNeighborhoodOperator.h:139
itk::NeighborhoodOperator< OutputImagePixelType, VDimension, NeighborhoodAllocator< OutputImagePixelType > >::PixelType
OutputImagePixelType PixelType
Definition: itkNeighborhoodOperator.h:85
itk::NeighborhoodOperator
Virtual class that defines a common interface to all neighborhood operator subtypes.
Definition: itkNeighborhoodOperator.h:72
itkNeighborhoodOperator.h
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::DerivativeOperator::GetOrder
unsigned int GetOrder() const
Definition: itkDerivativeOperator.h:89
itk::DerivativeOperator::PrintSelf
void PrintSelf(std::ostream &os, Indent i) const override
Definition: itkDerivativeOperator.h:96
itk::DerivativeOperator< OutputImagePixelType, Self::ImageDimension >::PixelType
typename Superclass::PixelType PixelType
Definition: itkDerivativeOperator.h:77
itk::DerivativeOperator::Fill
void Fill(const CoefficientVector &coeff) override
Definition: itkDerivativeOperator.h:114
itk::DerivativeOperator< OutputImagePixelType, Self::ImageDimension >::PixelRealType
typename Superclass::PixelRealType PixelRealType
Definition: itkDerivativeOperator.h:78
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::DerivativeOperator
A NeighborhoodOperator for taking an n-th order derivative at a pixel.
Definition: itkDerivativeOperator.h:69
itk::DerivativeOperator::SetOrder
void SetOrder(const unsigned int &order)
Definition: itkDerivativeOperator.h:82
itk::NeighborhoodOperator< OutputImagePixelType, VDimension, NeighborhoodAllocator< OutputImagePixelType > >::CoefficientVector
std::vector< PixelRealType > CoefficientVector
Definition: itkNeighborhoodOperator.h:148