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 // =====================================
44 new LayoutLine upright
46 new LayoutLine downleft
48 connect upright.Widget main.Widget1
49 connect upleft.Widget main.Widget2
50 connect downleft.Widget main.Widget3
52 # Here loads 'hola.mhd'
53 # ---------------------
55 # Don't forget to comment out the following 2 lines
56 # If you want to check someting else.
58 include vtk/boxes/bbLoadHola
61 # uncomment next lines to have a file selector
62 # --------------------------------------------
64 new FileSelector openFileDialog
65 new ImageReader reader
66 connect openFileDialog.Out reader.In
69 # uncomment next lines to use a vtkgdcmReader
70 # -------------------------------------
72 new FileSelector openFileDialog
73 new GetInfoGdcmReader reader
74 connect openFileDialog.Out reader.In
77 # uncomment next lines to use Gimmick
78 # -----------------------------------
84 # uncomment next lines to Read a MHD file (and nothing else !)
85 # ------------------------------------------------------------
87 new FileSelector openFileDialog
88 set openFileDialog.Wildcard "(*.mhd)|*.mhd"
89 new MetaImageReader reader
90 connect openFileDialog.Out reader.In
93 # uncomment the following lines to read a 3D images stack
94 # (only if file name order is meaningfull)
95 # -------------------------------------------------------
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
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
111 # uncomment the following lines to read a 3D images stack
112 # (if the directory contains a 'XCoherent" Serie)
113 # -------------------------------------------------------
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
121 // order the files, computes an accurate ZSpacing
122 new GetXCoherentInfoGdcmReader reader
123 connect fd.Out reader.In
126 # uncomment the following lines to read a 3D images stack
127 # (with DICOMDirReader)
128 # -------------------------------------------------------
130 include itk/boxes/bbDICOMDirReader
131 // To choose the directory
132 new DirectorySelector ds
133 new DICOMDirReader reader
134 connect ds.Out reader.In
138 //set reader.XSpacing 23.4
139 //set reader.YSpacing 23.4
140 //set reader.ZSpacing 35
142 #print "Image properties : $reader.Out"
146 new ImagePlanes planes
147 connect reader.Out planes.In
150 connect planes.PlaneX viewer.Obs1
151 connect planes.PlaneY viewer.Obs2
152 connect planes.PlaneZ viewer.Obs3
154 connect viewer.Widget main.Widget4
158 new Viewer2D viewerUL
159 set viewerUL.BoxProcessMode Always
160 connect planes.ImageX viewerUL.In
161 # contains only one slice
163 connect viewerUL.Widget upleft.Widget1
165 connect planes.BoxChange viewerUL.BoxExecute
167 print "===============planes.ImageX $planes.ImageX"
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
177 connect planes.BoxChange viewerUR.BoxExecute
179 print "===============planes.ImageY $planes.ImageY"
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
189 connect planes.BoxChange viewerDL.BoxExecute
191 print "===============planes.ImageZ $planes.ImageZ"
193 set main.WinTitle "demoViewing3"