1 #include <creaImageIOSystem.h>
3 #include <creaImageIOWxGimmickReaderDialog.h>
5 #include <creaVtkBasicSlicer.h>
7 class myApp : public wxApp
11 int OnExit() { return true; }
16 CREA_WXMAIN_WITH_CONSOLE
22 //See http://www.wxwindows.org/faqgtk.htm#locale
23 setlocale(LC_NUMERIC, "C");
25 wxInitAllImageHandlers();
28 creaImageIO::SetGimmickMessageLevel(9);
29 creaImageIO::SetGimmickDebugMessageLevel(9);
32 int min_dim = GIMMICK_2D_IMAGE_SELECTION;
33 int max_dim = GIMMICK_3D_IMAGE_SELECTION;
34 int output_dim = NATIVE;
37 creaImageIO::WxGimmickReaderDialog w(0,
39 _T("Select image(s) - Gimmick! (c) CREATIS-LRMN 2008"),
47 if (w.GetReturnCode() == wxID_OK)
49 std::cout << "$$$$ main : user clicked 'OK' $$$$"<<std::endl;
50 std::cout << "$$$$ selected files : "<<std::endl;
51 std::vector<std::string> s;
52 w.GetSelectedFiles(s);
53 std::vector<std::string>::iterator i;
54 for (i=s.begin();i!=s.end();++i)
56 std::cout << *i << std::endl;
58 std::cout << "$$$$ "<<std::endl;
60 std::vector<vtkImageData*> images;
61 w.GetSelectedImages(images,3);
62 crea::VtkBasicSlicer(images.front());
63 images.front()->Delete();
66 else if (w.GetReturnCode() == wxID_CANCEL)
68 std::cout << "$$$$ main : user clicked 'CANCEL' $$$$"<<std::endl;
72 std::cout << "$$$$ main : dialog ended without return code ! $$$$"
77 // std::cout << "$$$$ main : deleting dialog"<<std::endl;
79 std::cout << "$$$$$$$$$$$$$$$$$$$$ main ended "<<std::endl;