1 #ifndef __clitkGenericInterpolator_h
2 #define __clitkGenericInterpolator_h
5 #include "clitkIOCommon.h"
8 #include "itkNearestNeighborInterpolateImageFunction.h"
9 #include "itkLinearInterpolateImageFunction.h"
10 #include "itkBSplineInterpolateImageFunction.h"
11 #include "itkBSplineInterpolateImageFunctionWithLUT.h"
16 Requires at least the following section is the .ggo file
18 option "interp" - "Interpolation: 0=NN, 1=Linear, 2=BSpline, 3=BLUT" int no default="1"
19 option "interpOrder" - "Order if BLUT or BSpline (0-5)" int no default="3"
20 option "interpSF" - "Sampling factor if BLUT" int no default="20"
22 The use will something like
24 typedef clitk::GenericVectorInterpolator<InputImageType, double> GenericVectorInterpolatorType;
25 typename GenericVectorInterpolatorType::Pointer genericInterpolator=GenericVectorInterpolatorType::New();
26 genericInterpolator->SetArgsInfo(m_ArgsInfo);
27 typedef itk::VectorInterpolateImageFunction<InputImageType, double> InterpolatorType;
28 typename InterpolatorType::Pointer interpolator=genericInterpolator->GetInterpolatorPointer();
35 template <class args_info_type, class ImageType, class TCoordRep >
36 class GenericInterpolator : public itk::LightObject
39 //==============================================
40 typedef GenericInterpolator Self;
41 typedef itk::LightObject Superclass;
42 typedef itk::SmartPointer<Self> Pointer;
43 typedef itk::SmartPointer<const Self> ConstPointer;
45 typedef itk::InterpolateImageFunction<ImageType, TCoordRep> InterpolatorType;
46 typedef typename InterpolatorType::Pointer InterpolatorPointer;
48 /** Method for creation through the object factory. */
51 //==============================================
53 void SetArgsInfo(args_info_type args_info)
55 m_ArgsInfo= args_info;
56 m_Verbose=m_ArgsInfo.verbose_flag;
59 //==============================================
61 InterpolatorPointer GetInterpolatorPointer(void);
63 //==============================================
65 GenericInterpolator();
66 ~GenericInterpolator() {};
69 args_info_type m_ArgsInfo;
70 InterpolatorPointer m_Interpolator;
74 } // end namespace clitk
75 #ifndef ITK_MANUAL_INSTANTIATION
76 #include "clitkGenericInterpolator.txx"
79 #endif // #define __clitkGenericInterpolator_h