]> Creatis software - creaRigidRegistration.git/blob - PackRecalage/src/bbPackRecalageImageSwitcherBox.h
ImageSwitcherBox default values
[creaRigidRegistration.git] / PackRecalage / src / bbPackRecalageImageSwitcherBox.h
1 /*
2 # ---------------------------------------------------------------------
3 #
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
5 #                        pour la Santé)
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 #
8 #  This software is governed by the CeCILL-B license under French law and 
9 #  abiding by the rules of distribution of free software. You can  use, 
10 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
11 #  license as circulated by CEA, CNRS and INRIA at the following URL 
12 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
13 #  or in the file LICENSE.txt.
14 #
15 #  As a counterpart to the access to the source code and  rights to copy,
16 #  modify and redistribute granted by the license, users are provided only
17 #  with a limited warranty  and the software's author,  the holder of the
18 #  economic rights,  and the successive licensors  have only  limited
19 #  liability. 
20 #
21 #  The fact that you are presently reading this means that you have had
22 #  knowledge of the CeCILL-B license and that you accept its terms.
23 # ------------------------------------------------------------------------   
24 */
25
26
27 #ifdef _USE_WXWIDGETS_
28 #ifndef __bbPackRecalageImageSwitcherBox_h_INCLUDED__
29 #define __bbPackRecalageImageSwitcherBox_h_INCLUDED__
30 #include "bbPackRecalage_EXPORT.h"
31 #include "bbtkWxBlackBox.h"
32
33 #include "vtkImageData.h"
34
35 #include <wx/timer.h>
36 #include <wx/wx.h>
37
38 namespace bbPackRecalage
39 {
40         class ImageSwitcherBox;
41
42         class MyTimer: public wxTimer
43         {
44         public:
45                 MyTimer(ImageSwitcherBox *box);
46                 ~MyTimer();
47         virtual void Notify();
48
49         ImageSwitcherBox *_box;
50         };
51
52 class bbPackRecalage_EXPORT ImageSwitcherBox
53  : 
54    public bbtk::WxBlackBox
55 {
56   BBTK_BLACK_BOX_INTERFACE(ImageSwitcherBox,bbtk::WxBlackBox);
57   BBTK_DECLARE_INPUT(Title,std::string);
58   BBTK_DECLARE_INPUT(In1,vtkImageData*);
59   BBTK_DECLARE_INPUT(In2,vtkImageData*);
60   BBTK_DECLARE_INPUT(Time,int);
61   BBTK_DECLARE_INPUT(On,bool);
62   BBTK_PROCESS(Process);
63   BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
64   void Process();
65   BBTK_CREATE_WIDGET(CreateWidget);
66   void CreateWidget(wxWindow*);
67
68   public:
69           void Change();
70
71   private:
72         bool change;
73         MyTimer *myTimer;
74         int time;
75         int oldTime;
76         bool _on;
77         bool firstTime;
78 };
79
80 BBTK_BEGIN_DESCRIBE_BLACK_BOX(ImageSwitcherBox,bbtk::WxBlackBox);
81 BBTK_NAME("ImageSwitcherBox");
82 BBTK_AUTHOR("jn.trillos44@uniandes.edu.co");
83 BBTK_DESCRIPTION("Switches between 2 images for comparison");
84 BBTK_CATEGORY("__CategoryBlackBox__");
85 BBTK_INPUT(ImageSwitcherBox,Title,"Title prepended to the Widget",std::string,"");
86 BBTK_INPUT(ImageSwitcherBox,In1,"First Image",vtkImageData*,"");
87 BBTK_INPUT(ImageSwitcherBox,In2,"Second Image",vtkImageData*,"");
88 BBTK_INPUT(ImageSwitcherBox,Time,"Time between image change (default 50)",int,"");
89 BBTK_INPUT(ImageSwitcherBox,On,"Defines if the switcher is turned on. ON = True.",bool,"");
90 BBTK_OUTPUT(ImageSwitcherBox,Out,"Image to be placed",vtkImageData*,"");
91 BBTK_END_DESCRIBE_BLACK_BOX(ImageSwitcherBox);
92 }
93 // EO namespace bbPackRecalage
94
95 #endif // __bbPackRecalageImageSwitcherBox_h_INCLUDED__
96 #endif // _USE_WXWIDGETS_
97