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