]> Creatis software - bbtk.git/blob - packages/demo/bbs/appli/demoViewing3.bbs
#3202 BBTK Feature New Normal - fast algorithm for ImageBoundaries box
[bbtk.git] / packages / demo / bbs / appli / demoViewing3.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 "3 slicers and a 3D view"
27 author "jpr@creatis.insa-lyon.fr"
28 category "demo"
29
30 // To show how easy it is to add smthing
31 // =====================================
32
33 load vtk
34 include wxvtk
35 load std
36 load itk
37 include vtk
38 include wx
39 load itkvtk
40 load gdcmvtk
41
42 new LayoutX4 main
43
44 new LayoutLine  upright
45 new LayoutLine  upleft
46 new LayoutLine  downleft
47
48 connect upright.Widget   main.Widget1
49 connect upleft.Widget    main.Widget2
50 connect downleft.Widget  main.Widget3
51
52 # Here loads 'hola.mhd'
53 # ---------------------
54
55 # Don't forget to comment out the following 2 lines
56 # If you want to check someting else.
57
58 include vtk/boxes/bbLoadHola
59 new LoadHola reader
60
61 # uncomment next lines to have a file selector
62 # --------------------------------------------
63 /*
64 new FileSelector openFileDialog
65 new ImageReader reader
66   connect openFileDialog.Out reader.In
67 */
68
69 # uncomment next lines to use a vtkgdcmReader
70 # -------------------------------------
71 /*
72 new FileSelector openFileDialog
73 new GetInfoGdcmReader reader
74   connect openFileDialog.Out reader.In
75 */
76
77 # uncomment next lines to use Gimmick
78 # -----------------------------------
79 /*
80 load creaImageIO
81 new Gimmick reader
82 */
83
84 # uncomment next lines to Read a MHD file (and nothing else !)
85 # ------------------------------------------------------------
86 /*
87 new FileSelector openFileDialog
88  set openFileDialog.Wildcard  "(*.mhd)|*.mhd"
89 new MetaImageReader reader
90    connect openFileDialog.Out reader.In
91 */
92
93 # uncomment the following lines to read a 3D images stack
94 # (only if file name order is meaningfull)
95 # -------------------------------------------------------
96 /*
97 // To choose the directory
98 new DirectorySelector ds
99 // To get the image names into a vector
100 new FilesFromDirectory fd
101 // To read all the files, as a bbitk::ImagePointer
102 new ImageSeriesReader reader
103 // user choosen directory as input
104 connect ds.Out fd.In
105 set fd.Recursive false
106 // list of files as input
107 #print "Files found in $ds.Out$\n
108 connect fd.Out reader.FileNames
109 */
110
111 # uncomment the following lines to read a 3D images stack
112 # (if the directory contains a 'XCoherent" Serie)
113 # -------------------------------------------------------
114 /*
115 // To choose the directory
116 new DirectorySelector ds
117 // To get the image names into a vector
118 new FilesFromDirectory fd
119 // user choosen directory as input
120 connect ds.Out fd.In 
121 // order the files, computes an accurate ZSpacing
122 new GetXCoherentInfoGdcmReader reader
123 connect fd.Out reader.In
124 */
125
126 # uncomment the following lines to read a 3D images stack
127 # (with DICOMDirReader)
128 # -------------------------------------------------------
129 /*
130 include itk/boxes/bbDICOMDirReader
131 // To choose the directory
132 new DirectorySelector ds
133 new DICOMDirReader reader
134    connect ds.Out reader.In
135 */
136
137
138 //set reader.XSpacing 23.4
139 //set reader.YSpacing 23.4
140 //set reader.ZSpacing 35
141
142 #print "Image properties : $reader.Out"
143
144 //For 3D Viewer
145
146 new ImagePlanes planes
147   connect reader.Out planes.In
148
149 new Viewer3D viewer
150   connect planes.PlaneX viewer.Obs1
151   connect planes.PlaneY viewer.Obs2
152   connect planes.PlaneZ viewer.Obs3
153
154   connect viewer.Widget main.Widget4
155
156 // For X axis
157 // ----------
158 new Viewer2D viewerUL
159   set viewerUL.BoxProcessMode Always
160   connect planes.ImageX viewerUL.In
161    # contains only one slice
162   set viewerUL.Slice 0
163   connect viewerUL.Widget upleft.Widget1
164
165  connect planes.BoxChange viewerUL.BoxExecute
166
167 print "===============planes.ImageX $planes.ImageX"
168
169 // For Y axis
170 // ----------
171 new Viewer2D viewerUR
172   set viewerUR.BoxProcessMode Always
173   connect planes.ImageY viewerUR.In
174   connect viewerUR.Widget upright.Widget1
175  # contains only one  slice
176   set viewerUR.Slice 0
177  connect planes.BoxChange viewerUR.BoxExecute
178
179  print "===============planes.ImageY $planes.ImageY"
180
181 // For Z axis
182 // ----------
183 new Viewer2D viewerDL
184   set viewerDL.BoxProcessMode Always
185   connect planes.ImageZ viewerDL.In
186   connect viewerDL.Widget downleft.Widget1
187  # contains only one  slice
188   set viewerDL.Slice 0
189   connect planes.BoxChange viewerDL.BoxExecute 
190
191  print "===============planes.ImageZ $planes.ImageZ"
192
193 set main.WinTitle "demoViewing3"
194 exec main