1 include wxvtk/boxes/bbDoubleSlicer
9 define BasicImageApplication
12 description "Interface of a 'standard' image application. Displays two images : before/after processing; Offers buttons : open/parameters/run/save/quit. See <a href='../demo/index.html#DemoBasicImageApplication'>DemoBasicImageApplication.bbs</a>. Screenshot : <center><img src='../demo/DemoBasicImageApplication1.png' width=400></center>."
13 author "laurent.guigues@creatis.insa-lyon.fr"
19 new LayoutSplit mainWindow
20 set mainWindow.Proportion 90
22 new DoubleSlicer viewer
24 new LayoutLine buttonsBar
26 new CommandButton openButton
27 new CommandButton paramButton
28 new CommandButton runButton
29 new CommandButton saveButton
30 new CommandButton quitButton
32 connect viewer.Widget mainWindow.Widget1
33 connect buttonsBar.Widget mainWindow.Widget2
35 connect openButton.Widget buttonsBar.Widget1
36 connect paramButton.Widget buttonsBar.Widget2
37 connect runButton.Widget buttonsBar.Widget3
38 connect saveButton.Widget buttonsBar.Widget4
39 connect quitButton.Widget buttonsBar.Widget5
41 set viewer.Orientation 0
42 set buttonsBar.Orientation 0
45 set openButton.Label "Open"
46 set paramButton.Label "Parameters"
47 set saveButton.Label "Save"
48 new FileSelector openFileDialog
49 connect openButton.BoxChange openFileDialog.BoxExecute
50 connect openButton.BoxChange viewer.RefreshSlicer1
51 set openFileDialog.Message "Select input image"
52 set openFileDialog.OpenSave "Open"
54 new MetaImageReader reader
55 # set reader.Filename "/home/guigues/coding/Sofa/bbtk/data/thorax.hdr"
56 connect openFileDialog.Out reader.In
58 connect reader.Out viewer.In1
62 set runButton.Label "Run"
63 new MultipleInputs refreshViewerOut
64 connect refreshViewerOut.Out viewer.RefreshSlicer2
65 connect runButton.BoxChange refreshViewerOut.In1
69 new ImageWriter writer
70 new FileSelector saveFileDialog
71 set saveFileDialog.BoxProcessMode Always
72 set saveFileDialog.DefaultFile "out.hdr"
73 set saveFileDialog.Message "Select output image"
74 set saveFileDialog.OpenSave "Save"
75 connect saveFileDialog.Out writer.Filename
76 connect saveButton.BoxChange refreshViewerOut.In2
77 connect saveButton.BoxChange writer.BoxExecute
80 new LayoutSplit paramWindow
81 set paramWindow.Proportion 80
82 set paramWindow.WinTitle "Parameters"
83 # new LayoutLine userParamWindow
84 # connect userParamWindow.Widget paramWindow.Widget1
85 new CommandButton paramWindowCloseButton
86 set paramWindowCloseButton.Label "Close"
87 connect paramWindowCloseButton.Widget paramWindow.Widget2
88 new MultipleInputs paramWindowHide
89 connect paramWindowHide.Out paramWindow.WinHide
90 connect paramWindowCloseButton.BoxChange paramWindowHide.In1
91 connect paramButton.BoxChange paramWindow.BoxExecute
94 set quitButton.Label "Quit"
95 connect quitButton.BoxChange mainWindow.WinHide
96 connect quitButton.BoxChange paramWindowHide.In2
97 set quitButton.In "reset"
102 new anyItkImagePointerRelay imageOut
103 connect imageOut.Out viewer.In2
104 connect imageOut.Out writer.In
106 input AlgorithmOutput imageOut.In "Plug here the output of your algorithm"
107 output AlgorithmInput reader.Out "Plug this output to the input of your algorithm"
108 input ParametersWidget paramWindow.Widget1 "Connect here your parameter tuning widget"
110 input ParametersWindowWidth paramWindow.WinWidth "The width of the parameters window"
111 input ParametersWindowHeight paramWindow.WinHeight "The height of the parameters window"
112 input WinTitle mainWindow.WinTitle "Title of the main window"
114 input Refresh viewer.BoxProcessModeSlicer2 "Set to 'Reactive' to have automatic refresh when image or parameters change"