go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkRecursiveBSplineInterpolationWeightFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright UMC Utrecht and contributors
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 __itkRecursiveBSplineInterpolationWeightFunction_h
19 #define __itkRecursiveBSplineInterpolationWeightFunction_h
20 
21 #include "itkBSplineInterpolationWeightFunction.h"
22 
26 
27 namespace itk
28 {
30 template< unsigned int SplineOrder, unsigned int Dimension >
32 {
33 public:
34 
35  typedef GetConstNumberOfIndicesHack< SplineOrder, Dimension - 1 > OneDimensionLess;
36  itkStaticConstMacro( Value, unsigned int, ( SplineOrder + 1 ) * OneDimensionLess::Value );
37 };
38 
39 template< unsigned int SplineOrder >
40 class GetConstNumberOfIndicesHack< SplineOrder, 0 >
41 {
42 public:
43 
44  itkStaticConstMacro( Value, unsigned int, 1 );
45 };
46 
48 template< unsigned int SplineOrder, unsigned int Dimension >
49 class GetConstNumberOfWeightsHackRecursiveBSpline
50 {
51 public:
52 
53  itkStaticConstMacro( Value, unsigned int, ( SplineOrder + 1 ) * Dimension );
54 };
55 
73 template<
74  typename TCoordRep = float,
75  unsigned int VSpaceDimension = 2,
76  unsigned int VSplineOrder = 3 >
78  public BSplineInterpolationWeightFunction< TCoordRep, VSpaceDimension, VSplineOrder >
79 {
80 public:
81 
85  TCoordRep, VSpaceDimension, VSplineOrder > Superclass;
87  typedef SmartPointer< const Self > ConstPointer;
88 
90  itkNewMacro( Self );
91 
94 
96  itkStaticConstMacro( SpaceDimension, unsigned int, VSpaceDimension );
97 
99  itkStaticConstMacro( SplineOrder, unsigned int, VSplineOrder );
100 
102  typedef typename Superclass::WeightsType WeightsType;
103  typedef typename Superclass::IndexType IndexType;
104  typedef typename Superclass::SizeType SizeType;
105  typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
106  //typedef typename Superclass::
107 
109  typedef GetConstNumberOfWeightsHackRecursiveBSpline<
110  itkGetStaticConstMacro( SplineOrder ),
111  itkGetStaticConstMacro( SpaceDimension ) > GetConstNumberOfWeightsHackRecursiveBSplineType;
112  itkStaticConstMacro( NumberOfWeights, unsigned int, GetConstNumberOfWeightsHackRecursiveBSplineType::Value );
114  itkGetStaticConstMacro( SplineOrder ),
115  itkGetStaticConstMacro( SpaceDimension ) > GetConstNumberOfIndicesHackType;
116  itkStaticConstMacro( NumberOfIndices, unsigned int, GetConstNumberOfIndicesHackType::Value );
117 
119  itkGetConstMacro( NumberOfWeights, unsigned int );
120 
122  itkGetConstMacro( NumberOfIndices, unsigned int );
123 
126  virtual WeightsType Evaluate( const ContinuousIndexType & index ) const;
127 
136  virtual void Evaluate( const ContinuousIndexType & index,
137  WeightsType & weights, IndexType & startIndex ) const;
138 
139  void EvaluateDerivative( const ContinuousIndexType & index,
140  WeightsType & weights, const IndexType & startIndex ) const;
141 
142  void EvaluateSecondOrderDerivative( const ContinuousIndexType & index,
143  WeightsType & weights, const IndexType & startIndex ) const;
144 
145 protected:
146 
149  void PrintSelf( std::ostream & os, Indent indent ) const;
150 
151 private:
152 
153  RecursiveBSplineInterpolationWeightFunction( const Self & ); // purposely not implemented
154  void operator=( const Self & ); // purposely not implemented
155 
157  unsigned int m_NumberOfWeights;
158  unsigned int m_NumberOfIndices;
159  SizeType m_SupportSize;
160 
165 
170 
171 };
172 
173 } // end namespace itk
174 
175 #ifndef ITK_MANUAL_INSTANTIATION
176 #include "itkRecursiveBSplineInterpolationWeightFunction.hxx"
177 #endif
178 
179 #endif
GetConstNumberOfIndicesHack< itkGetStaticConstMacro(SplineOrder), itkGetStaticConstMacro(SpaceDimension) > GetConstNumberOfIndicesHackType
BSplineSecondOrderDerivativeKernelFunction2< itkGetStaticConstMacro(SplineOrder) > SecondOrderDerivativeKernelType
BSplineKernelFunction2< itkGetStaticConstMacro(SplineOrder) > KernelType
BSplineDerivativeKernelFunction2< itkGetStaticConstMacro(SplineOrder) > DerivativeKernelType
GetConstNumberOfIndicesHack< SplineOrder, Dimension - 1 > OneDimensionLess
Returns the weights over the support region used for B-spline interpolation/reconstruction.
BSplineInterpolationWeightFunction< TCoordRep, VSpaceDimension, VSplineOrder > Superclass
B-spline kernel used for density estimation and nonparameteric regression.
Derivative of a B-spline kernel used for density estimation and nonparametric regression.
Derivative of a B-spline kernel used for density estimation and nonparametric regression.
itkStaticConstMacro(Value, unsigned int,(SplineOrder+1) *OneDimensionLess::Value)


Generated on OURCE_DATE_EPOCH for elastix by doxygen 1.8.13 elastix logo