]> Creatis software - creaImageIO.git/blob - src2/creaImageIOImageReader.h
*** empty log message ***
[creaImageIO.git] / src2 / creaImageIOImageReader.h
1 #ifndef __creaImageIOImageReader_h_INCLUDED__
2 #define __creaImageIOImageReader_h_INCLUDED__
3
4 #include <creaImageIOAbstractImageReader.h>
5
6 namespace creaImageIO
7 {
8
9
10   /**
11    * \ingroup IO
12    * \brief Generic image reader which uses all the specific concrete image reader of the lib (tif, jpg, dicom, ...)
13    */
14   class ImageReader : virtual public AbstractImageReader
15   {
16   public:
17     ImageReader();
18     ~ImageReader();
19
20     /// Pushes back all kwown extensions (without dot) in the vector given
21     void PushBackExtensions(std::vector<std::string>&);
22
23     /// Returns true iff the file is readable
24     bool CanRead( const std::string& filename);
25     /// Reads and returns the image data. 
26     /// Returns an "Unreadable image" picture if fails
27     vtkImageData* ReadImage( const std::string& filename);
28     
29     /// Reads the attributes of the image.
30     /// Requested attributes names are provided as keys 
31     /// in a string to string map
32     /// On return, the values of the map are the values 
33     /// of the attributes (empty string if not available).
34     void ReadAttributes(const std::string& filename, 
35                         tree::AttributeMapType& attr);
36
37     /// Exclude specific readers 
38     /// TO DO...
39     
40
41   protected:
42     
43     void Register(AbstractImageReader*);
44
45     std::vector<AbstractImageReader*> mReader;
46     vtkImageData* mUnreadableImage;
47
48     std::string mLastFilename;
49     AbstractImageReader* mLastReader;
50     
51   private:
52
53   }; // class ImageReader
54   //=====================================================================
55
56
57
58 } // namespace creaImageIO
59
60
61
62 #endif // #ifndef __creaImageIOImageReader_h_INCLUDED__