#ifndef __creaImageIOImageReader_h_INCLUDED__ #define __creaImageIOImageReader_h_INCLUDED__ #include #include namespace creaImageIO { /** * \ingroup IO * \brief Generic image reader which uses all the specific concrete image reader of the lib (tif, jpg, dicom, ...) */ class CREAIMAGEIO_EXPORT ImageReader : virtual public AbstractImageReader { public: ImageReader(); ~ImageReader(); /// Pushes back all kwown extensions (without dot) in the vector given void PushBackExtensions(std::vector&); /// Returns true iff the file is readable bool CanRead( const std::string& filename); /// Reads and returns the image data. /// Returns an "Unreadable image" picture if fails vtkImageData* ReadImage( const std::string& filename); /// Reads the attributes of the image. /// Requested attributes names are provided as keys /// in a string to string map /// On return, the values of the map are the values /// of the attributes (empty string if not available). void ReadAttributes(const std::string& filename, tree::AttributeMapType& attr); /// Exclude specific readers /// TO DO... protected: /// Register a reader void Register( boost::shared_ptr ); std::vector > mReader; vtkImageData* mUnreadableImage; std::string mLastFilename; boost::shared_ptr mLastReader; bool ShallNotRead( const std::string& filename ); void UnRegister(const std::string i_val); std::vector mUnReader; private: }; // class ImageReader //===================================================================== } // namespace creaImageIO #endif // #ifndef __creaImageIOImageReader_h_INCLUDED__