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
45 void Register( boost::shared_ptr<AbstractImageReader> );
47 std::vector<boost::shared_ptr<AbstractImageReader> > mReader;
48 vtkImageData* mUnreadableImage;
50 std::string mLastFilename;
51 boost::shared_ptr<AbstractImageReader> mLastReader;
55 }; // class ImageReader
56 //=====================================================================
60 } // namespace creaImageIO
64 #endif // #ifndef __creaImageIOImageReader_h_INCLUDED__