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
23namespace itk
24{
68template <typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
69class ITK_TEMPLATE_EXPORT DerivativeOperator : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
70{
71public:
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
105protected:
107 using typename Superclass::CoefficientVector;
108
110 CoefficientVector
112
114 void
115 Fill(const CoefficientVector & coeff) override
116 {
117 Superclass::FillCenteredDirectional(coeff);
118 }
119
120private:
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
A NeighborhoodOperator for taking an n-th order derivative at a pixel.
void Fill(const CoefficientVector &coeff) override
CoefficientVector GenerateCoefficients() override
void PrintSelf(std::ostream &os, Indent indent) const override
void SetOrder(const unsigned int order)
unsigned int GetOrder() const
typename std::vector< PixelRealType > CoefficientVector
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Virtual class that defines a common interface to all neighborhood operator subtypes.
typename NumericTraits< TPixel >::RealType PixelRealType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....