]> Creatis software - creaImageIO.git/blob - src2/creaImageIOGimmickReaderDialog.cpp
f2c18d941135492c0f7041a1f8a9daffa5e75ca2
[creaImageIO.git] / src2 / creaImageIOGimmickReaderDialog.cpp
1 #include <creaImageIOGimmickReaderDialog.h>
2 #include <creaImageIOWxGimmickReaderDialog.h>
3
4 #ifdef _DEBUG
5 #define new DEBUG_NEW
6 #endif
7
8 namespace creaImageIO
9 {
10
11   bool GimmickReaderDialog(std::vector<vtkImageData*>& images,
12                            const std::string i_namedescp , 
13                            const std::string i_namedb ,
14                            const std::string& title,
15                            int posx, 
16                            int posy,
17                            int sizex,
18                            int sizey,
19                            int image_min_type,
20                            int image_max_type,
21                            int image_out_dim,
22                            int nb_threads)
23   {
24
25     
26     creaImageIO::WxGimmickReaderDialog w(0,
27                                          -1,
28                                          i_namedescp,
29                                          i_namedb,
30                                          crea::std2wx(title),
31                                          wxPoint(posx,posy),
32                                          wxSize(sizex,sizey),
33                                          image_min_type,
34                                          image_max_type,
35                                          nb_threads);
36     w.ShowModal();
37     
38     if (w.GetReturnCode() == wxID_OK)
39       {
40         w.GetSelectedImages(images,image_out_dim);
41         return true;
42       }
43     else if (w.GetReturnCode() == wxID_CANCEL)
44       {
45         return false;
46       }
47     else 
48       {
49         std::cout << "!! ERROR : GimmickReaderDialog : dialog ended without return code !"
50                   <<std::endl;
51         return false;
52       }
53   
54   
55   }
56
57 }