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 static constexpr SizeType SupportSize{ SizeType::Filled(VSplineOrder + 1) };
106
107protected:
110
114 using DerivativeKernelType = BSplineDerivativeKernelFunction<VSplineOrder>;
115 using DerivativeKernelPointer = typename DerivativeKernelType::Pointer;
119
124 using OneDWeightsType = Matrix<double, Self::SpaceDimension, VSplineOrder + 1>;
125
127 virtual void
129 const IndexType & startIndex,
130 OneDWeightsType & weights1D) const = 0;
131
133 void
134 PrintSelf(std::ostream & os, Indent indent) const override;
135
137 vnl_matrix<unsigned long> m_OffsetToIndexTable{};
138
139private:
144 void
146};
147
148} // end namespace itk
149
150#ifndef ITK_MANUAL_INSTANTIATION
151# include "itkBSplineInterpolationWeightFunctionBase.hxx"
152#endif
153
154#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
ContinuousIndex< TCoordRep, VSpaceDimension > ContinuousIndexType
FunctionBase< ContinuousIndex< TCoordRep, VSpaceDimension >, FixedArray< double, Math::UnsignedPower(VSplineOrder+1, VSpaceDimension)> > Superclass
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 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo