From 214731ac3153629b08ce03f440500b20f5cda35d Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Fri, 2 Jun 2023 11:06:09 +0200 Subject: [PATCH] N#3508 IFTI read multiple images --- bbtk_creaVtk_PKG/.DS_Store | Bin 6148 -> 8196 bytes .../src/bbcreaVtkMarchingCubes2.h | 2 +- .../src/bbcreaVtkNIFTIImageReader.cxx | 68 +++++++++--------- 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/bbtk_creaVtk_PKG/.DS_Store b/bbtk_creaVtk_PKG/.DS_Store index 220c1c2cdfc67b69cd7b97f6d1a94f5743e0a976..041e49fd4f90ee4e9cc1d0577b3467ea8abf6373 100644 GIT binary patch literal 8196 zcmeHMOK=oL82-OWATtvp9UzZc9!U|AR7hYG9x;HJCxi+biaZHunB8g2$YdtW%vF|5Hkl-PPSRZQT*`C_t^d*@_O9x1X03a%!8>T1@kaYxA*n%ojK_!S> zl*;GTBGg(Yfb3@a1 zxgQa1i)T##;E3&7UZK;=xmFNyV~47#+Bi#1Pq(%`-dMYF)25lm+Ue$Wx~;LcIo*<; znbFjWx((a*jURC)UGJpq#N0AKW%D}q`py1WLDtE5o+DO_xQmCaAUm(f3G!X?)yFNyef_g#k1S^8OLTqAwzwPGhi&c;6>KY<*lz||?pn6{+(_OI?2N+) zU2~F`qfyglE32x@jFhor&NZK+vO0A%m$8rL?C^Nh#;O`aKWLdDf6B8&D;7JaYLTa| z#xM>DPnXZlkXx!66|b!~^ufSB!I>FXY;4l?!6UY7u|Sj5<`&%;a?A{On59YDmR8*u z$;-iHeR1KoCAu-1^(H5|8wPRNlQo9%tY~(R8HD{)+>Kg}I#y%!sOo;<>#!_t&6ZVF zSMKUHjIm(C^m%{5eL?6xcqbK!PcIf%Bb8qBiwwt#@Q+#GAbX8UB z+UuprqCu@|PfJT9l?+->?bJ&LiPIDvr;~JwPSbmIhCZe9bb&6?H*|@aUK`&H7?@{uHt+AjBB`#-xX4pD$A4#rBbO;9#xv;Yb)^vN~5>W z9A*8@Y2pO=_$E&oy4##cb#?drM|0xpA~_3|E~{8oSKrjKdFzh9)gt9Jr>I+X8j15Z zNk`(0KIlAQ30WDb<@(Bd&6gqDwfHerOfFU;YuDHD;=;NSX~PO;csIRd3T+ps`|UF4v#XG)9q;YDjgcD*Fdwe4ozJC-en< zMHlHi`hk9;-{=N_5|pC~)sX~OVJ+&>fOTlX7PO)bTd^HI*oj{3Mjr+-gb|El3|Uy< zaN*%7e1x$iU&gC=4JUC5r|~x4#Rv1Gw(EAO;ml2`>M0|%nV>4z|FwG;L5OFJWLRaKz1{1j^~-d3;?U47#;us diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMarchingCubes2.h b/bbtk_creaVtk_PKG/src/bbcreaVtkMarchingCubes2.h index b4d44c4..21fcca2 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkMarchingCubes2.h +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMarchingCubes2.h @@ -40,7 +40,7 @@ class bbcreaVtk_EXPORT MarchingCubes2 BBTK_BEGIN_DESCRIBE_BLACK_BOX(MarchingCubes2,bbtk::AtomicBlackBox); BBTK_NAME("MarchingCubes2"); BBTK_AUTHOR("InfoDev"); - BBTK_DESCRIPTION("No Description."); + BBTK_DESCRIPTION("No Description. (JavaScript)"); BBTK_CATEGORY("empty"); BBTK_INPUT(MarchingCubes2,Active,"(default true) Active",bool,""); diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkNIFTIImageReader.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkNIFTIImageReader.cxx index fbb3ebb..42ebdd5 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkNIFTIImageReader.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkNIFTIImageReader.cxx @@ -32,45 +32,47 @@ void NIFTIImageReader::Process() // bbSetOutputOut( bbGetInputIn() ); // std::cout << "Output value = " < lstImages; - std::vector lstImages; + if ( bbGetInputFileNames().size()>0 ) + { + if (bbGetInputType()==0) + { + vtkNIFTIImageReader* reader=vtkNIFTIImageReader::New(); + if ( bbGetInputFileNames().size()==1) + { + reader->SetFileName( bbGetInputFileNames()[0].c_str() ); + reader->Update(); + } else { + vtkStringArray *lstFileNames=vtkStringArray::New(); + int i,size=bbGetInputFileNames().size(); + for (i=0;iInsertNextValue( bbGetInputFileNames()[i].c_str() ); + } // for i + reader->SetFileNames( lstFileNames ); + reader->Update(); + } // FileNames + lstImages.push_back( reader->GetOutput() ); + } // Type 0 - if (bbGetInputType()==0) - { - vtkNIFTIImageReader* reader=vtkNIFTIImageReader::New(); - if ( bbGetInputFileNames().size()==1) - { - reader->SetFileName( bbGetInputFileNames()[0].c_str() ); - reader->Update(); - } else { - vtkStringArray *lstFileNames=vtkStringArray::New(); - int i,size=bbGetInputFileNames().size(); - for (i=0;iInsertNextValue( bbGetInputFileNames()[i].c_str() ); - } // for i - reader->SetFileNames( lstFileNames ); - reader->Update(); - } // FileNames - lstImages.push_back( reader->GetOutput() ); - } // Type 0 - - if (bbGetInputType()==1) - { - int i,size=bbGetInputFileNames().size(); - for (i=0;iSetFileName( bbGetInputFileNames()[i].c_str() ); - reader->Update(); - lstImages.push_back( reader->GetOutput() ); - } // for i - } // Type 1 + if (bbGetInputType()==1) + { + int i,size=bbGetInputFileNames().size(); + for (i=0;iSetFileName( bbGetInputFileNames()[i].c_str() ); + reader->Update(); + lstImages.push_back( reader->GetOutput() ); + } // for i + } // Type 1 + } // if if (lstImages.size()>=1) { bbSetOutputOut( lstImages[0] ); } else {bbSetOutputOut( NULL ); } bbSetOutputOutVector( lstImages ); + } //===== // 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.47.1