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(5);
28 creaImageIO::SetGimmickDebugMessageLevel(0);
30 int min_dim = GIMMICK_2D_IMAGE_SELECTION;
31 int max_dim = GIMMICK_3D_IMAGE_SELECTION;
32 int output_dim = NATIVE;
35 creaImageIO::WxGimmickReaderDialog w(
38 _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;
52 std::vector<std::string> s;
53 w.GetSelectedFiles(s);
54 std::vector<std::string>::iterator i;
55 for (i=s.begin();i!=s.end();++i)
57 std::cout << *i << std::endl;
59 std::cout << "$$$$ "<<std::endl;
62 std::vector<vtkImageData*> images;
63 w.GetSelectedImages(images,output_dim);
64 std::cout<<images.size()<<std::endl;
66 crea::VtkBasicSlicer(images.front());
67 images.front()->Delete();
71 else if (w.GetReturnCode() == wxID_CANCEL)
74 std::cout << "$$$$ main : user clicked 'CANCEL' $$$$"<<std::endl;
79 std::cout << "$$$$ main : dialog ended without return code ! $$$$"
83 // std::cout << "$$$$ main : deleting dialog"<<std::endl;
85 std::cout << "$$$$$$$$$$$$$$$$$$$$ main ended "<<std::endl;