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 bbUserFinalizeProcessing();
20 f = GDCM_NAME_SPACE::File::New();
21 f->SetFileName( bbGetInputIn() );
29 // Get info from THE image file (only *one* as input)
31 std::vector<double> v_iop;
33 f->GetImageOrientationPatient(iop);
36 v_iop.push_back(iop[i]);
37 bbSetOutputIOP(v_iop );
39 std::vector<double> v_ipp;
41 f->GetImagePositionPatient(ipp);
44 v_ipp.push_back(ipp[i]);
45 bbSetOutputIPP(v_ipp );
47 std::vector<double> v_pixelspacing;
48 v_pixelspacing.push_back(f->GetXSpacing());
49 v_pixelspacing.push_back(f->GetYSpacing());
51 if (f->GetZSize() != 1)
53 v_pixelspacing.push_back(f->GetZSpacing());
55 bbSetOutputPixelSpacing(v_pixelspacing);
58 bbSetOutputInterSlice(f->GetZSpacing());
60 reader = vtkGdcmReader::New();
61 reader->SetFileName( bbGetInputIn().c_str() );
66 reader->GetOutput()->PrintSelf(std::cout, indent);
67 bbSetOutputOut( reader->GetOutput() );
70 void GetInfoGdcmReader::bbUserSetDefaultValues()
77 void GetInfoGdcmReader::bbUserInitializeProcessing()
83 void GetInfoGdcmReader::bbUserFinalizeProcessing()
98 // EO namespace bbgdcmvtk