]> Creatis software - creaMaracasVisu.git/blob - bbtk/bbs/boxes/Mesh_tool_ApplyExternalMask.bbs
Clean code
[creaMaracasVisu.git] / bbtk / bbs / boxes / Mesh_tool_ApplyExternalMask.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_ApplyExternalMask.bbs
4 # ----------------------------------
5
6 include std
7 include itkvtk
8 include wx
9 include vtk
10 include std
11 include creaMaracasVisu
12 include creaVtk
13 include PackRecalage
14
15 define Mesh_tool_ApplyExternalMask creaMaracasVisu
16
17 author "info-dev@creatis.insa-lyon.fr"
18 description "Show N Points"
19
20 category "demo"
21
22 new wx:LayoutLine Box08
23
24 new vtk:UpdateRender Box11
25   set Box11.Active "true"
26
27 new vtk:ImageVtkProperties Box68
28
29 new wx:LayoutLine Box79
30   set Box79.Orientation "H"
31   set Box79.WinTitle "New Surface ( Magenta )"
32
33 new wx:CommandButton Box80
34   set Box80.Label "Run"
35
36 new std:MagicBox Box66
37
38 new std:MagicBox Box67
39
40 new vtk:vtkImageDataPointerRelay Box35
41
42 new creaMaracasVisu:PolyDataToActor_Widget Box37
43   set Box37.color "0 1 1"
44   set Box37.meshOpacity "100"
45
46 new wx:LayoutTab Box40
47
48 new wx:CommandButton Box42
49   set Box42.Label "Apply  (Magenta->To Red)"
50
51 new wx:CommandButton Box43
52   set Box43.Label "Reset Tool"
53
54 new wx:LayoutLine Box44
55   set Box44.Orientation "V"
56   set Box44.WinTitle "1.2 Mesh Action"
57
58 new creaVtk:MeshManager_tool Box45
59   set Box45.Tool "30"
60
61 new std:MagicBox Box46
62
63 new std:MultipleInputs Box51
64
65 new std:MagicBox Box63
66
67 new std:MagicBox Box64
68
69 new std:MagicBox Box65
70
71 new std:MagicBox Box69
72
73 new std:MagicBox Box71
74
75 new creaMaracasVisu:MeshContours_Widget Box72
76   set Box72.colorMesh "0 1 1"
77
78 new wx:LayoutLine Box81
79   set Box81.WinTitle "Step 1.   Surface"
80
81 new wx:LayoutTab Box82
82
83 new wx:OutputText Box84
84
85 new creaVtk:MeshManager Box92
86
87 new creaVtk:MeshManager_tool Box93
88   set Box93.BoxProcessMode "Manual"
89   set Box93.Tool "35"
90
91 new creaMaracasVisu:wxVtkBaseView_Info Box96
92
93 new creaVtk:PolyDataToImageData Box97
94
95 new vtk:CreateImage Box98
96   set Box98.OutputFormat "VTK_UNSIGNED_CHAR"
97
98 new vtk:ImageGaussianSmooth Box99
99   set Box99.StdDevX "1"
100   set Box99.StdDevY "1"
101   set Box99.StdDevZ "1"
102
103 new vtk:MarchingCubes Box100
104   set Box100.Value "128"
105
106 new creaVtk:MeshReduction_DecimatePro Box41
107   set Box41.TargetReduction "0.8"
108
109 new creaVtk:MeshManager_tool Box47
110   set Box47.Tool "35"
111
112 new creaVtk:MeshManager_tool Box48
113   set Box48.Tool "35"
114
115 new creaVtk:PolyDataNormals Box39
116
117 new wx:LayoutTab Box49
118
119 new wx:LayoutLine Box50
120
121 new vtk:MetaImageReader Box53
122
123 new vtk:BinaryOperations Box56
124   set Box56.BoxProcessMode "Manual"
125
126 new vtk:ImageCastToUShort Box60
127
128 new creaVtk:ImageThreshold Box61
129   set Box61.InValue "255"
130   set Box61.Lower "128"
131   set Box61.OutValue "0"
132   set Box61.Upper "100000"
133
134 new vtk:InversCrop Box83
135   set Box83.BoxProcessMode "manual"
136   set Box83.Origin "0 0 0"
137   set Box83.Type "1"
138
139 new vtk:CreateImage Box85
140
141 new vtk:ImageVtkProperties Box87
142
143 new wx:LayoutLine Box88
144   set Box88.Orientation "H"
145   set Box88.WinTitle "External Mask (Yellow)"
146
147 new wx:OutputText Box89
148
149 new wx:OutputText Box90
150
151 new wx:OutputText Box91
152
153 new wx:LayoutLine Box77
154   set Box77.Orientation "V"
155   set Box77.WinTitle "1.3 Apply Changes"
156
157 new std:ConcatStrings Box78
158
159 new wx:CommandButton Box86
160   set Box86.Label "1.1 Run Contour Application"
161
162 new std:ExecSystemCommand Box94
163
164 new std:ConcatStrings Box95
165   set Box95.In1 "bbi    ia-01/ia-000302-contour.bbs "
166   set Box95.In2 "BaseImageFileName="
167   set Box95.In4 "   OutDir="
168
169 new std:StringSelect Box101
170
171 new std:ConcatStrings Box102
172   set Box102.In1 "start /b  "
173
174 new std:Configuration Box103
175
176 new std:ConcatStrings Box104
177
178 new std:ConcatStrings Box105
179
180 new std:ConcatStrings Box106
181   set Box106.In2 "contour-tmp-Imge.mhd"
182
183 new creaVtk:PolyDataToImageData Box107
184
185 new vtk:MetaImageWriter Box108
186   set Box108.Compression "true"
187
188 new vtk:CreateImage Box109
189
190 new vtk:ImageVtkProperties Box110
191
192 new creaVtk:MeshManager Box113
193
194 new creaVtk:MeshManager_tool Box114
195   set Box114.Tool "35"
196
197 new std:ConcatStrings Box115
198
199 new std:ConcatStrings_tool Box116
200   set Box116.Type "1"
201
202 new std:MultipleInputs Box117
203
204 new std:ConcatStrings Box120
205
206 new std:ConcatStrings_tool Box121
207   set Box121.Type "1"
208
209 new std:ConcatStrings Box122
210   set Box122.In2 "/contour-tmp2-Imge.mhd"
211
212 new creaMaracasVisu:ColorLayerImageView2 Box123
213   set Box123.ColorBarPosition "-100  -100"
214   set Box123.lstBaseColor "0 0 0    1 1 0"
215   set Box123.lstGreyLevelBoundaries "0  128  256"
216   set Box123.lstTransparenceBoundaries "0"
217
218 new wx:Slider Box124
219   set Box124.In "50"
220   set Box124.Max "100"
221   set Box124.Min "0"
222   set Box124.ReactiveOnTrack "true"
223
224 new std:Div Box125
225   set Box125.In2 "100"
226
227 new vtk:PolyDataToActor Box126
228
229 new std:MultipleInputs Box127
230
231 new vtk:UpdateRender Box128
232   set Box128.Active "true"
233
234 new vtk:ImageGaussianSmooth Box129
235   set Box129.StdDevX "1"
236   set Box129.StdDevY "1"
237   set Box129.StdDevZ "1"
238
239 new vtk:MarchingCubes Box130
240   set Box130.Value "128"
241
242 new creaVtk:MeshReduction_DecimatePro Box131
243   set Box131.TargetReduction "0.8"
244
245 new creaVtk:PolyDataNormals Box132
246
247 new creaVtk:ImageThreshold Box133
248   set Box133.InValue "255"
249   set Box133.Lower "128"
250   set Box133.OutValue "0"
251   set Box133.Upper "100000"
252
253 new PackRecalage:AddImageToVector Box134
254
255 new vtk:GetVectorVtkImageDataElement Box135
256   set Box135.I "0"
257
258 new wx:LayoutTab Box136
259
260 new wx:LayoutLine Box137
261   set Box137.Orientation "H"
262
263
264 connect Box66.Out Box11.Renderer
265 connect Box35.Out Box68.In
266 connect Box66.Out Box37.render
267 connect Box79.Widget Box40.Widget2
268 connect Box80.Widget Box44.Widget5
269 connect Box46.Out Box45.MeshManagerModel
270 connect Box42.BoxChange Box51.BoxExecute
271 connect Box45.BoxChange Box51.In2
272 connect Box71.Out Box72._wxvtkbaseview3D1
273 connect Box64.Out Box72._wxvtkbaseview2D1
274 connect Box65.Out Box72._wxvtkbaseview2D2
275 connect Box69.Out Box72._wxvtkbaseview2D3
276 connect Box44.Widget Box82.Widget2
277 connect Box82.Widget Box79.Widget2
278 connect Box84.Widget Box44.Widget9
279 connect Box92.MeshManagerModel Box93.MeshManagerModel
280 connect Box92.MeshBase Box72._polydata
281 connect Box92.MeshBase Box37.polydata
282 connect Box81.Widget Box08.Widget2
283 connect Box71.Out Box96.wxVtkBaseView
284 connect Box96.vtkRenderer Box66.In
285 connect Box98.Out Box97.InImage
286 connect Box68.Spacing Box98.Spacing
287 connect Box68.Size Box98.Dimensions
288 connect Box67.Out Box97.InPolyData
289 connect Box99.Out Box100.In
290 connect Box100.Out Box41.In
291 connect Box92.MeshManagerModel Box47.MeshManagerModel
292 connect Box43.BoxChange Box48.BoxExecute
293 connect Box92.MeshManagerModel Box48.MeshManagerModel
294 connect Box63.BoxChange Box72._execute
295 connect Box92.MeshBase Box45.Mesh
296 connect Box47.BoxChange Box51.In5
297 connect Box37.boxchange Box11.BoxExecute
298 connect Box41.Out Box39.In
299 connect Box39.Out Box93.Mesh
300 connect Box43.Widget Box44.Widget2
301 connect Box49.Widget Box81.Widget1
302 connect Box40.Widget Box81.Widget4
303 connect Box97.Out Box60.In
304 connect Box60.Out Box56.In2
305 connect Box56.Out Box61.In
306 connect Box61.Out Box99.In
307 connect Box85.Out Box83.ImageMove
308 connect Box42.BoxChange Box83.BoxExecute
309 connect Box87.TypeName Box85.OutputFormat
310 connect Box87.Spacing Box85.Spacing
311 connect Box87.Size Box85.Dimensions
312 connect Box50.Widget Box88.Widget1
313 connect Box89.Widget Box88.Widget2
314 connect Box90.Widget Box88.Widget3
315 connect Box88.Widget Box49.Widget2
316 connect Box91.Widget Box50.Widget2
317 connect Box42.Widget Box77.Widget2
318 connect Box78.Out Box08.WinTitle
319 connect Box86.Widget Box50.Widget4
320 connect Box95.Out Box101.In0
321 connect Box95.Out Box102.In2
322 connect Box102.Out Box101.In1
323 connect Box95.Out Box101.In2
324 connect Box103.SystemType Box101.In
325 connect Box104.Out Box95.In3
326 connect Box105.Out Box95.In5
327 connect Box105.Out Box106.In1
328 connect Box107.Out Box108.In
329 connect Box109.Out Box107.InImage
330 connect Box110.TypeName Box109.OutputFormat
331 connect Box110.Spacing Box109.Spacing
332 connect Box110.Size Box109.Dimensions
333 connect Box113.MeshManagerModel Box114.MeshManagerModel
334 connect Box67.Out Box114.Mesh
335 connect Box35.Out Box110.In
336 connect Box113.MeshBase Box107.InPolyData
337 connect Box115.Out Box94.In
338 connect Box101.Out Box116.In1
339 connect Box115.Box_ConcatStrings Box116.Box_ConcatString
340 connect Box86.BoxChange Box117.BoxExecute
341 connect Box114.BoxChange Box117.In1
342 connect Box106.Out Box121.In1
343 connect Box120.Box_ConcatStrings Box121.Box_ConcatString
344 connect Box120.Out Box108.Filename
345 connect Box116.BoxChange Box117.In5
346 connect Box121.BoxChange Box117.In2
347 connect Box108.BoxChange Box117.In6
348 connect Box108.BoxChange Box94.BoxExecute
349 connect Box105.Out Box122.In1
350 connect Box122.Out Box53.In
351 connect Box94.BoxChange Box56.BoxExecute
352 connect Box64.Out Box123.WxVtkBaseView
353 connect Box65.Out Box123.WxVtkBaseView1
354 connect Box69.Out Box123.WxVtkBaseView2
355 connect Box124.Widget Box50.Widget8
356 connect Box125.Out Box126.Opacity
357 connect Box66.Out Box126.Renderer
358 connect Box124.BoxChange Box126.BoxExecute
359 connect Box124.Out Box123.Opacity
360 connect Box124.Out Box125.In1
361 connect Box53.BoxChange Box127.In1
362 connect Box124.BoxChange Box127.In2
363 connect Box127.BoxChange Box123.BoxExecute
364 connect Box126.BoxChange Box128.BoxExecute
365 connect Box66.Out Box128.Renderer
366 connect Box94.BoxChange Box53.BoxExecute
367 connect Box80.BoxChange Box93.BoxExecute
368 connect Box129.Out Box130.In
369 connect Box130.Out Box131.In
370 connect Box131.Out Box132.In
371 connect Box133.Out Box129.In
372 connect Box132.Out Box126.In
373 connect Box53.Out Box134.In0
374 connect Box134.Out Box135.In
375 connect Box98.Out Box135.ErrorValue
376 connect Box135.Out Box56.In1
377 connect Box135.Out Box87.In
378 connect Box135.Out Box83.ImageFix
379 connect Box135.Out Box123.In
380 connect Box135.Out Box133.In
381 connect Box77.Widget Box136.Widget2
382 connect Box136.Widget Box79.Widget4
383 connect Box37.widget Box137.Widget4
384 connect Box72._widget Box137.Widget2
385 connect Box137.Widget Box79.Widget7
386
387 # Complex input ports
388 input mesh Box67.In " "
389 input image Box35.In " "
390 input meshmanagermodel Box46.In " "
391 input boxChange Box63.In " "
392 input wxvtkbaseview2 Box64.In " "
393 input wxvtkbaseview3 Box65.In " "
394 input wxvtkbaseview4 Box69.In " "
395 input wxvtkbaseview1 Box71.In " "
396 input title Box78.In1 " "
397 input BaseImageFileName Box104.In1 " "
398 input OutDir Box105.In1 " "
399
400 # Complex output ports
401 output widget Box08.Widget " "
402
403 exec Box45
404
405 endefine