]> Creatis software - creaImageIO.git/blob - src/creaImageIOWxIsimpleDlg.h
d20691c6adc332015f643d50b7c547788cd51341
[creaImageIO.git] / src / creaImageIOWxIsimpleDlg.h
1 #include "creaImageIOSimpleView.h"
2 #include "itkImageToVTKImageFilter.h"
3 #include <creaWx.h>
4 #include <itkImageFileReader.h>
5
6 namespace creaImageIO
7 {
8  /**
9    * \ingroup View
10    */
11
12         /// Simple Wxwidgets interface to select file(s) or directory or from creaImageIO database to display
13         template <typename TImage> 
14         class  __declspec(dllexport) WxISimpleDlg : public wxDialog
15         {
16         public:
17                  /// Ctor
18                   WxISimpleDlg( wxWindow *parent,  
19                           wxString i_title =_T(""),
20                           const std::string i_namedescp = "localdatabase_Descriptor.dscp",   
21                           const std::string i_namedb   = "Local Database"     
22                           );
23
24                   ~WxISimpleDlg(){};
25
26                   void setExts(std::vector<std::string>);
27                   /// Callback to read file(s)
28                   void OnReadFile(wxCommandEvent& event);
29
30                   /// Callback to read directory, no recursive
31                    void OnReadDirectory(wxCommandEvent &event);
32               
33                   /// Callback to select from creaImageIO database
34                    void OnReadGimmick(wxCommandEvent &event);
35
36                    /// return a vtkImageData vector of selected images, if available
37                    std::vector<vtkImageData*> getVtkImagesSelected() {return m_Vresults;}
38
39                         /// return a itkImage vector of selected images, if available
40                         std::vector<typename TImage::Pointer> getImagesSelected();
41                 
42
43                    wxString getInfoImage();
44
45                    void split4Din3Dvtk(const std::string &i_dir);
46                    void split3Din3Dvtk( );
47                    void set(bool i_dicom){m_dicom= i_dicom;}
48         private:
49
50                 std::vector<std::string> m_exts;
51                 std::string namedescp; 
52                 std::string namedb;
53                 wxString infoimage;
54                 bool m_dicom;
55                 /// interface to read data
56                 SimpleView m_view;
57                  void readImg(const std::string &i_name);
58                  void readDicomImg(const std::vector<std::string> &i_names);
59
60                  std::vector <typename TImage::Pointer> m_Iresults;
61
62                  std::vector <vtkImageData*> m_Vresults;
63
64         };
65
66
67 }