ITK  6.0.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  * https://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 {
67 template <typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
68 class ITK_TEMPLATE_EXPORT DerivativeOperator : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
69 {
70 public:
71 
75 
77  itkOverrideGetNameOfClassMacro(DerivativeOperator);
78 
80  using typename Superclass::PixelRealType;
81 
83  void
84  SetOrder(const unsigned int order)
85  {
86  this->m_Order = order;
87  }
88 
90  unsigned int
91  GetOrder() const
92  {
93  return m_Order;
94  }
95 
96  void
97  PrintSelf(std::ostream & os, Indent indent) const override
98  {
99  Superclass::PrintSelf(os, indent);
100 
101  os << indent << "Order: " << m_Order << std::endl;
102  }
103 
104 protected:
106  using typename Superclass::CoefficientVector;
107 
109  CoefficientVector
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::NeighborhoodOperator< OutputImagePixelType, VDimension, NeighborhoodAllocator< OutputImagePixelType > >::PixelRealType
typename NumericTraits< OutputImagePixelType >::RealType PixelRealType
Definition: itkNeighborhoodOperator.h:90
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:91
itk::DerivativeOperator::SetOrder
void SetOrder(const unsigned int order)
Definition: itkDerivativeOperator.h:84
itk::DerivativeOperator< OutputImagePixelType, Self::ImageDimension >::CoefficientVector
typename std::vector< PixelRealType > CoefficientVector
Definition: itkNeighborhoodOperator.h:153
itk::DerivativeOperator::Fill
void Fill(const CoefficientVector &coeff) override
Definition: itkDerivativeOperator.h:114
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::DerivativeOperator
A NeighborhoodOperator for taking an n-th order derivative at a pixel.
Definition: itkDerivativeOperator.h:68
itk::DerivativeOperator::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkDerivativeOperator.h:97