]> Creatis software - clitk.git/blob - tools/clitkWarpImageGenericFilter.h
With ITKv5, change VectorResample and VectorCast Image Filter to Resample and Cast...
[clitk.git] / tools / clitkWarpImageGenericFilter.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 clitkWarpImageGenericFilter_h
19 #define clitkWarpImageGenericFilter_h
20
21 /* =================================================
22  * @file   clitkWarpImageGenericFilter.h
23  * @author 
24  * @date   
25  * 
26  * @brief 
27  * 
28  ===================================================*/
29
30
31 // clitk include
32 #include "clitkIO.h"
33 #include "clitkCommon.h"
34 #include "clitkWarpImage_ggo.h"
35 #include "clitkForwardWarpImageFilter.h"
36 #include "clitkGenericInterpolator.h"
37 #include "clitkGenericVectorInterpolator.h"
38
39 //itk include
40 #include "itkLightObject.h"
41 #include "itkWarpImageFilter.h"
42 #if ( ITK_VERSION_MAJOR < 5 )
43 #include "itkVectorResampleImageFilter.h"
44 #else
45 #include "itkResampleImageFilter.h"
46 #endif
47
48 namespace clitk 
49 {
50
51
52   class ITK_EXPORT WarpImageGenericFilter : public itk::LightObject
53   {
54   public:
55     //----------------------------------------
56     // ITK
57     //----------------------------------------
58     typedef WarpImageGenericFilter                   Self;
59     typedef itk::LightObject                   Superclass;
60     typedef itk::SmartPointer<Self>            Pointer;
61     typedef itk::SmartPointer<const Self>      ConstPointer;
62    
63     // Method for creation through the object factory
64     itkNewMacro(Self);  
65
66     // Run-time type information (and related methods)
67     itkTypeMacro( WarpImageGenericFilter, LightObject );
68
69
70     //----------------------------------------
71     // Typedefs
72     //----------------------------------------
73
74
75     //----------------------------------------
76     // Set & Get
77     //----------------------------------------    
78     void SetArgsInfo(const args_info_clitkWarpImage & a)
79     {
80       m_ArgsInfo=a;
81       m_Verbose=m_ArgsInfo.verbose_flag;
82       m_InputFileName=m_ArgsInfo.input_arg;
83     }
84     
85     
86     //----------------------------------------  
87     // Update
88     //----------------------------------------  
89     void Update();
90
91   protected:
92
93     //----------------------------------------  
94     // Constructor & Destructor
95     //----------------------------------------  
96     WarpImageGenericFilter();
97     ~WarpImageGenericFilter() {};
98
99     
100     //----------------------------------------  
101     // Templated members
102     //----------------------------------------  
103     template <unsigned int Dimension>  void UpdateWithDim(std::string PixelType);
104     template <unsigned int Dimension, class PixelType>  void UpdateWithDimAndPixelType();
105
106     //----------------------------------------  
107     // Data members
108     //----------------------------------------
109     args_info_clitkWarpImage m_ArgsInfo;
110     bool m_Verbose;
111     std::string m_InputFileName;
112
113   };
114
115
116 } // end namespace clitk
117
118 #ifndef ITK_MANUAL_INSTANTIATION
119 #include "clitkWarpImageGenericFilter.txx"
120 #endif
121
122 #endif // #define clitkWarpImageGenericFilter_h