#ifndef __creaImageIOImageReader_h_INCLUDED__ #define __creaImageIOImageReader_h_INCLUDED__ #include #include #include #include #include namespace creaImageIO { //===================================================================== /// Image reader of a specific image format class SpecificImageReader; //===================================================================== //===================================================================== /// Generic image reader which stores a vector of SpecificImageReader class ImageReader { public: ImageReader(); ~ImageReader(); /// Returns the known extensions const std::vector& GetKnownExtensions() { return mKnownExtensions; } /// Returns true iff the file is readable bool CanRead( const std::string& filename, const std::string& exclude = ""); /// Reads and returns the image data. /// Returns an "Unreadable image" picture if fails vtkImageData* ReadImage( const std::string& filename, const std::string& exclude = ""); /// 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, std::map& attr); protected: void Register(SpecificImageReader*); std::vector mReader; std::vector mKnownExtensions; vtkImageData* mUnreadableImage; std::string mLastFilename; SpecificImageReader* mLastReader; private: }; // class ImageReader //===================================================================== } // namespace creaImageIO #endif // #ifndef __creaImageIOImageReader_h_INCLUDED__