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 "3 slicers and a 3D view"
27 author "jpr@creatis.insa-lyon.fr"
30 // To show how easy it is to add smthing
31 // =====================================
42 include wxvtk/boxes/bbSimpleSlicer
46 new LayoutLine upright
48 new LayoutLine downleft
49 new LayoutSplit downright
50 set downright.Proportion 85
52 connect upright.Widget main.Widget1
53 connect upleft.Widget main.Widget2
54 connect downleft.Widget main.Widget3
55 connect downright.Widget main.Widget4
57 # Here loads 'hola.mhd'
58 # ---------------------
60 include vtk/boxes/bbLoadHola
63 # Have a look at exampleViewing1.1.bbs
64 # If you want to know how to read different images.
66 // We need that to set Sliders sizes
68 #Get image dimensions, ...
69 new ImageProperties mc
70 connect reader.Out mc.In
72 #Get number of column (X)
73 new GetVectorIntElement gveX
74 connect mc.Size gveX.In
77 #Get number of rows (Y)
78 new GetVectorIntElement gveY
79 connect mc.Size gveY.In
82 #Get number of planes (Z)
83 new GetVectorIntElement gveZ
84 connect mc.Size gveZ.In
86 //print "Dim Z $gveZ.Out"
88 #Compute the number of the 'middle' slice on X axis
90 connect gveX.Out div0.In1
93 #Compute the number of the 'middle' slice on Y axis
95 connect gveY.Out div1.In1
98 #Compute the number of the 'middle' slice on Z axis
100 connect gveZ.Out div2.In1
104 new SimpleSlicer viewerUL
105 connect reader.Out viewerUL.In
106 connect viewerUL.Widget upleft.Widget1
107 #initial slice is the middle one
108 connect div0.Out viewerUL.Slice
109 #Slider size is the number of planes
110 connect gveX.Out viewerUL.SliderSize
111 set viewerUL.SliderReactiveOnTrack 1
112 set viewerUL.Orientation 0
113 set viewerUL.SliderOrientation H
114 set viewerUL.SliderTitle "Planes YZ"
117 new SimpleSlicer viewerUR
118 connect reader.Out viewerUR.In
119 connect viewerUR.Widget upright.Widget1
120 #initial slice is the middle one
121 connect div1.Out viewerUR.Slice
122 #Slider size is the number of planes
123 connect gveY.Out viewerUR.SliderSize
124 set viewerUR.SliderReactiveOnTrack 1
125 set viewerUR.SliderOrientation H
126 set viewerUR.Orientation 1
127 set viewerUR.SliderTitle "Planes XZ"
130 new SimpleSlicer viewerTD
131 connect reader.Out viewerTD.In
132 connect viewerTD.Widget downleft.Widget1
133 #initial slice is the middle one
134 connect div2.Out viewerTD.Slice
135 #Slider size is the number of planes
136 connect gveZ.Out viewerTD.SliderSize
137 set viewerTD.SliderReactiveOnTrack 1
138 set viewerTD.SliderOrientation H
139 set viewerTD.Orientation 2
140 set viewerTD.SliderTitle "Planes XY"
144 new ImagePlanes planes
145 connect reader.Out planes.In
148 connect planes.PlaneX viewer.Obs1
149 connect planes.PlaneY viewer.Obs2
150 connect planes.PlaneZ viewer.Obs3
153 set chkbox.Title "Interpolate Pixels (in '2D' images)"
155 connect chkbox.BoxChange viewerUL.BoxExecute
156 connect chkbox.BoxChange viewerUR.BoxExecute
157 connect chkbox.BoxChange viewerTD.BoxExecute
159 connect viewer.Widget downright.Widget1
160 connect chkbox.Widget downright.Widget2
162 connect chkbox.Out viewerUL.Interpolate
163 connect chkbox.Out viewerUR.Interpolate
164 connect chkbox.Out viewerTD.Interpolate
166 set main.WinTitle "demoViewing1"