]> Creatis software - creaImageIO.git/blobdiff - appli/TestWxGimmickReaderDialog/main.cxx
Fixed add files problem and Mac compatibility
[creaImageIO.git] / appli / TestWxGimmickReaderDialog / main.cxx
index 8149724adc7b2ea418f298b1252b6d21be57f62f..19afb0578a472c951c51a56509087fc92fb6a3ae 100644 (file)
@@ -24,22 +24,24 @@ bool myApp::OnInit( )
 #endif
    wxInitAllImageHandlers();
 
-   /*
-   creaImageIO::SetGimmickMessageLevel(9);
-   creaImageIO::SetGimmickDebugMessageLevel(9);
-   */
+   
+   creaImageIO::SetGimmickMessageLevel(5);
+   creaImageIO::SetGimmickDebugMessageLevel(0);
+   
 
    int min_dim = GIMMICK_2D_IMAGE_SELECTION;
    int max_dim = GIMMICK_3D_IMAGE_SELECTION;
+   int output_dim = NATIVE;
    int threads = 1;
 
    creaImageIO::WxGimmickReaderDialog w(0,
                                        -1,
                                        _T("Select image(s)        - Gimmick! (c) CREATIS-LRMN 2008"),
                                        wxDefaultPosition,
-                                       wxSize(1200,800),
+                                       wxSize(635,750),
                                        min_dim,
                                        max_dim,
+                                       output_dim,
                                        threads);
    w.ShowModal();
    
@@ -47,6 +49,7 @@ bool myApp::OnInit( )
      {
        std::cout << "$$$$ main : user clicked 'OK' $$$$"<<std::endl;
        std::cout << "$$$$ selected files : "<<std::endl;
+          //Puts filenames
        std::vector<std::string> s;
        w.GetSelectedFiles(s);
        std::vector<std::string>::iterator i;
@@ -56,18 +59,23 @@ bool myApp::OnInit( )
         }
        std::cout << "$$$$ "<<std::endl;
 
+          //Puts images
        std::vector<vtkImageData*> images;
-       w.GetSelectedImages(images,3);
-       crea::VtkBasicSlicer(images.front());
+          w.GetSelectedImages(images,output_dim);
+
+          crea::VtkBasicSlicer(images.front());
        images.front()->Delete();
+          w.OnExit();
 
      }
    else if (w.GetReturnCode() == wxID_CANCEL)
      {
+          w.OnExit();
        std::cout << "$$$$ main : user clicked 'CANCEL' $$$$"<<std::endl;
      }
    else 
      {
+                w.OnExit();
         std::cout << "$$$$ main : dialog ended without return code ! $$$$"
                  <<std::endl;