]> Creatis software - creaMaracasVisu.git/commitdiff
#2976 creaMaracasVisu Feature New Normal - ManualContourModel_Box
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Tue, 14 Jun 2016 11:09:57 +0000 (13:09 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Tue, 14 Jun 2016 11:09:57 +0000 (13:09 +0200)
14 files changed:
bbtk/bbs/appli/exampleManualContourModel_Box.bbg [new file with mode: 0644]
bbtk/bbs/appli/exampleManualContourModel_Box.bbs [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuContourControlPoints.cxx
bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuManualContourModel_Box.h [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx
bbtk/src/bbcreaMaracasVisuManualPaint_Model.h
bbtk/src/bbcreaMaracasVisuwxManualTree_MPRWidget_Box.cxx [new file with mode: 0644]
bbtk/src/bbcreaMaracasVisuwxManualTree_MPRWidget_Box.h [new file with mode: 0644]
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.cpp
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualBaseModel.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.h
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.cxx
lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.h

diff --git a/bbtk/bbs/appli/exampleManualContourModel_Box.bbg b/bbtk/bbs/appli/exampleManualContourModel_Box.bbg
new file mode 100644 (file)
index 0000000..91749a3
--- /dev/null
@@ -0,0 +1,160 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBG BlackBox Diagram file
+# - /tmpEED/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleManualContourModel_Box.bbg
+# ----------------------------------
+
+APP_START
+CATEGORY:<VOID>
+DESCRIPTION:Description ??
+AUTHOR:Author ??
+COMPLEXBOX:FALSE
+COMPLEXINPUTS:0
+BOXES:12
+BOX
+creaMaracasVisu:ShowNPoints:Box00
+ISEXEC:FALSE
+-39.494457:11.050643:-900.000000
+8.825543:1.050643:-900.000000
+FIN_BOX
+BOX
+vtk:LoadHola:Box01
+ISEXEC:FALSE
+9.258012:83.442946:-900.000000
+54.833012:73.442946:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ViewerNV:Box02
+ISEXEC:FALSE
+20.955874:40.973496:-900.000000
+81.595874:30.973496:-900.000000
+FIN_BOX
+BOX
+wx:LayoutSplit:Box03
+ISEXEC:TRUE
+13.204164:-71.936977:-900.000000
+58.779164:-81.936977:-900.000000
+PORT
+Orientation:"H"
+FIN_BOX
+BOX
+creaMaracasVisu:ManualContourModel_Box:Box04
+ISEXEC:FALSE
+-49.983835:-14.091828:-900.000000
+21.191165:-24.091828:-900.000000
+PORT
+OpenClose:"false"
+FIN_BOX
+BOX
+creaMaracasVisu:DrawAxe3D:Box05
+ISEXEC:FALSE
+-52.874467:-40.107511:-900.000000
+-7.299467:-50.107511:-900.000000
+PORT
+Colour:"1 1 0"
+FIN_BOX
+BOX
+vtk:Transform:Box06
+ISEXEC:FALSE
+-57.714085:25.260177:-900.000000
+-12.139085:15.260177:-900.000000
+FIN_BOX
+BOX
+vtk:ImageVtkProperties:Box07
+ISEXEC:FALSE
+-40.107511:44.925230:-900.000000
+5.467489:34.925230:-900.000000
+FIN_BOX
+BOX
+vtk:UpdateRender:Box08
+ISEXEC:FALSE
+-36.735108:-55.042440:-900.000000
+8.839892:-65.042440:-900.000000
+PORT
+Active:"true"
+FIN_BOX
+BOX
+vtk:vtkImageDataPointerRelay:Box09
+ISEXEC:FALSE
+-6.137882:66.826620:-900.000000
+65.037118:56.826620:-900.000000
+FIN_BOX
+BOX
+creaImageIO:ImagesChooserDialogBox:Box10
+ISEXEC:FALSE
+-43.926443:95.650480:-900.000000
+27.248557:85.650480:-900.000000
+FIN_BOX
+BOX
+creaMaracasVisu:ImageChangeInformation:Box11
+ISEXEC:FALSE
+-48.435663:82.829799:-900.000000
+22.739337:72.829799:-900.000000
+FIN_BOX
+CONNECTIONS:22
+CONNECTION
+Box02:Widget:Box03:Widget2
+NumberOfControlPoints:0
+CONNECTION
+Box00:Widget:Box03:Widget1
+NumberOfControlPoints:0
+CONNECTION
+Box02:Renderer1:Box00:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box02:Point:Box00:In
+NumberOfControlPoints:0
+CONNECTION
+Box02:BoxChange:Box00:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box00:lstPointsX:Box04:LstControlPointsX
+NumberOfControlPoints:0
+CONNECTION
+Box00:lstPointsY:Box04:LstControlPointsY
+NumberOfControlPoints:0
+CONNECTION
+Box00:lstPointsZ:Box04:LstControlPointsZ
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box05:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box04:LstContourPointsX:Box05:lstPointX
+NumberOfControlPoints:0
+CONNECTION
+Box04:LstContourPointsY:Box05:lstPointY
+NumberOfControlPoints:0
+CONNECTION
+Box04:LstContourPointsZ:Box05:lstPointZ
+NumberOfControlPoints:0
+CONNECTION
+Box02:Renderer1:Box05:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box06:Out:Box05:Transform
+NumberOfControlPoints:0
+CONNECTION
+Box00:BoxChange:Box08:BoxExecute
+NumberOfControlPoints:0
+CONNECTION
+Box02:Renderer1:Box08:Renderer
+NumberOfControlPoints:0
+CONNECTION
+Box07:Spacing:Box06:Scale
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box07:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box02:In
+NumberOfControlPoints:0
+CONNECTION
+Box09:Out:Box00:Image
+NumberOfControlPoints:0
+CONNECTION
+Box10:Out:Box11:In
+NumberOfControlPoints:0
+CONNECTION
+Box11:Out:Box09:In
+NumberOfControlPoints:0
+APP_END
diff --git a/bbtk/bbs/appli/exampleManualContourModel_Box.bbs b/bbtk/bbs/appli/exampleManualContourModel_Box.bbs
new file mode 100644 (file)
index 0000000..9b7d180
--- /dev/null
@@ -0,0 +1,96 @@
+# ----------------------------------
+# - BBTKGEditor v 1.4 BBS BlackBox Script
+# - /tmpEED/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleManualContourModel_Box.bbs
+# ----------------------------------
+
+# BBTK GEditor Script
+# ----------------------
+
+include std
+include itkvtk
+include creaMaracasVisu
+include vtk
+include wx
+include creaImageIO
+
+author "Author ??"
+description "Description ??"
+category "<VOID>"
+
+new creaMaracasVisu:ShowNPoints Box00
+
+new vtk:LoadHola Box01
+
+new creaMaracasVisu:ViewerNV Box02
+
+new wx:LayoutSplit Box03
+  set Box03.Orientation "H"
+
+new creaMaracasVisu:ManualContourModel_Box Box04
+  set Box04.OpenClose "false"
+
+new creaMaracasVisu:DrawAxe3D Box05
+  set Box05.Colour "1 1 0"
+
+new vtk:Transform Box06
+
+new vtk:ImageVtkProperties Box07
+
+new vtk:UpdateRender Box08
+  set Box08.Active "true"
+
+new vtk:vtkImageDataPointerRelay Box09
+
+new creaImageIO:ImagesChooserDialogBox Box10
+
+new creaMaracasVisu:ImageChangeInformation Box11
+
+
+connect Box02.Widget Box03.Widget2
+
+connect Box00.Widget Box03.Widget1
+
+connect Box02.Renderer1 Box00.Renderer
+
+connect Box02.Point Box00.In
+
+connect Box02.BoxChange Box00.BoxExecute
+
+connect Box00.lstPointsX Box04.LstControlPointsX
+
+connect Box00.lstPointsY Box04.LstControlPointsY
+
+connect Box00.lstPointsZ Box04.LstControlPointsZ
+
+connect Box00.BoxChange Box05.BoxExecute
+
+connect Box04.LstContourPointsX Box05.lstPointX
+
+connect Box04.LstContourPointsY Box05.lstPointY
+
+connect Box04.LstContourPointsZ Box05.lstPointZ
+
+connect Box02.Renderer1 Box05.Renderer
+
+connect Box06.Out Box05.Transform
+
+connect Box00.BoxChange Box08.BoxExecute
+
+connect Box02.Renderer1 Box08.Renderer
+
+connect Box07.Spacing Box06.Scale
+
+connect Box09.Out Box07.In
+
+connect Box09.Out Box02.In
+
+connect Box09.Out Box00.Image
+
+connect Box10.Out Box11.In
+
+connect Box11.Out Box09.In
+
+
+
+# Complex input ports
+exec Box03
index b59f6ae5b4f0166fdec7ce41d48e48ba57e0e1b6..c79906a1e3ebd1b477ab2e94b7e1eb2eb5312730 100644 (file)
@@ -16,7 +16,6 @@ BBTK_BLACK_BOX_IMPLEMENTATION(ContourControlPoints,bbtk::AtomicBlackBox);
 //===== 
 void ContourControlPoints::Process()
 {
-printf("EED ContourControlPoints::Process Start\n");
 // THE MAIN PROCESSING METHOD BODY
 //   Here we simply set the input 'In' value to the output 'Out'
 //   And print out the output value
@@ -83,7 +82,6 @@ printf("EED ContourControlPoints::Process Start\n");
 
 
        } // wxVtkBaseView
-printf("EED ContourControlPoints::Process End\n");
 
 }
 //===== 
diff --git a/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx b/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx
new file mode 100644 (file)
index 0000000..e1f6392
--- /dev/null
@@ -0,0 +1,109 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbcreaMaracasVisuManualContourModel_Box.h"
+#include "bbcreaMaracasVisuPackage.h"
+
+#include <creaContoursFactory.h>
+
+
+namespace bbcreaMaracasVisu
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,ManualContourModel_Box)
+BBTK_BLACK_BOX_IMPLEMENTATION(ManualContourModel_Box,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ManualContourModel_Box::Process()
+{
+
+// THE MAIN PROCESSING METHOD BODY
+//   Here we simply set the input 'In' value to the output 'Out'
+//   And print out the output value
+// INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
+//    void bbSet{Input|Output}NAME(const TYPE&)
+//    const TYPE& bbGet{Input|Output}NAME() const 
+//    Where :
+//    * NAME is the name of the input/output
+//      (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;
+       
+       creaContoursFactory f;
+       manualContourModel      *m;
+       std::vector<double> lstX;
+       std::vector<double> lstY;
+       std::vector<double> lstZ;
+       int i,size;
+       double x,y,z;
+
+       m = (manualContourModel*)f.getContourModel( bbGetInputType() );
+       m->SetNumberOfPointsSpline( bbGetInputNbPoints() );
+       m->SetCloseContour( bbGetInputOpenClose() );
+       size = bbGetInputLstControlPointsX().size();
+       for (i=0;i<size;i++)
+       {
+               m->InsertPoint( bbGetInputLstControlPointsX()[i] , bbGetInputLstControlPointsY()[i] , bbGetInputLstControlPointsZ()[i] );
+       } // for
+       m->UpdateSpline();
+       size = bbGetInputNbPoints();
+       for (i=0;i<size;i++)
+       {
+               m->GetSpline_i_Point(i,&x,&y,&z);
+               lstX.push_back(x);
+               lstY.push_back(y);
+               lstZ.push_back(z);
+       } // for
+       bbSetOutputLstContourPointsX(lstX);
+       bbSetOutputLstContourPointsY(lstY);
+       bbSetOutputLstContourPointsZ(lstZ);
+
+       delete m;
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ManualContourModel_Box::bbUserSetDefaultValues()
+{
+
+//  SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX 
+//    Here we initialize the input 'In' to 0
+   bbSetInputType(1);
+   bbSetInputOpenClose(true);
+   bbSetInputNbPoints(100);
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ManualContourModel_Box::bbUserInitializeProcessing()
+{
+
+//  THE INITIALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should allocate the internal/output pointers 
+//    if any 
+
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void ManualContourModel_Box::bbUserFinalizeProcessing()
+{
+
+//  THE FINALIZATION METHOD BODY :
+//    Here does nothing 
+//    but this is where you should desallocate the internal/output pointers 
+//    if any
+  
+}
+}
+// EO namespace bbcreaMaracasVisu
+
+
diff --git a/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.h b/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.h
new file mode 100644 (file)
index 0000000..0786994
--- /dev/null
@@ -0,0 +1,66 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifndef __bbcreaMaracasVisuManualContourModel_Box_h_INCLUDED__
+#define __bbcreaMaracasVisuManualContourModel_Box_h_INCLUDED__
+#include "bbcreaMaracasVisu_EXPORT.h"
+#include "bbtkAtomicBlackBox.h"
+#include "iostream"
+
+namespace bbcreaMaracasVisu
+{
+
+class bbcreaMaracasVisu_EXPORT ManualContourModel_Box
+ : 
+   public bbtk::AtomicBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(ManualContourModel_Box,bbtk::AtomicBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(Type,int);
+  BBTK_DECLARE_INPUT(OpenClose,bool);
+  BBTK_DECLARE_INPUT(NbPoints,int);
+  BBTK_DECLARE_INPUT(LstControlPointsX,std::vector<double>);
+  BBTK_DECLARE_INPUT(LstControlPointsY,std::vector<double>);
+  BBTK_DECLARE_INPUT(LstControlPointsZ,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(LstContourPointsX,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(LstContourPointsY,std::vector<double>);
+  BBTK_DECLARE_OUTPUT(LstContourPointsZ,std::vector<double>);
+  BBTK_PROCESS(Process);
+  void Process();
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(ManualContourModel_Box,bbtk::AtomicBlackBox);
+  BBTK_NAME("ManualContourModel_Box");
+  BBTK_AUTHOR("InfoDev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("empty");
+
+  BBTK_INPUT(ManualContourModel_Box,Type,"(1 default) 1=spline, 2=rectangle, 3=circle, 4=bullEye, 6=Line, 7=points, 8=rotationTool, 10=polugon, 12=Spline3D",int,"");
+  BBTK_INPUT(ManualContourModel_Box,OpenClose,"(true default) true=open, fals=close",bool,"");
+  BBTK_INPUT(ManualContourModel_Box,NbPoints,"Number of points int the spline",int,"");
+  BBTK_INPUT(ManualContourModel_Box,LstControlPointsX,"List of control points",std::vector<double>,"");
+  BBTK_INPUT(ManualContourModel_Box,LstControlPointsY,"List of control points",std::vector<double>,"");
+  BBTK_INPUT(ManualContourModel_Box,LstControlPointsZ,"List of control points",std::vector<double>,"");
+
+  BBTK_OUTPUT(ManualContourModel_Box,LstContourPointsX,"List of points in the contour",std::vector<double>,"");
+  BBTK_OUTPUT(ManualContourModel_Box,LstContourPointsY,"List of points in the contour",std::vector<double>,"");
+  BBTK_OUTPUT(ManualContourModel_Box,LstContourPointsZ,"List of points in the contour",std::vector<double>,"");
+
+BBTK_END_DESCRIBE_BLACK_BOX(ManualContourModel_Box);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbcreaMaracasVisu
+
+#endif // __bbcreaMaracasVisuManualContourModel_Box_h_INCLUDED__
+
+
+
+
+
index de2b946de5bd4480bbc78899f08d27a8cc25a37e..e36413448e29d70fe33e61093d2f50958584bbcd 100644 (file)
@@ -39,20 +39,67 @@ void ManualPaint_Model::Process()
                manualpaintmodel->SetBrushSize( bbGetInputBrushSize() );
                manualpaintmodel->SetBrushForm( bbGetInputBrushForm() );
                manualpaintmodel->SetToleranceFill( bbGetInputToleranceFill() );
-               manualpaintmodel->SetDistanceFill( bbGetInputDistanceFill() );
+               manualpaintmodel->SetDistanceFill( bbGetInputDistanceFill() );          
                manualpaintmodel->SetRangeMin( bbGetInputRange()[0] );
                manualpaintmodel->SetRangeMax( bbGetInputRange()[1] );
-               manualpaintmodel->PaintImage( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] );
+               if (bbGetInputPoint().size()==3)
+               {
+                       manualpaintmodel->PaintImage( bbGetInputPoint()[0] , bbGetInputPoint()[1] , bbGetInputPoint()[2] );
+               } // if Points
+
+               if ( bbGetInputByLstPointsX().size()!=0 )
+               {
+                       int i,size = bbGetInputByLstPointsX().size();
+                       for (i=0;i<size;i++)
+                       {
+                               manualpaintmodel->PaintImage( bbGetInputByLstPointsX()[i] , bbGetInputByLstPointsY()[i] , bbGetInputByLstPointsZ()[i] );
+                       } // for
+               }// if ByLstPointsX
+               
+               if (bbGetInputByImagePoints()!=NULL)
+               {
+                       int i,j,k;
+//                     int ia,ja,ka;
+//                     int ii,jj,kk;
+                       int ext[6];
+                       bbGetInputByImagePoints()->GetWholeExtent(ext);
+                       int dimX=ext[1]-ext[0]+1;
+                       int dimY=ext[3]-ext[2]+1;
+                       int dimZ=ext[5]-ext[4]+1;
+                       for (i=0;i<dimX;i++) 
+                       {
+                               if (i%20==0)
+                               {
+                                       printf("ManualPaint_Model %d%\n", (int)(i*100.0/dimX) );
+                               }
+                               for (j=0;j<dimY;j++) 
+                               {
+                                       for (k=0;k<dimZ;k++) 
+                                       {
+                                               if ( bbGetInputByImagePoints()->GetScalarComponentAsDouble(i,j,k, 0)>0)
+                                               {
+                                                       if (bbGetInputImage2()->GetScalarComponentAsDouble(i,j,k, 0)==0)
+                                                       {
+                                                               manualpaintmodel->PaintImage(i,j,k);
+                                                       } // bbGetInputImage2           
+                                               } // GetScalarComponentAsDouble                                         
+                                       }// for k
+                               }// for j
+                       }// for i
+                       printf("ManualPaint_Model %d%\n", 100 );
+               } // if ByImagePoints
         } else {
                printf("EED Warning: Image not set. Box creaMaracasVisu::ManualPaint_Model (BBTK) \n");
        } // if 
-//     manualpaintmodel-> GetScalarRange(double * range);
-//     manualpaintmodel-> SetUndoImage(); //DFCH
-//     manualpaintmodel-> Undo(); //DFCH
-//     manualpaintmodel-> Redo(); //DFCH
-
-
 
+       if (bbGetInputImage2()!=NULL)
+       { 
+               bbSetOutputOut( bbGetInputImage2() );
+       } else if (bbGetInputImage()!=NULL) { 
+               bbSetOutputOut( bbGetInputImage() );
+       } else { 
+               bbSetOutputOut( NULL );
+       } 
 }
 //===== 
 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
@@ -85,6 +132,8 @@ void ManualPaint_Model::bbUserSetDefaultValues()
        range.push_back(0);
        range.push_back(200);
        bbSetInputRange(range);
+
+       bbSetInputByImagePoints(NULL);
   
 }
 //===== 
index f9e5a4c0f7bff9b6955a106d127802aec5a58956..a363219680aa92db596401ef78a71c74811b6e70 100644 (file)
@@ -32,10 +32,12 @@ class bbcreaMaracasVisu_EXPORT ManualPaint_Model
   BBTK_DECLARE_INPUT(ToleranceFill,double);
   BBTK_DECLARE_INPUT(DistanceFill,int);
   BBTK_DECLARE_INPUT(Point,std::vector<int>);
+  BBTK_DECLARE_INPUT(ByImagePoints,vtkImageData*);
+  BBTK_DECLARE_INPUT(ByLstPointsX,std::vector<int>);
+  BBTK_DECLARE_INPUT(ByLstPointsY,std::vector<int>);
+  BBTK_DECLARE_INPUT(ByLstPointsZ,std::vector<int>);
   BBTK_DECLARE_INPUT(Range,std::vector<double>);
-
-
-//  BBTK_DECLARE_OUTPUT(Out,double);
+  BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
   BBTK_PROCESS(Process);
   void Process();
 
@@ -64,11 +66,13 @@ BBTK_BEGIN_DESCRIBE_BLACK_BOX(ManualPaint_Model,bbtk::AtomicBlackBox);
   BBTK_INPUT(ManualPaint_Model,BrushForm,"1 default   A) 2D 0=rect,1=circle    B) 3D 0=cube,1=sphere",int,"");
   BBTK_INPUT(ManualPaint_Model,ToleranceFill,"default 50",double,"");
   BBTK_INPUT(ManualPaint_Model,DistanceFill,"25 (default)",int,"");
-  BBTK_INPUT(ManualPaint_Model,Point,"[0,0,0] (default)",std::vector<int>,"");
+  BBTK_INPUT(ManualPaint_Model,Point,"[] (default)",std::vector<int>,"");
+  BBTK_INPUT(ManualPaint_Model,ByImagePoints,"Use image with values > 0 to run the ManualPaint",vtkImageData*,"");
+  BBTK_INPUT(ManualPaint_Model,ByLstPointsX,"X Lst of points to run the Manual Paint",std::vector<int>,"");
+  BBTK_INPUT(ManualPaint_Model,ByLstPointsY,"Y Lst of points to run the Manual Paint",std::vector<int>,"");
+  BBTK_INPUT(ManualPaint_Model,ByLstPointsZ,"Z Lst of points to run the Manual Paint",std::vector<int>,"");
   BBTK_INPUT(ManualPaint_Model,Range,"min-max range [0 200] default",std::vector<double>,"");
-
-
-//  BBTK_OUTPUT(ManualPaint_Model,Out,"First output",double,"");
+  BBTK_OUTPUT(ManualPaint_Model,Out,"Output image. Is the same pointer of input Image or Image2 with the modifications",vtkImageData*,"");
 
 BBTK_END_DESCRIBE_BLACK_BOX(ManualPaint_Model);
 //===== 
diff --git a/bbtk/src/bbcreaMaracasVisuwxManualTree_MPRWidget_Box.cxx b/bbtk/src/bbcreaMaracasVisuwxManualTree_MPRWidget_Box.cxx
new file mode 100644 (file)
index 0000000..fa4819d
--- /dev/null
@@ -0,0 +1,78 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#include "bbcreaMaracasVisuwxManualTree_MPRWidget_Box.h"
+#include "bbcreaMaracasVisuPackage.h"
+
+#include "widgets/wxManualTree_MPRWidget.h"
+
+#include "vtkMetaImageReader.h"
+
+namespace bbcreaMaracasVisu
+{
+
+BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaMaracasVisu,wxManualTree_MPRWidget_Box)
+BBTK_BLACK_BOX_IMPLEMENTATION(wxManualTree_MPRWidget_Box,bbtk::WxBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void wxManualTree_MPRWidget_Box::Process()
+{
+/*
+   std::string msg;
+    if (bbGetInputTitle()!="")
+      {
+       msg = bbGetInputTitle()+": " + bbGetInputIn();
+      }
+    else
+      {
+       msg = bbGetInputIn();
+      }
+   ((wxStaticText*)bbGetOutputWidget())->SetLabel( bbtk::std2wx( msg ) ); 
+*/
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void wxManualTree_MPRWidget_Box::CreateWidget(wxWindow* parent)
+{
+
+
+       vtkMetaImageReader *reader = vtkMetaImageReader::New();
+       reader->SetFileName("/home/davila/Borrame/eraseme/lea/hola2.mhd");
+       reader->Update();
+
+
+//     marImageData                    *marimagedata           = new marImageData( bbGetInputIn() );
+       marImageData                    *marimagedata           = new marImageData( reader->GetOutput() );
+       wxManualTree_MPRWidget  *window                         = new wxManualTree_MPRWidget( parent,marimagedata ,1);
+       window->ConfigureVTK();
+
+       bbSetOutputWidget( window );
+  
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void wxManualTree_MPRWidget_Box::bbUserSetDefaultValues()
+{
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void wxManualTree_MPRWidget_Box::bbUserInitializeProcessing()
+{
+
+}
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+void wxManualTree_MPRWidget_Box::bbUserFinalizeProcessing()
+{
+
+}
+}
+// EO namespace bbcreaMaracasVisu
+
+
diff --git a/bbtk/src/bbcreaMaracasVisuwxManualTree_MPRWidget_Box.h b/bbtk/src/bbcreaMaracasVisuwxManualTree_MPRWidget_Box.h
new file mode 100644 (file)
index 0000000..6995bc5
--- /dev/null
@@ -0,0 +1,48 @@
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+#ifdef _USE_WXWIDGETS_
+#ifndef __bbcreaMaracasVisuwxManualTree_MPRWidget_Box_h_INCLUDED__
+#define __bbcreaMaracasVisuwxManualTree_MPRWidget_Box_h_INCLUDED__
+#include "bbcreaMaracasVisu_EXPORT.h"
+#include "bbtkWxBlackBox.h"
+
+#include <vtkImageData.h>
+
+namespace bbcreaMaracasVisu
+{
+
+class bbcreaMaracasVisu_EXPORT wxManualTree_MPRWidget_Box
+ : 
+   public bbtk::WxBlackBox
+{
+  BBTK_BLACK_BOX_INTERFACE(wxManualTree_MPRWidget_Box,bbtk::WxBlackBox);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+  BBTK_DECLARE_INPUT(In,vtkImageData*);
+  BBTK_PROCESS(Process);
+  void Process();
+  BBTK_CREATE_WIDGET(CreateWidget);
+  void CreateWidget(wxWindow*);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+};
+
+BBTK_BEGIN_DESCRIBE_BLACK_BOX(wxManualTree_MPRWidget_Box,bbtk::WxBlackBox);
+  BBTK_NAME("wxManualTree_MPRWidget_Box");
+  BBTK_AUTHOR("Info-Dev");
+  BBTK_DESCRIPTION("No Description.");
+  BBTK_CATEGORY("__CategoryBlackBox__");
+  BBTK_INPUT(wxManualTree_MPRWidget_Box,In,"Image",vtkImageData*,"");
+BBTK_END_DESCRIBE_BLACK_BOX(wxManualTree_MPRWidget_Box);
+//===== 
+// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
+//===== 
+}
+// EO namespace bbcreaMaracasVisu
+
+#endif // __bbcreaMaracasVisuwxManualTree_MPRWidget_Box_h_INCLUDED__
+#endif // _USE_WXWIDGETS_
+
index 6178a934b5e926b3f221451777f8e32d10af10ae..c502c56df4126f0f989d63fa18b03f58f8c4f04b 100644 (file)
@@ -114,7 +114,6 @@ manualContourBaseControler* creaContoursFactory::getContourControler(int typeCon
        //Spline 3D
        if(typeContour==12)
        {
-               printf("JPReyes %p creaContoursFactory::getContourControler pasando por el Contour 12 \n",this);
                manContourControl = new manualContour3V3DControler();
        }
 
index f8adbefb811bf7ec126209d634d875ec302eaae2..7a227bc06026318818000fbbd2f53f88ecbe46c0 100644 (file)
@@ -86,7 +86,7 @@ public:
        virtual int                             GetSizeLstPoints();
        virtual double                  GetPathSize();
        virtual void                    Transform_Ax_Plus_B (double Ax, double Bx, double Ay, double By);
-       virtual void    GetSpline_i_Point(int i, double *x, double *y, double *z);
+       virtual void                    GetSpline_i_Point(int i, double *x, double *y, double *z);
        virtual void                    GetSpline_t_Point(double t, double *x, double *y, double *z);
 
        //
@@ -94,7 +94,7 @@ public:
        // @return int - spline points size
        //
        virtual int                             GetNumberOfPointsSpline();
-       virtual void    UpdateSpline();
+       virtual void                    UpdateSpline();
 
        //
        // Returns a list with the actual model
index edee925a4775be64502286deaaedd46a9dd5861b..ca053fdbce90c6ff38b98824c8f8599fb3ac82ad 100644 (file)
@@ -93,12 +93,12 @@ public:
        virtual int                             GetIdPoint(double x, double y, double z, int i_range,int type);
        virtual manualPoint*    GetManualPoint(int id);
        virtual int                             GetSizeLstPoints();
-       int                             GetNumberOfPointsSpline();
+       int                                             GetNumberOfPointsSpline();
        virtual void                    SetNumberOfPointsSpline(int size);
 
-       virtual void    UpdateSpline();
-       void                    SetCloseContour(bool closeContour);
-       bool                    IfCloseContour();
+       virtual void                    UpdateSpline();
+       void                                    SetCloseContour(bool closeContour);
+       bool                                    IfCloseContour();
 //JSTG 25-02-08 -----------------------------------------------------------------
        //void                  GetSplinePoint(double t, double &x, double &y, double &z);      //Method Original
        //void                  GetSplineiPoint(int i, double &x, double &y, double &z);        //Method Original
@@ -106,11 +106,11 @@ public:
        virtual double                  GetPathSize();
        virtual double                  GetPathArea();
 
-       void                    GetNearestPointAndNormal(double *p, double *rp,  double *rn);
+       void                                    GetNearestPointAndNormal(double *p, double *rp,  double *rn);
        
 // JSTG 25-02-08 -----------------------------------------------------------------
-       virtual void    GetSpline_i_Point(int i, double *x, double *y, double *z);
-       void                    GetSpline_t_Point(double t, double *x, double *y, double *z);
+       virtual void                    GetSpline_i_Point(int i, double *x, double *y, double *z);
+       void                                    GetSpline_t_Point(double t, double *x, double *y, double *z);
 //--------------------------------------------------------------------------------
 
        virtual std::vector<manualBaseModel*> ExploseModel(  );
index eafbb9a4a9d3512c03b1e01f6d1d4b72c0c56be5..d05a590073fdefc32daadc18ccb82e3d85faae2f 100644 (file)
@@ -62,12 +62,12 @@ END_EVENT_TABLE( );
 
 
 wxManualTree_MPRWidget::wxManualTree_MPRWidget( wxWindow* parent,
-                          marImageData *marimageData ,double voxelSize)
+                          marImageData *marimageData ,double voxelSize )
 : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL)
 {
 
        _voxelSize                                                      = voxelSize;
-       _marimageData                                                   = marimageData;
+       _marimageData                                           = marimageData;
 
        _wxvtk3Dbaseview_Clipping3D_C           = NULL;
        _wxvtkmpr3Dview_C                                       = NULL;
index 691c2dfd0b9b018177c4b7031f15583b4f2aac3c..8d33679b1a57befb60955098c353d913a0a849d7 100644 (file)
@@ -91,7 +91,7 @@
 class wxManualTree_MPRWidget : public wxPanel
 {
 public:
-    wxManualTree_MPRWidget(wxWindow* parent,marImageData *marimageData,double voxelSize);
+    wxManualTree_MPRWidget( wxWindow* parent , marImageData *marimageData , double voxelSize );
        ~wxManualTree_MPRWidget( );
 
        void ConfigureVTK();