]> Creatis software - clitk.git/blob - registration/clitkCalculateTREGenericFilter.h
Debug RTStruct conversion with empty struc
[clitk.git] / registration / clitkCalculateTREGenericFilter.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 clitkCalculateTREGenericFilter_h
19 #define clitkCalculateTREGenericFilter_h
20
21 /* =================================================
22  * @file   clitkCalculateTREGenericFilter.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 "clitkCalculateTRE_ggo.h"
35 #include "clitkGenericVectorInterpolator.h"
36 #include "clitkPointListWriter.h"
37 #include "clitkPointListReader.h"
38 #include "clitkDeformationListStatisticsFilter.h"
39 #include "clitkList.h"
40
41 //itk include
42 #include "itkLightObject.h"
43 #include "itkExtractImageFilter.h"
44
45 //general
46 #include <iomanip>
47
48 namespace clitk 
49 {
50
51
52   class ITK_EXPORT CalculateTREGenericFilter : public itk::LightObject
53   {
54   public:
55     //----------------------------------------
56     // ITK
57     //----------------------------------------
58     typedef CalculateTREGenericFilter                   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( CalculateTREGenericFilter, LightObject );
68
69
70     //-----------------------------
71     // Typedefs
72     //-----------------------------
73     typedef double ValueType;
74     typedef std::vector<ValueType> MeasureListType;
75
76
77     //----------------------------------------
78     // Set & Get
79     //----------------------------------------    
80     void SetArgsInfo(const args_info_clitkCalculateTRE& a)
81     {
82       m_ArgsInfo=a;
83       m_Verbose=m_ArgsInfo.verbose_flag;
84     }
85     
86     
87     //----------------------------------------  
88     // Update
89     //----------------------------------------  
90     void Update();
91
92   protected:
93
94     //----------------------------------------  
95     // Constructor & Destructor
96     //----------------------------------------  
97     CalculateTREGenericFilter();
98     ~CalculateTREGenericFilter() {};
99
100     
101     //----------------------------------------  
102     // Templated members
103     //----------------------------------------  
104     template <unsigned int Dimension,unsigned int Components> void ReadVectorFields(void);
105     template <unsigned int Dimension,unsigned int Components> void ProcessVectorFields(std::vector< typename itk::Image<itk::Vector<double, Components>, Dimension>::Pointer > dvfs, char** filenames);
106     template <unsigned int Dimension> void UpdateDVFWithDim( std::vector<typename itk::Image<itk::Vector<ValueType, Dimension>, Dimension>::Pointer > dvfs,  std::vector<std::string> filenames);
107     template <unsigned int Dimension,unsigned int Components> void ReadCoefficientImages(void);
108     template <unsigned int Dimension,unsigned int Components> void ProcessCoefficientImages(std::vector< typename itk::Image<itk::Vector<double, Components>, Dimension>::Pointer > dvfs, char** filenames);
109     template <unsigned int Dimension> void UpdateCoeffsWithDim( std::vector<typename itk::Image<itk::Vector<ValueType, Dimension>, Dimension>::Pointer > dvfs,  std::vector<std::string> filenames);
110     template<unsigned int Dimension> void BuildPointLists(std::vector<std::string>& filenames);
111
112     //----------------------------------------  
113     // Data members
114     //----------------------------------------
115     args_info_clitkCalculateTRE m_ArgsInfo;
116     bool m_Verbose;
117     std::string m_InputFileName;
118     unsigned int m_NumberOfFields;
119     unsigned int m_NumberOfLists;
120     unsigned int m_NumberOfPoints;
121
122   };
123
124
125 } // end namespace clitk 
126
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "clitkCalculateTREGenericFilter.txx"
129 #endif
130
131 #endif // #define clitkCalculateTREGenericFilter_h