From 5d332eae2105106da042e76430b810b9efe95c81 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 18 May 2016 07:25:38 +0200 Subject: [PATCH] #2951 BBTK Feature New Normal - Replace String box with vector functionality --- .../bbgdcmvtkGetXCoherentInfoGdcmReader.cxx | 18 +++++----- packages/std/src/bbstdReplaceString.cxx | 36 +++++++++++++++---- packages/std/src/bbstdReplaceString.h | 12 ++++--- 3 files changed, 48 insertions(+), 18 deletions(-) diff --git a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx index 5c309ae..105e782 100644 --- a/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx +++ b/packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx @@ -136,16 +136,19 @@ void GetXCoherentInfoGdcmReader::Process() { // Read the *first* image file (a SET of file names is given as input) gdcm::Reader *read = new gdcm::Reader(); - reader->SetFileName( bbGetInputIn()[0].c_str()); + reader->SetFileName( bbGetInputIn()[0].c_str() ); bool res = read->Read(); - if ( !res ) - { - delete read; - bbSetOutputOut(0); - return; - } + if ( !res ) + { + delete read; + printf("EED GetXCoherentInfoGdcmReader::Process resultImage NULL\n"); + bbSetOutputOut(NULL); + return; + } + + // Get info from the first image file const gdcm::File &f = read->GetFile(); int i; @@ -203,7 +206,6 @@ void GetXCoherentInfoGdcmReader::Process() } reader->SetFileNames(files); reader->Update(); - reader->GetOutput(); bbSetOutputOut( reader->GetOutput() ); } #endif diff --git a/packages/std/src/bbstdReplaceString.cxx b/packages/std/src/bbstdReplaceString.cxx index c8ea640..9975048 100644 --- a/packages/std/src/bbstdReplaceString.cxx +++ b/packages/std/src/bbstdReplaceString.cxx @@ -28,15 +28,39 @@ void ReplaceString::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " < tmpLst; + int i,size=bbGetInputIn().size(); + for ( i=0 ; i); BBTK_DECLARE_INPUT(Search,std::string); BBTK_DECLARE_INPUT(Replace,std::string); - BBTK_DECLARE_OUTPUT(Out,std::string); +// BBTK_DECLARE_OUTPUT(Out,std::string); + BBTK_DECLARE_OUTPUT(Out,std::vector); BBTK_PROCESS(Process); void Process(); //===== @@ -36,10 +38,12 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReplaceString,bbtk::AtomicBlackBox); BBTK_AUTHOR("InfoDev"); BBTK_DESCRIPTION("No Description."); BBTK_CATEGORY("empty"); - BBTK_INPUT(ReplaceString,In,"Input string",std::string,""); +// BBTK_INPUT(ReplaceString,In,"Input string",std::string,""); + BBTK_INPUT(ReplaceString,In,"Input vector of string",std::vector,""); BBTK_INPUT(ReplaceString,Search,"Searche sub string ",std::string,""); BBTK_INPUT(ReplaceString,Replace,"Replace new string",std::string,""); - BBTK_OUTPUT(ReplaceString,Out,"Output string",std::string,""); +// BBTK_OUTPUT(ReplaceString,Out,"Output string",std::string,""); + BBTK_OUTPUT(ReplaceString,Out,"Output vector string",std::vector< std::string >,""); BBTK_END_DESCRIBE_BLACK_BOX(ReplaceString); //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) -- 2.44.0