9 //include PackRecalage/boxes/checkerView
11 new FileSelector imageSelector1
12 set imageSelector1.Wildcard "*.mhd"
13 new FileSelector imageSelector2
14 set imageSelector2.Wildcard "*.mhd"
16 new MetaImageReader image
17 connect imageSelector1.Out image.In
19 new MetaImageReader image2
20 connect imageSelector2.Out image2.In
22 #Viewer containing image 1
24 new LayoutLine v1Layout
26 connect image.Out viewer1.In
27 set viewer1.nTypeView "0"
28 connect viewer1.Widget v1Layout.Widget1
30 #Viewer containing image 2
32 new LayoutLine v2Layout
34 connect image2.Out viewer2.In
35 set viewer2.nTypeView "0"
36 connect viewer2.Widget v2Layout.Widget1
38 #LayoutSplit were the images will be
40 new LayoutSplit initialImages
41 set initialImages.Proportion "50"
42 set initialImages.Orientation H
43 connect v1Layout.Widget initialImages.Widget1
44 connect v2Layout.Widget initialImages.Widget2
46 #Layout line that will contain the buttons
48 new LayoutLine buttonsLayout
49 set buttonsLayout.Orientation V
51 #Slider were the angle will be entered
54 set slider.Title "Angle"
58 set slider.ReactiveOnTrack "1"
59 connect slider.Widget buttonsLayout.Widget1
61 #Slider were the xScale will be entered
64 set sliderX.Title "% Scale in X"
68 set sliderX.ReactiveOnTrack "1"
69 connect sliderX.Widget buttonsLayout.Widget2
71 #Slider were the yScale will be entered
74 set sliderY.Title "% Scale in Y"
78 set sliderY.ReactiveOnTrack "1"
79 connect sliderY.Widget buttonsLayout.Widget3
81 # Create the reslicers
83 new SliceImage imgslice1
84 new SliceImage imgslice2
85 connect image.Out imgslice1.In
86 connect image2.Out imgslice2.In
88 #Box were the transformation will be made
90 new Transform2DBox transform
91 connect viewer2.Point transform.CenterPoint
92 connect slider.Out transform.Angle
93 connect sliderX.Out transform.ScaleX
94 connect sliderY.Out transform.ScaleY
96 new ReSlicerBox reslice1
97 connect viewer1.Point reslice1.Origin
98 connect transform.Out reslice1.Transform
99 connect imgslice2.Out reslice1.In
101 #Convolution Filter for both of the Images
103 new ImageConvolution convol1
104 connect imgslice1.Out convol1.In
105 new ImageConvolution convol2
106 connect reslice1.Out convol2.In
110 new ImageRecalageProperties properties
111 connect image.Out properties.In
112 connect image.BoxChange properties.BoxExecute
114 # Create the ZSlider for the slices
117 set sdrZ.ReactiveOnTrack 1
119 connect properties.LengthZ sdrZ.Max
120 set sdrZ.Title "Z for slice"
122 connect sdrZ.Out imgslice1.Z
123 connect sdrZ.Out imgslice2.Z
124 connect sdrZ.BoxChange imgslice1.BoxExecute
125 connect sdrZ.BoxChange imgslice2.BoxExecute
127 #Create slider for Convolution Factor
130 set sdrF.ReactiveOnTrack 1
134 set sdrF.Title "Convolution Factor"
136 connect sdrF.Out convol1.Factor
137 connect sdrF.Out convol2.Factor
139 #Create CheckBox for Convolution Filter On/Off
144 connect checkF.Out convol1.On
145 connect checkF.Out convol2.On
147 new MultipleInputs multF
148 connect sdrF.BoxChange multF.In1
149 connect checkF.BoxChange multF.In2
151 connect multF.BoxChange convol1.BoxExecute
152 connect multF.BoxChange convol2.BoxExecute
154 #Create Sliders for WinLevel and ColorLevel
156 new Slider colorLevel
157 set colorLevel.Min "0"
158 connect properties.ColorLevel colorLevel.Max
159 connect properties.MidColorLevel colorLevel.In
160 set colorLevel.ReactiveOnTrack true
161 set colorLevel.Title "Color Level"
163 new Slider windowLevel
164 set windowLevel.Min "0"
165 connect properties.ColorLevel windowLevel.Max
166 connect properties.MidColorLevel windowLevel.In
167 set windowLevel.ReactiveOnTrack true
168 set windowLevel.Title "Window Level"
170 # Connection to viewers
172 connect colorLevel.Out viewer1.ColorLevel
173 connect colorLevel.Out viewer2.ColorLevel
175 connect windowLevel.Out viewer1.WindowLevel
176 connect windowLevel.Out viewer2.WindowLevel
178 new MultipleInputs multLevels
179 connect colorLevel.BoxChange multLevels.In1
180 connect windowLevel.BoxChange multLevels.In2
182 connect multLevels.BoxChange viewer1.BoxExecute
183 connect multLevels.BoxChange viewer2.BoxExecute
187 new CommandButton saveBut
188 set saveBut.Label "Save Image"
190 new FileSelector fileSave
191 set fileSave.OpenSave "Save"
192 set fileSave.Wildcard "*.mhd"
194 new MetaImageWriter writSave
195 connect reslice1.Out writSave.In
196 connect fileSave.Out writSave.Filename
198 connect saveBut.BoxChange fileSave.BoxExecute
199 connect fileSave.BoxChange writSave.BoxExecute
201 ////////////////////Checkboard/////////////////////////
202 # Create the visulization box for checkerBoard
203 new CheckBoardBox cbb
204 connect convol1.Out cbb.In1
205 connect convol2.Out cbb.In2
209 set sdr.ReactiveOnTrack 1
215 set sdr2.ReactiveOnTrack 1
219 # Create viewer & layout for Checkerboard
220 new LayoutSplit checkerBoard
222 new ViewerNV viewerCH
223 set viewerCH.nTypeView "0"
224 set checkerBoard.Proportion 80
228 connect colorLevel.Out viewerCH.ColorLevel
229 connect windowLevel.Out viewerCH.WindowLevel
231 # Graphical pipeline for CheckBoard
232 connect sdr.Out cbb.Cols
233 connect sdr2.Out cbb.Rows
234 connect cbb.Out viewerCH.In
236 connect sdr.Widget ly.Widget2
237 connect sdr2.Widget ly.Widget3
239 connect viewerCH.Widget checkerBoard.Widget1
240 connect ly.Widget checkerBoard.Widget2
241 /////////////end of Checkboard////////////////////
244 new checkerView checkerboard
246 connect convol1.Out checkerboard.In1
247 connect convol2.Out checkerboard.In2
249 connect colorLevel.Out checkerboard.ColorLevel
250 connect windowLevel.Out checkerboard.WindowLevel
252 //////////////Transparency///////////////////////////
253 #Image Transparency view
255 new TransparencyV2 trans
256 connect convol1.Out trans.In1
257 connect convol2.Out trans.In2
263 set sdrP.ReactiveOnTrack true
265 connect sdrP.Out trans.Percent
267 new ViewerNV transView
268 connect trans.Out transView.In
269 set transView.nTypeView "0"
271 new LayoutSplit transparency
272 connect transView.Widget transparency.Widget1
273 connect sdrP.Widget transparency.Widget2
274 set transparency.Proportion 80
276 connect colorLevel.Out transView.ColorLevel
277 connect windowLevel.Out transView.WindowLevel
278 ///////////////////end of Transparency////////////////
281 /////////////////Image Switcher//////////////////////
283 new ImageSwitcherBox switch
284 connect convol1.Out switch.In1
285 connect convol2.Out switch.In2
288 connect checkS.Out switch.On
289 set checkS.Title "On"
296 set sdrT.ReactiveOnTrack "True"
298 connect sdrT.Out switch.Time
300 new Viewer2D viewerSwitch
301 connect switch.Out viewerSwitch.In
303 connect sdrT.BoxChange switch.BoxExecute
304 connect switch.BoxChange viewerSwitch.BoxExecute
306 new LayoutSplit switcher
307 set switcher.Proportion "70"
309 new LayoutSplit switchWindow
310 set switchWindow.Proportion "80"
311 connect viewerSwitch.Widget switchWindow.Widget1
313 new LayoutSplit switchTool
314 set switchTool.Orientation H
315 set switchTool.Proportion "50"
316 connect switch.Widget switchTool.Widget1
317 connect checkS.Widget switchTool.Widget2
319 connect switchTool.Widget switchWindow.Widget2
321 connect switchWindow.Widget switcher.Widget1
322 connect sdrT.Widget switcher.Widget2
324 //////////////end of Image Switch///////////////////
326 #Multiple inputs for managing the interaction
328 new MultipleInputs mult
329 connect slider.BoxChange mult.In1
330 connect sliderX.BoxChange mult.In2
331 connect sliderY.BoxChange mult.In3
332 connect viewer1.BoxChange mult.In4
333 connect viewer2.BoxChange mult.In5
335 new MultipleInputs mult2
336 connect multF.BoxChange mult2.In1
337 connect mult.BoxChange mult2.In2
339 # Execution pipeline for checkboard
341 new MultipleInputs mult3
342 connect ly.BoxChange mult3.In1
343 connect mult2.BoxChange mult3.In2
344 connect imgslice1.BoxChange mult3.In3
345 connect imgslice2.BoxChange mult3.In4
346 connect multLevels.BoxChange mult3.In5
348 connect mult3.BoxChange cbb.BoxExecute
349 connect cbb.BoxChange viewerCH.BoxExecute
351 #Execution pipeline for Transparency
353 new MultipleInputs mult4
354 connect mult2.BoxChange mult4.In1
355 connect sdrP.BoxChange mult4.In2
357 connect mult4.BoxChange trans.BoxExecute
358 connect trans.BoxChange transView.BoxExecute
360 ///////////////////////////////////////////////////////////////
365 connect checkerBoard.Widget tabs.Widget1
366 connect transparency.Widget tabs.Widget2
367 connect switcher.Widget tabs.Widget3
369 #Layout where the images and the buttons will be displayed
372 connect sdrZ.Widget tools.Widget1
373 connect colorLevel.Widget tools.Widget2
374 connect windowLevel.Widget tools.Widget3
375 connect saveBut.Widget tools.Widget5
377 new LayoutSplit convolTools
378 set convolTools.Orientation H
379 set convolTools.Proportion "80"
380 connect sdrF.Widget convolTools.Widget1
381 connect checkF.Widget convolTools.Widget2
383 connect convolTools.Widget tools.Widget4
385 new LayoutSplit window1
386 set window1.WinWidth "600"
387 set window1.Proportion "80"
388 set window1.Orientation V
389 connect initialImages.Widget window1.Widget1
390 connect buttonsLayout.Widget window1.Widget2
392 new LayoutSplit window2
393 connect tabs.Widget window2.Widget1
394 connect tools.Widget window2.Widget2
395 set window2.Proportion "90"
398 set main.WinWidth "1200"
399 set main.Proportion "50"
400 set main.Orientation H
401 connect window1.Widget main.Widget1
402 connect window2.Widget main.Widget2