ITK  5.4.0
Insight Toolkit
itkCoxDeBoorBSplineKernelFunction.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 itkCoxDeBoorBSplineKernelFunction_h
19 #define itkCoxDeBoorBSplineKernelFunction_h
20 
21 #include "itkKernelFunctionBase.h"
22 #include "vnl/vnl_real_polynomial.h"
23 #include "vnl/vnl_matrix.h"
24 
25 namespace itk
26 {
56 template <unsigned int VSplineOrder = 3, typename TRealValueType = double>
57 class ITK_TEMPLATE_EXPORT CoxDeBoorBSplineKernelFunction : public KernelFunctionBase<TRealValueType>
58 {
59 public:
60  ITK_DISALLOW_COPY_AND_MOVE(CoxDeBoorBSplineKernelFunction);
61 
67 
68  using typename Superclass::RealType;
69 
71  itkNewMacro(Self);
72 
75 
76  using VectorType = vnl_vector<TRealValueType>;
77  using PolynomialType = vnl_real_polynomial;
78  using MatrixType = vnl_matrix<TRealValueType>;
79 
81  void
82  SetSplineOrder(const unsigned int);
83 
85  itkGetConstMacro(SplineOrder, unsigned int);
86 
88  TRealValueType
89  Evaluate(const TRealValueType &) const override;
90 
92  TRealValueType
93  EvaluateDerivative(const TRealValueType &) const;
94 
96  TRealValueType
97  EvaluateNthDerivative(const TRealValueType &, const unsigned int) const;
98 
104  MatrixType
105  GetShapeFunctions();
106 
111  MatrixType
112  GetShapeFunctionsInZeroToOneInterval();
113 
114 protected:
116  ~CoxDeBoorBSplineKernelFunction() override = default;
117  void
118  PrintSelf(std::ostream & os, Indent indent) const override;
119 
120 private:
125  void
126  GenerateBSplineShapeFunctions(const unsigned int);
127 
135  CoxDeBoor(const unsigned short, const VectorType, const unsigned int, const unsigned int);
136 
137  MatrixType m_BSplineShapeFunctions{};
138  unsigned int m_SplineOrder{};
139 };
140 } // end namespace itk
141 
142 #ifndef ITK_MANUAL_INSTANTIATION
143 # include "itkCoxDeBoorBSplineKernelFunction.hxx"
144 #endif
145 
146 #endif
itk::CoxDeBoorBSplineKernelFunction::PolynomialType
vnl_real_polynomial PolynomialType
Definition: itkCoxDeBoorBSplineKernelFunction.h:77
itk::CoxDeBoorBSplineKernelFunction::VectorType
vnl_vector< TRealValueType > VectorType
Definition: itkCoxDeBoorBSplineKernelFunction.h:76
itk::KernelFunctionBase
Kernel used for density estimation and nonparametric regression.
Definition: itkKernelFunctionBase.h:43
itkKernelFunctionBase.h
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkOverrideGetNameOfClassMacro
itkOverrideGetNameOfClassMacro(AddImageFilter)
itk::FunctionBase< TRealValueType, TRealValueType >
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::CoxDeBoorBSplineKernelFunction::MatrixType
vnl_matrix< TRealValueType > MatrixType
Definition: itkCoxDeBoorBSplineKernelFunction.h:78
itk::CoxDeBoorBSplineKernelFunction
BSpline kernel used for density estimation and nonparametric regression.
Definition: itkCoxDeBoorBSplineKernelFunction.h:57