From 0d8ff9ae89c90ce56211a322c7f52d9fda44a7f4 Mon Sep 17 00:00:00 2001 From: "eduardo.davila@creatis.insa-lyon.fr" Date: Mon, 21 Oct 2024 11:32:43 +0200 Subject: [PATCH] #3334 nrrd format in ReadImages box --- bbtk/src/bbcreaImageIOReadImages.cxx | 26 +++++++++----------------- bbtk/src/bbcreaImageIOReadImages.h | 2 +- src/creaImageIOImageReader.cpp | 2 ++ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/bbtk/src/bbcreaImageIOReadImages.cxx b/bbtk/src/bbcreaImageIOReadImages.cxx index 8098413..2bd8f63 100644 --- a/bbtk/src/bbcreaImageIOReadImages.cxx +++ b/bbtk/src/bbcreaImageIOReadImages.cxx @@ -8,7 +8,6 @@ namespace bbcreaImageIO { - BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaImageIO,ReadImages) BBTK_BLACK_BOX_IMPLEMENTATION(ReadImages,bbtk::AtomicBlackBox); //===== @@ -16,7 +15,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ReadImages,bbtk::AtomicBlackBox); //===== void ReadImages::Process() { - // THE MAIN PROCESSING METHOD BODY // Here we simply set the input 'In' value to the output 'Out' // And print out the output value @@ -30,11 +28,9 @@ void ReadImages::Process() // (the one provided in the attribute 'type' of the tag 'input') // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " < mResults; VectorMapInfoDicom mResultsDicomAtr; creaImageIO::SimpleView mView; - if (bbGetInputActive()==true) { if( mView.readFile(bbGetInputLstNameImages() , bbGetInputDicomTags() , mResultsDicomAtr , mResults)==true ) @@ -52,43 +48,39 @@ void ReadImages::Process() 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) //===== void ReadImages::bbUserSetDefaultValues() { - // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX // Here we initialize the input 'In' to 0 bbSetInputActive(true); - } -//===== + +//===== // 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) //===== void ReadImages::bbUserInitializeProcessing() { - // THE INITIALIZATION METHOD BODY : // Here does nothing // but this is where you should allocate the internal/output pointers -// if any - - +// if any } -//===== + +//===== // 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) //===== void ReadImages::bbUserFinalizeProcessing() { - // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any - -} } -// EO namespace bbcreaImageIO + +}// EO namespace bbcreaImageIO diff --git a/bbtk/src/bbcreaImageIOReadImages.h b/bbtk/src/bbcreaImageIOReadImages.h index 74e4c0c..3a4e7b5 100644 --- a/bbtk/src/bbcreaImageIOReadImages.h +++ b/bbtk/src/bbcreaImageIOReadImages.h @@ -45,7 +45,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ReadImages,bbtk::AtomicBlackBox); 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,""); + BBTK_INPUT(ReadImages,LstNameImages,"List path to images (png, tiff, jpeg, bmp, SLC, mhd, mha, nii.gz, nrrd)",std::vector,""); BBTK_OUTPUT(ReadImages,Out,"Output Image",vtkImageData*,""); BBTK_OUTPUT(ReadImages,OutImages,"List of Output Image",std::vector,""); diff --git a/src/creaImageIOImageReader.cpp b/src/creaImageIOImageReader.cpp index 3dec1c2..2a6ee8b 100644 --- a/src/creaImageIOImageReader.cpp +++ b/src/creaImageIOImageReader.cpp @@ -46,6 +46,7 @@ #include #include #include +#include //#include @@ -71,6 +72,7 @@ namespace creaImageIO Register(boost::shared_ptr(new VtkImageReader(vtkSLCReader::New()))); Register(boost::shared_ptr(new VtkImageReader(vtkMetaImageReader::New(),"MHD",".mhd"))); Register(boost::shared_ptr(new VtkImageReader(vtkNIFTIImageReader::New(),"NIF",".nii.gz"))); + Register(boost::shared_ptr(new VtkImageReader(vtkNrrdReader::New(),"NRRD",".nrrd"))); // Register(new VtkImageReader(vtkGESignalReader::New())); Register(boost::shared_ptr(new DicomImageReader)); -- 2.47.1