]> Creatis software - creaImageIO.git/blob - src/creaImageIOImageReader.h
no message
[creaImageIO.git] / src / creaImageIOImageReader.h
1 #ifndef __creaImageIOImageReader_h_INCLUDED__
2 #define __creaImageIOImageReader_h_INCLUDED__
3
4
5 #include <creaImageIODicomNode.h>
6
7 #include <vtkImageData.h>
8 #include <string>
9 #include <vector>
10
11 namespace creaImageIO
12 {
13
14
15   //=====================================================================
16   class SpecificImageReader;
17   //=====================================================================
18
19   //=====================================================================
20   class ImageReader
21   {
22   public:
23     ImageReader();
24     ~ImageReader();
25
26     // Returns the known extensions
27     /*static*/ const std::vector<std::string>& GetKnownExtensions()  
28     { return mKnownExtensions; }
29     // Returns true iff the file is readable
30     /*static*/ bool CanRead( const std::string& filename, 
31                          const std::string& exclude = "");
32     // Reads the file. Returns an "Unreadable image" picture if fails
33     /*static*/ vtkImageData* Read( const std::string& filename,
34                                const std::string& exclude = "");
35
36     void ReadDicomInfo(const std::string& filename, 
37                        DicomNode* image);
38
39   protected:
40     
41     /*static*/ void Register(SpecificImageReader*);
42
43     /*static*/ std::vector<SpecificImageReader*> mReader;
44     /*static*/ std::vector<std::string> mKnownExtensions;
45     /*static*/ vtkImageData* mUnreadableImage;
46
47     /*static*/ std::string mLastFilename;
48     /*static*/ SpecificImageReader* mLastReader;
49     
50   private:
51
52   }; // class ImageReader
53   //=====================================================================
54
55
56
57 } // namespace creaImageIO
58
59
60
61 #endif // #ifndef __creaImageIOImageReader_h_INCLUDED__