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() );
27 // Get info from the image file
29 std::vector<double> v_iop;
31 f->GetImageOrientationPatient(iop);
33 v_iop.push_back(iop[i]);
34 bbSetOutputIOP(v_iop );
36 std::vector<double> v_ipp;
38 f->GetImagePositionPatient(ipp);
40 v_ipp.push_back(ipp[i]);
41 bbSetOutputIPP(v_ipp );
43 std::vector<double> v_pixelspacing;
44 v_pixelspacing.push_back(f->GetXSpacing());
45 v_pixelspacing.push_back(f->GetYSpacing());
46 if (f->GetZSize() != 1) {
47 v_pixelspacing.push_back(f->GetZSpacing());
49 bbSetOutputPixelSpacing(v_pixelspacing);
52 bbSetOutputInterSlice(f->GetZSpacing());
54 reader = vtkGdcmReader::New();
55 reader->SetFileName( bbGetInputIn().c_str() );
60 reader->GetOutput()->PrintSelf(std::cout, indent);
61 bbSetOutputOut( reader->GetOutput() );
64 void GetInfoGdcmReader::bbUserConstructor()
69 void GetInfoGdcmReader::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
73 void GetInfoGdcmReader::bbUserDestructor()
82 // EO namespace bbgdcmvtk