1 # ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
28 // --------------------------
29 // TODO : Check if is works! (was in packages/wxvtk/bbs/old)
32 include wxvtk/boxes/bbDoubleSlicer
40 define BasicImageApplication
43 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>."
44 author "laurent.guigues@creatis.insa-lyon.fr"
50 new LayoutSplit mainWindow
51 set mainWindow.Proportion 90
53 new DoubleSlicer viewer
55 new LayoutLine buttonsBar
57 new CommandButton openButton
58 new CommandButton paramButton
59 new CommandButton runButton
60 new CommandButton saveButton
61 new CommandButton quitButton
63 connect viewer.Widget mainWindow.Widget1
64 connect buttonsBar.Widget mainWindow.Widget2
66 connect openButton.Widget buttonsBar.Widget1
67 connect paramButton.Widget buttonsBar.Widget2
68 connect runButton.Widget buttonsBar.Widget3
69 connect saveButton.Widget buttonsBar.Widget4
70 connect quitButton.Widget buttonsBar.Widget5
72 set viewer.Orientation 0
73 set buttonsBar.Orientation 0
76 set openButton.Label "Open"
77 set paramButton.Label "Parameters"
78 set saveButton.Label "Save"
79 new FileSelector openFileDialog
80 connect openButton.BoxChange openFileDialog.BoxExecute
81 connect openButton.BoxChange viewer.RefreshSlicer1
82 set openFileDialog.Message "Select input image"
83 set openFileDialog.OpenSave "Open"
85 new MetaImageReader reader
86 connect openFileDialog.Out reader.In
88 connect reader.Out viewer.In1
92 set runButton.Label "Run"
93 new MultipleInputs refreshViewerOut
94 connect refreshViewerOut.Out viewer.RefreshSlicer2
95 connect runButton.BoxChange refreshViewerOut.In1
99 new ImageWriter writer
100 new FileSelector saveFileDialog
101 set saveFileDialog.BoxProcessMode Always
102 set saveFileDialog.DefaultFile "out.hdr"
103 set saveFileDialog.Message "Select output image"
104 set saveFileDialog.OpenSave "Save"
105 connect saveFileDialog.Out writer.Filename
106 connect saveButton.BoxChange refreshViewerOut.In2
107 connect saveButton.BoxChange writer.BoxExecute
110 new LayoutSplit paramWindow
111 set paramWindow.Proportion 80
112 set paramWindow.WinTitle "Parameters"
113 # new LayoutLine userParamWindow
114 # connect userParamWindow.Widget paramWindow.Widget1
115 new CommandButton paramWindowCloseButton
116 set paramWindowCloseButton.Label "Close"
117 connect paramWindowCloseButton.Widget paramWindow.Widget2
118 new MultipleInputs paramWindowHide
119 connect paramWindowHide.Out paramWindow.WinHide
120 connect paramWindowCloseButton.BoxChange paramWindowHide.In1
121 connect paramButton.BoxChange paramWindow.BoxExecute
124 set quitButton.Label "Quit"
125 connect quitButton.BoxChange mainWindow.WinHide
126 connect quitButton.BoxChange paramWindowHide.In2
127 set quitButton.In "reset"
132 new anyItkImagePointerRelay imageOut
133 connect imageOut.Out viewer.In2
134 connect imageOut.Out writer.In
136 input AlgorithmOutput imageOut.In "Plug here the output of your algorithm"
137 output AlgorithmInput reader.Out "Plug this output to the input of your algorithm"
138 input ParametersWidget paramWindow.Widget1 "Connect here your parameter tuning widget"
140 input ParametersWindowWidth paramWindow.WinWidth "The width of the parameters window"
141 input ParametersWindowHeight paramWindow.WinHeight "The height of the parameters window"
142 input WinTitle mainWindow.WinTitle "Title of the main window"
144 input Refresh viewer.BoxProcessModeSlicer2 "Set to 'Reactive' to have automatic refresh when image or parameters change"