1 #include <creaImageIOGimmickReaderDialog.h>
2 #include <creaImageIOWxGimmickReaderDialog.h>
10 vtkImageData* getImageDataDialog() {
13 //See http://www.wxwindows.org/faqgtk.htm#locale
14 setlocale(LC_NUMERIC, "C");
16 wxInitAllImageHandlers();
18 creaImageIO::SetGimmickMessageLevel(5);
19 creaImageIO::SetGimmickDebugMessageLevel(0);
21 int min_dim = GIMMICK_2D_IMAGE_SELECTION;
22 int max_dim = GIMMICK_3D_IMAGE_SELECTION;
23 int output_dim = NATIVE;
26 creaImageIO::WxGimmickReaderDialog w(
29 "localdatabase_Descriptor.dscp",
31 _T("Select image(s) - Gimmick! (c) CREATIS-LRMN 2008"),
40 if (w.GetReturnCode() == wxID_OK)
42 std::cout << "$$$$ main : user clicked 'OK' $$$$"<<std::endl;
43 std::cout << "$$$$ selected files : "<<std::endl;
45 std::vector<std::string> s;
46 w.GetSelectedFiles(s);
47 std::vector<std::string>::iterator i;
48 for (i=s.begin();i!=s.end();++i)
50 std::cout << *i << std::endl;
52 std::cout << "$$$$ "<<std::endl;
55 std::vector<vtkImageData*> images;
56 w.GetSelectedImages(images,output_dim);
57 std::cout<<images.size()<<std::endl;
62 //crea::VtkBasicSlicer(images.front());
63 //images.front()->Delete();
67 else if (w.GetReturnCode() == wxID_CANCEL)
70 std::cout << "$$$$ main : user clicked 'CANCEL' $$$$"<<std::endl;
75 std::cout << "$$$$ main : dialog ended without return code ! $$$$"
79 // std::cout << "$$$$ main : deleting dialog"<<std::endl;
81 std::cout << "$$$$$$$$$$$$$$$$$$$$ main ended "<<std::endl;
90 bool GimmickReaderDialog(std::vector<vtkImageData*>& images,
91 const std::string i_namedescp ,
92 const std::string i_namedb ,
93 const std::string& title,
104 creaImageIO::WxGimmickReaderDialog w(0,
116 if (w.GetReturnCode() == wxID_OK)
118 w.GetSelectedImages(images,image_out_dim);
121 else if (w.GetReturnCode() == wxID_CANCEL)
127 std::cout << "!! ERROR : GimmickReaderDialog : dialog ended without return code !"