1 #include "bbgdcmvtkGetInfoGdcmReader.h"
2 #include "bbgdcmvtkPackage.h"
5 #include "gdcmFileHelper.h"
6 #include "vtkImageData.h"
7 #include "vtkGdcmReader.h"
13 BBTK_ADD_BLACK_BOX_TO_PACKAGE(gdcmvtk,GetInfoGdcmReader)
14 BBTK_BLACK_BOX_IMPLEMENTATION(GetInfoGdcmReader,bbtk::AtomicBlackBox);
15 void GetInfoGdcmReader::Process()
18 f = GDCM_NAME_SPACE::File::New();
19 f->SetFileName( bbGetInputIn() );
30 std::vector<double> v_iop;
32 f->GetImageOrientationPatient(iop);
34 v_iop.push_back(iop[i]);
35 bbSetOutputIOP(v_iop );
37 std::vector<double> v_ipp;
39 f->GetImagePositionPatient(ipp);
41 v_ipp.push_back(ipp[i]);
42 bbSetOutputIPP(v_ipp );
44 std::vector<double> v_pixelspacing;
45 v_pixelspacing.push_back(f->GetXSpacing());
46 v_pixelspacing.push_back(f->GetYSpacing());
47 if (f->GetZSize() != 1) {
48 v_pixelspacing.push_back(f->GetZSpacing());
50 bbSetOutputPixelSpacing(v_pixelspacing);
53 bbSetOutputInterSlice(f->GetZSpacing());
55 reader = vtkGdcmReader::New();
56 reader->SetFileName( bbGetInputIn().c_str() );
61 reader->GetOutput()->PrintSelf(std::cout, indent);
62 bbSetOutputOut( reader->GetOutput() );
65 void GetInfoGdcmReader::bbUserConstructor()
67 std::cout << "entree ds GetInfoGdcmReader::bbUserConstructor()" << std::endl;
71 void GetInfoGdcmReader::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
75 void GetInfoGdcmReader::bbUserDestructor()
84 // EO namespace bbgdcmvtk