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(5);
29 creaImageIO::SetGimmickDebugMessageLevel(0);
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"),
48 if (w.GetReturnCode() == wxID_OK)
50 std::cout << "$$$$ main : user clicked 'OK' $$$$"<<std::endl;
51 std::cout << "$$$$ selected files : "<<std::endl;
53 std::vector<std::string> s;
54 w.GetSelectedFiles(s);
55 std::vector<std::string>::iterator i;
56 for (i=s.begin();i!=s.end();++i)
58 std::cout << *i << std::endl;
60 std::cout << "$$$$ "<<std::endl;
63 std::vector<vtkImageData*> images;
64 w.GetSelectedImages(images,output_dim);
65 std::cout<<images.size()<<std::endl;
67 crea::VtkBasicSlicer(images.front());
68 images.front()->Delete();
72 else if (w.GetReturnCode() == wxID_CANCEL)
75 std::cout << "$$$$ main : user clicked 'CANCEL' $$$$"<<std::endl;
80 std::cout << "$$$$ main : dialog ended without return code ! $$$$"
85 // std::cout << "$$$$ main : deleting dialog"<<std::endl;
87 std::cout << "$$$$$$$$$$$$$$$$$$$$ main ended "<<std::endl;