From e948526a22d1b5e45cccaeafe9dae9342b3e8315 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 7 Sep 2022 17:12:43 +0200 Subject: [PATCH] MeshManager --- bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbg | 470 ++++++++++++++++++++++ bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbs | 173 ++++++++ 2 files changed, 643 insertions(+) create mode 100644 bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbg create mode 100644 bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbs diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbg new file mode 100644 index 0000000..9b35a0b --- /dev/null +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbg @@ -0,0 +1,470 @@ +# ---------------------------------- +# - BBTKGEditor v 1.5 BBG BlackBox Diagram file +# - /Users/davila/Creatis/C22/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbg +# ---------------------------------- + +APP_START +CATEGORY:demo +DESCRIPTION:Show N Points +AUTHOR:info-dev@creatis.insa-lyon.fr +COMPLEXBOX:TRUE +COMPLEXBOXNAME:Mesh_tool_ApplyByImage +PACKAGENAME:creaMaracasVisu +COMPLEXOUTPUTS:1 +COMPLEX_PORT +widget +-190.515959:-183.832070:-900.000000 +FIN_COMPLEX_PORT +COMPLEXINPUTS:9 +COMPLEX_PORT +boxChange +-6.086529:137.355528:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview1 +-268.019084:133.379456:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +mesh +-59.814076:140.655693:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +image +-101.103689:138.087401:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview2 +-231.668448:132.854505:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview3 +-216.690458:133.262996:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +wxvtkbaseview4 +-193.414893:132.224675:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +title +-167.581636:131.715380:-900.000000 +FIN_COMPLEX_PORT +COMPLEX_PORT +meshmanagermodel +-131.800179:136.578564:-900.000000 +FIN_COMPLEX_PORT +BOXES:35 +BOX +wx:LayoutLine:Box08 +ISEXEC:FALSE +-191.490538:-129.735971:-900.000000 +-158.170538:-132.235971:-900.000000 +FIN_BOX +BOX +vtk:UpdateRender:Box11 +ISEXEC:FALSE +-7.745536:-95.586489:-900.000000 +14.279464:-98.086489:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +vtk:ImageVtkProperties:Box68 +ISEXEC:FALSE +-262.018178:-23.411381:-900.000000 +-239.483178:-25.911381:-900.000000 +FIN_BOX +BOX +wx:LayoutLine:Box79 +ISEXEC:FALSE +-142.444548:-98.205267:-900.000000 +-109.124548:-100.705267:-900.000000 +PORT +Orientation:"H" +PORT +WinTitle:"New Surface ( Magenta = Red+Yellow )" +FIN_BOX +BOX +wx:CommandButton:Box80 +ISEXEC:FALSE +-101.602098:27.184371:-900.000000 +-79.327098:24.684371:-900.000000 +PORT +Label:"Run" +FIN_BOX +BOX +std:MagicBox:Box66 +ISEXEC:FALSE +-8.767256:-65.552297:-900.000000 +12.832744:-68.052297:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box67 +ISEXEC:FALSE +-67.526006:124.007723:-900.000000 +-45.926006:121.507723:-900.000000 +FIN_BOX +BOX +vtk:vtkImageDataPointerRelay:Box35 +ISEXEC:FALSE +-107.091396:123.633118:-900.000000 +-83.881396:121.133118:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:PolyDataToActor_Widget:Box37 +ISEXEC:FALSE +-36.296182:-79.717323:-900.000000 +-13.276182:-82.217323:-900.000000 +PORT +color:"0 1 1" +FIN_BOX +BOX +wx:LayoutTab:Box40 +ISEXEC:FALSE +-182.535138:-107.612723:-900.000000 +-149.215138:-110.112723:-900.000000 +FIN_BOX +BOX +wx:CommandButton:Box42 +ISEXEC:FALSE +-91.903796:13.441695:-900.000000 +-69.628796:10.941695:-900.000000 +PORT +Label:"Apply (Magenta->To Red)" +FIN_BOX +BOX +wx:CommandButton:Box43 +ISEXEC:FALSE +-80.312782:7.645253:-900.000000 +-58.037782:5.145253:-900.000000 +PORT +Label:"Reset Tool" +FIN_BOX +BOX +wx:LayoutLine:Box44 +ISEXEC:FALSE +-122.128535:-44.031647:-900.000000 +-88.808535:-46.531647:-900.000000 +PORT +Orientation:"V" +PORT +WinTitle:"1.2 Mesh Action" +FIN_BOX +BOX +creaVtk:MeshManager_tool:Box45 +ISEXEC:FALSE +-88.859950:-132.940417:-900.000000 +-66.359950:-135.440417:-900.000000 +PORT +Tool:"30" +FIN_BOX +BOX +std:MagicBox:Box46 +ISEXEC:FALSE +-139.784698:124.004612:-900.000000 +-118.184698:121.504612:-900.000000 +FIN_BOX +BOX +std:MultipleInputs:Box51 +ISEXEC:FALSE +-92.949669:-148.627142:-900.000000 +-70.979669:-151.127142:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box63 +ISEXEC:FALSE +-11.435122:120.544719:-900.000000 +10.164878:118.044719:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box64 +ISEXEC:FALSE +-243.113826:124.330340:-900.000000 +-221.513826:121.830340:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box65 +ISEXEC:FALSE +-220.296210:124.504415:-900.000000 +-198.696210:122.004415:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box69 +ISEXEC:FALSE +-197.793508:124.678490:-900.000000 +-176.193508:122.178490:-900.000000 +FIN_BOX +BOX +std:MagicBox:Box71 +ISEXEC:FALSE +-273.359367:124.504415:-900.000000 +-251.759367:122.004415:-900.000000 +FIN_BOX +BOX +creaMaracasVisu:MeshContours_Widget:Box72 +ISEXEC:FALSE +-109.985892:-79.925596:-900.000000 +-87.190892:-82.425596:-900.000000 +PORT +colorMesh:"0 1 1" +FIN_BOX +BOX +wx:LayoutLine:Box81 +ISEXEC:FALSE +-186.050677:-117.835921:-900.000000 +-152.730677:-120.335921:-900.000000 +PORT +WinTitle:"Step 1. Surface" +FIN_BOX +BOX +wx:LayoutTab:Box82 +ISEXEC:FALSE +-123.564121:-52.398946:-900.000000 +-90.244121:-54.898946:-900.000000 +FIN_BOX +BOX +wx:OutputText:Box84 +ISEXEC:FALSE +-90.166444:-34.853291:-900.000000 +-68.496444:-37.353291:-900.000000 +FIN_BOX +BOX +creaVtk:MeshManager:Box92 +ISEXEC:FALSE +-180.315243:-41.937258:-900.000000 +-158.285243:-44.437258:-900.000000 +FIN_BOX +BOX +creaVtk:MeshManager_tool:Box93 +ISEXEC:FALSE +-256.027180:-70.934538:-900.000000 +-233.527180:-73.434538:-900.000000 +PORT +Tool:"35" +FIN_BOX +BOX +creaMaracasVisu:wxVtkBaseView_Info:Box96 +ISEXEC:FALSE +-6.504018:23.833007:-900.000000 +16.110982:21.333007:-900.000000 +FIN_BOX +BOX +creaVtk:PolyDataToImageData:Box97 +ISEXEC:FALSE +-251.393014:-39.330447:-900.000000 +-228.593014:-41.830447:-900.000000 +FIN_BOX +BOX +vtk:CreateImage:Box98 +ISEXEC:FALSE +-259.705405:-31.233561:-900.000000 +-237.775405:-33.733561:-900.000000 +PORT +OutputFormat:"VTK_UNSIGNED_CHAR" +FIN_BOX +BOX +vtk:ImageGaussianSmooth:Box99 +ISEXEC:FALSE +-255.182927:-47.291143:-900.000000 +-232.287927:-49.791143:-900.000000 +PORT +StdDevX:"1" +PORT +StdDevY:"1" +PORT +StdDevZ:"1" +FIN_BOX +BOX +vtk:MarchingCubes:Box100 +ISEXEC:FALSE +-251.360924:-55.324497:-900.000000 +-229.075924:-57.824497:-900.000000 +PORT +BoxProcessMode:"Manual" +PORT +Value:"128" +FIN_BOX +BOX +creaVtk:MeshReduction_DecimatePro:Box41 +ISEXEC:FALSE +-247.291053:-61.923455:-900.000000 +-223.796053:-64.423455:-900.000000 +PORT +TargetReduction:"0.8" +FIN_BOX +BOX +creaVtk:MeshManager_tool:Box47 +ISEXEC:FALSE +-60.096172:-132.552191:-900.000000 +-37.596172:-135.052191:-900.000000 +PORT +Tool:"35" +FIN_BOX +BOX +creaVtk:MeshManager_tool:Box48 +ISEXEC:FALSE +-31.571613:-131.892967:-900.000000 +-9.071613:-134.392967:-900.000000 +PORT +Tool:"35" +FIN_BOX +CONNECTIONS:53 +CONNECTION +Box08:Widget:widget:widget +NumberOfControlPoints:0 +CONNECTION +Box66:Out:Box11:Renderer +NumberOfControlPoints:0 +CONNECTION +mesh:mesh:Box67:In +NumberOfControlPoints:0 +CONNECTION +image:image:Box35:In +NumberOfControlPoints:0 +CONNECTION +Box35:Out:Box68:In +NumberOfControlPoints:0 +CONNECTION +title:title:Box08:WinTitle +NumberOfControlPoints:0 +CONNECTION +Box66:Out:Box37:render +NumberOfControlPoints:0 +CONNECTION +Box79:Widget:Box40:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box80:Widget:Box44:Widget5 +NumberOfControlPoints:0 +CONNECTION +meshmanagermodel:meshmanagermodel:Box46:In +NumberOfControlPoints:0 +CONNECTION +Box46:Out:Box45:MeshManagerModel +NumberOfControlPoints:0 +CONNECTION +Box42:BoxChange:Box51:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box45:BoxChange:Box51:In2 +NumberOfControlPoints:0 +CONNECTION +boxChange:boxChange:Box63:In +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview2:wxvtkbaseview2:Box64:In +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview3:wxvtkbaseview3:Box65:In +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview4:wxvtkbaseview4:Box69:In +NumberOfControlPoints:0 +CONNECTION +wxvtkbaseview1:wxvtkbaseview1:Box71:In +NumberOfControlPoints:0 +CONNECTION +Box71:Out:Box72:_wxvtkbaseview3D1 +NumberOfControlPoints:0 +CONNECTION +Box64:Out:Box72:_wxvtkbaseview2D1 +NumberOfControlPoints:0 +CONNECTION +Box65:Out:Box72:_wxvtkbaseview2D2 +NumberOfControlPoints:0 +CONNECTION +Box69:Out:Box72:_wxvtkbaseview2D3 +NumberOfControlPoints:0 +CONNECTION +Box72:_widget:Box79:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box44:Widget:Box82:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box82:Widget:Box79:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box84:Widget:Box44:Widget9 +NumberOfControlPoints:0 +CONNECTION +Box92:MeshManagerModel:Box93:MeshManagerModel +NumberOfControlPoints:0 +CONNECTION +Box92:MeshBase:Box72:_polydata +NumberOfControlPoints:0 +CONNECTION +Box92:MeshBase:Box37:polydata +NumberOfControlPoints:0 +CONNECTION +Box81:Widget:Box08:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box42:Widget:Box44:Widget6 +NumberOfControlPoints:0 +CONNECTION +Box43:Widget:Box44:Widget7 +NumberOfControlPoints:0 +CONNECTION +Box71:Out:Box96:wxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box96:vtkRenderer:Box66:In +NumberOfControlPoints:0 +CONNECTION +Box37:widget:Box79:Widget7 +NumberOfControlPoints:0 +CONNECTION +Box98:Out:Box97:InImage +NumberOfControlPoints:0 +CONNECTION +Box68:Spacing:Box98:Spacing +NumberOfControlPoints:0 +CONNECTION +Box68:Size:Box98:Dimensions +NumberOfControlPoints:0 +CONNECTION +Box67:Out:Box97:InPolyData +NumberOfControlPoints:0 +CONNECTION +Box97:Out:Box99:In +NumberOfControlPoints:0 +CONNECTION +Box99:Out:Box100:In +NumberOfControlPoints:0 +CONNECTION +Box100:BoxChange:Box93:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box40:Widget:Box81:Widget2 +NumberOfControlPoints:0 +CONNECTION +Box100:Out:Box41:In +NumberOfControlPoints:0 +CONNECTION +Box41:Out:Box93:Mesh +NumberOfControlPoints:0 +CONNECTION +Box92:MeshManagerModel:Box47:MeshManagerModel +NumberOfControlPoints:0 +CONNECTION +Box43:BoxChange:Box48:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box92:MeshManagerModel:Box48:MeshManagerModel +NumberOfControlPoints:0 +CONNECTION +Box63:BoxChange:Box72:_execute +NumberOfControlPoints:0 +CONNECTION +Box92:MeshBase:Box45:Mesh +NumberOfControlPoints:0 +CONNECTION +Box47:BoxChange:Box51:In5 +NumberOfControlPoints:0 +CONNECTION +Box80:BoxChange:Box100:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box37:boxchange:Box11:BoxExecute +NumberOfControlPoints:0 +APP_END diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbs new file mode 100644 index 0000000..3d561a7 --- /dev/null +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbs @@ -0,0 +1,173 @@ +# ---------------------------------- +# - BBTKGEditor v 1.5 BBS BlackBox Script (Complex Box) +# - /Users/davila/Creatis/C22/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyByImage.bbs +# ---------------------------------- + +include std +include itkvtk +include wx +include vtk +include std +include creaMaracasVisu +include creaVtk + +define Mesh_tool_ApplyByImage creaMaracasVisu + +author "info-dev@creatis.insa-lyon.fr" +description "Show N Points" + +category "demo" + +new wx:LayoutLine Box08 + +new vtk:UpdateRender Box11 + set Box11.Active "true" + +new vtk:ImageVtkProperties Box68 + +new wx:LayoutLine Box79 + set Box79.Orientation "H" + set Box79.WinTitle "New Surface ( Magenta = Red+Yellow )" + +new wx:CommandButton Box80 + set Box80.Label "Run" + +new std:MagicBox Box66 + +new std:MagicBox Box67 + +new vtk:vtkImageDataPointerRelay Box35 + +new creaMaracasVisu:PolyDataToActor_Widget Box37 + set Box37.color "0 1 1" + +new wx:LayoutTab Box40 + +new wx:CommandButton Box42 + set Box42.Label "Apply (Magenta->To Red)" + +new wx:CommandButton Box43 + set Box43.Label "Reset Tool" + +new wx:LayoutLine Box44 + set Box44.Orientation "V" + set Box44.WinTitle "1.2 Mesh Action" + +new creaVtk:MeshManager_tool Box45 + set Box45.Tool "30" + +new std:MagicBox Box46 + +new std:MultipleInputs Box51 + +new std:MagicBox Box63 + +new std:MagicBox Box64 + +new std:MagicBox Box65 + +new std:MagicBox Box69 + +new std:MagicBox Box71 + +new creaMaracasVisu:MeshContours_Widget Box72 + set Box72.colorMesh "0 1 1" + +new wx:LayoutLine Box81 + set Box81.WinTitle "Step 1. Surface" + +new wx:LayoutTab Box82 + +new wx:OutputText Box84 + +new creaVtk:MeshManager Box92 + +new creaVtk:MeshManager_tool Box93 + set Box93.Tool "35" + +new creaMaracasVisu:wxVtkBaseView_Info Box96 + +new creaVtk:PolyDataToImageData Box97 + +new vtk:CreateImage Box98 + set Box98.OutputFormat "VTK_UNSIGNED_CHAR" + +new vtk:ImageGaussianSmooth Box99 + set Box99.StdDevX "1" + set Box99.StdDevY "1" + set Box99.StdDevZ "1" + +new vtk:MarchingCubes Box100 + set Box100.BoxProcessMode "Manual" + set Box100.Value "128" + +new creaVtk:MeshReduction_DecimatePro Box41 + set Box41.TargetReduction "0.8" + +new creaVtk:MeshManager_tool Box47 + set Box47.Tool "35" + +new creaVtk:MeshManager_tool Box48 + set Box48.Tool "35" + + +connect Box66.Out Box11.Renderer +connect Box35.Out Box68.In +connect Box66.Out Box37.render +connect Box79.Widget Box40.Widget2 +connect Box80.Widget Box44.Widget5 +connect Box46.Out Box45.MeshManagerModel +connect Box42.BoxChange Box51.BoxExecute +connect Box45.BoxChange Box51.In2 +connect Box71.Out Box72._wxvtkbaseview3D1 +connect Box64.Out Box72._wxvtkbaseview2D1 +connect Box65.Out Box72._wxvtkbaseview2D2 +connect Box69.Out Box72._wxvtkbaseview2D3 +connect Box72._widget Box79.Widget6 +connect Box44.Widget Box82.Widget2 +connect Box82.Widget Box79.Widget2 +connect Box84.Widget Box44.Widget9 +connect Box92.MeshManagerModel Box93.MeshManagerModel +connect Box92.MeshBase Box72._polydata +connect Box92.MeshBase Box37.polydata +connect Box81.Widget Box08.Widget2 +connect Box42.Widget Box44.Widget6 +connect Box43.Widget Box44.Widget7 +connect Box71.Out Box96.wxVtkBaseView +connect Box96.vtkRenderer Box66.In +connect Box37.widget Box79.Widget7 +connect Box98.Out Box97.InImage +connect Box68.Spacing Box98.Spacing +connect Box68.Size Box98.Dimensions +connect Box67.Out Box97.InPolyData +connect Box97.Out Box99.In +connect Box99.Out Box100.In +connect Box100.BoxChange Box93.BoxExecute +connect Box40.Widget Box81.Widget2 +connect Box100.Out Box41.In +connect Box41.Out Box93.Mesh +connect Box92.MeshManagerModel Box47.MeshManagerModel +connect Box43.BoxChange Box48.BoxExecute +connect Box92.MeshManagerModel Box48.MeshManagerModel +connect Box63.BoxChange Box72._execute +connect Box92.MeshBase Box45.Mesh +connect Box47.BoxChange Box51.In5 +connect Box80.BoxChange Box100.BoxExecute +connect Box37.boxchange Box11.BoxExecute + +# Complex input ports +input mesh Box67.In " " +input image Box35.In " " +input title Box08.WinTitle " " +input meshmanagermodel Box46.In " " +input boxChange Box63.In " " +input wxvtkbaseview2 Box64.In " " +input wxvtkbaseview3 Box65.In " " +input wxvtkbaseview4 Box69.In " " +input wxvtkbaseview1 Box71.In " " + +# Complex output ports +output widget Box08.Widget " " + + +endefine -- 2.47.1