]> Creatis software - creaMaracasVisu.git/blob - bbtk/bbs/boxes/Mesh_tool_ApplyRegionGrowing.bbs
889e9cf8fffc9abb7d0bc933a6b7b0311db32632
[creaMaracasVisu.git] / bbtk / bbs / boxes / Mesh_tool_ApplyRegionGrowing.bbs
1 # ----------------------------------
2 # - BBTKGEditor v 1.5 BBS BlackBox Script (Complex Box)
3 # - /Users/davila/Creatis/C23/creatools_source/creaMaracasVisu/bbtk/bbs/boxes/Mesh_tool_ApplyRegionGrowing.bbs
4 # ----------------------------------
5
6 include std
7 include itkvtk
8 include creaMaracasVisu
9 include wx
10 include vtk
11 include std
12 include creaVtk
13 include PackRecalage
14 include toolsbbtk
15
16 define Mesh_tool_ApplyRegionGrowing creaMaracasVisu
17
18 author "info-dev@creatis.insa-lyon.fr"
19 description "Show N Points"
20
21 category "demo"
22
23 new creaMaracasVisu:ShowNPoints showNpoints
24   set showNpoints.Radio "2"
25   set showNpoints.Type "3"
26   set showNpoints.WinTitle "1.1 Points"
27
28 new wx:LayoutLine Box08
29
30 new vtk:UpdateRender Box11
31   set Box11.Active "true"
32
33 new std:MultipleInputs Box31
34
35 new creaMaracasVisu:wxPopupMenu Box57
36   set Box57.WithCtrlKey "true"
37
38 new std:AddStringToVector Box58
39   set Box58.In0 "+  Add point"
40   set Box58.In1 "(+)  Insert point"
41   set Box58.In2 "Track point"
42   set Box58.In3 "Set Nearest point"
43   set Box58.In4 "-  Erase point"
44   set Box58.In5 "--  Delete all points"
45   set Box58.In6 "----------------------"
46   set Box58.In7 "+>  Insert group after"
47   set Box58.In8 "- Delete group"
48   set Box58.In9 "Tool - Inverse Normals"
49
50 new creaMaracasVisu:ShowNPoints_Tools Box60
51
52 new vtk:ImageVtkProperties Box68
53
54 new wx:ComboBox Box78
55   set Box78.In "Union Intersection Difference Replace"
56
57 new wx:LayoutLine Box79
58   set Box79.Orientation "H"
59   set Box79.WinTitle "New Surface ( Magenta  =  Red+Yellow )"
60
61 new wx:CommandButton Box80
62   set Box80.Label "Run"
63
64 new std:MagicBox Box66
65
66 new std:MagicBox Box67
67
68 new creaMaracasVisu:PolyDataToActor_Widget Box48
69   set Box48.meshOpacity "50"
70
71 new vtk:vtkImageDataPointerRelay Box35
72
73 new creaMaracasVisu:PolyDataToActor_Widget Box37
74   set Box37.color "0 1 1"
75   set Box37.meshOpacity "100"
76
77 new wx:LayoutLine Box38
78   set Box38.Orientation "H"
79   set Box38.WinTitle "Threshold Surface (Yellow)"
80
81 new wx:LayoutTab Box39
82
83 new wx:LayoutTab Box40
84
85 new wx:CommandButton Box42
86   set Box42.Label "Apply  (Magenta->To Red)"
87
88 new wx:CommandButton Box43
89   set Box43.Label "Reset Tool"
90
91 new wx:LayoutLine Box44
92   set Box44.Orientation "V"
93   set Box44.WinTitle "1.3   Mesh Action"
94
95 new creaVtk:MeshManager_tool Box45
96   set Box45.Tool "30"
97
98 new std:MagicBox Box46
99
100 new std:MultipleInputs Box51
101
102 new creaMaracasVisu:ShowNPoints_Tools Box52
103   set Box52.Type "120"
104
105 new std:MultipleInputs Box53
106
107 new std:MultipleInputs Box55
108
109 new creaMaracasVisu:MeshContours_Widget Box62
110   set Box62.colorMesh "1 1 0"
111
112 new std:MagicBox Box63
113
114 new std:MagicBox Box64
115
116 new std:MagicBox Box65
117
118 new std:MagicBox Box69
119
120 new std:MagicBox Box71
121
122 new creaMaracasVisu:MeshContours_Widget Box72
123   set Box72.colorMesh "0 1 1"
124
125 new wx:LayoutLine Box81
126   set Box81.WinTitle "Step 1.   Surface"
127
128 new wx:LayoutTab Box82
129
130 new wx:OutputText Box84
131
132 new wx:LayoutTab Box86
133
134 new creaVtk:MeshManager Box92
135
136 new creaVtk:MeshManager_tool Box93
137   set Box93.Tool "35"
138
139 new std:MagicBox Box94
140
141 new creaMaracasVisu:wxVtkBaseView_Info Box96
142
143 new wx:LayoutLine Box98
144   set Box98.Orientation "H"
145
146 new std:AddStringToVector Box99
147   set Box99.In0 "Auto Add Points (Start/Stop)"
148
149 new std:VectorFilterString Box100
150   set Box100.In0 "0  1  2   3   4   5   6   7   8      9       10 "
151   set Box100.In1 "1  5 10 20 30 40 50 0  100   110   210"
152   set Box100.Type "2"
153
154 new std:ConcatStrings Box101
155
156 new creaVtk:ImageThresholdConnectivity Box102
157   set Box102.Border "50"
158
159 new wx:LayoutLine Box105
160   set Box105.WinTitle "1.2 Surface"
161
162 new creaMaracasVisu:SliderMinMax Box106
163   set Box106.InMax "2000"
164   set Box106.InMaxShow "-500"
165   set Box106.InMin "-1100"
166   set Box106.InMinShow "-1100"
167   set Box106.ShowActual "false"
168
169 new wx:Slider Box107
170   set Box107.In "15"
171   set Box107.Label "true"
172   set Box107.Max "40"
173   set Box107.Min "0"
174   set Box107.ReactiveOnTrack "true"
175   set Box107.Title "Border size"
176
177 new wx:CommandButton Box108
178   set Box108.Label "Refresh"
179
180 new std:ConcatStrings Box110
181   set Box110.In2 "   "
182
183 new std:MultipleInputs Box111
184
185 new std:MultipleInputs Box112
186
187 new creaVtk:MarchingCubes2 Box113
188   set Box113.BoxProcessMode "Manual"
189   set Box113.Value "128"
190
191 new creaVtk:ImageGaussianSmooth2 Box114
192   set Box114.StdDevX "1"
193   set Box114.StdDevY "1"
194   set Box114.StdDevZ "1"
195
196 new std:MultipleInputs Box118
197
198 new std:MagicBox Box120
199
200 new creaMaracasVisu:ColorLayerImageView Box122
201   set Box122.ColorBarPosition "-1000 -1000"
202   set Box122.TypeControlsInterface "2"
203   set Box122.lstTransparenceBoundaries "0"
204
205 new wx:LayoutLine Box124
206   set Box124.Orientation "V"
207   set Box124.WinTitle "1.4   Apply Changes"
208
209 new wx:LayoutTab Box125
210
211 new creaVtk:PolyDataToImageData Box127
212   set Box127.BoxProcessMode "Manual"
213
214 new vtk:CreateImage Box128
215
216 new vtk:BinaryOperations Box129
217
218 new creaVtk:ImageThreshold Box130
219   set Box130.InValue "255"
220   set Box130.OutValue "0"
221   set Box130.Upper "10000"
222
223 new creaVtk:MarchingCubes2 Box131
224   set Box131.Value "128"
225
226 new creaVtk:ImageGaussianSmooth2 Box132
227   set Box132.StdDevX "1"
228   set Box132.StdDevY "1"
229   set Box132.StdDevZ "1"
230
231 new creaVtk:PolyDataNormals Box133
232   set Box133.BoxProcessMode "Manual"
233
234 new std:StringSelect Box134
235   set Box134.In0 "0  128"
236   set Box134.In1 "0  500"
237   set Box134.In2 "1  128"
238   set Box134.In3 "7  128"
239
240 new std:GetVectorStringElement Box135
241   set Box135.I "0"
242
243 new std:GetVectorStringElement Box136
244   set Box136.I "1"
245
246 new PackRecalage:AddImageToVector Box137
247
248 new vtk:GetVectorVtkImageDataElement Box138
249   set Box138.I "0"
250
251 new vtk:CreateImage Box139
252
253 new toolsbbtk:ImageVtkPropertiesWidget Box140
254
255 new wx:LayoutLine Box141
256   set Box141.Orientation "H"
257
258 new wx:LayoutTab Box142
259
260 new wx:LayoutLine Box143
261   set Box143.Orientation "H"
262
263
264 connect Box31.BoxChange Box11.BoxExecute
265 connect Box58.Out Box57.In
266 connect showNpoints.WidgetShowNPoints Box60.WidgetShowNPoints
267 connect Box57.BoxChange Box60.BoxExecute
268 connect Box68.Spacing Box60.Spacing
269 connect Box66.Out Box11.Renderer
270 connect Box66.Out showNpoints.Renderer
271 connect Box66.Out Box48.render
272 connect Box48.boxchange Box31.In1
273 connect Box35.Out Box68.In
274 connect Box35.Out showNpoints.Image
275 connect Box66.Out Box37.render
276 connect Box38.Widget Box39.Widget2
277 connect Box79.Widget Box40.Widget2
278 connect Box46.Out Box45.MeshManagerModel
279 connect Box42.BoxChange Box51.BoxExecute
280 connect Box45.BoxChange Box51.In2
281 connect Box52.BoxChange Box51.In4
282 connect showNpoints.WidgetShowNPoints Box52.WidgetShowNPoints
283 connect Box42.BoxChange Box53.In3
284 connect Box52.BoxChange Box55.In2
285 connect Box63.BoxChange showNpoints.BoxExecute
286 connect Box64.Out Box57.wxVtkBaseView2
287 connect Box64.Out Box62._wxvtkbaseview2D1
288 connect Box65.Out Box57.wxVtkBaseView3
289 connect Box65.Out Box62._wxvtkbaseview2D2
290 connect Box69.Out Box57.wxVtkBaseView4
291 connect Box69.Out Box62._wxvtkbaseview2D3
292 connect Box71.Out Box57.wxVtkBaseView
293 connect Box71.Out Box62._wxvtkbaseview3D1
294 connect Box71.Out Box72._wxvtkbaseview3D1
295 connect Box64.Out Box72._wxvtkbaseview2D1
296 connect Box65.Out Box72._wxvtkbaseview2D2
297 connect Box69.Out Box72._wxvtkbaseview2D3
298 connect Box39.Widget Box81.Widget2
299 connect Box40.Widget Box81.Widget4
300 connect Box44.Widget Box82.Widget2
301 connect Box82.Widget Box79.Widget2
302 connect Box84.Widget Box44.Widget9
303 connect showNpoints.Widget Box86.Widget2
304 connect Box57.BoxChange Box08.BoxExecute
305 connect Box92.MeshManagerModel Box93.MeshManagerModel
306 connect Box92.MeshBase Box72._polydata
307 connect Box92.MeshBase Box37.polydata
308 connect Box81.Widget Box08.Widget2
309 connect Box94.BoxChange Box37.boxexecute
310 connect Box71.Out Box96.wxVtkBaseView
311 connect Box96.vtkRenderer Box66.In
312 connect Box43.Widget Box44.Widget1
313 connect Box78.Widget Box98.Widget2
314 connect Box80.Widget Box98.Widget4
315 connect Box98.Widget Box44.Widget3
316 connect Box99.Out Box58.StringVector
317 connect Box100.Out1 Box101.In1
318 connect Box101.Out Box60.Type
319 connect Box57.Out Box100.sk1
320 connect showNpoints.lstPointsX Box102.LstX
321 connect showNpoints.lstPointsY Box102.LstY
322 connect showNpoints.lstPointsZ Box102.LstZ
323 connect Box35.Out Box102.In
324 connect Box106.Widget Box105.Widget2
325 connect Box107.Out Box102.Border
326 connect Box106.OutStart Box110.In1
327 connect Box106.OutEnd Box110.In3
328 connect Box110.Out Box102.Threshold
329 connect Box63.BoxChange Box111.In1
330 connect Box31.BoxChange Box111.In3
331 connect Box111.BoxChange Box62._execute
332 connect Box63.BoxChange Box112.In1
333 connect Box37.boxchange Box112.In3
334 connect Box112.BoxChange Box72._execute
335 connect Box113.BoxChange Box31.BoxExecute
336 connect Box113.Out Box48.polydata
337 connect Box113.Out Box62._polydata
338 connect Box113.BoxChange Box48.boxexecute
339 connect Box114.Out Box113.In
340 connect Box118.BoxChange Box113.BoxExecute
341 connect Box108.BoxChange Box118.In3
342 connect Box80.BoxChange Box53.In2
343 connect Box43.BoxChange Box118.In2
344 connect Box43.BoxChange Box120.BoxExecute
345 connect Box120.BoxChange Box53.In4
346 connect Box43.BoxChange Box55.BoxExecute
347 connect Box42.BoxChange Box118.In4
348 connect Box64.Out Box122.WxVtkBaseView
349 connect Box65.Out Box122.WxVtkBaseView1
350 connect Box69.Out Box122.WxVtkBaseView2
351 connect Box108.Widget Box105.Widget8
352 connect Box107.Widget Box105.Widget6
353 connect Box106.BoxChange Box122.BoxExecute
354 connect Box122.Widget Box105.Widget7
355 connect Box102.Out Box122.In
356 connect Box42.Widget Box124.Widget1
357 connect Box105.Widget Box125.Widget2
358 connect Box67.Out Box127.InPolyData
359 connect Box68.Spacing Box128.Spacing
360 connect Box68.TypeName Box128.OutputFormat
361 connect Box68.Size Box128.Dimensions
362 connect Box128.Out Box127.InImage
363 connect Box127.Out Box129.In1
364 connect Box102.Out Box129.In2
365 connect Box129.Out Box130.In
366 connect Box132.Out Box131.In
367 connect Box130.Out Box132.In
368 connect Box131.Out Box133.In
369 connect Box53.BoxChange Box133.BoxExecute
370 connect Box133.Out Box93.Mesh
371 connect Box133.Out Box45.Mesh
372 connect Box133.BoxChange Box94.BoxExecute
373 connect Box133.BoxChange Box93.BoxExecute
374 connect Box78.Out Box134.In
375 connect Box134.Out Box135.In
376 connect Box135.Out Box129.Operation
377 connect Box134.Out Box136.In
378 connect Box136.Out Box130.Lower
379 connect Box102.Out Box137.In0
380 connect Box137.Out Box138.In
381 connect Box68.TypeName Box139.OutputFormat
382 connect Box68.Spacing Box139.Spacing
383 connect Box68.Size Box139.Dimensions
384 connect Box139.Out Box138.ErrorValue
385 connect Box138.Out Box114.In
386 connect Box53.BoxChange Box127.BoxExecute
387 connect Box35.Out Box140.in
388 connect Box140.widget Box125.Widget3
389 connect Box72._widget Box141.Widget2
390 connect Box37.widget Box141.Widget4
391 connect Box141.Widget Box79.Widget7
392 connect Box124.Widget Box142.Widget2
393 connect Box142.Widget Box79.Widget4
394 connect Box62._widget Box143.Widget2
395 connect Box48.widget Box143.Widget4
396 connect Box143.Widget Box38.Widget7
397 connect Box86.Widget Box38.Widget2
398 connect Box125.Widget Box38.Widget4
399
400 # Complex input ports
401 input point showNpoints.In " "
402 input mesh Box67.In " "
403 input image Box35.In " "
404 input title Box08.WinTitle " "
405 input meshmanagermodel Box46.In " "
406 input boxChange Box63.In " "
407 input wxvtkbaseview2 Box64.In " "
408 input wxvtkbaseview3 Box65.In " "
409 input wxvtkbaseview4 Box69.In " "
410 input wxvtkbaseview1 Box71.In " "
411
412 # Complex output ports
413 output widget Box08.Widget " "
414 output interactorStyleMaracas Box57.InteractorStyleMaracas " "
415 output interactorStyleMaracas2 Box57.InteractorStyleMaracas2 " "
416 output interactorStyleMaracas3 Box57.InteractorStyleMaracas3 " "
417 output interactorStyleMaracas4 Box57.InteractorStyleMaracas4 " "
418
419 exec Box55
420
421 endefine