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