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();
27 creaImageIO::SetGimmickMessageLevel(9);
28 creaImageIO::SetGimmickDebugMessageLevel(9);
30 int image_type = GIMMICK_3D_IMAGE_SELECTION;
33 creaImageIO::WxGimmickReaderDialog w(0,
35 _T("Select image(s) - Gimmick! (c) CREATIS-LRMN 2008"),
42 if (w.GetReturnCode() == wxID_OK)
44 std::cout << "$$$$ main : user clicked 'OK' $$$$"<<std::endl;
45 std::cout << "$$$$ selected files : "<<std::endl;
46 std::vector<std::string> s;
47 w.GetSelectedFiles(s);
48 std::vector<std::string>::iterator i;
49 for (i=s.begin();i!=s.end();++i)
51 std::cout << *i << std::endl;
53 std::cout << "$$$$ "<<std::endl;
55 std::vector<vtkImageData*> images;
56 w.GetSelectedImages(images);
57 crea::VtkBasicSlicer(images.front());
58 images.front()->Delete();
61 else if (w.GetReturnCode() == wxID_CANCEL)
63 std::cout << "$$$$ main : user clicked 'CANCEL' $$$$"<<std::endl;
67 std::cout << "$$$$ main : dialog ended without return code ! $$$$"
72 // std::cout << "$$$$ main : deleting dialog"<<std::endl;
74 std::cout << "$$$$$$$$$$$$$$$$$$$$ main ended "<<std::endl;