go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkBSplineInterpolationWeightFunctionBase.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 itkBSplineInterpolationWeightFunctionBase_h
19#define itkBSplineInterpolationWeightFunctionBase_h
20
21#include "itkFunctionBase.h"
22#include "itkContinuousIndex.h"
23#include "itkArray.h"
24#include "itkArray2D.h"
25#include "itkMath.h"
26#include "itkMatrix.h"
28#include "itkBSplineDerivativeKernelFunction.h"
30
31namespace itk
32{
49template <class TCoordRep = float, unsigned int VSpaceDimension = 2, unsigned int VSplineOrder = 3>
51 : public FunctionBase<ContinuousIndex<TCoordRep, VSpaceDimension>,
52 FixedArray<double, Math::UnsignedPower(VSplineOrder + 1, VSpaceDimension)>>
53{
54public:
56
59 using Superclass = FunctionBase<ContinuousIndex<TCoordRep, VSpaceDimension>,
60 FixedArray<double, Math::UnsignedPower(VSplineOrder + 1, VSpaceDimension)>>;
61 using Pointer = SmartPointer<Self>;
62 using ConstPointer = SmartPointer<const Self>;
63
65 itkTypeMacro(BSplineInterpolationWeightFunctionBase, FunctionBase);
66
68 itkStaticConstMacro(SpaceDimension, unsigned int, VSpaceDimension);
69
71 itkStaticConstMacro(SplineOrder, unsigned int, VSplineOrder);
72
74 static constexpr unsigned long NumberOfWeights = Math::UnsignedPower(VSplineOrder + 1, VSpaceDimension);
75
77 using WeightsType = FixedArray<double, NumberOfWeights>;
78
80 using IndexType = Index<VSpaceDimension>;
81 using SizeType = Size<VSpaceDimension>;
82
84 using ContinuousIndexType = ContinuousIndex<TCoordRep, VSpaceDimension>;
85
88 Evaluate(const ContinuousIndexType & index) const override;
89
97 virtual void
98 Evaluate(const ContinuousIndexType & cindex, const IndexType & startIndex, WeightsType & weights) const;
99
101 void
102 ComputeStartIndex(const ContinuousIndexType & index, IndexType & startIndex) const;
103
105 itkGetConstReferenceMacro(SupportSize, SizeType);
106
108 itkGetConstMacro(NumberOfWeights, unsigned long);
109
110protected:
113
117 using DerivativeKernelType = BSplineDerivativeKernelFunction<VSplineOrder>;
118 using DerivativeKernelPointer = typename DerivativeKernelType::Pointer;
122
124 using TableType = Array2D<unsigned long>;
125
130 using OneDWeightsType = Matrix<double, Self::SpaceDimension, VSplineOrder + 1>;
131
133 virtual void
135 const IndexType & startIndex,
136 OneDWeightsType & weights1D) const = 0;
137
139 void
140 PrintSelf(std::ostream & os, Indent indent) const override;
141
143 unsigned long m_NumberOfWeights;
146
147private:
149 void
151
156 void
158};
159
160} // end namespace itk
161
162#ifndef ITK_MANUAL_INSTANTIATION
163# include "itkBSplineInterpolationWeightFunctionBase.hxx"
164#endif
165
166#endif
Returns the weights over the support region used for B-spline interpolation/reconstruction.
virtual void Evaluate(const ContinuousIndexType &cindex, const IndexType &startIndex, WeightsType &weights) const
itkStaticConstMacro(SplineOrder, unsigned int, VSplineOrder)
~BSplineInterpolationWeightFunctionBase() override=default
WeightsType Evaluate(const ContinuousIndexType &index) const override
ITK_DISALLOW_COPY_AND_MOVE(BSplineInterpolationWeightFunctionBase)
virtual void Compute1DWeights(const ContinuousIndexType &index, const IndexType &startIndex, OneDWeightsType &weights1D) const =0
itkStaticConstMacro(SpaceDimension, unsigned int, VSpaceDimension)
void PrintSelf(std::ostream &os, Indent indent) const override
BSplineDerivativeKernelFunction< VSplineOrder > DerivativeKernelType
typename SecondOrderDerivativeKernelType::Pointer SecondOrderDerivativeKernelPointer
Matrix< double, Self::SpaceDimension, VSplineOrder+1 > OneDWeightsType
FunctionBase< ContinuousIndex< TCoordRep, VSpaceDimension >, FixedArray< double, Math::UnsignedPower(VSplineOrder+1, VSpaceDimension)> > Superclass
ContinuousIndex< TCoordRep, VSpaceDimension > ContinuousIndexType
void ComputeStartIndex(const ContinuousIndexType &index, IndexType &startIndex) const
B-spline kernel used for density estimation and nonparameteric regression.
FixedArray< double, VSplineOrder+1 > WeightArrayType
Derivative of a B-spline kernel used for density estimation and nonparametric regression.


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo