]> Creatis software - bbtk.git/blob - packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.h
GDCM vs GDCM2
[bbtk.git] / packages / gdcmvtk / src / bbgdcmvtkGetXCoherentInfoGdcmReader.h
1 #ifdef _USE_VTK_
2
3 #ifndef __bbgdcmvtkGetXCoherentInfoGdcmReader_h_INCLUDED__
4 #define __bbgdcmvtkGetXCoherentInfoGdcmReader_h_INCLUDED__
5
6 #include "bbgdcmvtk_EXPORT.h"
7 #include "bbtkAtomicBlackBox.h"
8 #include "iostream"
9
10 #if defined(USE_GDCM)
11 #include "vtkGdcmReader.h"
12 #endif
13
14 #if defined(USE_GDCM2)
15 #include "vtkGDCMImageReader.h"
16 #endif
17
18 #include "gdcmFile.h"
19 #include "gdcmSerieHelper.h"
20
21 #include "vtkImageData.h"
22 namespace bbgdcmvtk
23 {
24
25 class bbgdcmvtk_EXPORT GetXCoherentInfoGdcmReader
26  : 
27    public bbtk::AtomicBlackBox
28 {
29   BBTK_BLACK_BOX_INTERFACE(GetXCoherentInfoGdcmReader,bbtk::AtomicBlackBox);
30
31   BBTK_DECLARE_INPUT(In,            std::vector<std::string>);
32   BBTK_DECLARE_INPUT(IPPSort,       bool);
33   
34   BBTK_DECLARE_OUTPUT(Out,          vtkImageData *);
35   BBTK_DECLARE_OUTPUT(IPP,          std::vector<double>);
36   BBTK_DECLARE_OUTPUT(IOP,          std::vector<double>);
37   BBTK_DECLARE_OUTPUT(PixelSpacing, std::vector<double>);
38        
39   BBTK_PROCESS(Process);
40   void Process();
41   
42   private:
43
44 #if defined USE_GDCM
45                 GDCM_NAME_SPACE::File *f;
46                 GDCM_NAME_SPACE::SerieHelper *sh;
47                 vtkGdcmReader *reader;
48 #endif
49 #if defined USE_GDCM2
50                 vtkGDCMImageReader *reader;
51 #endif
52 };
53
54   //=================================================================
55   // UserBlackBox description
56 BBTK_BEGIN_DESCRIBE_BLACK_BOX(GetXCoherentInfoGdcmReader,bbtk::AtomicBlackBox);
57 BBTK_NAME("GetXCoherentInfoGdcmReader");
58 BBTK_AUTHOR("jpr, eduardo");
59 BBTK_DESCRIPTION("Get Dicom info from a File Set (a list of Dicom image file names) and read (as a vtkImageData)");
60 BBTK_CATEGORY("");
61
62 BBTK_INPUT(GetXCoherentInfoGdcmReader,In,     "List of Dicom image file names", std::vector<std::string>,"");
63 BBTK_INPUT(GetXCoherentInfoGdcmReader,IPPSort,"Sort on Image Position Patient",bool,"");
64
65 BBTK_OUTPUT(GetXCoherentInfoGdcmReader,Out,         "Output image",                vtkImageData *,"");
66 BBTK_OUTPUT(GetXCoherentInfoGdcmReader,IPP,         "Image Position (Patient)",    std::vector<double>,"");
67 BBTK_OUTPUT(GetXCoherentInfoGdcmReader,IOP,         "Image Orientation (Patient)", std::vector<double>,"");
68 BBTK_OUTPUT(GetXCoherentInfoGdcmReader,PixelSpacing,"Pixel Spacing",               std::vector<double>,"");
69 BBTK_END_DESCRIBE_BLACK_BOX(GetXCoherentInfoGdcmReader);
70 } // EO namespace bbgdcmvtk
71
72 #endif // __bbgdcmvtkGetXCoherentInfoGdcmReader_h_INCLUDED__
73
74 #endif //_USE_VTK_