]> Creatis software - clitk.git/blob - itk/clitkGenericVectorInterpolator.h
cleanup / better handling of errors
[clitk.git] / itk / clitkGenericVectorInterpolator.h
1 #ifndef __clitkGenericVectorInterpolator_h
2 #define __clitkGenericVectorInterpolator_h
3
4 //clitk include
5 #include "clitkImageCommon.h"
6
7 //itk include
8 #include "itkVectorNearestNeighborInterpolateImageFunction.h"
9 #include "itkVectorLinearInterpolateImageFunction.h"
10 #include "clitkVectorBSplineInterpolateImageFunction.h"
11 #include "clitkVectorBSplineInterpolateImageFunctionWithLUT.h"
12
13 /*
14
15 Requires at least the following section is the .ggo file
16
17 option "interpVF"               -       "Interpolation: 0=NN, 1=Linear, 2=BSpline, 3=BLUT"      int     no  default="1"
18 option "interpVFOrder"  -       "Order if BLUT or BSpline (0-5)"                        int     no  default="3"
19 option "interpVFSF"     -       "Sampling factor if BLUT"                               int     no  default="20"
20
21 */
22
23 namespace clitk
24 {
25   
26   template <class args_info_type,   class ImageType,  class TCoordRep >  
27   class GenericVectorInterpolator : public itk::LightObject
28   {
29   public:
30     //==============================================
31     typedef GenericVectorInterpolator     Self;
32     typedef itk::LightObject     Superclass;
33     typedef itk::SmartPointer<Self>            Pointer;
34     typedef itk::SmartPointer<const Self>      ConstPointer;
35
36     typedef itk::VectorInterpolateImageFunction<ImageType, TCoordRep> InterpolatorType;
37     typedef typename InterpolatorType::Pointer InterpolatorPointer;   
38      
39     /** Method for creation through the object factory. */
40     itkNewMacro(Self);  
41   
42     //============================================== 
43     //Set members
44     void SetArgsInfo(args_info_type args_info)
45     {
46       m_ArgsInfo= args_info;
47       m_Verbose=m_ArgsInfo.verbose_flag;
48     }
49
50     //============================================== 
51     //Get members
52     InterpolatorPointer GetInterpolatorPointer(void);
53     
54     //==============================================
55   protected:
56     GenericVectorInterpolator();
57     ~GenericVectorInterpolator() {};
58
59   private:
60     args_info_type m_ArgsInfo;
61     InterpolatorPointer m_Interpolator;
62     bool m_Verbose;
63   };
64
65 } // end namespace clitk
66 #ifndef ITK_MANUAL_INSTANTIATION
67 #include "clitkGenericVectorInterpolator.txx"
68 #endif
69
70 #endif // #define __clitkGenericVectorInterpolator_h