1 #ifndef __creaImageIOImageReader_h_INCLUDED__
2 #define __creaImageIOImageReader_h_INCLUDED__
4 #include <creaImageIOSystem.h>
5 #include <creaImageIOAbstractImageReader.h>
13 * \brief Generic image reader which uses all the specific concrete image reader of the lib (tif, jpg, dicom, ...)
15 class CREAIMAGEIO_EXPORT ImageReader : virtual public AbstractImageReader
21 /// Pushes back all kwown extensions (without dot) in the vector given
22 void PushBackExtensions(std::vector<std::string>&);
24 /// Returns true iff the file is readable
25 bool CanRead( const std::string& filename);
26 /// Reads and returns the image data.
27 /// Returns an "Unreadable image" picture if fails
28 vtkImageData* ReadImage( const std::string& filename);
30 /// Reads the attributes of the image.
31 /// Requested attributes names are provided as keys
32 /// in a string to string map
33 /// On return, the values of the map are the values
34 /// of the attributes (empty string if not available).
35 void ReadAttributes(const std::string& filename,
36 tree::AttributeMapType& attr);
38 /// Exclude specific readers
44 void Register(AbstractImageReader*);
46 std::vector<AbstractImageReader*> mReader;
47 vtkImageData* mUnreadableImage;
49 std::string mLastFilename;
50 AbstractImageReader* mLastReader;
54 }; // class ImageReader
55 //=====================================================================
59 } // namespace creaImageIO
63 #endif // #ifndef __creaImageIOImageReader_h_INCLUDED__