]> Creatis software - bbtk.git/blob - packages/demo/bbs/appli/demoViewing3.bbs
Synchronize demoViewing1 and demoViewing3
[bbtk.git] / packages / demo / bbs / appli / demoViewing3.bbs
1 description "3 slicers and a 3D view"
2 author "jpr@creatis.insa-lyon.fr"
3 category "demo"
4
5 // To show how easy it is to add smthing
6 // =====================================
7
8 load vtk
9 include wxvtk
10 load std
11 load itk
12 include vtk
13 include wx
14 load itkvtk
15 load gdcmvtk
16
17
18 new LayoutX4 main
19
20 new LayoutLine  upright
21 new LayoutLine  upleft
22 new LayoutLine  downleft
23
24 connect upright.Widget   main.Widget1
25 connect upleft.Widget    main.Widget2
26 connect downleft.Widget  main.Widget3
27
28 # Here loads hola.mhd
29 # -------------------
30 include vtk/boxes/bbLoadHola
31 new LoadHola reader
32
33 # uncomment next lines to have a file selector
34 # --------------------------------------------
35 /*
36 new FileSelector openFileDialog
37 new ImageReader reader
38   connect openFileDialog.Out reader.In
39 */
40
41 # uncomment next lines to use Gimmick
42 # -----------------------------------
43 /*
44 load creaImageIO
45 new Gimmick reader
46 */
47
48 # uncomment next lines to Read a MHD file (and nothing else !)
49 # ------------------------------------------------------------
50 /*
51 new FileSelector openFileDialog
52  set openFileDialog.Wildcard  "(*.mhd)|*.mhd"
53 new MetaImageReader reader
54    connect openFileDialog.Out reader.In
55 */
56
57 # uncomment the following lines to read a 3D images stack
58 # (only if file name order is meaningfull)
59 # -------------------------------------------------------
60 /*
61 // To choose the directory
62 new DirectorySelector ds
63 // To get the image names into a vector
64 new FilesFromDirectory fd
65 // To read all the files, as a bbitk::ImagePointer
66 new ImageSeriesReader reader
67 // user choosen directory as input
68 connect ds.Out fd.In
69 set fd.Recursive false
70 // list of files as input
71 #print "Files found in $ds.Out$\n
72 connect fd.Out reader.FileNames
73 */
74
75 # uncomment the following lines to read a 3D images stack
76 # (if the directory contains a 'XCoherent" Serie)
77 # -------------------------------------------------------
78 /*
79 // To choose the directory
80 new DirectorySelector ds
81 // To get the image names into a vector
82 new FilesFromDirectory fd
83 // user choosen directory as input
84 connect ds.Out fd.In 
85 // order the files, computes an accurate ZSpacing
86 new GetXCoherentInfoGdcmReader reader
87 connect fd.Out reader.In
88 */
89
90 # uncomment the following lines to read a 3D images stack
91 # (with DICOMDirReader)
92 # -------------------------------------------------------
93 /*
94 include itk/boxes/bbDICOMDirReader
95 // To choose the directory
96 new DirectorySelector ds
97 new DICOMDirReader reader
98    connect ds.Out reader.In
99 */
100
101
102 //set reader.XSpacing 23.4
103 //set reader.YSpacing 23.4
104 //set reader.ZSpacing 35
105
106 #print "Image properties : $reader.Out"
107
108 //For 3D Viewer
109
110 new ImagePlanes planes
111   connect reader.Out planes.In
112
113 new Viewer3D viewer
114   connect planes.PlaneX viewer.Obs1
115   connect planes.PlaneY viewer.Obs2
116   connect planes.PlaneZ viewer.Obs3
117
118   connect viewer.Widget main.Widget4
119
120 // For X axis
121 // ----------
122 new Viewer2D viewerUL
123   set viewerUL.BoxProcessMode Always
124   connect planes.ImageX viewerUL.In
125    # contains only one slice
126   set viewerUL.Slice 0
127   connect viewerUL.Widget upleft.Widget1
128
129  connect planes.BoxChange viewerUL.BoxExecute
130
131 print "===============planes.ImageX $planes.ImageX"
132
133 // For Y axis
134 // ----------
135 new Viewer2D viewerUR
136   set viewerUR.BoxProcessMode Always
137   connect planes.ImageY viewerUR.In
138   connect viewerUR.Widget upright.Widget1
139  # contains only one  slice
140   set viewerUR.Slice 0
141  connect planes.BoxChange viewerUR.BoxExecute
142
143  print "===============planes.ImageY $planes.ImageY"
144
145 // For Z axis
146 // ----------
147 new Viewer2D viewerDL
148   set viewerDL.BoxProcessMode Always
149   connect planes.ImageZ viewerDL.In
150   connect viewerDL.Widget downleft.Widget1
151  # contains only one  slice
152   set viewerDL.Slice 0
153   connect planes.BoxChange viewerDL.BoxExecute 
154
155  print "===============planes.ImageZ $planes.ImageZ"
156
157 set main.WinTitle "demoViewing3"
158 exec main