IMP  2.0.0
The Integrative Modeling Platform
ImageReaderWriter.h
Go to the documentation of this file.
1 /**
2  * \file em2d/ImageReaderWriter.h
3  * \brief Virtual class for reader/writers of images
4  * Copyright 2007-2013 IMP Inventors. All rights reserved.
5 */
6 
7 #ifndef IMPEM2D_IMAGE_READER_WRITER_H
8 #define IMPEM2D_IMAGE_READER_WRITER_H
9 
10 #include "IMP/em2d/em2d_config.h"
11 #include "IMP/Object.h"
13 #include "IMP/em/ImageHeader.h"
14 #include <iostream>
15 
16 IMPEM2D_BEGIN_NAMESPACE
17 
18 class ImageReaderWriter : public IMP::base::Object
19 {
20 public:
21  ImageReaderWriter(): Object("ImageReaderWriter%1%"){}
22  virtual void read(const String &filename, em::ImageHeader& header,
23  cv::Mat &data) const = 0;
24 
25  virtual void read_from_floats(const String &filename, em::ImageHeader& header,
26  cv::Mat &data) const = 0;
27 
28  virtual void read_from_ints(const String &filename, em::ImageHeader& header,
29  cv::Mat &data) const = 0;
30 
31  virtual void write(const String &filename, em::ImageHeader& header,
32  const cv::Mat &data) const = 0;
33 
34  virtual void write_to_floats(const String &filename,
35  em::ImageHeader& header,
36  const cv::Mat &data) const = 0;
37 
38  virtual void write_to_ints(const String &filename,
39  em::ImageHeader& header,
40  const cv::Mat &data) const = 0;
41 
42  IMP_OBJECT_INLINE(ImageReaderWriter,
43  { out << "I am an ImageReaderWriter"; }, {});
44 };
45 
46 IMPEM2D_END_NAMESPACE
47 
48 #endif /* IMPEM2D_IMAGE_READER_WRITER_H */