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