X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=packages%2Fgdcmvtk%2Fsrc%2FbbgdcmvtkGetXCoherentInfoGdcmReader.cxx;fp=packages%2Fgdcmvtk%2Fsrc%2FbbgdcmvtkGetXCoherentInfoGdcmReader.cxx;h=c1d16ba58fb15afc84ccce9badb0f3705362fa51;hb=1f305cb33157b21a82c7d0a97170ce09e580db0c;hp=751c683c37053cc58e3764e8db6d403ce42b4be8;hpb=5ff413fe20e5820f4442f44e78e2ecf68e7e9691;p=bbtk.git diff --git a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx index 751c683..c1d16ba 100644 --- a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx +++ b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx @@ -96,7 +96,7 @@ void GetXCoherentInfoGdcmReader::Process() f->SetFileName( bbGetInputIn()[0] ); } else { f->SetFileName( "" ); - } + } // if bool res = f->Load(); if ( !res ) @@ -105,7 +105,7 @@ void GetXCoherentInfoGdcmReader::Process() f->Delete(); bbSetOutputOut( CreateDefaultImage() ); return; - } + } // if res // Get info from the first image file int i; std::vector v_iop; @@ -113,7 +113,9 @@ void GetXCoherentInfoGdcmReader::Process() f->GetImageOrientationPatient(iop); for(i=0; i< 6; i++) + { v_iop.push_back(iop[i]); + } // for i bbSetOutputIOP(v_iop ); std::vector v_ipp; @@ -121,7 +123,9 @@ void GetXCoherentInfoGdcmReader::Process() f->GetImagePositionPatient(ipp); for(i=0; i< 3; i++) + { v_ipp.push_back(ipp[i]); + } // for i bbSetOutputIPP(v_ipp ); // Add *all the files* to the SerieHelper @@ -133,7 +137,7 @@ void GetXCoherentInfoGdcmReader::Process() ++it) { sh->AddFileName(*it); - } + } //for vector GDCM_NAME_SPACE::FileList::const_iterator it; @@ -143,10 +147,10 @@ void GetXCoherentInfoGdcmReader::Process() l = sh->GetFirstSingleSerieUIDFileSet(); int nbFiles; - double zspacing = 0.; - nbFiles = l->size() ; + double zspacing = 0.; + nbFiles = l->size() ; sh->OrderFileList(l); // this one should compute the *actual* Z Spacing! - zspacing = sh->GetZSpacing(); + zspacing = sh->GetZSpacing(); std::vector v_pixelspacing; v_pixelspacing.push_back( f->GetXSpacing() ); v_pixelspacing.push_back( f->GetYSpacing() ); @@ -155,21 +159,20 @@ void GetXCoherentInfoGdcmReader::Process() // v_pixelspacing.push_back(f->GetZSpacing()); // } bbSetOutputPixelSpacing(v_pixelspacing); - if (reader!=NULL) { reader->Delete(); - reader=NULL; + reader = NULL; } reader = vtkGdcmReader::New(); - //EED 21 mars 2012 FLIP probleme ..PLOP.. reader->SetFlipY(false); - - //reader->SetFileName( bbGetInputIn().c_str() ); reader->SetCoherentFileList(l); reader->Update(); + reader->GetOutput(); + +printf("EED GetXCoherentInfoGdcmReader::Process \n"); bbSetOutputOut( reader->GetOutput() ); } #endif @@ -202,7 +205,9 @@ void GetXCoherentInfoGdcmReader::Process() gdcm::Element iop; iop.Read( ss ); for(i=0; i< 6; i++) - v_iop.push_back((float)(iop[i])); + { + v_iop.push_back((float)(iop[i])); + } bbSetOutputIOP(v_iop ); std::vector v_ipp; @@ -210,7 +215,8 @@ void GetXCoherentInfoGdcmReader::Process() 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 bbSetOutputIPP(v_ipp ); @@ -272,11 +278,17 @@ void GetXCoherentInfoGdcmReader::bbUserInitializeProcessing() void GetXCoherentInfoGdcmReader::bbUserFinalizeProcessing() { if(reader) + { reader->Delete(); + } // if reader if(f) + { f->Delete(); + } // if f if(sh) + { sh->Delete(); + } // if sh } #endif @@ -284,7 +296,9 @@ void GetXCoherentInfoGdcmReader::bbUserFinalizeProcessing() void GetXCoherentInfoGdcmReader::bbUserFinalizeProcessing() { if(reader) + { reader->Delete(); + } } #endif