]> Creatis software - creaRigidRegistration.git/blob - PackRecalage/bbs/appli/PlaneReorientation.bbs
cfc472d37fa7564dc967867a03d87ecbac66e3a2
[creaRigidRegistration.git] / PackRecalage / bbs / appli / PlaneReorientation.bbs
1 description "Image Reorientation by choosing a plane"
2 author "jn.trillos44@uniandes.edu.co"
3 category "demo"
4
5 load vtk
6 include wxvtk
7 load std
8 load itk
9 include vtk
10 include wx
11 load itkvtk
12 load creaMaracasVisu
13 load PackRecalage
14
15 //File Readers
16
17 # Here loads hola.mhd
18 # -------------------
19 /*
20 include vtk/boxes/bbLoadHola
21 new LoadHola reader
22 */
23
24 ////////////////////////////////////
25 /*
26  For using load file dialog 
27 */
28 ///////////////////////////////////
29 /*
30 new FileSelector openFileDialog
31   set openFileDialog.Wildcard  "(*.mhd)|*.mhd"
32 new MetaImageReader reader
33    connect openFileDialog.Out reader.In
34 */
35 ////////////////////////////////////
36 /*
37 For using Gimmick           
38 */
39 ///////////////////////////////////
40
41 load creaImageIO
42 new Gimmick reader
43
44
45 //Show NPoints and ViewerNV for choosing the reorientation plane
46
47 new ViewerNV viewer
48   connect reader.Out viewer.In
49   set viewer.nTypeView "5 1 2 0"
50
51 new ShowNPoints showNpoints
52   connect reader.Out showNpoints.Image
53   connect viewer.Renderer1 showNpoints.Renderer
54   connect viewer.Point showNpoints.In
55   connect viewer.BoxChange showNpoints.BoxExecute
56   set showNpoints.Radio 10
57
58 //Sliders
59
60 //Reorientation class
61 new PlaneNormalBox normal
62   connect showNpoints.lstPointsX normal.InX
63   connect showNpoints.lstPointsY normal.InY
64   connect showNpoints.lstPointsZ normal.InZ
65  connect viewer.Point normal.CenterPoint
66
67 //Reslicer
68
69 new ReSlicerBox reSlicer
70   connect normal.Out reSlicer.Transform
71   connect reader.Out reSlicer.In
72   //set reSlicer.Origin "0,0,0" 
73   connect viewer.Point reSlicer.Origin
74   set reSlicer.Centered true
75   set reSlicer.Interpolate true
76
77   connect normal.BoxChange reSlicer.BoxExecute
78
79 //Button for activating the second window
80
81 new CommandButton but
82   set but.Label "Reorientation"
83   connect but.BoxChange normal.BoxExecute
84
85 //Second Window
86
87 new ViewerNV viewer2
88   connect reSlicer.Out viewer2.In
89   set viewer2.nTypeView "5 1 2 0"
90
91 new ShowNPoints showNpoints2
92   connect reSlicer.Out showNpoints2.Image
93   connect viewer2.Renderer1 showNpoints2.Renderer
94   connect viewer2.Point showNpoints2.In
95   connect viewer2.BoxChange showNpoints2.BoxExecute
96   set showNpoints.Radio 10  
97
98 //Layouts
99 new LayoutSplit controls
100   set controls.Orientation V
101   set controls.Proportion 80
102   connect showNpoints.Widget controls.Widget1
103   connect but.Widget controls.Widget2
104
105 new LayoutSplit windowResult
106   set windowResult.Orientation H
107   set windowResult.Proportion 20
108   connect showNpoints2.Widget windowResult.Widget1
109   connect viewer2.Widget windowResult.Widget2
110
111   connect reSlicer.BoxChange windowResult.BoxExecute
112
113 new LayoutSplit main
114   set main.Orientation H
115   set main.Proportion 20
116   connect controls.Widget main.Widget1
117   connect viewer.Widget main.Widget2
118
119 exec main