ITK  5.2.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  * http://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 {
57 template <unsigned int VSplineOrder = 3, typename TRealValueType = double>
58 class ITK_TEMPLATE_EXPORT CoxDeBoorBSplineKernelFunction : public KernelFunctionBase<TRealValueType>
59 {
60 public:
61  ITK_DISALLOW_COPY_AND_ASSIGN(CoxDeBoorBSplineKernelFunction);
62 
68 
69  using RealType = typename Superclass::RealType;
70 
72  itkNewMacro(Self);
73 
76 
77  using VectorType = vnl_vector<TRealValueType>;
78  using PolynomialType = vnl_real_polynomial;
79  using MatrixType = vnl_matrix<TRealValueType>;
80 
82  void
83  SetSplineOrder(const unsigned int);
84 
86  itkGetConstMacro(SplineOrder, unsigned int);
87 
89  TRealValueType
90  Evaluate(const TRealValueType &) const override;
91 
93  TRealValueType
94  EvaluateDerivative(const TRealValueType &) const;
95 
97  TRealValueType
98  EvaluateNthDerivative(const TRealValueType &, const unsigned int) const;
99 
105  MatrixType
106  GetShapeFunctions();
107 
112  MatrixType
113  GetShapeFunctionsInZeroToOneInterval();
114 
115 protected:
117  ~CoxDeBoorBSplineKernelFunction() override = default;
118  void
119  PrintSelf(std::ostream & os, Indent indent) const override;
120 
121 private:
126  void
127  GenerateBSplineShapeFunctions(const unsigned int);
128 
136  CoxDeBoor(const unsigned short, const VectorType, const unsigned int, const unsigned int);
137 
139  unsigned int m_SplineOrder;
140 };
141 } // end namespace itk
142 
143 #ifndef ITK_MANUAL_INSTANTIATION
144 # include "itkCoxDeBoorBSplineKernelFunction.hxx"
145 #endif
146 
147 #endif
itk::CoxDeBoorBSplineKernelFunction::PolynomialType
vnl_real_polynomial PolynomialType
Definition: itkCoxDeBoorBSplineKernelFunction.h:78
itk::KernelFunctionBase::RealType
TRealValueType RealType
Definition: itkKernelFunctionBase.h:52
itk::CoxDeBoorBSplineKernelFunction::m_SplineOrder
unsigned int m_SplineOrder
Definition: itkCoxDeBoorBSplineKernelFunction.h:139
itk::CoxDeBoorBSplineKernelFunction::VectorType
vnl_vector< TRealValueType > VectorType
Definition: itkCoxDeBoorBSplineKernelFunction.h:77
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
itk::FunctionBase< TRealValueType, TRealValueType >
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::CoxDeBoorBSplineKernelFunction::m_BSplineShapeFunctions
MatrixType m_BSplineShapeFunctions
Definition: itkCoxDeBoorBSplineKernelFunction.h:138
itk::CoxDeBoorBSplineKernelFunction::MatrixType
vnl_matrix< TRealValueType > MatrixType
Definition: itkCoxDeBoorBSplineKernelFunction.h:79
itk::CoxDeBoorBSplineKernelFunction
BSpline kernel used for density estimation and nonparametric regression.
Definition: itkCoxDeBoorBSplineKernelFunction.h:58