]> Creatis software - clitk.git/blob - tools/clitkImage2DicomGenericFilter.h
Add 2 options to clitkImage2Dicom
[clitk.git] / tools / clitkImage2DicomGenericFilter.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 clitkImage2DicomGenericFilter_h
19 #define clitkImage2DicomGenericFilter_h
20
21 /* =================================================
22  * @file   clitkImage2DicomGenericFilter.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 "clitkImage2Dicom_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 <vector>
44 #include <itksys/SystemTools.hxx>
45
46 #include "itkImage.h"
47 #include "itkMinimumMaximumImageFilter.h"
48  
49 #include "itkGDCMImageIO.h"
50 #include "itkGDCMSeriesFileNames.h"
51 #include "itkNumericSeriesFileNames.h"
52  
53 #include "itkImageSeriesReader.h"
54 #include "itkImageSeriesWriter.h"
55  
56 #include "itkResampleImageFilter.h"
57  
58 #if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR < 6 ) )
59 #include "itkShiftScaleImageFilter.h"
60 #endif
61  
62 #include "itkIdentityTransform.h"
63 #include "itkLinearInterpolateImageFunction.h"
64  
65 #include <itksys/SystemTools.hxx>
66  
67 #if ITK_VERSION_MAJOR >= 4
68 #include "gdcmUIDGenerator.h"
69 #else
70 #include "gdcm/src/gdcmFile.h"
71 #include "gdcm/src/gdcmUtil.h"
72 #endif
73  
74 #include <string>
75 #include <sstream>
76
77 namespace clitk 
78 {
79   template<class args_info_type>
80   class ITK_EXPORT Image2DicomGenericFilter : public itk::LightObject
81   {
82   public:
83     //----------------------------------------
84     // ITK
85     //----------------------------------------
86     typedef Image2DicomGenericFilter                   Self;
87     typedef itk::LightObject                   Superclass;
88     typedef itk::SmartPointer<Self>            Pointer;
89     typedef itk::SmartPointer<const Self>      ConstPointer;
90    
91     // Method for creation through the object factory
92     itkNewMacro(Self);  
93
94     // Run-time type information (and related methods)
95     itkTypeMacro( Image2DicomGenericFilter, LightObject );
96
97
98     //----------------------------------------
99     // Typedefs
100     //----------------------------------------
101
102
103     //----------------------------------------
104     // Set & Get
105     //----------------------------------------    
106     void SetArgsInfo(const args_info_type & a)
107     {
108       m_ArgsInfo=a;
109       m_Verbose=m_ArgsInfo.verbose_flag;
110       m_InputFileName=m_ArgsInfo.input_arg;
111     }
112     
113     
114     //----------------------------------------  
115     // Update
116     //----------------------------------------  
117     void Update();
118
119   protected:
120
121     //----------------------------------------  
122     // Constructor & Destructor
123     //----------------------------------------  
124     Image2DicomGenericFilter();
125     ~Image2DicomGenericFilter() {};
126
127     
128     //void CopyDictionary (itk::MetaDataDictionary &fromDict, itk::MetaDataDictionary &toDict);
129     //----------------------------------------  
130     // Templated members
131     //----------------------------------------  
132     template <unsigned int inputDimension, unsigned int outputDimension>  void UpdateWithDim(std::string PixelType);
133     template <unsigned int inputDimension, unsigned int outputDimension, class PixelType>  void UpdateWithDimAndPixelType();
134     
135     
136      //----------------------------------------  
137     // Data members
138     //----------------------------------------
139     args_info_type m_ArgsInfo;
140     bool m_Verbose;
141     std::string m_InputFileName;
142
143   };
144
145
146 } // end namespace clitk
147
148 #ifndef ITK_MANUAL_INSTANTIATION
149 #include "clitkImage2DicomGenericFilter.txx"
150 #endif
151
152 #endif // #define clitkImage2DicomGenericFilter_h