From: Eduardo DAVILA Date: Mon, 27 Apr 2020 08:41:10 +0000 (+0200) Subject: #3414 creaVtk Feature New Normal - openmp X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=08782c0d31c11a62a886395873580e394b3a9dcd;p=creaVtk.git #3414 creaVtk Feature New Normal - openmp --- 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); //=====