]> Creatis software - creaMaracasVisu.git/commitdiff
#3070 creaMaracasVisu Feature New Normal - bbmaracasvisuAxeVolume with fopenmp
authorEduardo DAVILA <davila@localhost.localdomain>
Wed, 8 Mar 2017 09:08:47 +0000 (10:08 +0100)
committerEduardo DAVILA <davila@localhost.localdomain>
Wed, 8 Mar 2017 09:08:47 +0000 (10:08 +0100)
bbtk/src/bbmaracasvisuAxeVolume.cxx

index 5cb228ef9c0c2a0ff2f333498d4e757e3381d632..24d2ef0a68db885ac7d427e50d2709d917c5e0a7 100644 (file)
@@ -93,27 +93,32 @@ void AxeVolume::Process()
        mimage->SetOrigin(bbGetInputIn()->GetOrigin());
        mimage->SetScalarType( outputformat );
        mimage->AllocateScalars();
-       int i,j,k;
+
     int sizeLstPointR  = bbGetInputlstPointR().size();
        int iAxe,sizeAxe        = bbGetInputlstPointX().size();
-       double rx,ry,rz;
-       double r,rr;
-       unsigned short *p;
+       int ii;
        int sizeImage           = sizeX*sizeY*sizeZ;
-       double px,py,pz;
-       double px1,py1,pz1;
-       double px2,py2,pz2;
+       unsigned short *p;
+
        // Clean image
        p = (unsigned short*)mimage->GetScalarPointer (0, 0, 0);
-       for ( i=0 ; i<sizeImage ; i++)
+       for ( ii=0 ; ii<sizeImage ; ii++)
        {
                *p = 0;
                p++;
        }
 
+
+#pragma omp parallel for 
        for (iAxe=0 ; iAxe<sizeAxe; iAxe++)
         {
-printf("AxeVolume %d/%d\n ",iAxe,sizeAxe);
+               int i,j,k;
+               double rx,ry,rz;
+               double r,rr;
+               double px,py,pz;
+               double px1,py1,pz1;
+               double px2,py2,pz2;
+               printf("AxeVolume %d/%d\n ",iAxe,sizeAxe);
                if (iAxe<sizeLstPointR)
                {
                        r = bbGetInputlstPointR()[ iAxe ]* invSpc[0];