]> Creatis software - clitk.git/blob - registration/clitkGenericVectorInterpolator.h
73bfa96b6b4360d9b71e7fd140b39b6c061ea732
[clitk.git] / registration / clitkGenericVectorInterpolator.h
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://www.centreleonberard.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ===========================================================================**/
18 #ifndef __clitkGenericVectorInterpolator_h
19 #define __clitkGenericVectorInterpolator_h
20 #include "clitkImageCommon.h"
21
22 //itk include
23 #include "itkVectorNearestNeighborInterpolateImageFunction.h"
24 #include "itkVectorLinearInterpolateImageFunction.h"
25 #include "clitkVectorBSplineInterpolateImageFunction.h"
26 #include "clitkVectorBSplineInterpolateImageFunctionWithLUT.h"
27
28 /*
29
30 Requires at least the following section is the .ggo file
31
32 option "interpVF"               -       "Interpolation: 0=NN, 1=Linear, 2=BSpline, 3=BLUT"      int     no  default="1"
33 option "interpVFOrder"  -       "Order if BLUT or BSpline (0-5)"                        int     no  default="3"
34 option "interpVFSF"     -       "Sampling factor if BLUT"                               int     no  default="20"
35
36 The use will look something like
37
38 typedef clitk::GenericVectorInterpolator<InputImageType, double> GenericVectorInterpolatorType;
39 typename GenericVectorInterpolatorType::Pointer genericInterpolator=GenericVectorInterpolatorType::New();
40 genericInterpolator->SetArgsInfo(m_ArgsInfo);
41 typedef itk::VectorInterpolateImageFunction<InputImageType, double> InterpolatorType; 
42 typename InterpolatorType::Pointer interpolator=genericInterpolator->GetInterpolatorPointer();
43
44 */
45
46 namespace clitk
47 {
48   
49   template <class args_info_type,   class ImageType,  class TCoordRep >  
50   class GenericVectorInterpolator : public itk::LightObject
51   {
52   public:
53     //==============================================
54     typedef GenericVectorInterpolator     Self;
55     typedef itk::LightObject     Superclass;
56     typedef itk::SmartPointer<Self>            Pointer;
57     typedef itk::SmartPointer<const Self>      ConstPointer;
58
59     typedef itk::VectorInterpolateImageFunction<ImageType, TCoordRep> InterpolatorType;
60     typedef typename InterpolatorType::Pointer InterpolatorPointer;   
61      
62     /** Method for creation through the object factory. */
63     itkNewMacro(Self);  
64   
65     //============================================== 
66     //Set members
67     void SetArgsInfo(args_info_type args_info)
68     {
69       m_ArgsInfo= args_info;
70       m_Verbose=m_ArgsInfo.verbose_flag;
71     }
72
73     //============================================== 
74     //Get members
75     InterpolatorPointer GetInterpolatorPointer(void);
76     
77     //==============================================
78   protected:
79     GenericVectorInterpolator();
80     ~GenericVectorInterpolator() {};
81
82   private:
83     args_info_type m_ArgsInfo;
84     InterpolatorPointer m_Interpolator;
85     bool m_Verbose;
86   };
87
88 } // end namespace clitk
89 #ifndef ITK_MANUAL_INSTANTIATION
90 #include "clitkGenericVectorInterpolator.txx"
91 #endif
92
93 #endif // #define __clitkGenericVectorInterpolator_h