OpenMS
Loading...
Searching...
No Matches
MSImagingExperiment.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg $
6// $Authors: Timo Sachsenberg, Patrick Boschmann $
7// --------------------------------------------------------------------------
8
9#pragma once
10
16
17namespace OpenMS
18{
29class OPENMS_DLLAPI MSImagingExperiment final
30{
31public:
33
39
52
56
60
66
70
74
80
84
88
95 bool hasPixel(UInt x, UInt y) const;
96
107
117 const MSSpectrum& getSpectrum(UInt x, UInt y) const;
118
141 IonImage extractIonImage(double mz, double tolerance_ppm) const;
142
168 IonImage extractIonImage(double mz, double tolerance_ppm, Size region_id) const;
173 void validate() const;
174
184 std::vector<Size> getRegionSpectrumIndices(Size region_id) const;
185
186
187private:
199 double mz_lo,
200 double mz_hi,
201 const std::vector<MSImagingGeometry::Pixel>& pixels,
202 const std::vector<Size>& pixel_indices) const;
203};
204
205} // namespace OpenMS
Dense W x H grid of ion intensities with a per-pixel mask.
Definition IonImage.h:31
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
In-memory model for a 2D imaging mass spectrometry dataset.
Definition MSImagingExperiment.h:30
Size getNumberOfPixels() const
Number of pixels in the geometry.
MSExperiment experiment_
Definition MSImagingExperiment.h:188
MSImagingGeometry geometry_
Definition MSImagingExperiment.h:189
MSExperiment & getMSExperiment()
Mutable access to the owned MSExperiment.
bool hasPixel(UInt x, UInt y) const
Tests pixel presence at (x, y).
void setGeometry(MSImagingGeometry geom)
Replaces the owned geometry.
const MSSpectrum & getSpectrum(UInt x, UInt y) const
Read access to the spectrum bound to the pixel at (x, y).
MSImagingExperiment(MSExperiment exp)
Constructs an MSImagingExperiment wrapping exp with an empty geometry.
MSImagingGeometry & getGeometry()
Mutable access to the owned geometry.
void extractIntoImage_(IonImage &image, double mz_lo, double mz_hi, const std::vector< MSImagingGeometry::Pixel > &pixels, const std::vector< Size > &pixel_indices) const
extracts the sum of intensities in [mz_lo:mz_hi] into image on a pixel level, indices control which p...
MSSpectrum & getSpectrum(UInt x, UInt y)
Mutable access to the spectrum bound to the pixel at (x, y).
IonImage extractIonImage(double mz, double tolerance_ppm, Size region_id) const
Extracts an ion image by summing peak intensities inside [mz - dm, mz + dm], with dm = mz * tolerance...
Size getNumberOfSpectra() const
Number of spectra in the underlying experiment.
IonImage extractIonImage(double mz, double tolerance_ppm) const
Extracts an ion image by summing peak intensities inside [mz - dm, mz + dm], with dm = mz * tolerance...
const MSImagingGeometry & getGeometry() const
Read access to the owned geometry.
MSImagingExperiment & operator=(MSExperiment exp)
Replaces the owned MSExperiment and resets the geometry.
void setMSExperiment(MSExperiment exp)
Replaces the owned MSExperiment.
void validate() const
Validates that every pixel references an in-range spectrum_index.
std::vector< Size > getRegionSpectrumIndices(Size region_id) const
Spectrum indices of the acquired pixels belonging to a region.
const MSExperiment & getMSExperiment() const
Read access to the owned MSExperiment.
Pixel grid metadata and (x, y) -> spectrum_index lookup for MSI data.
Definition MSImagingGeometry.h:33
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
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