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
23namespace itk
24{
67template <typename TPixel, unsigned int VDimension = 2, typename TAllocator = NeighborhoodAllocator<TPixel>>
68class ITK_TEMPLATE_EXPORT DerivativeOperator : public NeighborhoodOperator<TPixel, VDimension, TAllocator>
69{
70public:
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
104protected:
106 using typename Superclass::CoefficientVector;
107
109 CoefficientVector
111
113 void
114 Fill(const CoefficientVector & coeff) override
115 {
116 Superclass::FillCenteredDirectional(coeff);
117 }
118
119private:
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
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....