ITK  4.13.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:
66 
67  typedef typename Superclass::RealType RealType;
68 
70  itkNewMacro( Self );
71 
74 
75  typedef vnl_vector<TRealValueType> VectorType;
76  typedef vnl_real_polynomial PolynomialType;
77  typedef vnl_matrix<TRealValueType> MatrixType;
78 
80  void SetSplineOrder( const unsigned int );
81 
83  itkGetConstMacro( SplineOrder, unsigned int );
84 
86  TRealValueType Evaluate( const TRealValueType & ) const ITK_OVERRIDE;
87 
89  TRealValueType EvaluateDerivative( const TRealValueType & ) const;
90 
92  TRealValueType EvaluateNthDerivative( const TRealValueType &, const unsigned int ) const;
93 
99  MatrixType GetShapeFunctions();
100 
105  MatrixType GetShapeFunctionsInZeroToOneInterval();
106 
107 protected:
109  virtual ~CoxDeBoorBSplineKernelFunction() ITK_OVERRIDE;
110  void PrintSelf( std::ostream & os, Indent indent ) const ITK_OVERRIDE;
111 
112 private:
113  ITK_DISALLOW_COPY_AND_ASSIGN(CoxDeBoorBSplineKernelFunction);
114 
119  void GenerateBSplineShapeFunctions( const unsigned int );
120 
127  PolynomialType CoxDeBoor( const unsigned short, const VectorType,
128  const unsigned int, const unsigned int );
129 
130  MatrixType m_BSplineShapeFunctions;
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
KernelFunctionBase< TRealValueType > Superclass
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