]> Creatis software - creaImageIO.git/blob - src/creaImageIOWxGimmickReaderDialog.h
1f2a6c30808bd03005b340ce04e77df982252708
[creaImageIO.git] / src / creaImageIOWxGimmickReaderDialog.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 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 #
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.
16 #
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
21 #  liability. 
22 #
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 # ------------------------------------------------------------------------
26 */
27
28
29 #ifndef __creaImageIOWxGimmickReaderDialog_h_INCLUDED__
30 #define __creaImageIOWxGimmickReaderDialog_h_INCLUDED__
31
32 #ifdef USE_WXWIDGETS
33
34 #include <creaImageIOWxGimmickView.h>
35 #include "creaImageIOSystem.h"
36 #include <creaWx.h>
37 #include "wx/wx.h"
38 namespace creaImageIO
39 {
40   /**
41    * \ingroup GUI
42    */
43
44   //=====================================================================
45  //=====================================================================
46   class CREAIMAGEIO_EXPORT  WxGimmickReaderDialog : public wxDialog
47   {
48   public:
49     WxGimmickReaderDialog();
50     WxGimmickReaderDialog(wxWindow *parent,
51                           const wxWindowID id,
52                           const std::string i_namedescp , 
53                           const std::string i_namedb ,
54                           wxString title,
55                           const wxPoint& pos,
56                           const wxSize& size,
57                           int image_min_dim = GIMMICK_2D_IMAGE_SELECTION,
58                           int image_max_dim = GIMMICK_3D_IMAGE_SELECTION,
59                           int output_dim = NATIVE,
60                           int threads = 0);
61
62     boost::shared_ptr<Gimmick> GetGimmick() { return mGimmick; }
63     //    typedef WxGimmick ViewType;
64     typedef WxGimmickView::EventType EventType;
65
66     ~WxGimmickReaderDialog();
67
68         //===============================================================================================
69         //Image Selection
70         //===============================================================================================
71
72     void GetSelectedImages(std::vector<vtkImageData*>& s, int dim)
73     { mView->GetSelectedImages(s, dim); }
74
75     void GetSelectedImagesInVector(std::vector<vtkImageData*>& s, int dim)
76     { mView->GetSelectedImagesInVector(s, dim); }
77
78         // ----get selected files in an Output structure-------
79         // out: vector structure output  < <img, info>, ... >
80         // i_attr: list of dicom tags to extract 
81         // mult: information of one file or multiple files
82         // outmodel: xml-filename that specifies images order..(todo) 
83         void getSelected(std::vector<OutStrGimmick> &outG,std::vector< std::string> i_attr, bool mult, const std::string outmodel)
84         {
85                 mView->getSelectedFiles(outG, i_attr, mult, outmodel);
86         }
87
88     void GetSelectedFiles(std::vector<std::string>& s) 
89     { mView->GetSelectedFiles(s); }
90
91     void OnSelChanged(EventType& event);
92     void OnContextualMenu(EventType& event);
93     void OnMenuTest(wxCommandEvent& event);
94     void OnValid(bool valid);
95     void OnExit(){ mView->StopPlayer(); }
96         void deleteMessage();
97     // void OnButtonOk(wxCommandEvent& event);
98     // void OnButtonCancel(wxCommandEvent& event);
99         void stopReading()
100         {
101                 mView->stopReader();
102         }
103
104   private :
105
106     boost::shared_ptr<Gimmick>   mGimmick;
107     WxGimmickView* mView;
108
109     wxButton* mOkButton;
110     wxButton* mCancelButton;
111         wxBoxSizer *mtopsizer;
112
113     enum 
114       {
115         TVID = 1
116         //      OKID = 2,
117         //      CANCELID = 3
118       };
119
120   }; // class WxGimmickReaderDialog
121   //=====================================================================
122         
123 } // EO namespace creaImageIO
124
125
126 #endif // USE_WIDGETS
127 // EOF
128 #endif