16#include <unordered_map>
118 static constexpr Size NO_REGION = std::numeric_limits<Size>::max();
187 double pixel_size_x_ = -1.0;
188 double pixel_size_y_ = -1.0;
189 std::string pixel_size_unit_ =
"unknown";
Pixel grid metadata and (x, y) -> spectrum_index lookup for MSI data.
Definition MSImagingGeometry.h:33
Size getNumberOfPixels() const
Total number of pixels with a bound spectrum.
const std::vector< MSImagingRegion > & getRegions() const
All regions in insertion order.
void clearRegions()
Removes all regions; acquired pixels are left untouched.
double getPixelSizeY() const
Physical pixel size along y.
static UInt64 packKey_(UInt x, UInt y)
bool hasPixel(UInt x, UInt y) const
Tests pixel presence at (x, y).
const std::vector< Pixel > & getPixels() const
Pixels in insertion order.
UInt getWidth() const
Image width.
const MSImagingRegion & getRegion(Size id) const
Returns the region with the given id.
std::vector< Size > getRegionSpectrumIndices(Size id) const
Spectrum indices of the acquired pixels belonging to a region.
void addPixel(UInt x, UInt y, Size spectrum_index)
Adds a pixel at (x, y) bound to spectrum_index.
Size getSpectrumIndex(UInt x, UInt y) const
Looks up the spectrum index at (x, y).
std::vector< Size > getRegionPixels(Size id) const
Acquired pixels belonging to a region, as indices into getPixels().
std::vector< Pixel > pixels_
Definition MSImagingGeometry.h:190
void addRegion(const MSImagingRegion ®ion)
Adds a region to the geometry as a decoupled overlay.
std::unordered_map< Size, Size > region_id_to_index_
Definition MSImagingGeometry.h:195
Size regionOf(UInt x, UInt y) const
Returns the id of the region owning the acquired pixel at (x, y).
void setDimensions(UInt width, UInt height)
Sets the image dimensions.
void setPixelSize(double x, double y, const std::string &unit)
Records the physical pixel size and its unit.
std::unordered_map< UInt64, Size > lookup_
Definition MSImagingGeometry.h:191
UInt getHeight() const
Image height.
void clear()
Resets all state (dimensions, pixel size, pixels, lookup, regions).
const std::string & getPixelSizeUnit() const
Unit for the pixel size.
double getPixelSizeX() const
Physical pixel size along x.
void removeRegion(Size id)
Removes the region with the given id.
std::vector< MSImagingRegion > regions_
Definition MSImagingGeometry.h:194
Size getNumberOfRegions() const
Number of regions in the overlay.
A pixel in the imaging grid, linked to one spectrum in the experiment.
Definition MSImagingGeometry.h:37
A spatial region within an MSI dataset, in global pixel coordinates.
Definition MSImagingRegion.h:30
uint64_t UInt64
Unsigned integer type (64bit)
Definition Types.h:47
unsigned int UInt
Unsigned integer type.
Definition Types.h:64
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19