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
40 /// Another function to read attributes for a file
41 void getAttributes(const std::string filename,
42 std::map <std::string , std::string> &infos, std::vector<std::string> i_attr);
49 void Register( boost::shared_ptr<AbstractImageReader> );
51 std::vector<boost::shared_ptr<AbstractImageReader> > mReader;
52 vtkImageData* mUnreadableImage;
54 std::string mLastFilename;
55 boost::shared_ptr<AbstractImageReader> mLastReader;
57 bool ShallNotRead( const std::string& filename );
59 void UnRegister(const std::string i_val);
61 std::vector <std::string> mUnReader;
65 }; // class ImageReader
66 //=====================================================================
70 } // namespace creaImageIO
74 #endif // #ifndef __creaImageIOImageReader_h_INCLUDED__