![]() |
OpenMS
|
Dense W x H grid of ion intensities with a per-pixel mask. More...
#include <OpenMS/IMAGING/IonImage.h>
Public Member Functions | |
| IonImage ()=default | |
| Default-construct an empty 0 x 0 image. | |
| IonImage (UInt width, UInt height) | |
Constructs and zero-initializes a width x height image; all pixels invalid. | |
| void | resize (UInt width, UInt height) |
| Resizes and zero-initializes; all pixels become invalid. | |
| UInt | getWidth () const |
| Image width. | |
| UInt | getHeight () const |
| Image height. | |
| bool | hasPixel (UInt x, UInt y) const |
True once setIntensity has been called for the cell at (x, y). | |
| double | getIntensity (UInt x, UInt y) const |
Intensity at (x, y); 0.0 if never set. | |
| void | setIntensity (UInt x, UInt y, double intensity) |
Stores intensity at (x, y) and marks the cell valid. | |
| void | setMzRange (const RangeMZ &range) |
| Records the m/z window the image was extracted from. | |
| const RangeMZ & | getMzRange () const |
| m/z window the image was extracted from. | |
| const std::vector< double > & | getData () const |
| Raw row-major intensity buffer. | |
| const std::vector< bool > & | getMask () const |
| Parallel pixel mask (same indexing as getData()). | |
Private Member Functions | |
| Size | linearIndex_ (UInt x, UInt y) const |
Private Attributes | |
| UInt | width_ = 0 |
| UInt | height_ = 0 |
| std::vector< double > | intensities_ |
| std::vector< bool > | mask_ |
| RangeMZ | mz_range_ |
Dense W x H grid of ion intensities with a per-pixel mask.
Storage is row-major: index = y * W + x. Pixels are masked-out by default; setIntensity marks them present. The m/z window the image was extracted from is stored alongside the data for traceability.
3D MSI is intentionally not modeled here. Serial-section experiments are a stack of independent 2D acquisitions and should be handled as a collection of IonImage objects (one per section), matching the OpenMS "vector of units" idiom.
|
default |
Default-construct an empty 0 x 0 image.
Constructs and zero-initializes a width x height image; all pixels invalid.
| [in] | width | Number of columns. |
| [in] | height | Number of rows. |
| const std::vector< double > & getData | ( | ) | const |
Raw row-major intensity buffer.
| UInt getHeight | ( | ) | const |
Image height.
Intensity at (x, y); 0.0 if never set.
| [in] | x | Column index. |
| [in] | y | Row index. |
x, y) is false. | Exception::IndexOverflow | on out-of-bounds access. |
| const std::vector< bool > & getMask | ( | ) | const |
Parallel pixel mask (same indexing as getData()).
| const RangeMZ & getMzRange | ( | ) | const |
m/z window the image was extracted from.
| UInt getWidth | ( | ) | const |
Image width.
True once setIntensity has been called for the cell at (x, y).
| [in] | x | Column index. |
| [in] | y | Row index. |
Resizes and zero-initializes; all pixels become invalid.
| [in] | width | Number of columns. |
| [in] | height | Number of rows. |
Stores intensity at (x, y) and marks the cell valid.
| [in] | x | Column index. |
| [in] | y | Row index. |
| [in] | intensity | Value to store. |
| Exception::IndexOverflow | on out-of-bounds access. |
| void setMzRange | ( | const RangeMZ & | range | ) |
Records the m/z window the image was extracted from.
| [in] | range | m/z window. |
|
private |
|
private |
|
private |
|
private |
|
private |