From 0a78cc1bbbd1875930b8e9b74053f947e33691ef Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Mon, 18 Mar 2019 16:51:49 +0100 Subject: [PATCH] #3238 creaVtk Feature New Normal - ApplyMask box --- .../bbs/boxes/VectorVisuPlane.bbg | 326 ++++++++++++++ .../bbs/boxes/VectorVisuPlane.bbs | 130 ++++++ .../bbs/boxes/VectorVisuPlane_Widget.bbg | 424 ++++++++++++++++++ .../bbs/boxes/VectorVisuPlane_Widget.bbs | 153 +++++++ bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx | 135 ++++++ bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.h | 51 +++ bbtk_creaVtk_PKG/src/bbcreaVtkVectorsVisu.h | 2 +- lib/creaVtk/vtkVectorsVisu.cpp | 18 +- 8 files changed, 1229 insertions(+), 10 deletions(-) create mode 100644 bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbg create mode 100644 bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbs create mode 100644 bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbg create mode 100644 bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbs create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx create mode 100644 bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.h diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbg b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbg new file mode 100644 index 0000000..8daac66 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbg @@ -0,0 +1,326 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:TRUE +COMPLEXBOXNAME:VectorVisuPlane +PACKAGENAME:creaVtk +COMPLEXOUTPUTS:1 +COMPLEX_PORT +outvtkdataset +65.397463:-185.352165:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:4 +COMPLEX_PORT +structuredpoints +168.091564:208.867022:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +point +116.120397:207.428577:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +boxexecute +39.849629:211.168926:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +orientation +81.925146:210.995455:-900.000000 +FIN_COMPLEX_PORT +BOXES:22 +BOX +vtk:ProbeFilter:Box05 +ISEXEC:FALSE +68.090835:-154.896636:-900.000000 +104.490835:-164.896636:-900.000000 +FIN_BOX +BOX +creaVtk:PlaneSource:Box06 +ISEXEC:FALSE +-55.604401:-115.235612:-900.000000 +-17.154401:-125.235612:-900.000000 +PORT +Center:"10 10 10" +PORT +Normal:"0 0 1" +PORT +XResolution:"100" +PORT +YResolution:"100" +FIN_BOX +BOX +vtk:ImageVtkProperties:Box15 +ISEXEC:FALSE +-83.675523:128.799375:-900.000000 +-38.325523:118.799375:-900.000000 +FIN_BOX +BOX +std:GetVectorIntElement:Box16 +ISEXEC:FALSE +-150.960816:98.785690:-900.000000 +-104.510816:88.785690:-900.000000 +PORT +I:"0" +FIN_BOX +BOX +std:Div:Box17 +ISEXEC:FALSE +-154.010066:77.460700:-900.000000 +-124.685066:67.460700:-900.000000 +PORT +In2:"2" +FIN_BOX +BOX +std:GetVectorIntElement:Box18 +ISEXEC:FALSE +-85.650958:97.856583:-900.000000 +-39.200958:87.856583:-900.000000 +PORT +I:"1" +FIN_BOX +BOX +std:Div:Box19 +ISEXEC:FALSE +-105.283745:77.582504:-900.000000 +-75.958745:67.582504:-900.000000 +PORT +In2:"2" +FIN_BOX +BOX +std:GetVectorIntElement:Box20 +ISEXEC:FALSE +12.597771:35.349688:-900.000000 +59.047771:25.349688:-900.000000 +PORT +I:"2" +FIN_BOX +BOX +std:ConcatStrings:Box21 +ISEXEC:FALSE +-37.754838:12.042731:-900.000000 +1.970162:2.042731:-900.000000 +PORT +In2:" " +PORT +In4:" " +FIN_BOX +BOX +std:MathOperationVector:Box22 +ISEXEC:FALSE +-97.981490:-56.193301:-900.000000 +-50.456490:-66.193301:-900.000000 +PORT +Type:"2" +FIN_BOX +BOX +std:GetVectorIntElement:Box23 +ISEXEC:FALSE +-25.954150:102.423268:-900.000000 +20.495850:92.423268:-900.000000 +PORT +I:"2" +FIN_BOX +BOX +std:Div:Box24 +ISEXEC:FALSE +-34.789630:81.174151:-900.000000 +-5.464630:71.174151:-900.000000 +PORT +In2:"2" +FIN_BOX +BOX +std:MagicBox:Box41 +ISEXEC:FALSE +156.767214:162.166259:-900.000000 +192.842214:152.166259:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box43 +ISEXEC:FALSE +37.054745:160.043818:-900.000000 +73.129745:150.043818:-900.000000 +FIN_BOX +BOX +std:StringSelect:Box45 +ISEXEC:FALSE +-129.200732:-36.832657:-900.000000 +-87.040732:-46.832657:-900.000000 +FIN_BOX +BOX +std:ConcatStrings:Box46 +ISEXEC:FALSE +-166.643801:11.251334:-900.000000 +-126.918801:1.251334:-900.000000 +PORT +In2:" " +PORT +In4:" " +FIN_BOX +BOX +std:GetVectorIntElement:Box47 +ISEXEC:FALSE +-179.093435:36.317539:-900.000000 +-132.643435:26.317539:-900.000000 +PORT +I:"0" +FIN_BOX +BOX +std:MagicBox:Box48 +ISEXEC:FALSE +103.365686:162.462813:-900.000000 +139.440686:152.462813:-900.000000 +FIN_BOX +BOX +std:GetVectorIntElement:Box49 +ISEXEC:FALSE +-75.467291:34.093419:-900.000000 +-29.017291:24.093419:-900.000000 +PORT +I:"1" +FIN_BOX +BOX +std:ConcatStrings:Box50 +ISEXEC:FALSE +-90.467260:10.836635:-900.000000 +-50.742260:0.836635:-900.000000 +PORT +In2:" " +PORT +In4:" " +FIN_BOX +BOX +std:StringSelect:Box33 +ISEXEC:FALSE +135.527853:-57.599081:-900.000000 +177.687853:-67.599081:-900.000000 +PORT +In0:"1 0 0" +PORT +In1:"0 1 0" +PORT +In2:"0 0 1" +FIN_BOX +BOX +std:MagicBox:Box34 +ISEXEC:FALSE +92.061688:100.413387:-900.000000 +128.136688:90.413387:-900.000000 +FIN_BOX +CONNECTIONS:37 +CONNECTION +Box06:PolyData:Box05:Input +NumberOfControlPoints:0 +CONNECTION +Box15:Size:Box16:In +NumberOfControlPoints:0 +CONNECTION +Box16:Out:Box17:In1 +NumberOfControlPoints:0 +CONNECTION +Box18:Out:Box19:In1 +NumberOfControlPoints:0 +CONNECTION +Box15:Size:Box18:In +NumberOfControlPoints:0 +CONNECTION +Box20:Out:Box21:In5 +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box21:In1 +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box21:In3 +NumberOfControlPoints:0 +CONNECTION +Box15:Spacing:Box22:In1 +NumberOfControlPoints:0 +CONNECTION +Box22:Out:Box06:Center +NumberOfControlPoints:0 +CONNECTION +Box23:Out:Box24:In1 +NumberOfControlPoints:0 +CONNECTION +Box15:Size:Box23:In +NumberOfControlPoints:0 +CONNECTION +Box41:Out:Box15:In +NumberOfControlPoints:0 +CONNECTION +Box41:Out:Box05:Source +NumberOfControlPoints:0 +CONNECTION +structuredpoints:structuredpoints:Box41:In +NumberOfControlPoints:0 +CONNECTION +boxexecute:boxexecute:Box43:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box43:BoxChange:Box06:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box43:BoxChange:Box05:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box45:Out:Box22:In0 +NumberOfControlPoints:0 +CONNECTION +point:point:Box48:In +NumberOfControlPoints:0 +CONNECTION +Box48:Out:Box20:In +NumberOfControlPoints:0 +CONNECTION +Box48:Out:Box47:In +NumberOfControlPoints:0 +CONNECTION +Box47:Out:Box46:In1 +NumberOfControlPoints:0 +CONNECTION +Box19:Out:Box46:In3 +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box46:In5 +NumberOfControlPoints:0 +CONNECTION +Box48:Out:Box49:In +NumberOfControlPoints:0 +CONNECTION +Box49:Out:Box50:In3 +NumberOfControlPoints:0 +CONNECTION +Box17:Out:Box50:In1 +NumberOfControlPoints:0 +CONNECTION +Box24:Out:Box50:In5 +NumberOfControlPoints:0 +CONNECTION +Box05:Out:outvtkdataset:outvtkdataset +NumberOfControlPoints:0 +CONNECTION +Box33:Out:Box06:Normal +NumberOfControlPoints:0 +CONNECTION +orientation:orientation:Box34:In +NumberOfControlPoints:0 +CONNECTION +Box34:Out:Box45:In +NumberOfControlPoints:0 +CONNECTION +Box34:Out:Box33:In +NumberOfControlPoints:0 +CONNECTION +Box46:Out:Box45:In0 +NumberOfControlPoints:0 +CONNECTION +Box50:Out:Box45:In1 +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box45:In2 +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbs b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbs new file mode 100644 index 0000000..652e0db --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbs @@ -0,0 +1,130 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane.bbs +# ---------------------------------- + +include std +include itkvtk +include vtk +include creaVtk +include std + +define VectorVisuPlane creaVtk + +author "Author ??" +description "Description ??" + +category "" + +new vtk:ProbeFilter Box05 + +new creaVtk:PlaneSource Box06 + set Box06.Center "10 10 10" + set Box06.Normal "0 0 1" + set Box06.XResolution "100" + set Box06.YResolution "100" + +new vtk:ImageVtkProperties Box15 + +new std:GetVectorIntElement Box16 + set Box16.I "0" + +new std:Div Box17 + set Box17.In2 "2" + +new std:GetVectorIntElement Box18 + set Box18.I "1" + +new std:Div Box19 + set Box19.In2 "2" + +new std:GetVectorIntElement Box20 + set Box20.I "2" + +new std:ConcatStrings Box21 + set Box21.In2 " " + set Box21.In4 " " + +new std:MathOperationVector Box22 + set Box22.Type "2" + +new std:GetVectorIntElement Box23 + set Box23.I "2" + +new std:Div Box24 + set Box24.In2 "2" + +new std:MagicBox Box41 + +new std:MagicBox Box43 + +new std:StringSelect Box45 + +new std:ConcatStrings Box46 + set Box46.In2 " " + set Box46.In4 " " + +new std:GetVectorIntElement Box47 + set Box47.I "0" + +new std:MagicBox Box48 + +new std:GetVectorIntElement Box49 + set Box49.I "1" + +new std:ConcatStrings Box50 + set Box50.In2 " " + set Box50.In4 " " + +new std:StringSelect Box33 + set Box33.In0 "1 0 0" + set Box33.In1 "0 1 0" + set Box33.In2 "0 0 1" + +new std:MagicBox Box34 + + +connect Box06.PolyData Box05.Input +connect Box15.Size Box16.In +connect Box16.Out Box17.In1 +connect Box18.Out Box19.In1 +connect Box15.Size Box18.In +connect Box20.Out Box21.In5 +connect Box17.Out Box21.In1 +connect Box19.Out Box21.In3 +connect Box15.Spacing Box22.In1 +connect Box22.Out Box06.Center +connect Box23.Out Box24.In1 +connect Box15.Size Box23.In +connect Box41.Out Box15.In +connect Box41.Out Box05.Source +connect Box43.BoxChange Box06.BoxExecute +connect Box43.BoxChange Box05.BoxExecute +connect Box45.Out Box22.In0 +connect Box48.Out Box20.In +connect Box48.Out Box47.In +connect Box47.Out Box46.In1 +connect Box19.Out Box46.In3 +connect Box24.Out Box46.In5 +connect Box48.Out Box49.In +connect Box49.Out Box50.In3 +connect Box17.Out Box50.In1 +connect Box24.Out Box50.In5 +connect Box33.Out Box06.Normal +connect Box34.Out Box45.In +connect Box34.Out Box33.In +connect Box46.Out Box45.In0 +connect Box50.Out Box45.In1 +connect Box21.Out Box45.In2 + +# Complex input ports +input structuredpoints Box41.In " " +input boxexecute Box43.BoxExecute " " +input point Box48.In " " +input orientation Box34.In " " + +# Complex output ports +output outvtkdataset Box05.Out " " + + +endefine diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbg b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbg new file mode 100644 index 0000000..adca375 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbg @@ -0,0 +1,424 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBG BlackBox Diagram file +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbg +# ---------------------------------- + +APP_START +CATEGORY: +DESCRIPTION:Description ?? +AUTHOR:Author ?? +COMPLEXBOX:TRUE +COMPLEXBOXNAME:VectorVisuPlane_Widget +PACKAGENAME:creaVtk +COMPLEXOUTPUTS:1 +COMPLEX_PORT +outwidget +12.972521:-79.709422:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:7 +COMPLEX_PORT +structuredpoints +212.110624:122.074220:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +Point +171.858822:122.692544:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview1_2D +-131.175717:120.031151:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview2_2D +-76.740507:119.102934:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview3_2D +-26.739466:120.454247:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +vtkbaseview_3D +20.660762:120.110437:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +boxExecute +191.311263:123.319785:-900.000000 +FIN_COMPLEX_PORT +BOXES:21 +BOX +creaVtk:VectorsVisu_Interface:Box01 +ISEXEC:FALSE +-10.602310:-6.448999:-900.000000 +36.722690:-16.448999:-900.000000 +FIN_BOX +BOX +creaVtk:VectorVisuPlane:Box02 +ISEXEC:FALSE +-99.757409:11.634232:-900.000000 +-57.607409:1.634232:-900.000000 +FIN_BOX +BOX +creaVtk:VectorsVisu:Box03 +ISEXEC:FALSE +-97.110320:-50.060640:-900.000000 +-59.485320:-60.060640:-900.000000 +FIN_BOX +BOX +creaVtk:VectorsVisu:Box04 +ISEXEC:FALSE +-33.087761:-53.009755:-900.000000 +4.537239:-63.009755:-900.000000 +FIN_BOX +BOX +creaVtk:VectorsVisu:Box05 +ISEXEC:FALSE +30.171274:-54.116137:-900.000000 +67.796274:-64.116137:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:wxVtkBaseView_Info:Box06 +ISEXEC:FALSE +-143.868867:57.458390:-900.000000 +-97.718867:47.458390:-900.000000 +FIN_BOX +BOX +creaVtk:VectorVisuPlane:Box07 +ISEXEC:FALSE +-36.047788:12.741780:-900.000000 +6.102212:2.741780:-900.000000 +FIN_BOX +BOX +creaVtk:VectorVisuPlane:Box08 +ISEXEC:FALSE +58.065379:10.578012:-900.000000 +100.215379:0.578012:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box09 +ISEXEC:FALSE +46.032337:67.058709:-900.000000 +82.107337:57.058709:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box10 +ISEXEC:FALSE +109.452352:67.977758:-900.000000 +145.527352:57.977758:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:wxVtkBaseView_Info:Box11 +ISEXEC:FALSE +-84.129734:58.927188:-900.000000 +-37.979734:48.927188:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:wxVtkBaseView_Info:Box12 +ISEXEC:FALSE +-19.448948:61.219596:-900.000000 +26.701052:51.219596:-900.000000 +FIN_BOX +BOX +creaVtk:VectorVisuPlane:Box13 +ISEXEC:FALSE +198.651191:-8.262430:-900.000000 +240.801191:-18.262430:-900.000000 +PORT +orientation:"0" +FIN_BOX +BOX +creaVtk:VectorsVisu:Box14 +ISEXEC:FALSE +183.872272:-41.868749:-900.000000 +221.497272:-51.868749:-900.000000 +PORT +Orientation:"0" +FIN_BOX +BOX +creaVtk:VectorsVisu:Box15 +ISEXEC:FALSE +283.894309:-42.657652:-900.000000 +321.519309:-52.657652:-900.000000 +PORT +Orientation:"1" +FIN_BOX +BOX +creaVtk:VectorsVisu:Box16 +ISEXEC:FALSE +362.072416:-44.715724:-900.000000 +399.697416:-54.715724:-900.000000 +PORT +Orientation:"2" +FIN_BOX +BOX +creaVtk:VectorVisuPlane:Box17 +ISEXEC:FALSE +288.334393:-11.949302:-900.000000 +330.484393:-21.949302:-900.000000 +PORT +orientation:"1" +FIN_BOX +BOX +creaVtk:VectorVisuPlane:Box18 +ISEXEC:FALSE +367.652496:-12.437082:-900.000000 +409.802496:-22.437082:-900.000000 +PORT +orientation:"2" +FIN_BOX +BOX +creaMaracasVisu:wxVtkBaseView_Info:Box20 +ISEXEC:FALSE +243.103893:59.188056:-900.000000 +289.253893:49.188056:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box21 +ISEXEC:FALSE +183.524331:65.763428:-900.000000 +219.599331:55.763428:-900.000000 +FIN_BOX +BOX +std:MultipleInputs:Box24 +ISEXEC:FALSE +127.554980:-6.909168:-900.000000 +167.254980:-16.909168:-900.000000 +FIN_BOX +CONNECTIONS:79 +CONNECTION +Box01:widget:outwidget:outwidget +NumberOfControlPoints:0 +CONNECTION +Box06:vtkRenderer:Box03:Renderer +NumberOfControlPoints:0 +CONNECTION +Box06:Direction:Box02:orientation +NumberOfControlPoints:0 +CONNECTION +Box02:outvtkdataset:Box03:In +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box03:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box03:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box03:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box01:active:Box03:Active +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box04:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box04:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box04:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box01:active:Box04:Active +NumberOfControlPoints:0 +CONNECTION +Box06:Direction:Box03:Orientation +NumberOfControlPoints:0 +CONNECTION +Point:Point:Box09:In +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box02:point +NumberOfControlPoints:0 +CONNECTION +structuredpoints:structuredpoints:Box10:In +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box02:structuredpoints +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box07:point +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box07:structuredpoints +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box08:structuredpoints +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box08:point +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview1_2D:wxvtkbaseview1_2D:Box06:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview2_2D:wxvtkbaseview2_2D:Box11:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box11:vtkRenderer:Box04:Renderer +NumberOfControlPoints:0 +CONNECTION +Box07:outvtkdataset:Box04:In +NumberOfControlPoints:0 +CONNECTION +Box11:Direction:Box04:Orientation +NumberOfControlPoints:0 +CONNECTION +Box12:vtkRenderer:Box05:Renderer +NumberOfControlPoints:0 +CONNECTION +Box08:outvtkdataset:Box05:In +NumberOfControlPoints:0 +CONNECTION +Box12:Direction:Box05:Orientation +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview3_2D:wxvtkbaseview3_2D:Box12:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box05:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box05:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box05:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box01:active:Box05:Active +NumberOfControlPoints:0 +CONNECTION +Box11:Direction:Box07:orientation +NumberOfControlPoints:0 +CONNECTION +Box12:Direction:Box08:orientation +NumberOfControlPoints:0 +CONNECTION +Box13:outvtkdataset:Box14:In +NumberOfControlPoints:0 +CONNECTION +Box17:outvtkdataset:Box15:In +NumberOfControlPoints:0 +CONNECTION +Box18:outvtkdataset:Box16:In +NumberOfControlPoints:0 +CONNECTION +vtkbaseview_3D:vtkbaseview_3D:Box20:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box20:vtkRenderer:Box14:Renderer +NumberOfControlPoints:0 +CONNECTION +Box20:vtkRenderer:Box15:Renderer +NumberOfControlPoints:0 +CONNECTION +Box20:vtkRenderer:Box16:Renderer +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box13:structuredpoints +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box17:structuredpoints +NumberOfControlPoints:0 +CONNECTION +Box10:Out:Box18:structuredpoints +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box13:point +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box17:point +NumberOfControlPoints:0 +CONNECTION +Box09:Out:Box18:point +NumberOfControlPoints:0 +CONNECTION +Box20:Direction:Box14:Orientation +NumberOfControlPoints:0 +CONNECTION +Box20:Direction:Box15:Orientation +NumberOfControlPoints:0 +CONNECTION +Box20:Direction:Box16:Orientation +NumberOfControlPoints:0 +CONNECTION +boxExecute:boxExecute:Box21:In +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box02:boxexecute +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box07:boxexecute +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box08:boxexecute +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box13:boxexecute +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box17:boxexecute +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box18:boxexecute +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box14:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box15:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box01:Type:Box16:TypeForm +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box14:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box15:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:Opacity:Box16:Opacity +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box14:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box15:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:ScaleFactor:Box16:ScaleFactor +NumberOfControlPoints:0 +CONNECTION +Box01:active:Box14:Active +NumberOfControlPoints:0 +CONNECTION +Box01:active:Box15:Active +NumberOfControlPoints:0 +CONNECTION +Box01:active:Box16:Active +NumberOfControlPoints:0 +CONNECTION +Box21:Out:Box24:In1 +NumberOfControlPoints:0 +CONNECTION +Box01:boxChange:Box24:In2 +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box03:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box14:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box04:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box05:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box15:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box24:BoxChange:Box16:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbs b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbs new file mode 100644 index 0000000..4f3f818 --- /dev/null +++ b/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbs @@ -0,0 +1,153 @@ +# ---------------------------------- +# - BBTKGEditor v 1.4 BBS BlackBox Script (Complex Box) +# - /home/davila/Creatis/C8/creatools_source/creaVtk/bbtk_creaVtk_PKG/bbs/boxes/VectorVisuPlane_Widget.bbs +# ---------------------------------- + +include std +include itkvtk +include creaVtk +include creaMaracasVisu +include std + +define VectorVisuPlane_Widget creaVtk + +author "Author ??" +description "Description ??" + +category "" + +new creaVtk:VectorsVisu_Interface Box01 + +new creaVtk:VectorVisuPlane Box02 + +new creaVtk:VectorsVisu Box03 + +new creaVtk:VectorsVisu Box04 + +new creaVtk:VectorsVisu Box05 + +new creaMaracasVisu:wxVtkBaseView_Info Box06 + +new creaVtk:VectorVisuPlane Box07 + +new creaVtk:VectorVisuPlane Box08 + +new std:MagicBox Box09 + +new std:MagicBox Box10 + +new creaMaracasVisu:wxVtkBaseView_Info Box11 + +new creaMaracasVisu:wxVtkBaseView_Info Box12 + +new creaVtk:VectorVisuPlane Box13 + set Box13.orientation "0" + +new creaVtk:VectorsVisu Box14 + set Box14.Orientation "0" + +new creaVtk:VectorsVisu Box15 + set Box15.Orientation "1" + +new creaVtk:VectorsVisu Box16 + set Box16.Orientation "2" + +new creaVtk:VectorVisuPlane Box17 + set Box17.orientation "1" + +new creaVtk:VectorVisuPlane Box18 + set Box18.orientation "2" + +new creaMaracasVisu:wxVtkBaseView_Info Box20 + +new std:MagicBox Box21 + +new std:MultipleInputs Box24 + + +connect Box06.vtkRenderer Box03.Renderer +connect Box06.Direction Box02.orientation +connect Box02.outvtkdataset Box03.In +connect Box01.Opacity Box03.Opacity +connect Box01.ScaleFactor Box03.ScaleFactor +connect Box01.Type Box03.TypeForm +connect Box01.active Box03.Active +connect Box01.Opacity Box04.Opacity +connect Box01.ScaleFactor Box04.ScaleFactor +connect Box01.Type Box04.TypeForm +connect Box01.active Box04.Active +connect Box06.Direction Box03.Orientation +connect Box09.Out Box02.point +connect Box10.Out Box02.structuredpoints +connect Box09.Out Box07.point +connect Box10.Out Box07.structuredpoints +connect Box10.Out Box08.structuredpoints +connect Box09.Out Box08.point +connect Box11.vtkRenderer Box04.Renderer +connect Box07.outvtkdataset Box04.In +connect Box11.Direction Box04.Orientation +connect Box12.vtkRenderer Box05.Renderer +connect Box08.outvtkdataset Box05.In +connect Box12.Direction Box05.Orientation +connect Box01.Opacity Box05.Opacity +connect Box01.ScaleFactor Box05.ScaleFactor +connect Box01.Type Box05.TypeForm +connect Box01.active Box05.Active +connect Box11.Direction Box07.orientation +connect Box12.Direction Box08.orientation +connect Box13.outvtkdataset Box14.In +connect Box17.outvtkdataset Box15.In +connect Box18.outvtkdataset Box16.In +connect Box20.vtkRenderer Box14.Renderer +connect Box20.vtkRenderer Box15.Renderer +connect Box20.vtkRenderer Box16.Renderer +connect Box10.Out Box13.structuredpoints +connect Box10.Out Box17.structuredpoints +connect Box10.Out Box18.structuredpoints +connect Box09.Out Box13.point +connect Box09.Out Box17.point +connect Box09.Out Box18.point +connect Box20.Direction Box14.Orientation +connect Box20.Direction Box15.Orientation +connect Box20.Direction Box16.Orientation +connect Box21.Out Box02.boxexecute +connect Box21.Out Box07.boxexecute +connect Box21.Out Box08.boxexecute +connect Box21.Out Box13.boxexecute +connect Box21.Out Box17.boxexecute +connect Box21.Out Box18.boxexecute +connect Box01.Type Box14.TypeForm +connect Box01.Type Box15.TypeForm +connect Box01.Type Box16.TypeForm +connect Box01.Opacity Box14.Opacity +connect Box01.Opacity Box15.Opacity +connect Box01.Opacity Box16.Opacity +connect Box01.ScaleFactor Box14.ScaleFactor +connect Box01.ScaleFactor Box15.ScaleFactor +connect Box01.ScaleFactor Box16.ScaleFactor +connect Box01.active Box14.Active +connect Box01.active Box15.Active +connect Box01.active Box16.Active +connect Box21.Out Box24.In1 +connect Box01.boxChange Box24.In2 +connect Box24.BoxChange Box03.BoxExecute +connect Box24.BoxChange Box14.BoxExecute +connect Box24.BoxChange Box04.BoxExecute +connect Box24.BoxChange Box05.BoxExecute +connect Box24.BoxChange Box15.BoxExecute +connect Box24.BoxChange Box16.BoxExecute + +# Complex input ports +input Point Box09.In " " +input structuredpoints Box10.In " " +input wxvtkbaseview1_2D Box06.wxVtkBaseView " " +input wxvtkbaseview2_2D Box11.wxVtkBaseView " " +input wxvtkbaseview3_2D Box12.wxVtkBaseView " " +input vtkbaseview_3D Box20.wxVtkBaseView " " +input boxExecute Box21.In " " + +# Complex output ports +output outwidget Box01.widget " " + + +endefine diff --git a/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx new file mode 100644 index 0000000..264f55e --- /dev/null +++ b/bbtk_creaVtk_PKG/src/bbcreaVtkApplyMask.cxx @@ -0,0 +1,135 @@ +//===== +// 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 "bbcreaVtkApplyMask.h" +#include "bbcreaVtkPackage.h" + +#include "creaVtk_MACROS.h" + +namespace bbcreaVtk +{ + +BBTK_ADD_BLACK_BOX_TO_PACKAGE(creaVtk,ApplyMask) +BBTK_BLACK_BOX_IMPLEMENTATION(ApplyMask,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 ApplyMask::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 = " <GetExtent( extImage ); + int dimXImage = extImage[1]-extImage[0]+1; + int dimYImage = extImage[3]-extImage[2]+1; + int dimZImage = extImage[5]-extImage[4]+1; + + int extMask[6]; + bbGetInputImage()->GetExtent( extMask ); + int dimXMask = extMask[1]-extMask[0]+1; + int dimYMask = extMask[3]-extMask[2]+1; + int dimZMask = extMask[5]-extMask[4]+1; + + + if (bbGetOutputOut()!=NULL) + { + bbGetOutputOut()->Delete(); + } + + vtkImageData *resultImage=NULL; + resultImage = vtkImageData::New(); + resultImage->Initialize(); + resultImage->SetSpacing( bbGetInputImage()->GetSpacing() ); + resultImage->SetDimensions( dimXImage, dimYImage, dimZImage ); + resultImage->AllocateScalars( bbGetInputImage()->GetScalarType(),1 ); + + + if ((dimXImage==dimXMask) && + (dimYImage==dimYMask) && + (dimZImage==dimZMask)) + { + + + long int i, size = dimXImage * dimYImage * dimZImage; + #pragma omp parallel for + for (i=0; i=1) && (GetOrientation()<=3)) + if ((GetOrientation()>=0) && (GetOrientation()<=2)) { _vtkglyph = vtkGlyph2D::New(); } // _orientation @@ -145,11 +145,11 @@ vtkPointData *data = _vtkglyph->GetOutput()->GetPointData(); _pdm->Update(); #endif - // Orientation 0 3D OK - // Orientation 1 2D xy OK - - // Orientation 2 2D yz - if (GetOrientation()==2) + // Orientation -1 3D OK + // Orientation 2 2D xy OK + + // Orientation 0 2D yz + if (GetOrientation()==0) { _trans->Identity(); _trans->Translate(900,0,0); @@ -157,8 +157,8 @@ vtkPointData *data = _vtkglyph->GetOutput()->GetPointData(); _actor->SetUserTransform(_trans); } - // Orientation 3 2D xz - if (GetOrientation()==3) + // Orientation 1 2D xz + if (GetOrientation()==1) { _trans->Identity(); _trans->RotateWXYZ(90,1,0,0); -- 2.47.1