itkBSplineInterpolationWeightFunction.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkBSplineInterpolationWeightFunction_h
00018 #define __itkBSplineInterpolationWeightFunction_h
00019
00020 #include "itkFunctionBase.h"
00021 #include "itkContinuousIndex.h"
00022 #include "itkBSplineKernelFunction.h"
00023 #include "itkArray.h"
00024 #include "itkArray2D.h"
00025
00026 namespace itk
00027 {
00028
00045 template <
00046 class TCoordRep = float,
00047 unsigned int VSpaceDimension = 2,
00048 unsigned int VSplineOrder = 3
00049 >
00050 class ITK_EXPORT BSplineInterpolationWeightFunction :
00051 public FunctionBase< ContinuousIndex<TCoordRep,VSpaceDimension>,
00052 Array<double> >
00053 {
00054 public:
00056 typedef BSplineInterpolationWeightFunction Self;
00057 typedef FunctionBase< ContinuousIndex<TCoordRep,VSpaceDimension>,
00058 Array<double> > Superclass;
00059 typedef SmartPointer<Self> Pointer;
00060 typedef SmartPointer<const Self> ConstPointer;
00061
00063 itkNewMacro( Self );
00064
00066 itkTypeMacro(BSplineInterpolationWeightFunction, FunctionBase);
00067
00069 itkStaticConstMacro(SpaceDimension, unsigned int, VSpaceDimension);
00070
00072 itkStaticConstMacro(SplineOrder, unsigned int, VSplineOrder);
00073
00075 typedef Array<double> WeightsType;
00076
00078 typedef Index<VSpaceDimension> IndexType;
00079 typedef Size<VSpaceDimension> SizeType;
00080
00082 typedef ContinuousIndex<TCoordRep,VSpaceDimension> ContinuousIndexType;
00083
00086 virtual WeightsType Evaluate( const ContinuousIndexType & index ) const;
00087
00096 virtual void Evaluate( const ContinuousIndexType & index,
00097 WeightsType & weights, IndexType & startIndex ) const;
00098
00100 itkGetConstMacro( SupportSize, SizeType );
00101
00103 itkGetConstMacro( NumberOfWeights, unsigned long );
00104
00105 protected:
00106 BSplineInterpolationWeightFunction();
00107 ~BSplineInterpolationWeightFunction() {}
00108 void PrintSelf(std::ostream& os, Indent indent) const;
00109
00110 private:
00111 BSplineInterpolationWeightFunction(const Self&);
00112 void operator=(const Self&);
00113
00115 unsigned long m_NumberOfWeights;
00116
00118 SizeType m_SupportSize;
00119
00121 typedef Array2D<unsigned long> TableType;
00122
00124 TableType m_OffsetToIndexTable;
00125
00127 typedef BSplineKernelFunction<itkGetStaticConstMacro(SplineOrder)> KernelType;
00128
00130 typename KernelType::Pointer m_Kernel;
00131
00132 };
00133
00134 }
00135
00136
00137 #define ITK_TEMPLATE_BSplineInterpolationWeightFunction(_, EXPORT, x, y) namespace itk { \
00138 _(3(class EXPORT BSplineInterpolationWeightFunction< ITK_TEMPLATE_3 x >)) \
00139 namespace Templates { typedef BSplineInterpolationWeightFunction< ITK_TEMPLATE_3 x > BSplineInterpolationWeightFunction##y; } \
00140 }
00141
00142 #if ITK_TEMPLATE_EXPLICIT
00143 # include "Templates/itkBSplineInterpolationWeightFunction+-.h"
00144 #endif
00145
00146 #if ITK_TEMPLATE_TXX
00147 # include "itkBSplineInterpolationWeightFunction.txx"
00148 #endif
00149
00150
00151 #endif
00152