]> Creatis software - creaVtk.git/commitdiff
Bug Modified pipeline
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Tue, 24 Nov 2020 09:28:46 +0000 (10:28 +0100)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Tue, 24 Nov 2020 09:28:46 +0000 (10:28 +0100)
bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbg [new file with mode: 0644]
bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbs [new file with mode: 0644]
bbtk_creaVtk_PKG/src/bbcreaVtkImageCutByAxis.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkImageCutByAxis.h
bbtk_creaVtk_PKG/src/bbcreaVtkMeshCutByAxis.cxx
bbtk_creaVtk_PKG/src/bbcreaVtkMeshCutByAxis.h
bbtk_creaVtk_PKG/src/bbcreaVtkScalarsToColors.cxx

diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbg b/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbg
new file mode 100644 (file)
index 0000000..b947543
--- /dev/null
@@ -0,0 +1,168 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:12
+BOX
+vtk:LoadHola:Box00
+ISEXEC:FALSE
+42.970380:121.375067:-900.000000
+78.520380:111.375067:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box01
+ISEXEC:FALSE
+12.381685:53.142024:-900.000000
+48.256685:43.142024:-900.000000
+PORT
+nTypeView:"6 1 2 0"
+FIN_BOX
+BOX
+wx:LayoutSplit:Box02
+ISEXEC:TRUE
+-21.881348:-68.528094:-900.000000
+14.793652:-78.528094:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+BOX
+wx:LayoutLine:Box03
+ISEXEC:FALSE
+-89.318321:28.465101:-900.000000
+-52.743321:18.465101:-900.000000
+FIN_BOX
+BOX
+vtk:PolyDataToActor:Box05
+ISEXEC:FALSE
+49.016284:-54.225839:-900.000000
+91.416284:-64.225839:-900.000000
+PORT
+Colour:"1 0 0"
+FIN_BOX
+BOX
+wx:Slider:Box06
+ISEXEC:FALSE
+-88.015958:64.249653:-900.000000
+-56.440958:54.249653:-900.000000
+PORT
+In:"100"
+PORT
+Max:"100"
+PORT
+Min:"0"
+PORT
+ReactiveOnTrack:"true"
+FIN_BOX
+BOX
+std:Div:Box07
+ISEXEC:FALSE
+-32.712798:46.677489:-900.000000
+-3.387798:36.677489:-900.000000
+PORT
+In2:"100"
+FIN_BOX
+BOX
+creaVtk:MeshCutByAxis:Box08
+ISEXEC:FALSE
+80.897806:-31.255502:-900.000000
+121.972806:-41.255502:-900.000000
+PORT
+InsideVol:"true"
+PORT
+Point:"30 30 30"
+FIN_BOX
+BOX
+vtk:MarchingCubes:Box14
+ISEXEC:FALSE
+74.384670:4.520731:-900.000000
+116.184670:-5.479269:-900.000000
+PORT
+Value:"500"
+FIN_BOX
+BOX
+wx:RadioButton:Box17
+ISEXEC:FALSE
+-36.357203:77.589847:-900.000000
+1.542797:67.589847:-900.000000
+PORT
+In0:"Inside"
+PORT
+In1:"Outside"
+FIN_BOX
+BOX
+vtk:ImageVtkProperties:Box18
+ISEXEC:FALSE
+111.800931:65.662813:-900.000000
+157.150931:55.662813:-900.000000
+FIN_BOX
+BOX
+std:MathOperationVector:Box19
+ISEXEC:FALSE
+113.596399:21.834168:-900.000000
+161.121399:11.834168:-900.000000
+PORT
+Type:"2"
+FIN_BOX
+CONNECTIONS:18
+CONNECTION
+Box00:Out:Box01:In
+NumberOfControlPoints:0
+CONNECTION
+Box01:Widget:Box02:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:Box02:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box01:Renderer1:Box05:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box06:Widget:Box03:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box06:Out:Box07:In1
+NumberOfControlPoints:0
+CONNECTION
+Box07:Out:Box05:Opacity
+NumberOfControlPoints:0
+CONNECTION
+Box08:Out:Box05:In
+NumberOfControlPoints:0
+CONNECTION
+Box01:BoxChange:Box08:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box01:BoxChange:Box05:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:Box14:In
+NumberOfControlPoints:0
+CONNECTION
+Box14:Out:Box08:In
+NumberOfControlPoints:0
+CONNECTION
+Box17:Widget:Box03:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box17:Out:Box08:InsideVol
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:Box18:In
+NumberOfControlPoints:0
+CONNECTION
+Box18:Spacing:Box19:In1
+NumberOfControlPoints:0
+CONNECTION
+Box01:Point:Box19:In0
+NumberOfControlPoints:0
+CONNECTION
+Box19:Out:Box08:Point
+NumberOfControlPoints:0
+APP_END
diff --git a/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbs b/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbs
new file mode 100644 (file)
index 0000000..9453d7d
--- /dev/null
@@ -0,0 +1,99 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /home/davila/Creatis/C11/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/appli/exampleMeshCutByAxis.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include vtk
+include creaMaracasVisu
+include wx
+include std
+include creaVtk
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new vtk:LoadHola Box00
+
+new creaMaracasVisu:ViewerNV Box01
+  set Box01.nTypeView "6 1 2 0"
+
+new wx:LayoutSplit Box02
+  set Box02.Orientation "H"
+
+new wx:LayoutLine Box03
+
+new vtk:PolyDataToActor Box05
+  set Box05.Colour "1 0 0"
+
+new wx:Slider Box06
+  set Box06.In "100"
+  set Box06.Max "100"
+  set Box06.Min "0"
+  set Box06.ReactiveOnTrack "true"
+
+new std:Div Box07
+  set Box07.In2 "100"
+
+new creaVtk:MeshCutByAxis Box08
+  set Box08.InsideVol "true"
+  set Box08.Point "30 30 30"
+
+new vtk:MarchingCubes Box14
+  set Box14.Value "500"
+
+new wx:RadioButton Box17
+  set Box17.In0 "Inside"
+  set Box17.In1 "Outside"
+
+new vtk:ImageVtkProperties Box18
+
+new std:MathOperationVector Box19
+  set Box19.Type "2"
+
+
+connect Box00.Out Box01.In
+
+connect Box01.Widget Box02.Widget2
+
+connect Box03.Widget Box02.Widget1
+
+connect Box01.Renderer1 Box05.Renderer
+
+connect Box06.Widget Box03.Widget1
+
+connect Box06.Out Box07.In1
+
+connect Box07.Out Box05.Opacity
+
+connect Box08.Out Box05.In
+
+connect Box01.BoxChange Box08.BoxExecute
+
+connect Box01.BoxChange Box05.BoxExecute
+
+connect Box00.Out Box14.In
+
+connect Box14.Out Box08.In
+
+connect Box17.Widget Box03.Widget2
+
+connect Box17.Out Box08.InsideVol
+
+connect Box00.Out Box18.In
+
+connect Box18.Spacing Box19.In1
+
+connect Box01.Point Box19.In0
+
+connect Box19.Out Box08.Point
+
+
+
+# Complex input ports
+exec Box02
index 764464214a8062919c0a671c851340a76c4adc8d..687ee7394d561e28836f19f38a5b7838558f2b25 100644 (file)
@@ -118,7 +118,7 @@ void ImageCutByAxis::Process()
                } // for j
 
        } //c4
-
+       newData->Modified();
        bbSetOutputOut( newData );
 
 }
@@ -131,7 +131,7 @@ void ImageCutByAxis::bbUserSetDefaultValues()
 //  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
 //    Here we initialize the input 'In' to 0
    bbSetInputIn(NULL);
-   bbSetInputType("x+y+z+");
+   bbSetInputType("x-y-z+");
    bbSetInputInsideVol(true);
    std::vector<int> point;
    point.push_back(0);
index 1cf7640d99ed95933935df8ad835037c407be3ce..33d9c3c706b37029289c44862e01f0fd26383789 100644 (file)
@@ -38,7 +38,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageCutByAxis,bbtk::AtomicBlackBox);
        BBTK_DESCRIPTION("No Description.");
        BBTK_CATEGORY("empty");
        BBTK_INPUT(ImageCutByAxis,In,"Input image",vtkImageData*,"");
-       BBTK_INPUT(ImageCutByAxis,Type,"x y z  x+y+  x-y+ x+y- x-y-  y+z+  y+z- y-z+ y-z-  x+z+  x+z- x-z+ x-z-   x+y+z+ x-y+z+ x+y-z+ x+y+z- x-y-z+ x-y+z- x+y-z- x-y-z-",std::string,"");
+       BBTK_INPUT(ImageCutByAxis,Type,"(default x-y-z+)  missing all options:x y z  x+y+  x-y+ x+y- x-y-  y+z+  y+z- y-z+ y-z-  x+z+  x+z- x-z+ x-z-   x+y+z+ x-y+z+ x+y-z+ x+y+z- x-y-z+ x-y+z- x+y-z- x-y-z-",std::string,"");
        BBTK_INPUT(ImageCutByAxis,InsideVol,"Inside volume",bool,"");
        BBTK_INPUT(ImageCutByAxis,Point,"First input",std::vector<int>,"");
        BBTK_INPUT(ImageCutByAxis,TypeOrientation,"TypeOrientation (default 0) 0=XY 1=XZ 2=YZ",int,"");
index 70a8429bff556c75a14f0b52022c6f212f9e3876..7af703c93e6c65824714e9aa40c458ab01f7046a 100644 (file)
@@ -7,7 +7,7 @@
 #include <vtkBox.h>
 #include <vtkPlane.h>
 #include <vtkClipPolyData.h>
-
+#include <vtkPolyDataNormals.h>
 namespace bbcreaVtk
 {
 
@@ -39,14 +39,18 @@ void MeshCutByAxis::Process()
                vtkPlane                *clipPlane      = vtkPlane::New();      
                vtkBox                  *clipBox        = vtkBox::New();        
                vtkClipPolyData *clipper        = vtkClipPolyData::New();
+//             clipper->GenerateClipScalarsOn();
+//             clipper->GenerateClippedOutputOff();
 //EED 2017-01-01 Migration VTK7
 #if VTK_MAJOR_VERSION <= 5
            clipper             -> SetInput( bbGetInputIn() );
 #else
+//             vtkPolyDataNormals *nn = vtkPolyDataNormals::New();
+//             nn->SetInputData( bbGetInputIn() );
+//         clipper             -> SetInputData( nn->GetOutput() );
            clipper             -> SetInputData( bbGetInputIn() );
 #endif
                clipper->SetInsideOut( bbGetInputInsideVol() );
-
                int a;  // correction border 
                if (bbGetInputInsideVol()==false)
                {
@@ -54,15 +58,12 @@ void MeshCutByAxis::Process()
                } else {
                        a=0;
                }
-
                int px=bbGetInputPoint()[0];
                int py=bbGetInputPoint()[1];
                int pz=bbGetInputPoint()[2];
-
                if ( bbGetInputType()=="x"              ) { clipPlane->SetNormal(1, 0, 0);                                                                              ok=1;   } else  
                if ( bbGetInputType()=="y"              ) { clipPlane->SetNormal(0, 1, 0);                                                                              ok=1;   } else
                if ( bbGetInputType()=="z"              ) { clipPlane->SetNormal(0, 0, 1);                                                                              ok=1;   } else
-
                if ( bbGetInputType()=="x+y+"   ) { clipBox->SetBounds(px       ,px+sb  ,py             ,py+sb  ,pz-sb  ,pz+sb  );      ok=2;   } else
                if ( bbGetInputType()=="x-y+"   ) { clipBox->SetBounds(px-sb,px+a       ,py             ,py+sb  ,pz-sb  ,pz+sb  );      ok=2;   } else
                if ( bbGetInputType()=="x+y-"   ) { clipBox->SetBounds(px       ,px+sb  ,py-sb  ,py+a   ,pz-sb  ,pz+sb  );      ok=2;   } else
@@ -78,7 +79,6 @@ void MeshCutByAxis::Process()
                if ( bbGetInputType()=="x+z-"   ) { clipBox->SetBounds(px       ,px+sb  ,py-sb  ,py+sb  ,pz-sb  ,pz+a   );      ok=2;   } else
                if ( bbGetInputType()=="x-z-"   ) { clipBox->SetBounds(px-sb,px+a       ,py-sb  ,py+sb  ,pz-sb  ,pz+a   );      ok=2;   } else
 
-
                if ( bbGetInputType()=="x+y+z+" ) { clipBox->SetBounds(px       ,px+sb  ,py             ,py+sb  ,pz     ,pz+sb  );      ok=2;   } else
                if ( bbGetInputType()=="x-y+z+" ) { clipBox->SetBounds(px-sb,px+a       ,py             ,py+sb  ,pz     ,pz+sb  );      ok=2;   } else
                if ( bbGetInputType()=="x+y-z+" ) { clipBox->SetBounds(px       ,px+sb  ,py-sb  ,py+a   ,pz     ,pz+sb  );      ok=2;   } else
@@ -90,11 +90,14 @@ void MeshCutByAxis::Process()
 
                if (ok==1) {
                        clipPlane       -> SetOrigin(px,py,pz); 
+                       clipPlane       -> Modified();
                        clipper         -> SetClipFunction(clipPlane);  
+                       clipper         -> Update();
                        bbSetOutputOut( clipper->GetOutput() ); 
-               } else          if (ok==2) {
-                       
-                       clipper         -> SetClipFunction(clipBox);  
+               } else          if (ok==2) {                    
+                       clipBox -> Modified();
+                       clipper -> SetClipFunction(clipBox); 
+                       clipper -> Update();
                        bbSetOutputOut( clipper->GetOutput() ); 
                } else {
                        bbSetOutputOut( bbGetInputIn() ); 
index 23cf4cb510aeb8013f64456a4b059889ec09d96d..d043878e99de754a5f61e04b3407ab622fd79212 100644 (file)
@@ -37,7 +37,7 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(MeshCutByAxis,bbtk::AtomicBlackBox);
   BBTK_DESCRIPTION("MeshCutByAxis");
   BBTK_CATEGORY("empty");
   BBTK_INPUT(MeshCutByAxis,In,"Mesh to be cut",vtkPolyData*,"");
-  BBTK_INPUT(MeshCutByAxis,Type,"x y z  x+y+  x-y+ x+y- x-y-  y+z+  y+z- y-z+ y-z-  x+z+  x+z- x-z+ x-z-   x+y+z+ x-y+z+ x+y-z+ x+y+z- x-y-z+ x-y+z- x+y-z- x-y-z-",std::string,"");
+  BBTK_INPUT(MeshCutByAxis,Type,"(defalut x+y+z+)  x  y  z  x+y+  x-y+ x+y- x-y-  y+z+  y+z- y-z+ y-z-  x+z+  x+z- x-z+ x-z-   x+y+z+  x-y+z+  x+y-z+  x+y+z-  x-y-z+  x-y+z-  x+y-z-  x-y-z-",std::string,"");
   BBTK_INPUT(MeshCutByAxis,InsideVol,"Inside volume",bool,"");
   BBTK_INPUT(MeshCutByAxis,Point,"First input",std::vector<int>,"");
   BBTK_OUTPUT(MeshCutByAxis,Out,"First output",vtkPolyData*,"");
index 871319a1f1b6ecc7e1121cee11612110a26cc9eb..d306ff39b5e9824781f14187ba1b509eb4cb20ef 100644 (file)
@@ -295,6 +295,7 @@ printf("EED ScalarsToColors::Process  Start\n");
                                _colorLookupTable->SetTableValue(500-i,rgba);
                        } // for
 */
+                       colorLookupTable->Modified();
                        _scalarstocolors = colorLookupTable;
                } // if Type 0