From 2eca3a52df362d04f3f914fe90c16c570f8d775a Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Fri, 20 Sep 2019 13:19:38 +0200 Subject: [PATCH] #3309 BBTK Bug New Normal - Bug gdcmvtk - GetXCoherentInfoGdcmReader std - FilesFromDirectory --- .../src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx | 7 +++---- packages/std/src/bbstdFilesFromDirectory.cxx | 13 ++++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx index 39ff153..e553a67 100644 --- a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx +++ b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx @@ -87,7 +87,6 @@ vtkImageData* GetXCoherentInfoGdcmReader::CreateDefaultImage() #if defined USE_GDCM void GetXCoherentInfoGdcmReader::Process() { - // Read the *first* image file (a SET of file names is given as input) f = GDCM_NAME_SPACE::File::New(); @@ -97,7 +96,7 @@ void GetXCoherentInfoGdcmReader::Process() } else { f->SetFileName( "" ); } // if - + bool res = f->Load(); if ( !res ) { @@ -139,7 +138,6 @@ void GetXCoherentInfoGdcmReader::Process() sh->AddFileName(*it); } //for vector - GDCM_NAME_SPACE::FileList::const_iterator it; GDCM_NAME_SPACE::FileList *l; @@ -166,6 +164,7 @@ void GetXCoherentInfoGdcmReader::Process() int iTag,sizeDicomTagsVector=bbGetInputDicomTags().size(); GDCM_NAME_SPACE::FileList::const_iterator iitt = l->begin(); //iitt ++; + for ( ; iitt != l->end(); ++iitt) { MapInfoDicom mapinfodicom; @@ -198,7 +197,6 @@ void GetXCoherentInfoGdcmReader::Process() reader->SetCoherentFileList(l); reader->Update(); reader->GetOutput(); - bbSetOutputOut( reader->GetOutput() ); } #endif @@ -289,6 +287,7 @@ void GetXCoherentInfoGdcmReader::Process() void GetXCoherentInfoGdcmReader::bbUserSetDefaultValues() { + reader=NULL; std::vector init; init.push_back(""); bbSetInputIn(init); diff --git a/packages/std/src/bbstdFilesFromDirectory.cxx b/packages/std/src/bbstdFilesFromDirectory.cxx index 7ea9ae3..77dc59f 100644 --- a/packages/std/src/bbstdFilesFromDirectory.cxx +++ b/packages/std/src/bbstdFilesFromDirectory.cxx @@ -49,11 +49,14 @@ void FilesFromDirectory::Process() { Filenames.clear(); SimpleFilenames.clear(); - DirName = bbGetInputIn(); - /*int nbFiles = */ Explore(DirName, bbGetInputRecursive(), bbGetInputRecursiveLevel() ); - CleanFilenames( DirName ); - bbSetOutputOut(Filenames); - bbSetOutputOutSimple(SimpleFilenames); + if (bbGetInputIn()!="") + { + DirName = bbGetInputIn(); + /*int nbFiles = */ Explore(DirName, bbGetInputRecursive(), bbGetInputRecursiveLevel() ); + CleanFilenames( DirName ); + bbSetOutputOut(Filenames); + bbSetOutputOutSimple(SimpleFilenames); + } // if In } void FilesFromDirectory::bbUserSetDefaultValues() -- 2.47.1