]> Creatis software - crea.git/commitdiff
no message
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 11 Apr 2011 11:56:35 +0000 (11:56 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 11 Apr 2011 11:56:35 +0000 (11:56 +0000)
appli/creaNewProject/NewProject/bbtk_mySamplePackage_PKG/bbs/appli/Sample_BoxVtkPipeline.bbg [new file with mode: 0644]
appli/creaNewProject/NewProject/bbtk_mySamplePackage_PKG/bbs/appli/Sample_BoxVtkPipeline.bbs [new file with mode: 0644]
appli/creaNewProject/NewProject/bbtk_mySamplePackage_PKG/src/bbmySamplePackagemySampleBoxWithVTK.cxx
appli/creaNewProject/NewProject/bbtk_mySamplePackage_PKG/src/bbmySamplePackagemySampleBoxWithVTK.h
appli/creaNewProject/NewProject/lib/mySampleLib/myFierceClass2.h
appli/creaNewProject/NewProject/lib/mySampleLib/myFierceClass3vtkPipeline.cxx
appli/creaNewProject/NewProject/lib/mySampleLib/myFierceClass3vtkPipeline.h

diff --git a/appli/creaNewProject/NewProject/bbtk_mySamplePackage_PKG/bbs/appli/Sample_BoxVtkPipeline.bbg b/appli/creaNewProject/NewProject/bbtk_mySamplePackage_PKG/bbs/appli/Sample_BoxVtkPipeline.bbg
new file mode 100644 (file)
index 0000000..621617a
--- /dev/null
@@ -0,0 +1,68 @@
+# ----------------------------------
+# - BBTKGEditor v 1.2 BBG BlackBox Diagram file
+# - /Users/davila/Creatis/All2/creatools_source/crea/appli/creaNewProject/NewProject/bbtk_mySamplePackage_PKG/bbs/appli/Sample_BoxVtkPipeline.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+BOXES:5
+BOX
+mySamplePackage:mySampleBoxWithVTK:Box00
+ISEXEC:FALSE
+-19.548882:83.036235:900.000000
+51.626118:73.036235:900.000000
+PORT
+Lower:1000
+PORT
+Upper:2000
+FIN_BOX
+BOX
+vtk:LoadHola:Box01
+ISEXEC:FALSE
+-21.939698:107.067447:900.000000
+23.635302:97.067447:900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box02
+ISEXEC:FALSE
+-60.852862:53.978044:900.000000
+-0.212862:43.978044:900.000000
+PORT
+nTypeView:"0"
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box03
+ISEXEC:FALSE
+9.466460:53.259684:900.000000
+70.106460:43.259684:900.000000
+PORT
+nTypeView:"0"
+FIN_BOX
+BOX
+wx:LayoutSplit:Box04
+ISEXEC:TRUE
+-10.314595:15.108602:900.000000
+35.260405:5.108602:900.000000
+PORT
+Orientation:H
+FIN_BOX
+CONNECTIONS:5
+CONNECTION
+Box01:Out:Box00:In
+NumberOfControlPoints:0
+CONNECTION
+Box00:Out:Box03:In
+NumberOfControlPoints:0
+CONNECTION
+Box02:Widget:Box04:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box03:Widget:Box04:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box01:Out:Box02:In
+NumberOfControlPoints:0
+APP_END
diff --git a/appli/creaNewProject/NewProject/bbtk_mySamplePackage_PKG/bbs/appli/Sample_BoxVtkPipeline.bbs b/appli/creaNewProject/NewProject/bbtk_mySamplePackage_PKG/bbs/appli/Sample_BoxVtkPipeline.bbs
new file mode 100644 (file)
index 0000000..de4d03f
--- /dev/null
@@ -0,0 +1,42 @@
+# ----------------------------------
+# - BBTKGEditor v 1.2 BBS BlackBox Script
+# - /Users/davila/Creatis/All2/creatools_source/crea/appli/creaNewProject/NewProject/bbtk_mySamplePackage_PKG/bbs/appli/Sample_BoxVtkPipeline.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include mySamplePackage
+include vtk
+include creaMaracasVisu
+include wx
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new mySampleBoxWithVTK Box00
+  set Box00.Lower 1000
+  set Box00.Upper 2000
+
+new LoadHola Box01
+
+new ViewerNV Box02
+  set Box02.nTypeView "0"
+
+new ViewerNV Box03
+  set Box03.nTypeView "0"
+
+new LayoutSplit Box04
+  set Box04.Orientation H
+
+
+connect Box01.Out Box00.In
+connect Box00.Out Box03.In
+connect Box02.Widget Box04.Widget1
+connect Box03.Widget Box04.Widget2
+connect Box01.Out Box02.In
+
+exec Box04
index 55385341629379c45f46873602f5a5d904344e39..9ed332ee605204faa993e35a40c6c136a722baa3 100644 (file)
@@ -21,8 +21,11 @@ void mySampleBoxWithVTK::Process()
 //      (the one provided in the attribute 'name' of the tag 'input')
 //    * TYPE is the C++ type of the input/output
 //      (the one provided in the attribute 'type' of the tag 'input')
-    bbSetOutputOut( bbGetInputIn() );
-    std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
+       
+       myVtkPipeline.SetImage( bbGetInputIn() );
+       myVtkPipeline.SetThresholdBetween(  bbGetInputLower() , bbGetInputUpper() );
+       myVtkPipeline.Execute();
+    bbSetOutputOut( myVtkPipeline.GetResult() );
   
 }
 
index fbc2975da3b1da9ee94a230da3a69063ba9e8ba8..e9bc1f6f34278e884fb7f4c17814e77988275c26 100644 (file)
@@ -5,6 +5,9 @@
 #include "bbtkAtomicBlackBox.h"
 #include "iostream"
 
+#include <vtkImageData.h>
+#include "myFierceClass3vtkPipeline.h"
+
 namespace bbmySamplePackage
 {
 
@@ -14,20 +17,25 @@ class bbmySamplePackage_EXPORT mySampleBoxWithVTK
 {
   BBTK_BLACK_BOX_INTERFACE(mySampleBoxWithVTK,bbtk::AtomicBlackBox);
 
-  BBTK_DECLARE_INPUT(In,double);
-  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_DECLARE_INPUT(In,vtkImageData*);
+  BBTK_DECLARE_INPUT(Lower,double);
+  BBTK_DECLARE_INPUT(Upper,double);
+  BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
   BBTK_PROCESS(Process);
   void Process();
 
+  myFierceClass3vtkPipeline myVtkPipeline;
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(mySampleBoxWithVTK,bbtk::AtomicBlackBox);
 BBTK_NAME("mySampleBoxWithVTK");
-BBTK_AUTHOR("_author_");
-BBTK_DESCRIPTION("_description_");
-BBTK_CATEGORY("");
-BBTK_INPUT(mySampleBoxWithVTK,In,"First input",double,"");
-BBTK_OUTPUT(mySampleBoxWithVTK,Out,"First output",double,"");
+BBTK_AUTHOR("Info-Dev");
+BBTK_DESCRIPTION("vtk pipeline example threshold + gaussian smooth");
+BBTK_CATEGORY("filter");
+BBTK_INPUT(mySampleBoxWithVTK,In,"Input image",vtkImageData*,"");
+BBTK_INPUT(mySampleBoxWithVTK,Lower,"lower threshold",double,"");
+BBTK_INPUT(mySampleBoxWithVTK,Upper,"upper threshold",double,"");
+BBTK_OUTPUT(mySampleBoxWithVTK,Out,"Output image",vtkImageData*,"");
 BBTK_END_DESCRIBE_BLACK_BOX(mySampleBoxWithVTK);
 
 }
index 3b0871dda69f7533c9b235ce4cfc2c7a3a39a97d..92a1914899200444d64a3618a1872ef4a3ddda30 100644 (file)
@@ -10,7 +10,7 @@
 class /*CREA_EXPORT*/ myFierceClass2
 {
    public :
-      myFierceClass2() : X(0.0), Y(0.0), Percent(0.0) {};
+      myFierceClass2() : X(0.0), Y(0.0), Result(0.0) {};
       myFierceClass2(int a, int b) : X (a), Y(b) {};
       ~myFierceClass2(){};
       void SetX (double x);   
index adb354e396486589076854d69f55681b8c183fcf..4c13c61cbec1ca736f8031c250dfb9f4864305c9 100644 (file)
@@ -15,7 +15,7 @@ myFierceClass3vtkPipeline::myFierceClass3vtkPipeline()
 }
 
 
-myFierceClass3vtkPipeline::myFierceClass3vtkPipeline()
+myFierceClass3vtkPipeline::~myFierceClass3vtkPipeline()
 {
        filterThreshold->Delete();
        filterGaussian->Delete();
index ea5f48c96c7bc37427ff5f773e3ec9422e25423c..5639a220bc56e9f6dafe96af4e11c075bcd5ae36 100644 (file)
@@ -16,7 +16,7 @@ class /*CREA_EXPORT*/ myFierceClass3vtkPipeline
 {
        public :
                myFierceClass3vtkPipeline();
-               myFierceClass3vtkPipeline();
+                ~myFierceClass3vtkPipeline();
                void SetImage(vtkImageData * img);   
                void SetThresholdBetween(double l,double u);
                void Execute();