![]() |
OpenMS
|
Pixel grid metadata and (x, y) -> spectrum_index lookup for MSI data. More...
#include <OpenMS/IMAGING/MSImagingGeometry.h>
Classes | |
| struct | Pixel |
| A pixel in the imaging grid, linked to one spectrum in the experiment. More... | |
Public Member Functions | |
| void | setDimensions (UInt width, UInt height) |
| Sets the image dimensions. | |
| UInt | getWidth () const |
| Image width. | |
| UInt | getHeight () const |
| Image height. | |
| void | setPixelSize (double x, double y, const std::string &unit="micrometer") |
| Records the physical pixel size and its unit. | |
| double | getPixelSizeX () const |
| Physical pixel size along x. | |
| double | getPixelSizeY () const |
| Physical pixel size along y. | |
| const std::string & | getPixelSizeUnit () const |
| Unit for the pixel size. | |
| void | addPixel (UInt x, UInt y, Size spectrum_index) |
Adds a pixel at (x, y) bound to spectrum_index. | |
| bool | hasPixel (UInt x, UInt y) const |
Tests pixel presence at (x, y). | |
| Size | getSpectrumIndex (UInt x, UInt y) const |
Looks up the spectrum index at (x, y). | |
| const std::vector< Pixel > & | getPixels () const |
| Pixels in insertion order. | |
| Size | getNumberOfPixels () const |
| Total number of pixels with a bound spectrum. | |
| void | clear () |
| Resets all state (dimensions, pixel size, pixels, lookup). | |
Static Private Member Functions | |
| static UInt64 | packKey_ (UInt x, UInt y) |
Private Attributes | |
| UInt | width_ = 0 |
| UInt | height_ = 0 |
| double | pixel_size_x_ = 1.0 |
| double | pixel_size_y_ = 1.0 |
| std::string | pixel_size_unit_ = "micrometer" |
| std::vector< Pixel > | pixels_ |
| std::unordered_map< UInt64, Size > | lookup_ |
Pixel grid metadata and (x, y) -> spectrum_index lookup for MSI data.
Coordinates are zero-based. imzML files are one-based; the Phase 2 loader (ImzMLFile) is responsible for normalizing those to zero-based coordinates before populating this geometry.
3D MSI is intentionally not modeled here. Serial-section experiments should be handled as a collection of MSImagingExperiment objects (one per section).
| struct OpenMS::MSImagingGeometry::Pixel |
Adds a pixel at (x, y) bound to spectrum_index.
| [in] | x | Column index (zero-based). |
| [in] | y | Row index (zero-based). |
| [in] | spectrum_index | Index into the bound MSExperiment. |
| Exception::InvalidValue | on duplicate coordinates, or if dimensions have been set and (x, y) is outside [0, width) x [0, height). |
| void clear | ( | ) |
Resets all state (dimensions, pixel size, pixels, lookup).
| UInt getHeight | ( | ) | const |
Image height.
| Size getNumberOfPixels | ( | ) | const |
Total number of pixels with a bound spectrum.
| const std::vector< Pixel > & getPixels | ( | ) | const |
Pixels in insertion order.
| const std::string & getPixelSizeUnit | ( | ) | const |
Unit for the pixel size.
| double getPixelSizeX | ( | ) | const |
Physical pixel size along x.
| double getPixelSizeY | ( | ) | const |
Physical pixel size along y.
Looks up the spectrum index at (x, y).
| [in] | x | Column index. |
| [in] | y | Row index. |
| Exception::ElementNotFound | if no pixel exists at that coordinate. |
| UInt getWidth | ( | ) | const |
Image width.
Tests pixel presence at (x, y).
| [in] | x | Column index. |
| [in] | y | Row index. |
Sets the image dimensions.
| [in] | width | Number of columns. |
| [in] | height | Number of rows. |
| void setPixelSize | ( | double | x, |
| double | y, | ||
| const std::string & | unit = "micrometer" |
||
| ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |