]> Creatis software - creaMaracasVisu.git/blob - bbtk/bbs/appli/ExampleGaussianSmooth.bbs
no message
[creaMaracasVisu.git] / bbtk / bbs / appli / ExampleGaussianSmooth.bbs
1 description "creaMaracasVisu::ImageGaussianSmooth box example. "
2 category "example"
3 author "eduardo.davila@creatis.insa-lyon.fr"
4
5 include std
6 include vtk
7 include wx
8 include itk
9 include itkvtk
10 include wxvtk
11
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 
17
18 #---------------------------------------------------------------------
19
20 new Slider slider
21
22 #---------------------------------------------------------------------
23
24 new Viewer2D viewer2DImageOriginal
25   connect reader.Out                    viewer2DImageOriginal.In
26   connect slider.Out                    viewer2DImageOriginal.Slice
27   connect slider.BoxChange      viewer2DImageOriginal.BoxExecute
28     
29 #---------------------------------------------------------------------
30
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
37
38 new Viewer2D viewer2DImageSegmented
39   connect threshold.Out         viewer2DImageSegmented.In
40   connect slider.Out                    viewer2DImageSegmented.Slice
41   connect slider.BoxChange      viewer2DImageSegmented.BoxExecute
42
43 #---------------------------------------------------------------------
44
45 new ImageGaussianSmooth smooth
46   connect threshold.Out smooth.In
47   set smooth.StdDevX  1
48   set smooth.StdDevY  1
49   set smooth.StdDevZ  1
50
51 new Viewer2D viewer2DImageSmooth
52   connect smooth.Out            viewer2DImageSmooth.In
53   connect slider.Out                    viewer2DImageSmooth.Slice
54   connect slider.BoxChange      viewer2DImageSmooth.BoxExecute
55
56 #---------------------------------------------------------------------
57
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
63
64
65 #---------------------------------------------------------------------
66
67 new Viewer3D  viewernvImagethreshold3D
68 #  set viewernvImagethreshold3D.nTypeView "5" 
69
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
75
76
77 #---------------------------------------------------------------------
78 new Viewer3D  viewernvImageSmooth3D
79 #  set viewernvImageSmooth3D.nTypeView "5" 
80
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
86
87
88 #---------------------------------------------------------------------
89
90 new LayoutLine downLayout
91  set downLayout.Orientation H
92   connect viewernvImagethreshold3D.Widget               downLayout.Widget1
93   connect viewernvImageSmooth3D.Widget          downLayout.Widget2
94
95 #---------------------------------------------------------------------
96 new LayoutSplit splitUp
97   connect slider.Widget         splitUp.Widget1
98   connect upLayout.Widget               splitUp.Widget2
99
100 new LayoutSplit mainSplit
101   connect splitUp.Widget                mainSplit.Widget1
102   connect downLayout.Widget     mainSplit.Widget2
103
104 #---------------------------------------------------------------------
105
106 exec isoextractorthreshold
107 exec isoextractorsmooth
108 exec mainSplit