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