X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=bbtk_creaVtk_PKG%2Fsrc%2FbbcreaVtkMultipleOperations.cxx;h=b5b02b8816251afe10fc626e258a8a282513c652;hb=500bc2ff1c3fe51a9ce94324dee722fb2f7bfd36;hp=edd549d53153028ae98925caba04849450da240c;hpb=0d5215ddb4f879862e52ed4910e78f0fd0cb8863;p=creaVtk.git diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkMultipleOperations.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkMultipleOperations.cxx index edd549d..b5b02b8 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkMultipleOperations.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkMultipleOperations.cxx @@ -16,7 +16,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(MultipleOperations,bbtk::AtomicBlackBox); //===== void MultipleOperations::Process() { -printf("EED MultipleOperations::Process Start\n"); // THE MAIN PROCESSING METHOD BODY // Here we simply set the input 'In' value to the output 'Out' // And print out the output value @@ -37,7 +36,6 @@ printf("EED MultipleOperations::Process Start\n"); int dimXImage = extImage[1]-extImage[0]+1; int dimYImage = extImage[3]-extImage[2]+1; int dimZImage = extImage[5]-extImage[4]+1; - int iLst,sizeLst= bbGetInputInLst().size(); if (bbGetOutputOut()!=NULL) { bbGetOutputOut()->Delete(); @@ -48,24 +46,48 @@ printf("EED MultipleOperations::Process Start\n"); resultImage->SetDimensions( dimXImage, dimYImage, dimZImage ); resultImage->AllocateScalars( bbGetInputInLst()[0]->GetScalarType(),1 ); long int index,size=dimXImage*dimYImage*dimZImage; - if (bbGetInputType()==20) + DEF_POINTER_IMAGE_VTK_CREA(vOut,ssOut,pOut,stOut,resultImage ) + if ((bbGetInputType()==20) || (bbGetInputType()==21) ) { - DEF_POINTER_IMAGE_VTK_CREA(vIn ,ssIn ,pIn ,stIn ,bbGetInputInLst()[0] ) - DEF_POINTER_IMAGE_VTK_CREA(vOut,ssOut,pOut,stOut,resultImage ) - double vInBack,acumDiff; -// #pragma omp parallel for - for (index=0;indexGetScalarPointer() ); GETVALUE2_VTK_CREA(vIn,pIn,stIn,index) if (iLst!=0) { - acumDiff = acumDiff+abs(vIn-vInBack); - } - vInBack=vIn; + if (bbGetInputType()==20) + { + acumDiff = acumDiff+abs(vIn-vInBack); + vInBack=vIn; + } // if 20 + if (bbGetInputType()==21) + { + acumDiff = acumDiff+vIn; + } // if 20 + } } // for iLst acumDiff = acumDiff/sizeLst; SETVALUE2_VTK_CREA(acumDiff,pOut,stOut,index) @@ -73,8 +95,6 @@ printf("EED MultipleOperations::Process Start\n"); } // if Type==20 bbSetOutputOut( resultImage ); } // if InLst size -printf("EED MultipleOperations::Process End\n"); - } //===== // 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)