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