]> Creatis software - bbtk.git/commitdiff
#3526 Bug OpenMP boundaries box
authoreduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 28 Oct 2024 14:29:30 +0000 (15:29 +0100)
committereduardo.davila@creatis.insa-lyon.fr <eduardo.davila@creatis.insa-lyon.fr>
Mon, 28 Oct 2024 14:29:30 +0000 (15:29 +0100)
packages/vtk/src/bbvtkImageBoundaries.cxx
packages/vtk/src/bbvtkMagnitud.h
packages/wx/src/bbwxLayoutSplit.cxx

index ad8f1afd93a9b2b0009b49f2e6d483e49da37bef..036553da4c835ef75135ea51dae6536cf70e0302 100644 (file)
@@ -77,7 +77,6 @@ void ImageBoundaries::Process()
                double lowervalue = bbGetInputLowerValue();
                double uppervalue = bbGetInputUpperValue();
                DEF_POINTER_IMAGE_VTK_CREA(vI,ssI,pI,stI,bbGetInputIn())        
-               long int index=0;
 
         
         int *vecXMin = (int*)malloc( maxZ*sizeof(int) );
@@ -109,13 +108,14 @@ void ImageBoundaries::Process()
 
 printf("EED ImageBoundaries::Process (with openmp)\n");
 // http://jakascorner.com/blog/2016/05/omp-for.html
-        #pragma omp parallel for
+      #pragma omp parallel for
                for ( k=0 ; k<maxZ ; k++)
                {
 if ( (k1omp==k) || (k2omp==k) || (k3omp==k) ||
      (k4omp==k) || (k5omp==k) || (k6omp==k) ) { printf("  %d%\n", (int)(((double)k/(double)(maxZ-1))*100 )); }
                        int i,j;
                        double vItmpOMP;
+            long int index = maxX * maxY * k;
                        for (j=0 ; j<maxY ; j++)
                        {
                                for (i=0 ; i<maxX ; i++)
@@ -139,7 +139,6 @@ if ( (k1omp==k) || (k2omp==k) || (k3omp==k) ||
                         if (i>vecXMax[k]) vecXMax[k] = i;
                         if (j>vecYMax[k]) vecYMax[k] = j;
                         if (k>vecZMax[k]) vecZMax[k] = k;
-
                                        }
                                } // for k
                        } // for j
index c3d673735b909fa31a941161b6cda435bc120144..04c398c5aad2973841ff5dc3f56adb1a819c0dd0 100644 (file)
@@ -177,7 +177,7 @@ class bbvtk_EXPORT Magnitud
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(Magnitud,bbtk::AtomicBlackBox);
 BBTK_NAME("Magnitud");
 BBTK_AUTHOR("seba-tor@uniandes.edu.co");
-BBTK_DESCRIPTION("Receive an ImgaData and generates an Actor. 'EED this box habe to be splited in 5 box'");
+BBTK_DESCRIPTION("Receive an ImgaData and generates an Actor. 'EED this box have to be splited in 5 box'");
 BBTK_CATEGORY("");
 // -------------- [
   BBTK_INPUT(Magnitud,In,"Receive the image source",vtkImageData*, "");
index e632f95ef453afc75e6c0222e4b818dd3f58098e..6c107523f093c7a589bb8a910902cd9bb8620bce 100644 (file)
@@ -58,7 +58,7 @@ namespace bbwx
                bbSetInputProportion(50);
                bbSetInputWidget1(NULL);
                bbSetInputWidget2(NULL);
-               w=NULL; 
+               w = NULL;
        }
        
        //-----------------------------------------------------------------     
@@ -78,7 +78,7 @@ namespace bbwx
 
   void LayoutSplit::CreateWidget(wxWindow* parent)
   {
-    wxPanel            *splitterWindowPanel    = new wxPanel(parent, -1, wxDefaultPosition, wxSize(40,40) );
+    wxPanel *splitterWindowPanel       = new wxPanel(parent, -1, wxDefaultPosition, wxSize(40,40) );
 
  //   wxSplitterWindow *w
                        w                       = new wxSplitterWindow( splitterWindowPanel, //bbGetWxParent(),
@@ -88,7 +88,7 @@ namespace bbwx
 //                                                                     wxSize(400,200),
                                                                        wxSP_3DSASH |
                                                                        wxSP_LIVE_UPDATE );
-       w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
+    w->SetName( bbtk::std2wx( bbGetInputWinTitle() ) );
        w->SetMinimumPaneSize(15);
        //RaC Nov2012 Correctly resize internal panels with the window resize event
        w->SetSashGravity(0.5);
@@ -100,20 +100,22 @@ namespace bbwx
     if (w2==NULL) { w2=new wxPanel(bbGetWxParent()); }
     w1->Reparent(w);
     w2->Reparent(w);
- */ 
-
+ */
          wxWindow* w1 = bbCreateWidgetOfInput("Widget1",w);
          wxWindow* w2 = bbCreateWidgetOfInput("Widget2",w);
          if (w1==NULL) { w1=new wxPanel(splitterWindowPanel); }
          if (w2==NULL) { w2=new wxPanel(splitterWindowPanel); }
-         
          int orientation=0;
     if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"0|H|h|horizontal|Horizontal|HORIZONTAL")==true)  { orientation=0; }
     if (bbtk::Utilities::loosematch(bbGetInputOrientation(),"1|V|v|vertical|Vertical|VERTICAL")==true)    { orientation=1; }
     
 
-    if (orientation==1) { w->SplitHorizontally( w1, w2, 100); }
-    else                { w->SplitVertically( w1, w2, 100);   }
+    if (orientation==1) 
+    {
+        w->SplitHorizontally( w1, w2, 100);
+    } else {
+        w->SplitVertically( w1, w2, 100);
+    }
 
 //EED 2024-03-30  
     wxBoxSizer *sizer  = new wxBoxSizer(wxVERTICAL);
@@ -123,10 +125,8 @@ namespace bbwx
     splitterWindowPanel->Layout();
     bbSetOutputWidget( splitterWindowPanel );
 //    bbSetOutputWidget( w );
-
   }
 
-
   // This callback is necessary to get actual processing of the view 
   // when window is shown
   void  LayoutSplit::OnShowWidget()
@@ -145,27 +145,21 @@ namespace bbwx
        //      bbtkError("LayoutSplit::OnShowWidget() : win == 0 !");
       }
     w->GetParent()->GetParent()->GetClientSize(&width,&height);
-    int    pos = 100;
-    double ww  = width;
-    double hh  = height;
-    double proportion = bbGetInputProportion();
+    int    pos          = 100;
+    double ww           = width;
+    double hh           = height;
+    double proportion   = bbGetInputProportion();
     if (bbtk::Utilities::loosematch(bbGetInputOrientation(),
                                    "0|H|h|horizontal|Horizontal|HORIZONTAL")==true)  
-      { 
-       pos = (int)(ww * proportion * 0.01);
-      }    else {
-       pos = (int)(hh * proportion * 0.01);
-      } 
-  
-       printf("EED LayoutSplit::OnShowWidget  width=%d   height=%d  proportion=%d pos=%d box=%s\n", width,height,bbGetInputProportion(),pos, bbGetFullName().c_str() );        
+    {
+        pos = (int)(ww * proportion * 0.01);
+    }    else {
+        pos = (int)(hh * proportion * 0.01);
+    }
     w->SetSashPosition(pos,true);
     //RaC Nov2012 Correctly resize internal panels with the window resize event
     w->SetSashGravity(0.5);
-
   }
-
-
-
 }//namespace bbwx
 
 #endif // _USE_WXWIDGETS_