]> Creatis software - creaImageIO.git/commitdiff
*** empty log message ***
authorFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Wed, 27 Apr 2011 19:12:49 +0000 (19:12 +0000)
committerFrederic Cervenansky <Frederic.Cervenansky@creatis.insa-lyon.fr>
Wed, 27 Apr 2011 19:12:49 +0000 (19:12 +0000)
appli/TestWxSimpleView/main.cxx

index 9efb1bd55e320be3d683d82a901f3be5e9efbc44..d8d5c172005f2af5b673ae7cf433b7b94ff513d0 100644 (file)
@@ -1,8 +1,11 @@
 #include <creaImageIOSystem.h>
 #include <creaWx.h>
 #include <creaImageIOWxISimpleDlg.h>
-#include <creaImageIOWxISimpleDlg.txx>
+#include <creaImageIOWxISimpleDlg.hpp>
 #include <itkImageBase.h>
+#include <creaVtkBasicSlicer.h>
+
+#define ITK_DIM_TO_TEST 4
 
 // Just to test the selection of file(s), directory or from creaImageIO database.
 class myApp : public wxApp
@@ -24,13 +27,43 @@ bool myApp::OnInit( )
   setlocale(LC_NUMERIC, "C");
 #endif
    wxInitAllImageHandlers();
-
-   typedef itk::Image<short, 4 >  ImageType;
-   creaImageIO::WxISimpleDlg<ImageType> x(0);
-   x.ShowModal();
-
- std::vector <ImageType::Pointer> test = x.getImagesSelected();
+   std::vector <vtkImageData*> vtktest;
+   std::vector<std::string> exts;
+  if(ITK_DIM_TO_TEST == 3)
+   {
    
+          typedef itk::Image<short, ITK_DIM_TO_TEST >  ImageType;
+          creaImageIO::WxISimpleDlg<ImageType> x(0);
+          // files extension to take in count
+       exts.push_back(".hdr");
+       x.setExts(exts);
+       x.ShowModal();
+          // get itkImage vector
+          std::vector <ImageType::Pointer> test = x.getImagesSelected();
+          // convert 3D itk to 3D vtk
+          x.split3Din3Dvtk();
+           // get vtkImageData* vector
+       vtktest = x.getVtkImagesSelected();
+  }
+  else if (ITK_DIM_TO_TEST == 4)
+  {
+         typedef itk::Image<short, ITK_DIM_TO_TEST >  ImageType;
+      creaImageIO::WxISimpleDlg<ImageType> x(0);
+         x.ShowModal();
+         // get itkImage vector
+         std::vector <ImageType::Pointer> test = x.getImagesSelected();
+         // convert 4D itk to 3D vtk  with a directory to create tempory vtk files.
+      x.split4Din3Dvtk("d:/temp");
+         // get vtkImageData* vector
+         vtktest = x.getVtkImagesSelected();
+       }
+  else{}
+
+  if(vtktest.size() >0)
+   {
+       crea::VtkBasicSlicer(vtktest.front());
+   }
    return false;
 }