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 # ------------------------------------------------------------------------ */
26 description "creaMaracasVisu::ImageGaussianSmooth box example. "
28 author "eduardo.davila@creatis.insa-lyon.fr"
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
43 #---------------------------------------------------------------------
47 #---------------------------------------------------------------------
49 new Viewer2D viewer2DImageOriginal
50 connect reader.Out viewer2DImageOriginal.In
51 connect slider.Out viewer2DImageOriginal.Slice
52 connect slider.BoxChange viewer2DImageOriginal.BoxExecute
54 #---------------------------------------------------------------------
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
63 new Viewer2D viewer2DImageSegmented
64 connect threshold.Out viewer2DImageSegmented.In
65 connect slider.Out viewer2DImageSegmented.Slice
66 connect slider.BoxChange viewer2DImageSegmented.BoxExecute
68 #---------------------------------------------------------------------
70 new ImageGaussianSmooth smooth
71 connect threshold.Out smooth.In
76 new Viewer2D viewer2DImageSmooth
77 connect smooth.Out viewer2DImageSmooth.In
78 connect slider.Out viewer2DImageSmooth.Slice
79 connect slider.BoxChange viewer2DImageSmooth.BoxExecute
81 #---------------------------------------------------------------------
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
90 #---------------------------------------------------------------------
92 new Viewer3D viewernvImagethreshold3D
93 # set viewernvImagethreshold3D.nTypeView "5"
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
102 #---------------------------------------------------------------------
103 new Viewer3D viewernvImageSmooth3D
104 # set viewernvImageSmooth3D.nTypeView "5"
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
113 #---------------------------------------------------------------------
115 new LayoutLine downLayout
116 set downLayout.Orientation H
117 connect viewernvImagethreshold3D.Widget downLayout.Widget1
118 connect viewernvImageSmooth3D.Widget downLayout.Widget2
120 #---------------------------------------------------------------------
121 new LayoutSplit splitUp
122 connect slider.Widget splitUp.Widget1
123 connect upLayout.Widget splitUp.Widget2
125 new LayoutSplit mainSplit
126 connect splitUp.Widget mainSplit.Widget1
127 connect downLayout.Widget mainSplit.Widget2
129 #---------------------------------------------------------------------
131 exec isoextractorthreshold
132 exec isoextractorsmooth