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