ITK  5.4.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 {
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 
78  itkOverrideGetNameOfClassMacro(DerivativeOperator);
79 
81  using typename Superclass::PixelRealType;
82 
84  void
85  SetOrder(const unsigned int order)
86  {
87  this->m_Order = order;
88  }
89 
91  unsigned int
92  GetOrder() const
93  {
94  return m_Order;
95  }
96 
97  void
98  PrintSelf(std::ostream & os, Indent indent) const override
99  {
100  Superclass::PrintSelf(os, indent);
101 
102  os << indent << "Order: " << m_Order << std::endl;
103  }
104 
105 protected:
107  using typename Superclass::CoefficientVector;
108 
110  CoefficientVector
111  GenerateCoefficients() override;
112 
114  void
115  Fill(const CoefficientVector & coeff) override
116  {
117  Superclass::FillCenteredDirectional(coeff);
118  }
119 
120 private:
122  unsigned int m_Order{ 1 };
123 };
124 } // namespace itk
125 
126 #ifndef ITK_MANUAL_INSTANTIATION
127 # include "itkDerivativeOperator.hxx"
128 #endif
129 
130 #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:92
itk::DerivativeOperator::SetOrder
void SetOrder(const unsigned int order)
Definition: itkDerivativeOperator.h:85
itk::DerivativeOperator< OutputImagePixelType, Self::ImageDimension >::CoefficientVector
typename std::vector< PixelRealType > CoefficientVector
Definition: itkNeighborhoodOperator.h:147
itk::DerivativeOperator::Fill
void Fill(const CoefficientVector &coeff) override
Definition: itkDerivativeOperator.h:115
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::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkDerivativeOperator.h:98