]> Creatis software - creaImageIO.git/blob - src2/creaImageIOImageFinder.h
Corrected ggo to work in win32.
[creaImageIO.git] / src2 / creaImageIOImageFinder.h
1 #ifndef __creaImageIOImageFinder_h_INCLUDED__
2 #define __creaImageIOImageFinder_h_INCLUDED__
3
4 #include <creaImageIOTreeHandler.h>
5 #include <creaImageIOImageReader.h>
6 #include <wx/wx.h>
7 #include <wx/progdlg.h>
8
9 namespace creaImageIO
10 {
11         /**
12         * \ingroup Model
13         */
14
15   //=======================================================================
16   /// Parses (recursively) a part of a filesystem to look for known images and load their attributes in order to add the images to a Tree (submission via a TreeHandler::AddBranch)
17
18   class ImageFinder
19   {
20   public:
21     //====================================================================
22     /// Ctor
23     ImageFinder(TreeHandler* tree);
24     /// Dtor
25     ~ImageFinder();
26     //====================================================================
27     /*
28     struct UpdateSummary
29     {
30       int scanned_dirs;
31       int scanned_files;
32       int handled_images;
33       int added_images;
34
35       int added_patients;
36       int added_studies;
37       int added_series;
38
39       long parse_time;
40       long file_scan_time;
41       long update_structs_time;
42       long update_database_time;
43       long total_time;
44       bool cancelled_by_user;
45       
46       UpdateSummary() :
47         scanned_dirs(0),
48         scanned_files(0),
49         handled_images(0),
50         added_images(0),
51         added_patients(0),
52         added_studies(0),
53         added_series(0),
54         parse_time(0),
55         file_scan_time(0),
56         update_structs_time(0),
57         update_database_time(0),
58         total_time(0),
59         cancelled_by_user(false)
60       {}
61     };
62     */
63
64     ///Returns if the file can be read or not
65     bool IsHandledFile( const std::string& filename);
66     bool AddFile( const std::string& filename );
67     //            UpdateSummary& summary );
68     bool AddFiles( const std::vector<std::string>& filename );
69     //             wxProgressDialog* progress, 
70     //             UpdateSummary& summary);
71     bool AddDirectory( const std::string& directory, 
72                        bool recurse );
73     //                 wxProgressDialog* progress, 
74     //                 UpdateSummary& summary
75     //                 );
76
77     void ParseDirectory( const std::string& directory, 
78                          std::vector<std::string> &Filenames,
79                          bool recurse );
80     //                   wxProgressDialog* progress, 
81     //                   UpdateSummary& summary);
82   private:
83     TreeHandler* mTreeHandler;
84     ImageReader mReader;
85     //   wxStopWatch msw[10];
86
87   };
88   // EO class ImageFinder
89   //=======================================================================
90
91
92 } // EO namespace creaImageIO
93
94 // EOF
95 #endif  
96