2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
29 #ifndef __creaImageIOWxGimmickPanel_h_INCLUDED__
30 #define __creaImageIOWxGimmickPanel_h_INCLUDED__
34 // Signal/slot mechanism for progress events
35 #include <boost/signals2/signal.hpp>
36 #include <boost/bind.hpp>
38 #include <creaImageIOWxGimmickView.h>
46 //=====================================================================
47 //=====================================================================
48 class CREAIMAGEIO_EXPORT WxGimmickPanel : public wxPanel
52 WxGimmickPanel(wxWindow *parent,
56 const std::string i_namedescp ,
57 const std::string i_namedb = "Local Database",
62 //=============================================
63 typedef boost::signals2::signal<void (bool)> SendImageSignalType;
64 typedef SendImageSignalType::slot_function_type SendImageCallbackType;
65 //=============================================
67 //==================================================================
68 /// Adds the function f to the list of functions to call
69 /// when the addition progresses.
70 /// f is of type ProgressCallbackType which is:
71 /// void (*ProgressCallbackType)(Progress&)
72 /// To pass a member function 'f' of an instance 'c' of a class 'C'
73 /// as callback you have to 'bind' it, i.e. call:
74 /// ConnectSendImageObserver ( boost::bind( &C::f , c, _1 ) );
75 void ConnectSendImageObserver(SendImageCallbackType callback);
76 //==================================================================
78 //===============================================================================================
80 //===============================================================================================
82 void GetSelectedImages(std::vector<vtkImageData*>& s, int dim)
84 mView->GetSelectedImages(s, dim);
87 //EED 28mai2010 Use new mechanism getSelected
88 // void GetSelectedImagesInVector(std::vector<vtkImageData*>& s, int dim)
90 // mView->GetSelectedImagesInVector(s, dim);
94 // ----get selected files in an Output structure-------
95 // out: vector structure output < <img, info>, ... >
96 // i_attr: list of dicom tags to extract
97 // mult: information of one file or multiple files
98 // outmodel: xml-filename that specifies images order..(todo)
99 void getSelected(std::vector<OutStrGimmick> &outG,std::vector< std::string> i_attr, std::vector<std::string> &outFileNames, bool mult, const std::string outmodel)
101 mView->getSelectedFiles(outG, i_attr, outFileNames, mult, outmodel);
104 void OnSelectedImage(bool t);
106 void AddImagesToDB(std::string dir);
108 // DECLARE_EVENT_TABLE();
111 boost::shared_ptr<Gimmick> mGimmick;
112 WxGimmickView* mView;
114 ///The sendImage signal
115 SendImageSignalType mSendImageSignal;
117 }; // class WxGimmickPanel
118 //=====================================================================
121 } // EO namespace creaImageIO
124 #endif // USE_WIDGETS