From: Eduardo DAVILA Date: Tue, 14 Jun 2016 11:09:57 +0000 (+0200) Subject: #2976 creaMaracasVisu Feature New Normal - ManualContourModel_Box X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaMaracasVisu.git;a=commitdiff_plain;h=865d74f8d9ea0b80a3bc4de0be2b73d85399c2b5 #2976 creaMaracasVisu Feature New Normal - ManualContourModel_Box --- diff --git a/bbtk/bbs/appli/exampleManualContourModel_Box.bbg b/bbtk/bbs/appli/exampleManualContourModel_Box.bbg new file mode 100644 index 0000000..91749a3 --- /dev/null +++ b/bbtk/bbs/appli/exampleManualContourModel_Box.bbg @@ -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: +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 index 0000000..9b7d180 --- /dev/null +++ b/bbtk/bbs/appli/exampleManualContourModel_Box.bbs @@ -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 "" + +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 diff --git a/bbtk/src/bbcreaMaracasVisuContourControlPoints.cxx b/bbtk/src/bbcreaMaracasVisuContourControlPoints.cxx index b59f6ae..c79906a 100644 --- a/bbtk/src/bbcreaMaracasVisuContourControlPoints.cxx +++ b/bbtk/src/bbcreaMaracasVisuContourControlPoints.cxx @@ -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 index 0000000..e1f6392 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.cxx @@ -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 + + +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 = " < lstX; + std::vector lstY; + std::vector 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;iInsertPoint( bbGetInputLstControlPointsX()[i] , bbGetInputLstControlPointsY()[i] , bbGetInputLstControlPointsZ()[i] ); + } // for + m->UpdateSpline(); + size = bbGetInputNbPoints(); + for (i=0;iGetSpline_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 index 0000000..0786994 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuManualContourModel_Box.h @@ -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); + BBTK_DECLARE_INPUT(LstControlPointsY,std::vector); + BBTK_DECLARE_INPUT(LstControlPointsZ,std::vector); + BBTK_DECLARE_OUTPUT(LstContourPointsX,std::vector); + BBTK_DECLARE_OUTPUT(LstContourPointsY,std::vector); + BBTK_DECLARE_OUTPUT(LstContourPointsZ,std::vector); + 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,""); + BBTK_INPUT(ManualContourModel_Box,LstControlPointsY,"List of control points",std::vector,""); + BBTK_INPUT(ManualContourModel_Box,LstControlPointsZ,"List of control points",std::vector,""); + + BBTK_OUTPUT(ManualContourModel_Box,LstContourPointsX,"List of points in the contour",std::vector,""); + BBTK_OUTPUT(ManualContourModel_Box,LstContourPointsY,"List of points in the contour",std::vector,""); + BBTK_OUTPUT(ManualContourModel_Box,LstContourPointsZ,"List of points in the contour",std::vector,""); + +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__ + + + + + diff --git a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx index de2b946..e364134 100644 --- a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx +++ b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.cxx @@ -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;iPaintImage( 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;iGetScalarComponentAsDouble(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); } //===== diff --git a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.h b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.h index f9e5a4c..a363219 100644 --- a/bbtk/src/bbcreaMaracasVisuManualPaint_Model.h +++ b/bbtk/src/bbcreaMaracasVisuManualPaint_Model.h @@ -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); + BBTK_DECLARE_INPUT(ByImagePoints,vtkImageData*); + BBTK_DECLARE_INPUT(ByLstPointsX,std::vector); + BBTK_DECLARE_INPUT(ByLstPointsY,std::vector); + BBTK_DECLARE_INPUT(ByLstPointsZ,std::vector); BBTK_DECLARE_INPUT(Range,std::vector); - - -// 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,""); + BBTK_INPUT(ManualPaint_Model,Point,"[] (default)",std::vector,""); + 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,""); + BBTK_INPUT(ManualPaint_Model,ByLstPointsY,"Y Lst of points to run the Manual Paint",std::vector,""); + BBTK_INPUT(ManualPaint_Model,ByLstPointsZ,"Z Lst of points to run the Manual Paint",std::vector,""); BBTK_INPUT(ManualPaint_Model,Range,"min-max range [0 200] default",std::vector,""); - - -// 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 index 0000000..fa4819d --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuwxManualTree_MPRWidget_Box.cxx @@ -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 index 0000000..6995bc5 --- /dev/null +++ b/bbtk/src/bbcreaMaracasVisuwxManualTree_MPRWidget_Box.h @@ -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 + +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_ + diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.cpp index 6178a93..c502c56 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/creaContoursFactory.cpp @@ -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(); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualBaseModel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualBaseModel.h index f8adbef..7a227bc 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualBaseModel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualBaseModel.h @@ -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 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.h index edee925..ca053fd 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualContourModel.h @@ -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 ExploseModel( ); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.cxx index eafbb9a..d05a590 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.cxx @@ -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; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.h index 691c2df..8d33679 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxManualTree_MPRWidget.h @@ -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();