From 08782c0d31c11a62a886395873580e394b3a9dcd Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Mon, 27 Apr 2020 10:41:10 +0200 Subject: [PATCH] #3414 creaVtk Feature New Normal - openmp --- bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx | 43 ++++++++++++------- .../src/bbcreaVtkMagnitudVector.cxx | 25 ++++++++--- .../src/bbcreaVtkMultipleOperations.cxx | 25 +++++++---- .../src/bbcreaVtkMultipleOperations.h | 2 +- 4 files changed, 65 insertions(+), 30 deletions(-) diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx index 0424c5e..463ee22 100644 --- a/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx @@ -84,41 +84,54 @@ void ApplyMask::Process() (dimZImage==dimZMask)) { long int i, size = dimXImage * dimYImage * dimZImage; + DEF_POINTER_IMAGE_VTK_CREA(vI,ssI,pI,stI, bbGetInputImage() ); + DEF_POINTER_IMAGE_VTK_CREA(vM,ssM,pM,stM, bbGetInputMask() ); + DEF_POINTER_IMAGE_VTK_CREA(vO,ssO,pO,stO, resultImage ); + +long int k1omp=(double)(size-1)*0.0; +long int k2omp=(double)(size-1)*0.2; +long int k3omp=(double)(size-1)*0.4; +long int k4omp=(double)(size-1)*0.6; +long int k5omp=(double)(size-1)*0.8; +long int k6omp=(double)(size-1)*1.0; +printf("EED ApplyMask::Process (with openmp)\n"); #pragma omp parallel for for (i=0; iDelete(); @@ -48,14 +46,27 @@ printf("EED MultipleOperations::Process Start\n"); resultImage->SetDimensions( dimXImage, dimYImage, dimZImage ); resultImage->AllocateScalars( bbGetInputInLst()[0]->GetScalarType(),1 ); long int index,size=dimXImage*dimYImage*dimZImage; + DEF_POINTER_IMAGE_VTK_CREA(vOut,ssOut,pOut,stOut,resultImage ) if (bbGetInputType()==20) { - 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 + +long int k1omp=(double)(size-1)*0.0; +long int k2omp=(double)(size-1)*0.2; +long int k3omp=(double)(size-1)*0.4; +long int k4omp=(double)(size-1)*0.6; +long int k5omp=(double)(size-1)*0.8; +long int k6omp=(double)(size-1)*1.0; + +printf("EED MultipleOperations::Process (with openmp)\n"); +#pragma omp parallel for for (index=0;index,""); - BBTK_INPUT(MultipleOperations,Type,"(default 0) 0, 20 diff ",int,""); + BBTK_INPUT(MultipleOperations,Type,"(default 0) 0, 20 average-difference ",int,""); BBTK_OUTPUT(MultipleOperations,Out,"Output image",vtkImageData*,""); BBTK_END_DESCRIBE_BLACK_BOX(MultipleOperations); //===== -- 2.47.1