]> Creatis software - creaImageIO.git/blob - src2/creaImageIOImageFinder.h
*** empty log message ***
[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     ///
65     
66
67     bool IsHandledFile( const std::string& filename);
68     bool AddFile( const std::string& filename );
69     //            UpdateSummary& summary );
70     bool AddFiles( const std::vector<std::string>& filename );
71     //             wxProgressDialog* progress, 
72     //             UpdateSummary& summary);
73     bool AddDirectory( const std::string& directory, 
74                        bool recurse );
75     //                 wxProgressDialog* progress, 
76     //                 UpdateSummary& summary
77     //                 );
78
79     void ParseDirectory( const std::string& directory, 
80                          std::vector<std::string> &Filenames,
81                          bool recurse );
82     //                   wxProgressDialog* progress, 
83     //                   UpdateSummary& summary);
84   private:
85     TreeHandler* mTreeHandler;
86     ImageReader mReader;
87     //   wxStopWatch msw[10];
88
89   };
90   // EO class ImageFinder
91   //=======================================================================
92
93
94 } // EO namespace creaImageIO
95
96 // EOF
97 #endif  
98