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