1 description "creaMaracasVisu::ImageGaussianSmooth box example. "
3 author "eduardo.davila@creatis.insa-lyon.fr"
12 new MetaImageReader reader
13 include std/boxes/bbPrependPackageDataPath.bbs
14 new PrependPackageDataPath prependDatapath
15 set prependDatapath.In "vtk/hola.mhd"
16 connect prependDatapath.Out reader.In
18 #---------------------------------------------------------------------
22 #---------------------------------------------------------------------
24 new Viewer2D viewer2DImageOriginal
25 connect reader.Out viewer2DImageOriginal.In
26 connect slider.Out viewer2DImageOriginal.Slice
27 connect slider.BoxChange viewer2DImageOriginal.BoxExecute
29 #---------------------------------------------------------------------
31 new BinaryThresholdImageFilter threshold
32 set threshold.LowerThreshold 2000
33 set threshold.UpperThreshold 5000
34 set threshold.InsideValue 255
35 set threshold.OutsideValue 0
36 connect reader.Out threshold.In
38 new Viewer2D viewer2DImageSegmented
39 connect threshold.Out viewer2DImageSegmented.In
40 connect slider.Out viewer2DImageSegmented.Slice
41 connect slider.BoxChange viewer2DImageSegmented.BoxExecute
43 #---------------------------------------------------------------------
45 new ImageGaussianSmooth smooth
46 connect threshold.Out smooth.In
51 new Viewer2D viewer2DImageSmooth
52 connect smooth.Out viewer2DImageSmooth.In
53 connect slider.Out viewer2DImageSmooth.Slice
54 connect slider.BoxChange viewer2DImageSmooth.BoxExecute
56 #---------------------------------------------------------------------
58 new LayoutLine upLayout
59 set upLayout.Orientation H
60 connect viewer2DImageOriginal.Widget upLayout.Widget1
61 connect viewer2DImageSegmented.Widget upLayout.Widget2
62 connect viewer2DImageSmooth.Widget upLayout.Widget3
65 #---------------------------------------------------------------------
67 new Viewer3D viewernvImagethreshold3D
68 # set viewernvImagethreshold3D.nTypeView "5"
70 new IsoSurfaceExtractor isoextractorthreshold
71 connect threshold.Out isoextractorthreshold.In
72 set isoextractorthreshold.Opacity 1
73 set isoextractorthreshold.Isovalue 128
74 connect viewernvImagethreshold3D.Renderer isoextractorthreshold.Renderer
77 #---------------------------------------------------------------------
78 new Viewer3D viewernvImageSmooth3D
79 # set viewernvImageSmooth3D.nTypeView "5"
81 new IsoSurfaceExtractor isoextractorsmooth
82 connect smooth.Out isoextractorsmooth.In
83 set isoextractorsmooth.Opacity 1
84 set isoextractorsmooth.Isovalue 128
85 connect viewernvImageSmooth3D.Renderer isoextractorsmooth.Renderer
88 #---------------------------------------------------------------------
90 new LayoutLine downLayout
91 set downLayout.Orientation H
92 connect viewernvImagethreshold3D.Widget downLayout.Widget1
93 connect viewernvImageSmooth3D.Widget downLayout.Widget2
95 #---------------------------------------------------------------------
96 new LayoutSplit splitUp
97 connect slider.Widget splitUp.Widget1
98 connect upLayout.Widget splitUp.Widget2
100 new LayoutSplit mainSplit
101 connect splitUp.Widget mainSplit.Widget1
102 connect downLayout.Widget mainSplit.Widget2
104 #---------------------------------------------------------------------
106 exec isoextractorthreshold
107 exec isoextractorsmooth