load std
load wx
load wxvtk
define DoubleSlicer
description "Simple viewer displaying the same slice of two images. The slice is controlled by a slider. See DemoDoubleSlicer.bbs. Screenshot :
"
author "laurent.guigues at creatis.insa-lyon.fr"
new LayoutLine main
new LayoutLine slicers
new Viewer2D slicer1
new Viewer2D slicer2
new Slider slider
connect slicers.Widget main.Widget1
connect slicer1.Widget slicers.Widget1
connect slicer2.Widget slicers.Widget2
connect slider.Widget main.Widget2
connect slider.Out slicer1.Slice
connect slider.Out slicer2.Slice
# WE NEED A MultipleInputs BOX TO CONNECT BOTH
# slider.BoxChange AND THE INPUT BoxExecuteSlicer1
# OF THE COMPLEX BOX TO slicer1.BoxExecute
# idem for slicer2
new MultipleInputs refresh1
new MultipleInputs refresh2
connect refresh1.Out slicer1.BoxExecute
connect refresh2.Out slicer2.BoxExecute
connect slider.BoxChange refresh2.In1
connect slider.BoxChange refresh1.In1
# set main.Proportion 80
set slider.Title "Slice"
input In1 slicer1.In "Left (or top) image"
input In2 slicer2.In "Right (or bottom) image"
input WinTitle main.WinTitle "Title of the window"
input WinWidth main.WinWidth "Width of the window"
input WinHeight main.WinHeight "Width of the window"
input Orientation slicers.Orientation "Orientation of the images (0=Horizontal / 1=Vertical)"
input RefreshSlicer1 refresh1.In2 "Refreshes the first slicer"
input RefreshSlicer2 refresh2.In2 "Refreshes the second slicer"
input BoxProcessModeSlicer1 slicer1.BoxProcessMode "Process mode of the first slicer"
input BoxProcessModeSlicer2 slicer2.BoxProcessMode "Process mode of the second slicer"
output Widget main.Widget "Widget"
# exec slicer1
exec main
endefine