From 31657903fe66f835d7465671626f02bd5a8a4cc6 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 16 Jun 2021 15:45:47 +0200 Subject: [PATCH] #3320 ReadImages box --- bbtk/src/bbcreaImageIOReadImages.cxx | 24 ++++++++++++++++-------- bbtk/src/bbcreaImageIOReadImages.h | 2 ++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/bbtk/src/bbcreaImageIOReadImages.cxx b/bbtk/src/bbcreaImageIOReadImages.cxx index 33a7839..8098413 100644 --- a/bbtk/src/bbcreaImageIOReadImages.cxx +++ b/bbtk/src/bbcreaImageIOReadImages.cxx @@ -34,15 +34,23 @@ void ReadImages::Process() std::vector mResults; VectorMapInfoDicom mResultsDicomAtr; creaImageIO::SimpleView mView; - if( mView.readFile(bbGetInputLstNameImages() , bbGetInputDicomTags() , mResultsDicomAtr , mResults)==true ) + + if (bbGetInputActive()==true) { - bbSetOutputOut( mView.getVolumeSelected( mResults ) ); - bbSetOutputOutImages( mResults ); - bbSetOutputDicomInfo( mResultsDicomAtr ); + if( mView.readFile(bbGetInputLstNameImages() , bbGetInputDicomTags() , mResultsDicomAtr , mResults)==true ) + { + bbSetOutputOut( mView.getVolumeSelected( mResults ) ); + bbSetOutputOutImages( mResults ); + bbSetOutputDicomInfo( mResultsDicomAtr ); + } else { + bbSetOutputOut( NULL ); + printf("EED Warning! ReadImages::Process Files(s) not found. \n"); + }// if readFile } else { - bbSetOutputOut( NULL ); - printf("EED Warning! ReadImages::Process Files(s) not found. \n"); - }// if readFile + bbSetOutputOutImages( mResults ); + bbSetOutputDicomInfo( mResultsDicomAtr ); + bbSetOutputOut( NULL ); + }//Active } //===== // 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) @@ -52,7 +60,7 @@ void ReadImages::bbUserSetDefaultValues() // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 -// bbSetInputIn(0); + bbSetInputActive(true); } //===== diff --git a/bbtk/src/bbcreaImageIOReadImages.h b/bbtk/src/bbcreaImageIOReadImages.h index cb2079e..74e4c0c 100644 --- a/bbtk/src/bbcreaImageIOReadImages.h +++ b/bbtk/src/bbcreaImageIOReadImages.h @@ -24,6 +24,7 @@ class bbcreaImageIO_EXPORT ReadImages //===== // 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) //===== + BBTK_DECLARE_INPUT(Active,bool); BBTK_DECLARE_INPUT(DicomTags,std::vector); BBTK_DECLARE_INPUT(LstNameImages,std::vector); BBTK_DECLARE_OUTPUT(Out,vtkImageData*); @@ -42,6 +43,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReadImages,bbtk::AtomicBlackBox); BBTK_DESCRIPTION("No Description."); BBTK_CATEGORY("empty"); + BBTK_INPUT(ReadImages,Active,"(default true) Active true/false",bool,""); BBTK_INPUT(ReadImages,DicomTags,"Dicom Tags (vector of Dicom tags ex: D0028_0030 D0020_0037)",std::vector,""); BBTK_INPUT(ReadImages,LstNameImages,"List path to images",std::vector,""); -- 2.47.1