]> Creatis software - creaMaracasVisu.git/blob - bbtk/bbs/appli/exampleGaussianSmooth.bbs
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / bbtk / bbs / appli / exampleGaussianSmooth.bbs
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and 
10 #  abiding by the rules of distribution of free software. You can  use, 
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
12 #  license as circulated by CEA, CNRS and INRIA at the following URL 
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability. 
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */ 
25
26 description "creaMaracasVisu::ImageGaussianSmooth box example. "
27 category "example"
28 author "eduardo.davila@creatis.insa-lyon.fr"
29
30 include std
31 include vtk
32 include wx
33 include itk
34 include itkvtk
35 include wxvtk
36
37 new MetaImageReader reader 
38 include  std/boxes/bbPrependPackageDataPath.bbs 
39 new PrependPackageDataPath prependDatapath 
40   set prependDatapath.In "vtk/hola.mhd" 
41   connect prependDatapath.Out reader.In 
42
43 #---------------------------------------------------------------------
44
45 new Slider slider
46
47 #---------------------------------------------------------------------
48
49 new Viewer2D viewer2DImageOriginal
50   connect reader.Out                    viewer2DImageOriginal.In
51   connect slider.Out                    viewer2DImageOriginal.Slice
52   connect slider.BoxChange      viewer2DImageOriginal.BoxExecute
53     
54 #---------------------------------------------------------------------
55
56 new BinaryThresholdImageFilter threshold
57   set threshold.LowerThreshold 2000
58   set threshold.UpperThreshold 5000
59   set threshold.InsideValue 255
60   set threshold.OutsideValue 0
61   connect reader.Out threshold.In
62
63 new Viewer2D viewer2DImageSegmented
64   connect threshold.Out         viewer2DImageSegmented.In
65   connect slider.Out                    viewer2DImageSegmented.Slice
66   connect slider.BoxChange      viewer2DImageSegmented.BoxExecute
67
68 #---------------------------------------------------------------------
69
70 new ImageGaussianSmooth smooth
71   connect threshold.Out smooth.In
72   set smooth.StdDevX  1
73   set smooth.StdDevY  1
74   set smooth.StdDevZ  1
75
76 new Viewer2D viewer2DImageSmooth
77   connect smooth.Out            viewer2DImageSmooth.In
78   connect slider.Out                    viewer2DImageSmooth.Slice
79   connect slider.BoxChange      viewer2DImageSmooth.BoxExecute
80
81 #---------------------------------------------------------------------
82
83 new LayoutLine upLayout
84   set upLayout.Orientation H
85   connect viewer2DImageOriginal.Widget                  upLayout.Widget1
86   connect viewer2DImageSegmented.Widget         upLayout.Widget2
87   connect viewer2DImageSmooth.Widget            upLayout.Widget3
88
89
90 #---------------------------------------------------------------------
91
92 new Viewer3D  viewernvImagethreshold3D
93 #  set viewernvImagethreshold3D.nTypeView "5" 
94
95 new IsoSurfaceExtractor  isoextractorthreshold
96   connect threshold.Out isoextractorthreshold.In
97   set isoextractorthreshold.Opacity 1
98   set isoextractorthreshold.Isovalue 128
99   connect viewernvImagethreshold3D.Renderer             isoextractorthreshold.Renderer
100
101
102 #---------------------------------------------------------------------
103 new Viewer3D  viewernvImageSmooth3D
104 #  set viewernvImageSmooth3D.nTypeView "5" 
105
106 new IsoSurfaceExtractor  isoextractorsmooth
107   connect smooth.Out isoextractorsmooth.In
108   set isoextractorsmooth.Opacity 1
109   set isoextractorsmooth.Isovalue 128
110   connect viewernvImageSmooth3D.Renderer                isoextractorsmooth.Renderer
111
112
113 #---------------------------------------------------------------------
114
115 new LayoutLine downLayout
116  set downLayout.Orientation H
117   connect viewernvImagethreshold3D.Widget               downLayout.Widget1
118   connect viewernvImageSmooth3D.Widget          downLayout.Widget2
119
120 #---------------------------------------------------------------------
121 new LayoutSplit splitUp
122   connect slider.Widget         splitUp.Widget1
123   connect upLayout.Widget               splitUp.Widget2
124
125 new LayoutSplit mainSplit
126   connect splitUp.Widget                mainSplit.Widget1
127   connect downLayout.Widget     mainSplit.Widget2
128
129 #---------------------------------------------------------------------
130
131 exec isoextractorthreshold
132 exec isoextractorsmooth
133 exec mainSplit