18 #ifndef __itkBSplineInterpolationWeightFunctionBase_h
19 #define __itkBSplineInterpolationWeightFunctionBase_h
21 #include "itkFunctionBase.h"
22 #include "itkContinuousIndex.h"
24 #include "itkArray2D.h"
25 #include "itkMatrix.h"
27 #include "itkBSplineDerivativeKernelFunction.h"
34 template<
unsigned int SplineOrder,
unsigned int Dimension >
35 class GetConstNumberOfWeightsHack
39 typedef GetConstNumberOfWeightsHack< SplineOrder, Dimension - 1 > OneDimensionLess;
40 itkStaticConstMacro( Value,
unsigned long, ( SplineOrder + 1 ) * OneDimensionLess::Value );
44 template<
unsigned int SplineOrder >
45 class GetConstNumberOfWeightsHack< SplineOrder, 0 >
49 itkStaticConstMacro( Value,
unsigned long, 1 );
68 template<
class TCoordRep =
float,
69 unsigned int VSpaceDimension = 2,
70 unsigned int VSplineOrder = 3 >
72 public FunctionBase< ContinuousIndex< TCoordRep, VSpaceDimension >, Array< double > >
79 ContinuousIndex< TCoordRep, VSpaceDimension >,
94 typedef GetConstNumberOfWeightsHack<
95 itkGetStaticConstMacro( SplineOrder ),
96 itkGetStaticConstMacro( SpaceDimension ) > GetConstNumberOfWeightsHackType;
97 itkStaticConstMacro( NumberOfWeights,
unsigned long, GetConstNumberOfWeightsHackType::Value );
110 virtual WeightsType
Evaluate(
const ContinuousIndexType & index )
const;
119 virtual void Evaluate(
const ContinuousIndexType & cindex,
120 const IndexType & startIndex, WeightsType & weights )
const;
124 IndexType & startIndex )
const;
127 itkGetConstReferenceMacro( SupportSize, SizeType );
130 itkGetConstMacro( NumberOfWeights,
unsigned long );
154 itkGetStaticConstMacro( SpaceDimension ),
159 const ContinuousIndexType & index,
160 const IndexType & startIndex,
164 virtual void PrintSelf( std::ostream & os, Indent indent )
const;
194 #ifndef ITK_MANUAL_INSTANTIATION
195 #include "itkBSplineInterpolationWeightFunctionBase.hxx"
Matrix< double, itkGetStaticConstMacro(SpaceDimension), itkGetStaticConstMacro(SplineOrder)+1 > OneDWeightsType
SecondOrderDerivativeKernelType::Pointer SecondOrderDerivativeKernelPointer
ContinuousIndex< TCoordRep, VSpaceDimension > ContinuousIndexType
Size< VSpaceDimension > SizeType
DerivativeKernelType::Pointer m_DerivativeKernel
virtual WeightsType Evaluate(const ContinuousIndexType &index) const
void InitializeOffsetToIndexTable(void)
BSplineSecondOrderDerivativeKernelFunction2< Self::SplineOrder > SecondOrderDerivativeKernelType
TableType m_OffsetToIndexTable
BSplineDerivativeKernelFunction< Self::SplineOrder > DerivativeKernelType
~BSplineInterpolationWeightFunctionBase()
Array< double > WeightsType
KernelType::Pointer m_Kernel
SmartPointer< const Self > ConstPointer
BSplineInterpolationWeightFunctionBase()
SecondOrderDerivativeKernelType::Pointer m_SecondOrderDerivativeKernel
void ComputeStartIndex(const ContinuousIndexType &index, IndexType &startIndex) const
void InitializeSupport(void)
unsigned long m_NumberOfWeights
BSplineKernelFunction2< Self::SplineOrder > KernelType
DerivativeKernelType::Pointer DerivativeKernelPointer
itkStaticConstMacro(SpaceDimension, unsigned int, VSpaceDimension)
KernelType::WeightArrayType WeightArrayType
Array2D< unsigned long > TableType
SmartPointer< Self > Pointer
Index< VSpaceDimension > IndexType
KernelType::Pointer KernelPointer
virtual void PrintSelf(std::ostream &os, Indent indent) const
FunctionBase< ContinuousIndex< TCoordRep, VSpaceDimension >, Array< double > > Superclass
FixedArray< double, itkGetStaticConstMacro(SplineOrder)+1 > WeightArrayType
B-spline kernel used for density estimation and nonparameteric regression.
virtual void Compute1DWeights(const ContinuousIndexType &index, const IndexType &startIndex, OneDWeightsType &weights1D) const =0
BSplineInterpolationWeightFunctionBase Self
Returns the weights over the support region used for B-spline interpolation/reconstruction.
Derivative of a B-spline kernel used for density estimation and nonparametric regression.
void operator=(const Self &)