1 #ifndef __creaImageIOImageReader_h_INCLUDED__
2 #define __creaImageIOImageReader_h_INCLUDED__
5 #include <vtkImageData.h>
9 #include <creaImageIOTreeAttributeMapType.h>
18 //=====================================================================
19 /// Image reader of a specific image format
20 class SpecificImageReader;
21 //=====================================================================
23 //=====================================================================
24 /// Generic image reader which stores a vector of SpecificImageReader
32 /// Returns true iff the file is readable
33 bool CanRead( const std::string& filename,
34 const std::string& exclude = "");
35 /// Reads and returns the image data.
36 /// Returns an "Unreadable image" picture if fails
37 vtkImageData* ReadImage( const std::string& filename,
38 const std::string& exclude = "");
40 /// Reads the attributes of the image.
41 /// Requested attributes names are provided as keys
42 /// in a string to string map
43 /// On return, the values of the map are the values
44 /// of the attributes (empty string if not available).
45 void ReadAttributes(const std::string& filename,
46 tree::AttributeMapType& attr);
48 /// Returns the known extensions
49 const std::vector<std::string>& GetKnownExtensions()
50 { return mKnownExtensions; }
54 void Register(SpecificImageReader*);
56 std::vector<SpecificImageReader*> mReader;
57 std::vector<std::string> mKnownExtensions;
58 vtkImageData* mUnreadableImage;
60 std::string mLastFilename;
61 SpecificImageReader* mLastReader;
65 }; // class ImageReader
66 //=====================================================================
70 } // namespace creaImageIO
74 #endif // #ifndef __creaImageIOImageReader_h_INCLUDED__