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 # ------------------------------------------------------------------------
29 #ifndef __creaImageIOWxIsimpleDlg_h_INCLUDED__
30 #define __creaImageIOWxIsimpleDlg_h_INCLUDED__
33 #include "creaImageIOSimpleView.h"
34 #include "itkImageToVTKImageFilter.h"
36 #include <itkImageFileReader.h>
37 #include <boost/any.hpp>
44 /// Simple Wxwidgets interface to select file(s) or directory or from creaImageIO database to display
45 template <typename TImage>
46 class __declspec(dllexport) WxISimpleDlg : public wxDialog
50 WxISimpleDlg( wxWindow *parent,
51 wxString i_title =_T(""),
52 const std::string i_namedescp = "localdatabase_Descriptor.dscp",
53 const std::string i_namedb = "Local Database"
58 void setExts(std::vector<std::string>);
59 /// Callback to read file(s)
60 void OnReadFile(wxCommandEvent& event);
62 /// Callback to read directory, no recursive
63 void OnReadDirectory(wxCommandEvent &event);
65 /// Callback to select from creaImageIO database
66 void OnReadGimmick(wxCommandEvent &event);
68 /// return a vtkImageData vector of selected images, if available
69 std::vector<vtkImageData*> getVtkImagesSelected() {return m_Vresults;}
71 /// return a itkImage vector of selected images, if available
72 std::vector<typename TImage::Pointer> getImagesSelected();
75 wxString getInfoImage();
77 void split4Din3Dvtk(const std::string &i_dir);
78 void split3Din3Dvtk( );
79 void set(bool i_dicom){m_dicom= i_dicom;}
80 std::vector <boost::any>& getAnyImages(){ return m_AnyImages;}
83 std::vector<boost::any> m_AnyImages;
84 std::vector<std::string> m_exts;
85 std::string namedescp;
89 /// interface to read data
91 void readImg(const std::string &i_name);
92 void readDicomImg(const std::vector<std::string> &i_names);
94 std::vector <typename TImage::Pointer> m_Iresults;
96 std::vector <vtkImageData*> m_Vresults;
104 #endif //__creaImageIOWxIsimpleDlg_h_INCLUDED__