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