2 # ---------------------------------------------------------------------
4 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
6 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
10 # This software is governed by the CeCILL-B license under French law and
11 # abiding by the rules of distribution of free software. You can use,
12 # modify and/ or redistribute the software under the terms of the CeCILL-B
13 # license as circulated by CEA, CNRS and INRIA at the following URL
14 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15 # or in the file LICENSE.txt.
17 # As a counterpart to the access to the source code and rights to copy,
18 # modify and redistribute granted by the license, users are provided only
19 # with a limited warranty and the software's author, the holder of the
20 # economic rights, and the successive licensors have only limited
23 # The fact that you are presently reading this means that you have had
24 # knowledge of the CeCILL-B license and that you accept its terms.
25 # ------------------------------------------------------------------------
27 #include <creaImageIOSystem.h>
29 #include <creaImageIOWxISimpleDlg.h>
30 #include <creaImageIOWxISimpleDlg.hpp>
31 #include <itkImageBase.h>
32 #include <creaVtkBasicSlicer.h>
34 #define ITK_DIM_TO_TEST 4
36 // Just to test the selection of file(s), directory or from creaImageIO database.
37 class myApp : public wxApp
41 int OnExit() { return true; }
46 CREA_WXMAIN_WITH_CONSOLE
52 //See http://www.wxwindows.org/faqgtk.htm#locale
53 setlocale(LC_NUMERIC, "C");
55 wxInitAllImageHandlers();
56 std::vector <vtkImageData*> vtktest;
57 std::vector<std::string> exts;
58 vtkImageData* im = vtkImageData::New();
59 if(ITK_DIM_TO_TEST == 3)
62 typedef itk::Image<short, ITK_DIM_TO_TEST > ImageType;
63 creaImageIO::WxISimpleDlg<ImageType> x(0);
64 // files extension to take in count
65 exts.push_back(".hdr");
68 // get itkImage vector
69 std::vector <ImageType::Pointer> test = x.getImagesSelected();
70 // convert 3D itk to 3D vtk
72 vtktest = x.getVtkImagesSelected();
75 crea::VtkBasicSlicer(vtktest.front());
78 else if (ITK_DIM_TO_TEST == 4)
80 typedef itk::Image<short, ITK_DIM_TO_TEST > ImageType;
81 creaImageIO::WxISimpleDlg<ImageType> x(0);
83 // get itkImage vector
84 std::vector <ImageType::Pointer> test = x.getImagesSelected();
85 // convert 4D itk to 3D vtk with a directory to create tempory vtk files.
86 x.split4Din3Dvtk("d:/temp2");
87 // get vtkImageData* vector
88 vtktest = x.getVtkImagesSelected();
91 crea::VtkBasicSlicer(vtktest.front());