]> Creatis software - clitk.git/blob - tools/clitkImage2DicomDoseGenericFilter.h
Add output dicom filename to clitkImage2Dicom
[clitk.git] / tools / clitkImage2DicomDoseGenericFilter.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 clitkImage2DicomDoseGenericFilter_h
19 #define clitkImage2DicomDoseGenericFilter_h
20
21 /* =================================================
22  * @file   clitkImage2DicomDoseGenericFilter.h
23  * @author 
24  * @date   
25  * 
26  * @brief 
27  * 
28  ===================================================*/
29
30
31 // clitk include
32 #include "clitkIO.h"
33 #include "clitkImageCommon.h"
34 #include "clitkImage2DicomDose_ggo.h"
35
36 //itk include
37 #include "itkLightObject.h"
38 #include "itkGDCMImageIO.h"
39 #include "itkMetaDataDictionary.h"
40 #include "itkGDCMSeriesFileNames.h"
41 #include "itkImageSeriesReader.h"
42 #include "itkImageSeriesWriter.h"
43 #include "itkImageFileReader.h"
44 #include "itkImageFileWriter.h"
45 #include <vector>
46 #include <itksys/SystemTools.hxx>
47
48 namespace clitk 
49 {
50   template<class args_info_type>
51   class ITK_EXPORT Image2DicomDoseGenericFilter : public itk::LightObject
52   {
53
54   public:
55     //----------------------------------------
56     // ITK
57     //----------------------------------------
58     typedef Image2DicomDoseGenericFilter   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( Image2DicomDoseGenericFilter, LightObject );
68
69     //methods
70     //----------------------------------------
71     // Set & Get
72     //----------------------------------------    
73     void SetArgsInfo(const args_info_type & a)
74     {
75       m_ArgsInfo=a;
76       m_Verbose=m_ArgsInfo.verbose_flag;
77       m_InputFileName=m_ArgsInfo.input_arg;
78     }
79
80     //----------------------------------------  
81     // Update
82     //----------------------------------------  
83     void Update();
84
85   protected:
86     //----------------------------------------  
87     // Constructor & Destructor
88     //----------------------------------------  
89     Image2DicomDoseGenericFilter();
90     ~Image2DicomDoseGenericFilter() {};
91
92     //----------------------------------------  
93     // Templated members
94     //----------------------------------------  
95     template <unsigned int Dimension>  void UpdateWithDim(std::string PixelType);
96     template <unsigned int Dimension, class PixelType>  void UpdateWithDimAndPixelType();
97
98
99     gdcm::File * mDCMFile;
100
101     //----------------------------------------  
102     // Data members
103     //----------------------------------------
104     args_info_type m_ArgsInfo;
105     bool m_Verbose;
106     std::string m_InputFileName;
107
108   };
109
110   //Usefull functions
111   void CopyDictionary (itk::MetaDataDictionary &fromDict, itk::MetaDataDictionary &toDict);
112   template <typename T> std::string NumberToString ( T Number );
113
114 } // end namespace clitk
115
116 #ifndef ITK_MANUAL_INSTANTIATION
117 #include "clitkImage2DicomDoseGenericFilter.txx"
118 #endif
119
120 #endif // #define clitkImage2DicomDoseGenericFilter_h