IMP  2.3.0
The Integrative Modeling Platform
IMP::em2d::Image Class Reference

2D Electron Microscopy images in IMP More...

#include <IMP/em2d/Image.h>

+ Inheritance diagram for IMP::em2d::Image:

Detailed Description

2D Electron Microscopy images in IMP

Definition at line 27 of file Image.h.

Public Member Functions

 Image (int rows, int cols)
 
 Image (String filename, const ImageReaderWriter *reader)
 
cv::Mat & get_data ()
 
em::ImageHeaderget_header ()
 
FloatRange get_min_and_max_values () const
 
String get_name () const
 
virtual std::string get_type_name () const
 Define the basic things needed by any Object. More...
 
virtual ::IMP::base::VersionInfo get_version_info () const
 Get information about the module and version of the object. More...
 
double operator() (int i, int j) const
 
void read (String filename, const ImageReaderWriter *reader)
 
void set_data (const cv::Mat &mat)
 
void set_name (const String &name)
 
void set_size (int rows, int cols)
 
void set_size (Image *img)
 
void set_value (double val)
 
void set_value (int i, int j, double val)
 
void set_zeros ()
 
void show (std::ostream &out) const
 
void update_header ()
 
void write (const String &filename, const ImageReaderWriter *writer)
 
- Public Member Functions inherited from IMP::base::Object
virtual void clear_caches ()
 
CheckLevel get_check_level () const
 
LogLevel get_log_level () const
 
void set_check_level (CheckLevel l)
 
void set_log_level (LogLevel l)
 Set the logging level used in this object. More...
 
void set_was_used (bool tf) const
 
void show (std::ostream &out=std::cout) const
 
const std::string & get_name () const
 
void set_name (std::string name)
 

Protected Member Functions

void set_defaults ()
 
void set_size_data (int rows, int cols)
 
- Protected Member Functions inherited from IMP::base::Object
 Object (std::string name)
 Construct an object with the given name. More...
 
virtual void do_destroy ()
 

Protected Attributes

cv::Mat data_
 Matrix with the data for the image. More...
 
em::ImageHeader header_
 Header for the image with all the pertinent information. More...
 
String name_
 Name of the image. Frequently it will be the name of the file. More...
 

Constructor & Destructor Documentation

IMP::em2d::Image::Image ( int  rows,
int  cols 
)

Create an empty image

Parameters
rowsThe number of rows
colsThe number of columns
IMP::em2d::Image::Image ( String  filename,
const ImageReaderWriter reader 
)

Create an image reading from a file

Parameters
filenameThe name of the file containing the image
readerThe image reader to use

Definition at line 43 of file Image.h.

Member Function Documentation

cv::Mat& IMP::em2d::Image::get_data ( )

Access to the matrix of data

Returns
A reference to the matrix of data

Definition at line 51 of file Image.h.

em::ImageHeader& IMP::em2d::Image::get_header ( )

Access to the image header

Returns
A reference to the header with the EM parameters

Definition at line 94 of file Image.h.

FloatRange IMP::em2d::Image::get_min_and_max_values ( ) const

Recover the minimum and maximum values in the image

Returns
A range. The first value is the minimum. The second one is the maximum.
String IMP::em2d::Image::get_name ( ) const

Get the name of the image

Returns
A string with the name

Definition at line 166 of file Image.h.

virtual std::string IMP::em2d::Image::get_type_name ( ) const
virtual

Define the basic things needed by any Object.

Reimplemented from IMP::base::Object.

Definition at line 154 of file Image.h.

virtual ::IMP::base::VersionInfo IMP::em2d::Image::get_version_info ( ) const
virtual

Get information about the module and version of the object.

Reimplemented from IMP::base::Object.

Definition at line 154 of file Image.h.

double IMP::em2d::Image::operator() ( int  i,
int  j 
) const

Recover the value of a pixel

Parameters
irow
jcolumn
Returns
the value

Definition at line 88 of file Image.h.

void IMP::em2d::Image::read ( String  filename,
const ImageReaderWriter reader 
)

Read an image from file

Parameters
filenameThe name of the file containing the image
readerThe image reader to use

Definition at line 125 of file Image.h.

void IMP::em2d::Image::set_data ( const cv::Mat &  mat)

Sets the entire data of the matrix

Parameters
matCV matrix containing the data for an image
void IMP::em2d::Image::set_name ( const String name)

Set the name of the image

Parameters
name

Definition at line 160 of file Image.h.

void IMP::em2d::Image::set_size ( int  rows,
int  cols 
)

Sets the size of the image

Parameters
rows
cols
void IMP::em2d::Image::set_size ( Image img)

Resize to the same size of the parameter image

Parameters
imgThe image to get the size from
void IMP::em2d::Image::set_value ( double  val)

Set all the pixels of an image

Parameters
valValue to use xxx

Definition at line 69 of file Image.h.

void IMP::em2d::Image::set_value ( int  i,
int  j,
double  val 
)

Sets the value for a pixel

Parameters
irow
jcolumn
valvalue

Definition at line 80 of file Image.h.

void IMP::em2d::Image::set_zeros ( )

Sets the image to zero

Definition at line 62 of file Image.h.

void IMP::em2d::Image::show ( std::ostream &  out) const

Shows information about the class

Parameters
outStream used to show the information

Definition at line 147 of file Image.h.

void IMP::em2d::Image::update_header ( )

Adjusts the information of the image header taking into account the dimensions of the data and setting the time, date, type, etc ... Adjust the information of the image header taking into account the dimensions of the data and setting the time, date, type, etc ...

void IMP::em2d::Image::write ( const String filename,
const ImageReaderWriter writer 
)

Writes the image to a file (the image matrix of data is stored as floats when writing) Writes the image to a file (the image matrix of data is stored as floats when writing)

Parameters
filenameThe output file
writerThe image writer to use

Definition at line 138 of file Image.h.

Member Data Documentation

cv::Mat IMP::em2d::Image::data_
protected

Matrix with the data for the image.

Definition at line 183 of file Image.h.

em::ImageHeader IMP::em2d::Image::header_
protected

Header for the image with all the pertinent information.

Definition at line 185 of file Image.h.

String IMP::em2d::Image::name_
protected

Name of the image. Frequently it will be the name of the file.

Definition at line 180 of file Image.h.


The documentation for this class was generated from the following file: