From 4ae4c8a57a71c86165a9889e2569e249197f48c0 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Sat, 26 Oct 2019 11:29:39 +0200 Subject: [PATCH] #3309 BBTK Bug New Normal - Bug gdcmvtk - GetXCoherentInfoGdcmReader std - FilesFromDirectory --- .../bbgdcmvtkGetXCoherentInfoGdcmReader.cxx | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx index e553a67..e09b38a 100644 --- a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx +++ b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx @@ -144,6 +144,12 @@ void GetXCoherentInfoGdcmReader::Process() // Should only contain one! l = sh->GetFirstSingleSerieUIDFileSet(); + if (l==NULL) + { + printf("EED GetXCoherentInfoGdcmReader::Process Warnning not coherent list/file \n"); + return; + } + double zspacing = 0.; sh->OrderFileList(l); // this one should compute the *actual* Z Spacing! zspacing = sh->GetZSpacing(); @@ -168,7 +174,6 @@ void GetXCoherentInfoGdcmReader::Process() for ( ; iitt != l->end(); ++iitt) { MapInfoDicom mapinfodicom; - for (iTag=0; iTagSetFileName( bbGetInputIn()[0].c_str() ); - bool res = read->Read(); if ( !res ) { @@ -217,8 +221,6 @@ void GetXCoherentInfoGdcmReader::Process() return; } - - // Get info from the first image file const gdcm::File &f = read->GetFile(); int i; @@ -229,17 +231,17 @@ void GetXCoherentInfoGdcmReader::Process() gdcm::Element iop; iop.Read( ss ); for(i=0; i< 6; i++) - { + { v_iop.push_back((float)(iop[i])); - } + } bbSetOutputIOP(v_iop ); - std::vector v_ipp; + std::vector v_ipp; const gdcm::DataElement &deIpp = f.GetDataSet().GetDataElement(gdcm::Tag((0x0020,0x0032))); deIpp.GetValue().Print(ss); gdcm::Element ipp; ipp.Read( ss ); - for(i=0; i< 3; i++) + for(i=0; i< 3; i++) { v_ipp.push_back((float)(ipp[i])); } // for 3 @@ -287,7 +289,7 @@ void GetXCoherentInfoGdcmReader::Process() void GetXCoherentInfoGdcmReader::bbUserSetDefaultValues() { - reader=NULL; + reader=NULL; std::vector init; init.push_back(""); bbSetInputIn(init); -- 2.45.1