ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkCoxDeBoorBSplineKernelFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
56 template<unsigned int VSplineOrder = 3, typename TRealValueType = double>
57 class ITK_TEMPLATE_EXPORT CoxDeBoorBSplineKernelFunction:
58  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 SetSplineOrder( const unsigned int );
83 
85  itkGetConstMacro( SplineOrder, unsigned int );
86 
88  TRealValueType Evaluate( const TRealValueType & ) const override;
89 
91  TRealValueType EvaluateDerivative( const TRealValueType & ) const;
92 
94  TRealValueType EvaluateNthDerivative( const TRealValueType &, const unsigned int ) const;
95 
101  MatrixType GetShapeFunctions();
102 
107  MatrixType GetShapeFunctionsInZeroToOneInterval();
108 
109 protected:
111  ~CoxDeBoorBSplineKernelFunction() override = default;
112  void PrintSelf( std::ostream & os, Indent indent ) const override;
113 
114 private:
119  void GenerateBSplineShapeFunctions( const unsigned int );
120 
127  PolynomialType CoxDeBoor( const unsigned short, const VectorType,
128  const unsigned int, const unsigned int );
129 
131  unsigned int m_SplineOrder;
132 };
133 } // end namespace itk
134 
135 #ifndef ITK_MANUAL_INSTANTIATION
136 #include "itkCoxDeBoorBSplineKernelFunction.hxx"
137 #endif
138 
139 #endif
Kernel used for density estimation and nonparameteric regression.
BSpline kernel used for density estimation and nonparameteric regression.
Control indentation during Print() invocation.
Definition: itkIndent.h:49