1 #ifndef __clitkGenericInterpolator_h
2 #define __clitkGenericInterpolator_h
3 #include "clitkImageCommon.h"
6 #include "itkNearestNeighborInterpolateImageFunction.h"
7 #include "itkLinearInterpolateImageFunction.h"
8 #include "itkBSplineInterpolateImageFunction.h"
9 #include "itkBSplineInterpolateImageFunctionWithLUT.h"
14 Requires at least the following section is the .ggo file
16 option "interp" - "Interpolation: 0=NN, 1=Linear, 2=BSpline, 3=BLUT" int no default="1"
17 option "interpOrder" - "Order if BLUT or BSpline (0-5)" int no default="3"
18 option "interpSF" - "Sampling factor if BLUT" int no default="20"
20 The use will something like
22 typedef clitk::GenericVectorInterpolator<InputImageType, double> GenericVectorInterpolatorType;
23 typename GenericVectorInterpolatorType::Pointer genericInterpolator=GenericVectorInterpolatorType::New();
24 genericInterpolator->SetArgsInfo(m_ArgsInfo);
25 typedef itk::VectorInterpolateImageFunction<InputImageType, double> InterpolatorType;
26 typename InterpolatorType::Pointer interpolator=genericInterpolator->GetInterpolatorPointer();
33 template <class args_info_type, class ImageType, class TCoordRep >
34 class GenericInterpolator : public itk::LightObject
37 //==============================================
38 typedef GenericInterpolator Self;
39 typedef itk::LightObject Superclass;
40 typedef itk::SmartPointer<Self> Pointer;
41 typedef itk::SmartPointer<const Self> ConstPointer;
43 typedef itk::InterpolateImageFunction<ImageType, TCoordRep> InterpolatorType;
44 typedef typename InterpolatorType::Pointer InterpolatorPointer;
46 /** Method for creation through the object factory. */
49 //==============================================
51 void SetArgsInfo(args_info_type args_info)
53 m_ArgsInfo= args_info;
54 m_Verbose=m_ArgsInfo.verbose_flag;
57 //==============================================
59 InterpolatorPointer GetInterpolatorPointer(void);
61 //==============================================
63 GenericInterpolator();
64 ~GenericInterpolator() {};
67 args_info_type m_ArgsInfo;
68 InterpolatorPointer m_Interpolator;
72 } // end namespace clitk
73 #ifndef ITK_MANUAL_INSTANTIATION
74 #include "clitkGenericInterpolator.txx"
77 #endif // #define __clitkGenericInterpolator_h