IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
ImageReaderWriter.h
Go to the documentation of this file.
1/**
2 * \file IMP/em2d/ImageReaderWriter.h
3 * \brief Virtual class for reader/writers of images
4 * Copyright 2007-2026 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"
12#include "IMP/em2d/Matrix.h"
13#include "IMP/em/ImageHeader.h"
14#include <iostream>
15
16IMPEM2D_BEGIN_NAMESPACE
17
18//! Virtual class for reader/writers of images
19class ImageReaderWriter : public IMP::Object {
20 public:
21 ImageReaderWriter() : Object("ImageReaderWriter%1%") {}
22 virtual void read(const String &filename, em::ImageHeader &header,
23 DoubleMatrix &data) const = 0;
24
25 virtual void read_from_floats(const String &filename, em::ImageHeader &header,
26 DoubleMatrix &data) const = 0;
27
28 virtual void read_from_ints(const String &filename, em::ImageHeader &header,
29 DoubleMatrix &data) const = 0;
30
31 virtual void write(const String &filename, em::ImageHeader &header,
32 const DoubleMatrix &data) const = 0;
33
34 virtual void write_to_floats(const String &filename, em::ImageHeader &header,
35 const DoubleMatrix &data) const = 0;
36
37 virtual void write_to_ints(const String &filename, em::ImageHeader &header,
38 const DoubleMatrix &data) const = 0;
39
40 IMP_OBJECT_METHODS(ImageReaderWriter);
41};
42
43IMPEM2D_END_NAMESPACE
44
45#endif /* IMPEM2D_IMAGE_READER_WRITER_H */
Header for EM images. Compatible with Spider and Xmipp formats Copyright 2007-2022 IMP Inventors....
Matrices used to store image data Copyright 2007-2026 IMP Inventors. All rights reserved.
A shared base class to help in debugging and things.
Common base class for heavy weight IMP objects.
Definition Object.h:111
Object(std::string name)
Construct an object with the given name.
Class to deal with the header of Electron Microscopy images in IMP.
Definition ImageHeader.h:28
Eigen::Array< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > DoubleMatrix
Matrix of doubles, used to store the data of an image.
Definition Matrix.h:28
std::string String
Basic string value.
Definition types.h:43
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.