1 #ifndef __creaImageIOImageReader_h_INCLUDED__
2 #define __creaImageIOImageReader_h_INCLUDED__
5 #include <creaImageIOTreeAttributeDescriptor.h>
7 #include <vtkImageData.h>
16 //=====================================================================
17 /// Image reader of a specific image format
18 class SpecificImageReader;
19 //=====================================================================
21 //=====================================================================
22 /// Generic image reader which stores a vector of SpecificImageReader
30 /// Returns true iff the file is readable
31 bool CanRead( const std::string& filename,
32 const std::string& exclude = "");
33 /// Reads and returns the image data.
34 /// Returns an "Unreadable image" picture if fails
35 vtkImageData* ReadImage( const std::string& filename,
36 const std::string& exclude = "");
38 /// Reads the attributes of the image.
39 /// Requested attributes names are provided as keys
40 /// in a string to string map
41 /// On return, the values of the map are the values
42 /// of the attributes (empty string if not available).
43 void ReadAttributes(const std::string& filename,
44 std::map<std::string,std::string>& attr);
46 /// Returns the known extensions
47 const std::vector<std::string>& GetKnownExtensions()
48 { return mKnownExtensions; }
52 void Register(SpecificImageReader*);
54 std::vector<SpecificImageReader*> mReader;
55 std::vector<std::string> mKnownExtensions;
56 vtkImageData* mUnreadableImage;
58 std::string mLastFilename;
59 SpecificImageReader* mLastReader;
63 }; // class ImageReader
64 //=====================================================================
68 } // namespace creaImageIO
72 #endif // #ifndef __creaImageIOImageReader_h_INCLUDED__