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
29 /// Returns the known extensions
30 const std::vector<std::string>& GetKnownExtensions()
31 { return mKnownExtensions; }
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 std::map<std::string,std::string>& attr);
50 void Register(SpecificImageReader*);
52 std::vector<SpecificImageReader*> mReader;
53 std::vector<std::string> mKnownExtensions;
54 vtkImageData* mUnreadableImage;
56 std::string mLastFilename;
57 SpecificImageReader* mLastReader;
61 }; // class ImageReader
62 //=====================================================================
66 } // namespace creaImageIO
70 #endif // #ifndef __creaImageIOImageReader_h_INCLUDED__