X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=appli%2FTestWxSimpleView%2Fmain.cxx;h=60898b99ee1b52dc21d188c50b18820c02b59836;hb=124b9349d1cc0a7316228bab71f96bc183bcbf6f;hp=9efb1bd55e320be3d683d82a901f3be5e9efbc44;hpb=7453657b912f5057cd1060ed195f30e8224c385e;p=creaImageIO.git diff --git a/appli/TestWxSimpleView/main.cxx b/appli/TestWxSimpleView/main.cxx index 9efb1bd..60898b9 100644 --- a/appli/TestWxSimpleView/main.cxx +++ b/appli/TestWxSimpleView/main.cxx @@ -1,8 +1,11 @@ #include #include #include -#include +#include #include +#include + +#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,49 @@ bool myApp::OnInit( ) setlocale(LC_NUMERIC, "C"); #endif wxInitAllImageHandlers(); - - typedef itk::Image ImageType; - creaImageIO::WxISimpleDlg x(0); - x.ShowModal(); - - std::vector test = x.getImagesSelected(); + std::vector vtktest; + std::vector exts; + vtkImageData* im = vtkImageData::New(); + if(ITK_DIM_TO_TEST == 3) + { + typedef itk::Image ImageType; + creaImageIO::WxISimpleDlg x(0); + // files extension to take in count + exts.push_back(".hdr"); + x.setExts(exts); + x.ShowModal(); + // get itkImage vector + std::vector test = x.getImagesSelected(); + // convert 3D itk to 3D vtk + x.split3Din3Dvtk(); + vtktest = x.getVtkImagesSelected(); + if(vtktest.size() >0) + { + crea::VtkBasicSlicer(vtktest.front()); + } + } + else if (ITK_DIM_TO_TEST == 4) + { + typedef itk::Image ImageType; + creaImageIO::WxISimpleDlg x(0); + x.ShowModal(); + // get itkImage vector + std::vector test = x.getImagesSelected(); + // convert 4D itk to 3D vtk with a directory to create tempory vtk files. + x.split4Din3Dvtk("d:/temp2"); + // get vtkImageData* vector + vtktest = x.getVtkImagesSelected(); + if(vtktest.size() >0) + { + crea::VtkBasicSlicer(vtktest.front()); + } + } + + else{} + + + return false; }