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