From 97dfe2c2d3d8f3f4157ca2ae9923c98a5139ae98 Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Wed, 21 Jun 2023 16:48:22 +0200 Subject: [PATCH] #3512 Mesh application External Mask --- .../bbs/boxes/Mesh_tool_ApplyExternalMask.bbg | 282 ++++++++++++++---- .../bbs/boxes/Mesh_tool_ApplyExternalMask.bbs | 96 ++++-- 2 files changed, 296 insertions(+), 82 deletions(-) diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyExternalMask.bbg b/bbtk/bbs/boxes/Mesh_tool_ApplyExternalMask.bbg index 9c3134d..cf003d7 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyExternalMask.bbg +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyExternalMask.bbg @@ -60,7 +60,7 @@ COMPLEX_PORT OutDir -306.137122:136.559941:-900.000000 FIN_COMPLEX_PORT -BOXES:73 +BOXES:85 BOX wx:LayoutLine:Box08 ISEXEC:FALSE @@ -249,6 +249,8 @@ ISEXEC:FALSE -256.725914:-77.013526:-900.000000 -234.225914:-79.513526:-900.000000 PORT +BoxProcessMode:"Manual" +PORT Tool:"35" FIN_BOX BOX @@ -289,8 +291,6 @@ ISEXEC:FALSE -251.360924:-55.324497:-900.000000 -229.075924:-57.824497:-900.000000 PORT -BoxProcessMode:"Manual" -PORT Value:"128" FIN_BOX BOX @@ -326,8 +326,8 @@ FIN_BOX BOX wx:LayoutTab:Box49 ISEXEC:FALSE --327.245485:-110.119535:-900.000000 --293.925485:-112.619535:-900.000000 +-323.246419:-121.744726:-900.000000 +-289.926419:-124.244726:-900.000000 FIN_BOX BOX wx:LayoutLine:Box50 @@ -338,24 +338,8 @@ FIN_BOX BOX vtk:MetaImageReader:Box53 ISEXEC:FALSE --359.018805:-24.910953:-900.000000 --336.558805:-27.410953:-900.000000 -FIN_BOX -BOX -creaMaracasVisu:ColorLayerImageView:Box54 -ISEXEC:FALSE --353.702938:-66.113712:-900.000000 --313.342938:-68.613712:-900.000000 -PORT -ColorBarPosition:"-100 -100" -PORT -TypeControlsInterface:"2" -PORT -lstBaseColor:"0 0 0 1 1 0" -PORT -lstGreyLevelBoundaries:"0 128 256" -PORT -lstTransparenceBoundaries:"0" +-302.688649:3.843695:-900.000000 +-280.228649:1.343695:-900.000000 FIN_BOX BOX vtk:BinaryOperations:Box56 @@ -412,8 +396,8 @@ FIN_BOX BOX wx:LayoutLine:Box88 ISEXEC:FALSE --333.078226:-98.745809:-900.000000 --299.758226:-101.245809:-900.000000 +-329.079160:-110.371000:-900.000000 +-295.759160:-112.871000:-900.000000 PORT Orientation:"H" PORT @@ -464,8 +448,8 @@ FIN_BOX BOX std:ExecSystemCommand:Box94 ISEXEC:FALSE --328.364289:26.520030:-900.000000 --305.529289:24.020030:-900.000000 +-336.489836:22.291022:-900.000000 +-313.654836:19.791022:-900.000000 FIN_BOX BOX std:ConcatStrings:Box95 @@ -596,12 +580,130 @@ FIN_BOX BOX std:ConcatStrings:Box122 ISEXEC:FALSE --345.507935:-17.289218:-900.000000 --322.747935:-19.789218:-900.000000 +-318.501310:15.906425:-900.000000 +-295.741310:13.406425:-900.000000 PORT In2:"/contour-tmp2-Imge.mhd" FIN_BOX -CONNECTIONS:114 +BOX +creaMaracasVisu:ColorLayerImageView2:Box123 +ISEXEC:FALSE +-295.086341:-75.891865:-900.000000 +-267.046341:-78.391865:-900.000000 +PORT +ColorBarPosition:"-100 -100" +PORT +lstBaseColor:"0 0 0 1 1 0" +PORT +lstGreyLevelBoundaries:"0 128 256" +PORT +lstTransparenceBoundaries:"0" +FIN_BOX +BOX +wx:Slider:Box124 +ISEXEC:FALSE +-341.706625:-61.308615:-900.000000 +-311.906625:-63.808615:-900.000000 +PORT +In:"50" +PORT +Max:"100" +PORT +Min:"0" +PORT +ReactiveOnTrack:"true" +FIN_BOX +BOX +std:Div:Box125 +ISEXEC:FALSE +-338.328005:-69.389772:-900.000000 +-317.293005:-71.889772:-900.000000 +PORT +In2:"100" +FIN_BOX +BOX +vtk:PolyDataToActor:Box126 +ISEXEC:FALSE +-267.469800:-109.242377:-900.000000 +-241.189800:-111.742377:-900.000000 +FIN_BOX +BOX +std:MultipleInputs:Box127 +ISEXEC:FALSE +-296.195768:-69.714919:-900.000000 +-274.115768:-72.214919:-900.000000 +FIN_BOX +BOX +vtk:UpdateRender:Box128 +ISEXEC:FALSE +-266.292429:-116.398618:-900.000000 +-244.157429:-118.898618:-900.000000 +PORT +Active:"true" +FIN_BOX +BOX +vtk:ImageGaussianSmooth:Box129 +ISEXEC:FALSE +-304.578465:-39.696287:-900.000000 +-281.573465:-42.196287:-900.000000 +PORT +StdDevX:"1" +PORT +StdDevY:"1" +PORT +StdDevZ:"1" +FIN_BOX +BOX +vtk:MarchingCubes:Box130 +ISEXEC:FALSE +-303.547461:-44.539928:-900.000000 +-281.262461:-47.039928:-900.000000 +PORT +Value:"128" +FIN_BOX +BOX +creaVtk:MeshReduction_DecimatePro:Box131 +ISEXEC:FALSE +-301.869874:-50.142101:-900.000000 +-278.264874:-52.642101:-900.000000 +PORT +TargetReduction:"0.8" +FIN_BOX +BOX +creaVtk:PolyDataNormals:Box132 +ISEXEC:FALSE +-300.853811:-54.739656:-900.000000 +-278.448811:-57.239656:-900.000000 +FIN_BOX +BOX +creaVtk:ImageThreshold:Box133 +ISEXEC:FALSE +-304.566132:-33.812250:-900.000000 +-282.276132:-36.312250:-900.000000 +PORT +InValue:"255" +PORT +Lower:"128" +PORT +OutValue:"0" +PORT +Upper:"100000" +FIN_BOX +BOX +PackRecalage:AddImageToVector:Box134 +ISEXEC:FALSE +-299.160959:-10.728224:-900.000000 +-274.640959:-13.228224:-900.000000 +FIN_BOX +BOX +vtk:GetVectorVtkImageDataElement:Box135 +ISEXEC:FALSE +-296.347769:-16.354604:-900.000000 +-272.402769:-18.854604:-900.000000 +PORT +I:"0" +FIN_BOX +CONNECTIONS:132 CONNECTION Box08:Widget:widget:widget NumberOfControlPoints:0 @@ -714,9 +816,6 @@ CONNECTION Box99:Out:Box100:In NumberOfControlPoints:0 CONNECTION -Box100:BoxChange:Box93:BoxExecute -NumberOfControlPoints:0 -CONNECTION Box100:Out:Box41:In NumberOfControlPoints:0 CONNECTION @@ -738,9 +837,6 @@ CONNECTION Box47:BoxChange:Box51:In5 NumberOfControlPoints:0 CONNECTION -Box80:BoxChange:Box100:BoxExecute -NumberOfControlPoints:0 -CONNECTION Box37:boxchange:Box11:BoxExecute NumberOfControlPoints:0 CONNECTION @@ -759,15 +855,6 @@ CONNECTION Box40:Widget:Box81:Widget4 NumberOfControlPoints:0 CONNECTION -Box64:Out:Box54:WxVtkBaseView -NumberOfControlPoints:0 -CONNECTION -Box65:Out:Box54:WxVtkBaseView1 -NumberOfControlPoints:0 -CONNECTION -Box69:Out:Box54:WxVtkBaseView2 -NumberOfControlPoints:0 -CONNECTION Box97:Out:Box60:In NumberOfControlPoints:0 CONNECTION @@ -780,24 +867,12 @@ CONNECTION Box61:Out:Box99:In NumberOfControlPoints:0 CONNECTION -Box53:Out:Box56:In1 -NumberOfControlPoints:0 -CONNECTION -Box53:Out:Box54:In -NumberOfControlPoints:0 -CONNECTION -Box53:Out:Box83:ImageFix -NumberOfControlPoints:0 -CONNECTION Box85:Out:Box83:ImageMove NumberOfControlPoints:0 CONNECTION Box42:BoxChange:Box83:BoxExecute NumberOfControlPoints:0 CONNECTION -Box53:Out:Box87:In -NumberOfControlPoints:0 -CONNECTION Box87:TypeName:Box85:OutputFormat NumberOfControlPoints:0 CONNECTION @@ -834,9 +909,6 @@ CONNECTION Box78:Out:Box08:WinTitle NumberOfControlPoints:0 CONNECTION -Box54:Widget:Box50:Widget7 -NumberOfControlPoints:0 -CONNECTION Box86:Widget:Box50:Widget4 NumberOfControlPoints:0 CONNECTION @@ -933,9 +1005,6 @@ CONNECTION Box108:BoxChange:Box94:BoxExecute NumberOfControlPoints:0 CONNECTION -Box94:BoxChange:Box53:BoxExecute -NumberOfControlPoints:0 -CONNECTION Box105:Out:Box122:In1 NumberOfControlPoints:0 CONNECTION @@ -944,4 +1013,91 @@ NumberOfControlPoints:0 CONNECTION Box94:BoxChange:Box56:BoxExecute NumberOfControlPoints:0 +CONNECTION +Box64:Out:Box123:WxVtkBaseView +NumberOfControlPoints:0 +CONNECTION +Box65:Out:Box123:WxVtkBaseView1 +NumberOfControlPoints:0 +CONNECTION +Box69:Out:Box123:WxVtkBaseView2 +NumberOfControlPoints:0 +CONNECTION +Box124:Widget:Box50:Widget8 +NumberOfControlPoints:0 +CONNECTION +Box125:Out:Box126:Opacity +NumberOfControlPoints:0 +CONNECTION +Box66:Out:Box126:Renderer +NumberOfControlPoints:0 +CONNECTION +Box124:BoxChange:Box126:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box124:Out:Box123:Opacity +NumberOfControlPoints:0 +CONNECTION +Box124:Out:Box125:In1 +NumberOfControlPoints:0 +CONNECTION +Box53:BoxChange:Box127:In1 +NumberOfControlPoints:0 +CONNECTION +Box124:BoxChange:Box127:In2 +NumberOfControlPoints:0 +CONNECTION +Box127:BoxChange:Box123:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box126:BoxChange:Box128:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box66:Out:Box128:Renderer +NumberOfControlPoints:0 +CONNECTION +Box94:BoxChange:Box53:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box80:BoxChange:Box93:BoxExecute +NumberOfControlPoints:0 +CONNECTION +Box129:Out:Box130:In +NumberOfControlPoints:0 +CONNECTION +Box130:Out:Box131:In +NumberOfControlPoints:0 +CONNECTION +Box131:Out:Box132:In +NumberOfControlPoints:0 +CONNECTION +Box133:Out:Box129:In +NumberOfControlPoints:0 +CONNECTION +Box132:Out:Box126:In +NumberOfControlPoints:0 +CONNECTION +Box53:Out:Box134:In0 +NumberOfControlPoints:0 +CONNECTION +Box134:Out:Box135:In +NumberOfControlPoints:0 +CONNECTION +Box98:Out:Box135:ErrorValue +NumberOfControlPoints:0 +CONNECTION +Box135:Out:Box56:In1 +NumberOfControlPoints:0 +CONNECTION +Box135:Out:Box87:In +NumberOfControlPoints:0 +CONNECTION +Box135:Out:Box83:ImageFix +NumberOfControlPoints:0 +CONNECTION +Box135:Out:Box123:In +NumberOfControlPoints:0 +CONNECTION +Box135:Out:Box133:In +NumberOfControlPoints:0 APP_END diff --git a/bbtk/bbs/boxes/Mesh_tool_ApplyExternalMask.bbs b/bbtk/bbs/boxes/Mesh_tool_ApplyExternalMask.bbs index 3a2a253..3a58431 100644 --- a/bbtk/bbs/boxes/Mesh_tool_ApplyExternalMask.bbs +++ b/bbtk/bbs/boxes/Mesh_tool_ApplyExternalMask.bbs @@ -10,6 +10,7 @@ include vtk include std include creaMaracasVisu include creaVtk +include PackRecalage define Mesh_tool_ApplyExternalMask creaMaracasVisu @@ -84,6 +85,7 @@ new wx:OutputText Box84 new creaVtk:MeshManager Box92 new creaVtk:MeshManager_tool Box93 + set Box93.BoxProcessMode "Manual" set Box93.Tool "35" new creaMaracasVisu:wxVtkBaseView_Info Box96 @@ -99,7 +101,6 @@ new vtk:ImageGaussianSmooth Box99 set Box99.StdDevZ "1" new vtk:MarchingCubes Box100 - set Box100.BoxProcessMode "Manual" set Box100.Value "128" new creaVtk:MeshReduction_DecimatePro Box41 @@ -119,13 +120,6 @@ new wx:LayoutLine Box50 new vtk:MetaImageReader Box53 -new creaMaracasVisu:ColorLayerImageView Box54 - set Box54.ColorBarPosition "-100 -100" - set Box54.TypeControlsInterface "2" - set Box54.lstBaseColor "0 0 0 1 1 0" - set Box54.lstGreyLevelBoundaries "0 128 256" - set Box54.lstTransparenceBoundaries "0" - new vtk:BinaryOperations Box56 set Box56.BoxProcessMode "Manual" @@ -215,6 +209,52 @@ new std:ConcatStrings_tool Box121 new std:ConcatStrings Box122 set Box122.In2 "/contour-tmp2-Imge.mhd" +new creaMaracasVisu:ColorLayerImageView2 Box123 + set Box123.ColorBarPosition "-100 -100" + set Box123.lstBaseColor "0 0 0 1 1 0" + set Box123.lstGreyLevelBoundaries "0 128 256" + set Box123.lstTransparenceBoundaries "0" + +new wx:Slider Box124 + set Box124.In "50" + set Box124.Max "100" + set Box124.Min "0" + set Box124.ReactiveOnTrack "true" + +new std:Div Box125 + set Box125.In2 "100" + +new vtk:PolyDataToActor Box126 + +new std:MultipleInputs Box127 + +new vtk:UpdateRender Box128 + set Box128.Active "true" + +new vtk:ImageGaussianSmooth Box129 + set Box129.StdDevX "1" + set Box129.StdDevY "1" + set Box129.StdDevZ "1" + +new vtk:MarchingCubes Box130 + set Box130.Value "128" + +new creaVtk:MeshReduction_DecimatePro Box131 + set Box131.TargetReduction "0.8" + +new creaVtk:PolyDataNormals Box132 + +new creaVtk:ImageThreshold Box133 + set Box133.InValue "255" + set Box133.Lower "128" + set Box133.OutValue "0" + set Box133.Upper "100000" + +new PackRecalage:AddImageToVector Box134 + +new vtk:GetVectorVtkImageDataElement Box135 + set Box135.I "0" + connect Box66.Out Box11.Renderer connect Box35.Out Box68.In @@ -244,7 +284,6 @@ connect Box68.Spacing Box98.Spacing connect Box68.Size Box98.Dimensions connect Box67.Out Box97.InPolyData connect Box99.Out Box100.In -connect Box100.BoxChange Box93.BoxExecute connect Box100.Out Box41.In connect Box92.MeshManagerModel Box47.MeshManagerModel connect Box43.BoxChange Box48.BoxExecute @@ -252,26 +291,18 @@ 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 connect Box41.Out Box39.In connect Box39.Out Box93.Mesh connect Box43.Widget Box44.Widget2 connect Box49.Widget Box81.Widget1 connect Box40.Widget Box81.Widget4 -connect Box64.Out Box54.WxVtkBaseView -connect Box65.Out Box54.WxVtkBaseView1 -connect Box69.Out Box54.WxVtkBaseView2 connect Box97.Out Box60.In connect Box60.Out Box56.In2 connect Box56.Out Box61.In connect Box61.Out Box99.In -connect Box53.Out Box56.In1 -connect Box53.Out Box54.In -connect Box53.Out Box83.ImageFix connect Box85.Out Box83.ImageMove connect Box42.BoxChange Box83.BoxExecute -connect Box53.Out Box87.In connect Box87.TypeName Box85.OutputFormat connect Box87.Spacing Box85.Spacing connect Box87.Size Box85.Dimensions @@ -283,7 +314,6 @@ connect Box91.Widget Box50.Widget2 connect Box77.Widget Box82.Widget4 connect Box42.Widget Box77.Widget2 connect Box78.Out Box08.WinTitle -connect Box54.Widget Box50.Widget7 connect Box86.Widget Box50.Widget4 connect Box95.Out Box101.In0 connect Box95.Out Box102.In2 @@ -314,10 +344,38 @@ connect Box116.BoxChange Box117.In5 connect Box121.BoxChange Box117.In2 connect Box108.BoxChange Box117.In6 connect Box108.BoxChange Box94.BoxExecute -connect Box94.BoxChange Box53.BoxExecute connect Box105.Out Box122.In1 connect Box122.Out Box53.In connect Box94.BoxChange Box56.BoxExecute +connect Box64.Out Box123.WxVtkBaseView +connect Box65.Out Box123.WxVtkBaseView1 +connect Box69.Out Box123.WxVtkBaseView2 +connect Box124.Widget Box50.Widget8 +connect Box125.Out Box126.Opacity +connect Box66.Out Box126.Renderer +connect Box124.BoxChange Box126.BoxExecute +connect Box124.Out Box123.Opacity +connect Box124.Out Box125.In1 +connect Box53.BoxChange Box127.In1 +connect Box124.BoxChange Box127.In2 +connect Box127.BoxChange Box123.BoxExecute +connect Box126.BoxChange Box128.BoxExecute +connect Box66.Out Box128.Renderer +connect Box94.BoxChange Box53.BoxExecute +connect Box80.BoxChange Box93.BoxExecute +connect Box129.Out Box130.In +connect Box130.Out Box131.In +connect Box131.Out Box132.In +connect Box133.Out Box129.In +connect Box132.Out Box126.In +connect Box53.Out Box134.In0 +connect Box134.Out Box135.In +connect Box98.Out Box135.ErrorValue +connect Box135.Out Box56.In1 +connect Box135.Out Box87.In +connect Box135.Out Box83.ImageFix +connect Box135.Out Box123.In +connect Box135.Out Box133.In # Complex input ports input mesh Box67.In " " -- 2.47.1