]> Creatis software - creaImageIO.git/blob - src/creaImageIOVtkImageReader.h
ad60149eab6fb66a1e8ab00a1f232f1323812320
[creaImageIO.git] / src / creaImageIOVtkImageReader.h
1 #ifndef __creaImageIOVtkImageReader_h_INCLUDED__
2 #define __creaImageIOVtkImageReader_h_INCLUDED__
3
4
5 #include <creaImageIOAbstractImageReader.h>
6
7 // forward decl
8 class vtkImageReader2;
9
10 namespace creaImageIO
11 {
12
13
14   /**
15    * \ingroup IO
16    */
17   
18   //=====================================================================
19   /// Concrete image reader based on a vtkImageReader2 
20   class VtkImageReader : virtual public AbstractImageReader
21   {
22   public:
23     VtkImageReader(vtkImageReader2* reader, 
24                    const std::string& name = "",
25                    const std::string& extensions = "");
26
27     virtual ~VtkImageReader();
28
29
30
31         /// Add file extensions read by the reader
32     virtual void PushBackExtensions(std::vector<std::string>&);
33         /// Test if file is read by this reader
34     virtual bool CanRead(const std::string& filename);
35         /// return for a file a 2D VTkImage
36     virtual vtkImageData* ReadImage(const std::string& filename);
37         /// Read the attributes for a file
38     virtual void ReadAttributes(const std::string& filename, 
39                                 tree::AttributeMapType& attr);
40
41         virtual void getAttributes(const std::string filename,
42                 std::map <std::string , std::string> &infos, std::vector<std::string> i_attr);
43   private:
44     vtkImageReader2* mReader;
45     std::string mExtensions;
46   };
47   //=====================================================================
48
49
50
51 } // namespace creaImageIO
52
53
54
55 #endif // #ifndef __creaImageIOVtkImageReader_h_INCLUDED__