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