1 # ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
27 print "=== GaussianSmooth box example ==="
28 description "GaussianSmooth box example. Screenshot : <img src=ExampleGaussianSmooth.JPG></img>"
29 author "eduardo.davila at creatis.insa-lyon.fr"
39 new MetaImageReader reader
40 include std/boxes/bbPrependPackageDataPath.bbs
41 new PrependPackageDataPath prependDatapath
42 set prependDatapath.In "vtk/hola.mhd"
43 connect prependDatapath.Out reader.In
45 #---------------------------------------------------------------------
48 set slider.Title "Slice"
52 #---------------------------------------------------------------------
54 new Viewer2D viewer2DImageOriginal
55 connect reader.Out viewer2DImageOriginal.In
56 connect slider.Out viewer2DImageOriginal.Slice
57 connect slider.BoxChange viewer2DImageOriginal.BoxExecute
59 #---------------------------------------------------------------------
61 new BinaryThresholdImageFilter threshold
62 set threshold.LowerThreshold 1000
63 set threshold.UpperThreshold 5000
64 set threshold.InsideValue 255
65 set threshold.OutsideValue 0
66 connect reader.Out threshold.In
68 new Viewer2D viewer2DImageSegmented
69 connect threshold.Out viewer2DImageSegmented.In
70 connect slider.Out viewer2DImageSegmented.Slice
71 connect slider.BoxChange viewer2DImageSegmented.BoxExecute
73 #---------------------------------------------------------------------
75 new ImageGaussianSmooth smooth
76 connect threshold.Out smooth.In
81 new Viewer2D viewer2DImageSmooth
82 connect smooth.Out viewer2DImageSmooth.In
83 connect slider.Out viewer2DImageSmooth.Slice
84 connect slider.BoxChange viewer2DImageSmooth.BoxExecute
86 #---------------------------------------------------------------------
88 new LayoutLine upLayout
89 set upLayout.Orientation H
90 connect viewer2DImageOriginal.Widget upLayout.Widget1
91 connect viewer2DImageSegmented.Widget upLayout.Widget2
92 connect viewer2DImageSmooth.Widget upLayout.Widget3
95 #---------------------------------------------------------------------
97 new Viewer3D viewernvImagethreshold3D
98 # set viewernvImagethreshold3D.nTypeView "5"
100 new IsoSurfaceExtractor isoextractorthreshold
101 connect threshold.Out isoextractorthreshold.In
102 set isoextractorthreshold.Opacity 1
103 set isoextractorthreshold.Isovalue 128
104 connect viewernvImagethreshold3D.Renderer isoextractorthreshold.Renderer
107 #---------------------------------------------------------------------
108 new Viewer3D viewernvImageSmooth3D
109 # set viewernvImageSmooth3D.nTypeView "5"
111 new IsoSurfaceExtractor isoextractorsmooth
112 connect smooth.Out isoextractorsmooth.In
113 set isoextractorsmooth.Opacity 1
114 set isoextractorsmooth.Isovalue 128
115 connect viewernvImageSmooth3D.Renderer isoextractorsmooth.Renderer
118 #---------------------------------------------------------------------
120 new LayoutLine downLayout
121 set downLayout.Orientation H
122 connect viewernvImagethreshold3D.Widget downLayout.Widget1
123 connect viewernvImageSmooth3D.Widget downLayout.Widget2
125 #---------------------------------------------------------------------
126 new LayoutSplit splitDown
127 connect upLayout.Widget splitDown.Widget1
128 connect downLayout.Widget splitDown.Widget2
130 #---------------------------------------------------------------------
131 new LayoutSplit mainSplit
132 connect slider.Widget mainSplit.Widget1
133 connect splitDown.Widget mainSplit.Widget2
137 exec isoextractorthreshold
138 exec isoextractorsmooth