]> Creatis software - creaImageIO.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Tue, 24 Feb 2009 20:29:16 +0000 (20:29 +0000)
committerguigues <guigues>
Tue, 24 Feb 2009 20:29:16 +0000 (20:29 +0000)
src2/creaImageIOGimmickReaderDialog.cpp [new file with mode: 0644]
src2/creaImageIOGimmickReaderDialog.h [new file with mode: 0644]
src2/creaImageIORFImageReader.cpp

diff --git a/src2/creaImageIOGimmickReaderDialog.cpp b/src2/creaImageIOGimmickReaderDialog.cpp
new file mode 100644 (file)
index 0000000..d8c52e1
--- /dev/null
@@ -0,0 +1,50 @@
+#include <creaImageIOGimmickReaderDialog.h>
+#include <creaImageIOWxGimmickReaderDialog.h>
+#include <BlockScopeWxApp.h>
+
+namespace creaImageIO
+{
+
+  bool GimmickReaderDialog(std::vector<vtkImageData*>& images,
+                          const std::string& title,
+                          int posx, 
+                          int posy,
+                          int sizex,
+                          int sizey,
+                          int image_min_type,
+                          int image_max_type,
+                          int image_out_dim,
+                          int nb_threads)
+  {
+    BlockScopeWxApp app;
+    
+    creaImageIO::WxGimmickReaderDialog w(0,
+                                        -1,
+                                        crea::std2wx(title),
+                                        wxPoint(posx,posy),
+                                        wxSize(sizex,sizey),
+                                        image_min_type,
+                                        image_max_type,
+                                        nb_threads);
+    w.ShowModal();
+    
+    if (w.GetReturnCode() == wxID_OK)
+      {
+       w.GetSelectedImages(images,image_out_dim);
+       return true;
+      }
+    else if (w.GetReturnCode() == wxID_CANCEL)
+      {
+       return false;
+      }
+    else 
+      {
+       std::cout << "!! ERROR : GimmickReaderDialog : dialog ended without return code !"
+                 <<std::endl;
+       return false;
+      }
+  
+  
+  }
+
+}
diff --git a/src2/creaImageIOGimmickReaderDialog.h b/src2/creaImageIOGimmickReaderDialog.h
new file mode 100644 (file)
index 0000000..7cbacb9
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef __creaImageIOGimmickReaderDialog_h_INCLUDED__
+#define __creaImageIOGimmickReaderDialog_h_INCLUDED__
+
+#include <vtkImageData.h>
+#include <vector>
+
+namespace creaImageIO
+{
+  /**
+   * \ingroup GUI
+   * \brief Pops up a WxGimmickReaderDialog 
+   * returns true if the user clicked 'Ok', false if 'Cancel'
+   *  and fills the vector of images
+   */
+  bool GimmickReaderDialog(std::vector<vtkImageData*>& images,
+                          const std::string& title = "Select images",
+                          int posx = 0, int posy = 0,
+                          int sizex = 1200, int sizey = 800,
+                          int image_min_type = 2,
+                          int image_max_type = 3,
+                          int image_out_dim = 2,
+                          int nb_threads = 1);
+  
+}
+
+#endif
index 5c7aec269f16b93985f913263f4a191b97620a29..53111ac93e032316ea042c0e21de32d716c6b9df 100644 (file)
@@ -92,9 +92,13 @@ namespace creaImageIO
     }
     fclose(rf_file);  
 
-
-    return crea::NewVtkImageDataFromRaw( data,
-                                        im_size);
+    std::cout << "NewVtkImageDataFromRaw" << std::endl;
+    vtkImageData* im = crea::NewVtkImageDataFromRaw( data,
+                                                    h.width,
+                                                    h.height,
+                                                    h.frame);
+    
+     std::cout << "OK" << std::endl;
     
   }
   //=====================================================================