From c207afb3b26146b6286e2492ba23a744e3a2e1d2 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 12 Jun 2014 11:07:48 +0200 Subject: [PATCH] 2390 creaMaracasVisu Feature New Normal manual contour information in units and pixels 2389 creaMaracasVisu Feature New Normal new box Measurement 3D widget 2345 creaMaracasVisu Feature Test Phase Normal Ruler01XY --- .../appli/exampleMeasure3DLength_Widget.bbg | 61 ++++++ .../appli/exampleMeasure3DLength_Widget.bbs | 46 ++++ .../appli/exampleRuler01_XY_MPR_Widget.bbg | 67 ++++++ .../appli/exampleRuler01_XY_MPR_Widget.bbs | 50 +++++ bbtk/bbs/boxes/Measure3DLength_Widget.bbg | 203 ++++++++++++++++++ bbtk/bbs/boxes/Measure3DLength_Widget.bbs | 83 +++++++ bbtk/bbs/boxes/Ruler01_XY.bbg | 25 +-- bbtk/bbs/boxes/Ruler01_XY.bbs | 10 +- bbtk/bbs/boxes/Ruler01_XY_MPR_Widget.bbg | 60 ++++-- bbtk/bbs/boxes/Ruler01_XY_MPR_Widget.bbs | 6 + bbtk/src/bbmaracasvisuAxeVolume.cxx | 16 +- bbtk/src/bbmaracasvisuShowNPoints.cxx | 12 +- .../manualContour/manualViewBaseContour.cpp | 26 +++ .../manualContour/manualViewBaseContour.h | 49 ++--- .../manualContour/manualViewContour.cpp | 36 +++- 15 files changed, 669 insertions(+), 81 deletions(-) create mode 100644 bbtk/bbs/appli/exampleMeasure3DLength_Widget.bbg create mode 100644 bbtk/bbs/appli/exampleMeasure3DLength_Widget.bbs create mode 100644 bbtk/bbs/appli/exampleRuler01_XY_MPR_Widget.bbg create mode 100644 bbtk/bbs/appli/exampleRuler01_XY_MPR_Widget.bbs create mode 100644 bbtk/bbs/boxes/Measure3DLength_Widget.bbg create mode 100644 bbtk/bbs/boxes/Measure3DLength_Widget.bbs diff --git a/bbtk/bbs/appli/exampleMeasure3DLength_Widget.bbg b/bbtk/bbs/appli/exampleMeasure3DLength_Widget.bbg new file mode 100644 index 0000000..18d65bc --- /dev/null +++ b/bbtk/bbs/appli/exampleMeasure3DLength_Widget.bbg @@ -0,0 +1,61 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleMeasure3DLength_Widget.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:4 +BOX +creaMaracasVisu:Measure3DLength_Widget:Box00 +ISEXEC:FALSE +39.212290:20.074196:-900.000000 +110.387290:10.074196:-900.000000 +FIN_BOX +BOX +vtk:LoadHola:Box01 +ISEXEC:FALSE +14.249559:77.280455:-900.000000 +59.824559:67.280455:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box02 +ISEXEC:TRUE +64.591067:-8.008876:-900.000000 +110.166067:-18.008876:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box03 +ISEXEC:FALSE +48.781337:50.237496:-900.000000 +109.421337:40.237496:-900.000000 +FIN_BOX +CONNECTIONS:7 +CONNECTION +Box01:Out:Box00:vtkimagedata +NumberOfControlPoints:0 +CONNECTION +Box00:widget:Box02:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box01:Out:Box03:In +NumberOfControlPoints:0 +CONNECTION +Box03:Widget:Box02:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box03:Renderer1:Box00:vtkrender +NumberOfControlPoints:0 +CONNECTION +Box03:Point:Box00:point +NumberOfControlPoints:0 +CONNECTION +Box03:BoxChange:Box00:boxexecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk/bbs/appli/exampleMeasure3DLength_Widget.bbs b/bbtk/bbs/appli/exampleMeasure3DLength_Widget.bbs new file mode 100644 index 0000000..bd7c134 --- /dev/null +++ b/bbtk/bbs/appli/exampleMeasure3DLength_Widget.bbs @@ -0,0 +1,46 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleMeasure3DLength_Widget.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaMaracasVisu +include vtk +include wx + +author "Author ??" +description "Description ??" +category "" + +new Measure3DLength_Widget Box00 + +new LoadHola Box01 + +new LayoutSplit Box02 + set Box02.Orientation "H" + +new ViewerNV Box03 + + +connect Box01.Out Box00.vtkimagedata + +connect Box00.widget Box02.Widget1 + +connect Box01.Out Box03.In + +connect Box03.Widget Box02.Widget2 + +connect Box03.Renderer1 Box00.vtkrender + +connect Box03.Point Box00.point + +connect Box03.BoxChange Box00.boxexecute + + + +# Complex input ports +exec Box02 diff --git a/bbtk/bbs/appli/exampleRuler01_XY_MPR_Widget.bbg b/bbtk/bbs/appli/exampleRuler01_XY_MPR_Widget.bbg new file mode 100644 index 0000000..adb5c97 --- /dev/null +++ b/bbtk/bbs/appli/exampleRuler01_XY_MPR_Widget.bbg @@ -0,0 +1,67 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleRuler01_XY_MPR_Widget.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:FALSE +COMPLEXINPUTS:0 +BOXES:4 +BOX +creaMaracasVisu:Ruler01_XY_MPR_Widget:Box00 +ISEXEC:FALSE +-21.191778:11.391376:-900.000000 +49.983222:1.391376:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box01 +ISEXEC:TRUE +-11.136820:-23.228225:-900.000000 +34.438180:-33.228225:-900.000000 +PORT +Orientation:"H" +FIN_BOX +BOX +vtk:LoadHola:Box02 +ISEXEC:FALSE +-3.500143:66.630004:-900.000000 +42.074857:56.630004:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ViewerNV:Box03 +ISEXEC:FALSE +2.736476:41.556249:-900.000000 +63.376476:31.556249:-900.000000 +FIN_BOX +CONNECTIONS:9 +CONNECTION +Box02:Out:Box03:In +NumberOfControlPoints:0 +CONNECTION +Box03:wxVtkBaseView4:Box00:wxvtkbaseview3 +NumberOfControlPoints:0 +CONNECTION +Box03:wxVtkBaseView3:Box00:wxvtkbaseview2 +NumberOfControlPoints:0 +CONNECTION +Box03:wxVtkBaseView2:Box00:wxvtkbaseview1 +NumberOfControlPoints:0 +CONNECTION +Box00:widget:Box01:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box03:Widget:Box01:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box03:Point:Box00:point3D +NumberOfControlPoints:0 +CONNECTION +Box02:Out:Box00:image +NumberOfControlPoints:0 +CONNECTION +Box03:BoxChange:Box00:boxexecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk/bbs/appli/exampleRuler01_XY_MPR_Widget.bbs b/bbtk/bbs/appli/exampleRuler01_XY_MPR_Widget.bbs new file mode 100644 index 0000000..a3d9887 --- /dev/null +++ b/bbtk/bbs/appli/exampleRuler01_XY_MPR_Widget.bbs @@ -0,0 +1,50 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script +# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/appli/exampleRuler01_XY_MPR_Widget.bbs +# ---------------------------------- + +# BBTK GEditor Script +# ---------------------- + +include std +include itkvtk +include creaMaracasVisu +include wx +include vtk + +author "Author ??" +description "Description ??" +category "" + +new Ruler01_XY_MPR_Widget Box00 + +new LayoutSplit Box01 + set Box01.Orientation "H" + +new LoadHola Box02 + +new ViewerNV Box03 + + +connect Box02.Out Box03.In + +connect Box03.wxVtkBaseView4 Box00.wxvtkbaseview3 + +connect Box03.wxVtkBaseView3 Box00.wxvtkbaseview2 + +connect Box03.wxVtkBaseView2 Box00.wxvtkbaseview1 + +connect Box00.widget Box01.Widget1 + +connect Box03.Widget Box01.Widget2 + +connect Box03.Point Box00.point3D + +connect Box02.Out Box00.image + +connect Box03.BoxChange Box00.boxexecute + + + +# Complex input ports +exec Box01 diff --git a/bbtk/bbs/boxes/Measure3DLength_Widget.bbg b/bbtk/bbs/boxes/Measure3DLength_Widget.bbg new file mode 100644 index 0000000..169fd71 --- /dev/null +++ b/bbtk/bbs/boxes/Measure3DLength_Widget.bbg @@ -0,0 +1,203 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Measure3DLength_Widget.bbg +# ---------------------------------- + +APP_START +CATEGORY:example +DESCRIPTION:Evaluates the sum of the Euclidean distances among the points in the list following their order. Put some points in the image using the Points Widget and the click on Evaluate Length button. +AUTHOR:Ricardo A Corredor +COMPLEXBOX:TRUE +COMPLEXBOXNAME:Measure3DLength_Widget +PACKAGENAME:creaMaracasVisu +COMPLEXOUTPUTS:1 +COMPLEX_PORT +widget +-73.656290:-178.300664:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:4 +COMPLEX_PORT +vtkrender +114.998510:126.184605:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +vtkimagedata +-73.800942:121.819300:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +boxexecute +-8.867026:122.637795:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +point +16.233479:122.637795:-900.000000 +FIN_COMPLEX_PORT +BOXES:13 +BOX +vtk:vtkImageDataPointerRelay:Box17 +ISEXEC:FALSE +-103.073390:85.042401:-900.000000 +-31.898390:75.042401:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box24 +ISEXEC:FALSE +83.350047:58.522374:-900.000000 +128.925047:48.522374:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:ShowNPoints:Box31 +ISEXEC:FALSE +-19.500275:46.578993:-900.000000 +28.819725:36.578993:-900.000000 +FIN_BOX +BOX +wx:LayoutSplit:Box32 +ISEXEC:FALSE +-88.870549:-103.442289:-900.000000 +-43.295549:-113.442289:-900.000000 +PORT +Proportion:"10" +FIN_BOX +BOX +wx:LayoutTab:Box33 +ISEXEC:FALSE +-86.480662:-135.944741:-900.000000 +-28.920662:-145.944741:-900.000000 +FIN_BOX +BOX +wx:OutputText:Box34 +ISEXEC:FALSE +-115.357081:-42.579068:-900.000000 +-69.782081:-52.579068:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box35 +ISEXEC:FALSE +-120.593639:-62.409237:-900.000000 +-63.033639:-72.409237:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:DrawAxe3D:Box36 +ISEXEC:FALSE +30.214068:-57.210352:-900.000000 +75.789068:-67.210352:-900.000000 +FIN_BOX +BOX +vtk:ImageVtkProperties:Box38 +ISEXEC:FALSE +-90.773526:47.520231:-900.000000 +-45.198526:37.520231:-900.000000 +FIN_BOX +BOX +vtk:Transform:Box39 +ISEXEC:FALSE +-28.044997:-32.402812:-900.000000 +17.530003:-42.402812:-900.000000 +FIN_BOX +BOX +vtk:UpdateRender:Box41 +ISEXEC:FALSE +-17.927938:-14.384669:-900.000000 +27.647062:-24.384669:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +vtk:MeasureLength:Box42 +ISEXEC:FALSE +-110.735213:-13.259354:-900.000000 +-65.160213:-23.259354:-900.000000 +FIN_BOX +BOX +vtk:PointsXYZtoVTKPoints:Box43 +ISEXEC:FALSE +-58.228353:0.397139:-900.000000 +12.946647:-9.602861:-900.000000 +FIN_BOX +CONNECTIONS:28 +CONNECTION +vtkimagedata:vtkimagedata:Box17:In +NumberOfControlPoints:0 +CONNECTION +vtkrender:vtkrender:Box24:In +NumberOfControlPoints:0 +CONNECTION +point:point:Box31:In +NumberOfControlPoints:0 +CONNECTION +boxexecute:boxexecute:Box31:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box31:Image +NumberOfControlPoints:0 +CONNECTION +Box34:Widget:Box35:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box35:Widget:Box32:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box31:Widget:Box32:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box32:Widget:Box33:Widget1 +NumberOfControlPoints:0 +CONNECTION +Box33:Widget:widget:widget +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box31:Renderer +NumberOfControlPoints:0 +CONNECTION +Box31:lstPointsY:Box36:lstPointY +NumberOfControlPoints:0 +CONNECTION +Box31:lstPointsX:Box36:lstPointX +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box36:Renderer +NumberOfControlPoints:0 +CONNECTION +Box31:lstPointsZ:Box36:lstPointZ +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box38:In +NumberOfControlPoints:0 +CONNECTION +Box39:Out:Box36:Transform +NumberOfControlPoints:0 +CONNECTION +Box38:Spacing:Box39:Scale +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box41:Renderer +NumberOfControlPoints:0 +CONNECTION +Box31:BoxChange:Box41:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box42:Length:Box34:In +NumberOfControlPoints:0 +CONNECTION +Box43:Points:Box42:Points +NumberOfControlPoints:0 +CONNECTION +Box31:lstPointsX:Box43:LstPointsX +NumberOfControlPoints:0 +CONNECTION +Box31:lstPointsY:Box43:LstPointsY +NumberOfControlPoints:0 +CONNECTION +Box31:lstPointsZ:Box43:LstPointsZ +NumberOfControlPoints:0 +CONNECTION +Box31:BoxChange:Box34:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box42:ImageData +NumberOfControlPoints:0 +CONNECTION +Box31:BoxChange:Box36:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk/bbs/boxes/Measure3DLength_Widget.bbs b/bbtk/bbs/boxes/Measure3DLength_Widget.bbs new file mode 100644 index 0000000..ac4328d --- /dev/null +++ b/bbtk/bbs/boxes/Measure3DLength_Widget.bbs @@ -0,0 +1,83 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/creaTools/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Measure3DLength_Widget.bbs +# ---------------------------------- + +include std +include itkvtk +include vtk +include std +include creaMaracasVisu +include wx + +define Measure3DLength_Widget creaMaracasVisu + +author "Ricardo A Corredor" +description "Evaluates the sum of the Euclidean distances among the points in the list following their order. Put some points in the image using the Points Widget and the click on Evaluate Length button. " + +category "example" + +new vtkImageDataPointerRelay Box17 + +new MagicBox Box24 + +new ShowNPoints Box31 + +new LayoutSplit Box32 + set Box32.Proportion "10" + +new LayoutTab Box33 + +new OutputText Box34 + +new LayoutLine Box35 + +new DrawAxe3D Box36 + +new ImageVtkProperties Box38 + +new Transform Box39 + +new UpdateRender Box41 + set Box41.Active "true" + +new MeasureLength Box42 + +new PointsXYZtoVTKPoints Box43 + + +connect Box17.Out Box31.Image +connect Box34.Widget Box35.Widget1 +connect Box35.Widget Box32.Widget1 +connect Box31.Widget Box32.Widget2 +connect Box32.Widget Box33.Widget1 +connect Box24.Out Box31.Renderer +connect Box31.lstPointsY Box36.lstPointY +connect Box31.lstPointsX Box36.lstPointX +connect Box24.Out Box36.Renderer +connect Box31.lstPointsZ Box36.lstPointZ +connect Box17.Out Box38.In +connect Box39.Out Box36.Transform +connect Box38.Spacing Box39.Scale +connect Box24.Out Box41.Renderer +connect Box31.BoxChange Box41.BoxExecute +connect Box42.Length Box34.In +connect Box43.Points Box42.Points +connect Box31.lstPointsX Box43.LstPointsX +connect Box31.lstPointsY Box43.LstPointsY +connect Box31.lstPointsZ Box43.LstPointsZ +connect Box31.BoxChange Box34.BoxExecute +connect Box17.Out Box42.ImageData +connect Box31.BoxChange Box36.BoxExecute + +# Complex input ports +input vtkimagedata Box17.In " " +input vtkrender Box24.In " " +input point Box31.In " " +input boxexecute Box31.BoxExecute " " + +# Complex output ports +output widget Box33.Widget " " + + +endefine diff --git a/bbtk/bbs/boxes/Ruler01_XY.bbg b/bbtk/bbs/boxes/Ruler01_XY.bbg index 3483a74..3dfe5e6 100644 --- a/bbtk/bbs/boxes/Ruler01_XY.bbg +++ b/bbtk/bbs/boxes/Ruler01_XY.bbg @@ -44,7 +44,7 @@ COMPLEX_PORT wxvtkbaseview 105.349495:86.477605:-900.000000 FIN_COMPLEX_PORT -BOXES:20 +BOXES:19 BOX vtk:ImageVtkProperties:Box00 ISEXEC:FALSE @@ -80,22 +80,14 @@ PORT I:"0" FIN_BOX BOX -std:Div:Box15 -ISEXEC:FALSE --209.698469:-17.442919:-900.000000 --176.923469:-27.442919:-900.000000 -PORT -In1:"1" -FIN_BOX -BOX std:ConcatStrings:Box16 ISEXEC:FALSE 122.643426:-194.996817:-900.000000 168.218426:-204.996817:-900.000000 PORT -In2:"u (" +In2:"p (" PORT -In4:"p) " +In4:"u) " PORT In5:" ang=" PORT @@ -195,7 +187,7 @@ ISEXEC:FALSE -34.175716:55.173035:-900.000000 11.399284:45.173035:-900.000000 FIN_BOX -CONNECTIONS:40 +CONNECTIONS:39 CONNECTION Box00:Spacing:Box05:In1 NumberOfControlPoints:0 @@ -203,12 +195,6 @@ CONNECTION Box00:Spacing:Box14:In NumberOfControlPoints:0 CONNECTION -Box14:Out:Box15:In2 -NumberOfControlPoints:0 -CONNECTION -Box15:Out:Box17:In2 -NumberOfControlPoints:0 -CONNECTION Box17:Out:Box16:In3 NumberOfControlPoints:0 CONNECTION @@ -316,4 +302,7 @@ NumberOfControlPoints:0 CONNECTION Box03:Out:Box29:Translate NumberOfControlPoints:0 +CONNECTION +Box14:Out:Box17:In2 +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Ruler01_XY.bbs b/bbtk/bbs/boxes/Ruler01_XY.bbs index 544ccc3..055a8bb 100644 --- a/bbtk/bbs/boxes/Ruler01_XY.bbs +++ b/bbtk/bbs/boxes/Ruler01_XY.bbs @@ -28,12 +28,9 @@ new UpdateRender Box07 new GetVectorFloatElement Box14 set Box14.I "0" -new Div Box15 - set Box15.In1 "1" - new ConcatStrings Box16 - set Box16.In2 "u (" - set Box16.In4 "p) " + set Box16.In2 "p (" + set Box16.In4 "u) " set Box16.In5 " ang=" set Box16.In7 " ." @@ -74,8 +71,6 @@ new MagicBox Box31 connect Box00.Spacing Box05.In1 connect Box00.Spacing Box14.In -connect Box14.Out Box15.In2 -connect Box15.Out Box17.In2 connect Box17.Out Box16.In3 connect Box18.Out Box17.In1 connect Box18.Out Box16.In1 @@ -104,6 +99,7 @@ connect Box03.Out Box28.CenterPointIn connect Box30.Direction Box28.Direction connect Box30.vtkRenderer Box19.In connect Box03.Out Box29.Translate +connect Box14.Out Box17.In2 # Complex input ports input SizeReal Box18.In " " diff --git a/bbtk/bbs/boxes/Ruler01_XY_MPR_Widget.bbg b/bbtk/bbs/boxes/Ruler01_XY_MPR_Widget.bbg index c80dd2c..9794657 100644 --- a/bbtk/bbs/boxes/Ruler01_XY_MPR_Widget.bbg +++ b/bbtk/bbs/boxes/Ruler01_XY_MPR_Widget.bbg @@ -13,35 +13,39 @@ PACKAGENAME:creaMaracasVisu COMPLEXOUTPUTS:1 COMPLEX_PORT widget --27.752181:-66.376350:-900.000000 +19.952815:-37.492466:-900.000000 FIN_COMPLEX_PORT -COMPLEXINPUTS:5 +COMPLEXINPUTS:6 COMPLEX_PORT wxvtkbaseview1 --47.493423:85.259277:-900.000000 +29.281804:82.836758:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT wxvtkbaseview2 -64.373615:83.256542:-900.000000 +40.148422:83.070194:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT wxvtkbaseview3 -115.872507:84.400962:-900.000000 +52.327962:82.723833:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT point3D -6.580414:82.684332:-900.000000 +101.990405:84.734156:-900.000000 FIN_COMPLEX_PORT COMPLEX_PORT image --68.951294:85.545382:-900.000000 +-65.597036:83.309210:-900.000000 FIN_COMPLEX_PORT -BOXES:6 +COMPLEX_PORT +boxexecute +-10.018206:80.872425:-900.000000 +FIN_COMPLEX_PORT +BOXES:7 BOX creaMaracasVisu:Ruler01_XY_Widget:Box00 ISEXEC:FALSE --82.112122:10.013673:-900.000000 --36.537122:0.013673:-900.000000 +-31.984607:12.063497:-900.000000 +13.590393:2.063497:-900.000000 FIN_BOX BOX creaMaracasVisu:Ruler01_XY_Widget:Box01 @@ -52,28 +56,34 @@ FIN_BOX BOX creaMaracasVisu:Ruler01_XY_Widget:Box02 ISEXEC:FALSE -93.842425:14.305248:-900.000000 -139.417425:4.305248:-900.000000 +89.370082:11.323686:-900.000000 +134.945082:1.323686:-900.000000 FIN_BOX BOX wx:LayoutTab:Box03 ISEXEC:FALSE --34.046490:-39.482484:-900.000000 -23.513510:-49.482484:-900.000000 +16.826416:-12.462076:-900.000000 +74.386416:-22.462076:-900.000000 FIN_BOX BOX std:MagicBox:Box04 ISEXEC:FALSE -12.302513:59.795936:-900.000000 -57.877513:49.795936:-900.000000 +94.668170:61.286717:-900.000000 +140.243170:51.286717:-900.000000 FIN_BOX BOX vtk:vtkImageDataPointerRelay:Box06 ISEXEC:FALSE --112.725353:60.082041:-900.000000 --41.550353:50.082041:-900.000000 +-75.642173:59.150303:-900.000000 +-4.467173:49.150303:-900.000000 FIN_BOX -CONNECTIONS:15 +BOX +std:MagicBox:Box07 +ISEXEC:FALSE +20.915502:54.597408:-900.000000 +66.490502:44.597408:-900.000000 +FIN_BOX +CONNECTIONS:19 CONNECTION Box00:Widget:Box03:Widget1 NumberOfControlPoints:0 @@ -119,4 +129,16 @@ NumberOfControlPoints:0 CONNECTION Box06:Out:Box02:Image NumberOfControlPoints:0 +CONNECTION +boxexecute:boxexecute:Box07:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box07:Out:Box00:BoxExecuteRulerInterface +NumberOfControlPoints:0 +CONNECTION +Box07:Out:Box01:BoxExecuteRulerInterface +NumberOfControlPoints:0 +CONNECTION +Box07:Out:Box02:BoxExecuteRulerInterface +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Ruler01_XY_MPR_Widget.bbs b/bbtk/bbs/boxes/Ruler01_XY_MPR_Widget.bbs index eec1b94..0a8cc1e 100644 --- a/bbtk/bbs/boxes/Ruler01_XY_MPR_Widget.bbs +++ b/bbtk/bbs/boxes/Ruler01_XY_MPR_Widget.bbs @@ -29,6 +29,8 @@ new MagicBox Box04 new vtkImageDataPointerRelay Box06 +new MagicBox Box07 + connect Box00.Widget Box03.Widget1 connect Box01.Widget Box03.Widget2 @@ -39,6 +41,9 @@ connect Box04.Out Box02.Point connect Box06.Out Box00.Image connect Box06.Out Box01.Image connect Box06.Out Box02.Image +connect Box07.Out Box00.BoxExecuteRulerInterface +connect Box07.Out Box01.BoxExecuteRulerInterface +connect Box07.Out Box02.BoxExecuteRulerInterface # Complex input ports input wxvtkbaseview2 Box01.wxvtkbaseview " " @@ -46,6 +51,7 @@ input wxvtkbaseview3 Box02.wxvtkbaseview " " input point3D Box04.In " " input wxvtkbaseview1 Box00.wxvtkbaseview " " input image Box06.In " " +input boxexecute Box07.BoxExecute " " # Complex output ports output widget Box03.Widget " " diff --git a/bbtk/src/bbmaracasvisuAxeVolume.cxx b/bbtk/src/bbmaracasvisuAxeVolume.cxx index 53c5d38..79e5ac0 100644 --- a/bbtk/src/bbmaracasvisuAxeVolume.cxx +++ b/bbtk/src/bbmaracasvisuAxeVolume.cxx @@ -69,13 +69,15 @@ void AxeVolume::Process() int i,j,k; - int sizeLstPointR = bbGetInputlstPointR().size(); - int iAxe,sizeAxe=bbGetInputlstPointX().size(); + int sizeLstPointR = bbGetInputlstPointR().size(); + int iAxe,sizeAxe = bbGetInputlstPointX().size(); double rx,ry,rz; double r,rr; unsigned short *p; - int sizeImage = sizeX*sizeY*sizeZ; - double px,py,pz,px1,py1,pz1,px2,py2,pz2; + int sizeImage = sizeX*sizeY*sizeZ; + double px,py,pz; + double px1,py1,pz1; + double px2,py2,pz2; // Clean image p = (unsigned short*)mimage->GetScalarPointer (0, 0, 0); @@ -87,16 +89,16 @@ void AxeVolume::Process() for (iAxe=0 ; iAxe=1) { r = bbGetInputlstPointR()[ bbGetInputlstPointR().size()-1 ] * invSpc[0]; } else { r = 1; } - } else { - r = bbGetInputlstPointR()[ iAxe ]* invSpc[0]; } px = bbGetInputlstPointX()[iAxe] * invSpc[0]; py = bbGetInputlstPointY()[iAxe] * invSpc[1]; diff --git a/bbtk/src/bbmaracasvisuShowNPoints.cxx b/bbtk/src/bbmaracasvisuShowNPoints.cxx index b33daa4..7c33f5d 100644 --- a/bbtk/src/bbmaracasvisuShowNPoints.cxx +++ b/bbtk/src/bbmaracasvisuShowNPoints.cxx @@ -352,10 +352,14 @@ void WidgetShowNPoints::OnAddPoint (wxCommandEvent& event) mbbShowNPoints->bbSetOutputlstPointsY( lstPointsY ); mbbShowNPoints->bbSetOutputlstPointsZ( lstPointsZ ); mbbShowNPoints->bbSetOutputlstLabels( lstLabels ); - mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsX")); - mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsY")); - mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsZ")); - mbbShowNPoints->bbSignalOutputModification(std::string("lstLabels")); + + mbbShowNPoints->bbSignalOutputModification(); + +//EED 07/07/2014 +// mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsX")); +// mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsY")); +// mbbShowNPoints->bbSignalOutputModification(std::string("lstPointsZ")); +// mbbShowNPoints->bbSignalOutputModification(std::string("lstLabels")); } //------------------------------------------------------------------------ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp index 4a3daf7..1e76574 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.cpp @@ -214,6 +214,7 @@ void manualViewBaseContour::AddTextActor() if(_show_text) { _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor ); + _wxvtkbaseview->GetRenderer()->AddActor2D( _textActor2 ); } } // ---------------------------------------------------------------------------- @@ -222,6 +223,7 @@ void manualViewBaseContour::RemoveTextActor() if(_show_text) { _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor ); + _wxvtkbaseview->GetRenderer()->RemoveActor2D( _textActor2 ); } } // ---------------------------------------------------------------------------- @@ -310,6 +312,7 @@ void manualViewBaseContour::ConstructVTKObjects() InitTextActor(); } +// ---------------------------------------------------------------------------- void manualViewBaseContour::InitTextActor() { // Text @@ -326,6 +329,23 @@ void manualViewBaseContour::InitTextActor() tprop->SetFontSize(14); tprop->SetFontFamilyToArial(); tprop->SetColor(0, 0, 1); + + + // Text 2 + _textActor2 = vtkTextActor::New(); +// _textActor->SetDisplayPosition(200, 200); + _textActor2->SetInput("00"); + // Set coordinates to match the old vtkScaledTextActor default value +// _textActor2->GetPosition2Coordinate()->SetCoordinateSystemToNormalizedViewport(); +// _textActor2->GetPosition2Coordinate()->SetValue( 0.2 , 0.2 ); + _textActor2->GetPositionCoordinate()->SetCoordinateSystemToWorld (); +// _textActor2->GetPositionCoordinate()->SetValue( 0.8 , 0.8 ); + + vtkTextProperty *tprop2 = _textActor2->GetTextProperty(); + tprop2->SetFontSize(14); + tprop2->SetFontFamilyToArial(); + tprop2->SetColor(0, 0, 1); + } // ---------------------------------------------------------------------------- @@ -660,7 +680,10 @@ void manualViewBaseContour::Refresh() // virtual void manualViewBaseContour::RefreshText() // virtual { if( _textActor!=NULL) + { _textActor -> SetInput("00"); + _textActor2 -> SetInput("00"); + } } // ---------------------------------------------------------------------------- void manualViewBaseContour::SetColorNormalContour(double r, double g, double b) @@ -913,6 +936,8 @@ void manualViewBaseContour::SetVisible(bool ok) _contourVtkActor->GetProperty()->SetOpacity( opacity ); _textActor->GetProperty()->SetOpacity( opacity ); _textActor->SetInput("00"); + _textActor2->GetProperty()->SetOpacity( opacity ); + _textActor2->SetInput("00"); } // ---------------------------------------------------------------------------- @@ -922,6 +947,7 @@ void manualViewBaseContour::SetShowText(bool ok) if (_show_text==false && _textActor!=NULL) { _textActor->SetInput("00"); + _textActor2->SetInput("00"); } } // ---------------------------------------------------------------------------- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.h index 10ead8b..d773a7e 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewBaseContour.h @@ -208,56 +208,57 @@ private: protected: - double _range; - - double _coulorEdit_r; - double _coulorEdit_g; - double _coulorEdit_b; - double _coulorNormal_r; - double _coulorNormal_g; - double _coulorNormal_b; - double _coulorSelection_r; - double _coulorSelection_g; - double _coulorSelection_b; - double _widthline; + double _range; + + double _coulorEdit_r; + double _coulorEdit_g; + double _coulorEdit_b; + double _coulorNormal_r; + double _coulorNormal_g; + double _coulorNormal_b; + double _coulorSelection_r; + double _coulorSelection_g; + double _coulorSelection_b; + double _widthline; // // Reference to VTKBaseView // - wxVtkBaseView *_wxvtkbaseview; + wxVtkBaseView *_wxvtkbaseview; // // Is the contour selected // - bool _selected; - bool *_editable; - bool _posibleSelected; - bool _viewControlPoints; + bool _selected; + bool *_editable; + bool _posibleSelected; + bool _viewControlPoints; // text - bool _show_text; - int _id_viewPoint_for_text; - vtkTextActor *_textActor; + bool _show_text; + int _id_viewPoint_for_text; + vtkTextActor *_textActor; + vtkTextActor *_textActor2; // // Contour model // manualBaseModel *_manContModel; - vtkPoints *_pts; + vtkPoints *_pts; // JSTG 25-02-08 -------------------------------------------- - int _sizePointsContour; + int _sizePointsContour; //----------------------------------------------------------- // // Control points list // - std::vector _lstViewPoints; + std::vector _lstViewPoints; // // Spacing // - double _spc[3]; + double _spc[3]; virtual void RefreshText(); diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp index 8cc853c..0006b13 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour/manualViewContour.cpp @@ -151,8 +151,10 @@ void manualViewContour::RefreshText() // virtual if ((_textActor!=NULL) && ( _textActor->GetProperty()->GetOpacity()!=0 )){ int size = GetNumberOfPoints(); char text[50]; - char resultText[50]; + char resultText[250]; strcpy(resultText, "000"); + char resultText2[250]; + strcpy(resultText2, "000"); //CMRU 19-08-09 ---------------------------------- std::string label; @@ -164,10 +166,17 @@ void manualViewContour::RefreshText() // virtual strcpy(resultText,"L= "); gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text ); strcat(resultText,text); + strcat(resultText,"p"); //CMRU 19-08-09 ---------------------------------- strcat(resultText," "); strcat(resultText,label.c_str()); + + strcpy(resultText2,"L= "); + gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text ); + strcat(resultText2,text); + strcat(resultText2,"u"); + //------------------------------------------------ } if (size>2) @@ -177,14 +186,35 @@ void manualViewContour::RefreshText() // virtual strcpy(resultText,"P= "); gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text ); strcat(resultText,text); + strcat(resultText,"p"); + gcvt ( _mesureScale * _mesureScale * this->_manContModel->GetPathArea(), 5, text ); strcat(resultText," A= "); strcat(resultText,text); - strcat(resultText," "); + strcat(resultText,"p^2 "); + + + strcpy(resultText2,"P= "); + gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text ); + strcat(resultText2,text); + strcat(resultText2,"u"); + + gcvt ( _mesureScale * _mesureScale * this->_manContModel->GetPathArea(), 5, text ); + strcat(resultText2," A= "); + strcat(resultText2,text); + strcat(resultText2,"u^2 "); + } else { strcpy(resultText,"L= "); gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text ); strcat(resultText,text); + strcat(resultText,"p"); + + strcpy(resultText2,"L= "); + gcvt ( _mesureScale * this->_manContModel->GetPathSize(), 5, text ); + strcat(resultText2,text); + strcat(resultText2,"u"); + } //CMRU 19-08-09 ---------------------------------- strcat(resultText,label.c_str()); @@ -192,6 +222,7 @@ void manualViewContour::RefreshText() // virtual } _textActor->SetInput(resultText); + _textActor2->SetInput(resultText2); if (size>=1){ @@ -217,6 +248,7 @@ void manualViewContour::RefreshText() // virtual py=py*_spc[1]; _textActor->SetPosition(px+GetRange()+1,py); + _textActor2->SetPosition(px+GetRange()+1,py+2); } } } -- 2.47.1