11#include <OpenMS/OpenMSConfig.h>
43 uint32_t max_count_x {0};
44 uint32_t max_count_y {0};
45 uint32_t max_count_z {1};
46 double pixel_size_x {-1};
47 double pixel_size_y {-1};
48 std::string pixel_size_unit {
"unknown"};
137 uint64_t encoded_bytes {0};
139 bool compressed {
false};
146 uint64_t mz_offset {0};
147 uint64_t mz_length {0};
149 bool mz_compressed {
false};
150 uint64_t int_offset {0};
151 uint64_t int_length {0};
153 bool int_compressed {
false};
154 std::vector<AuxArray>
aux;
181 std::vector<double>& out,
182 const std::string& ibd_path);
193 std::vector<float>& out,
194 const std::string& ibd_path);
224 std::vector<float>& out,
225 const std::string& ibd_path,
226 const std::string& array_name);
236 const std::string& ibd_path);
244 const std::vector<double>& mz,
245 const std::string& ibd_path);
255 const std::string& ibd_path);
263 const std::vector<double>& mz,
264 const std::string& ibd_path);
298 bool warn =
false, uint32_t x = 0, uint32_t y = 0, uint32_t z = 0);
315 const std::vector<float>& values);
Shared .ibd binary array decode utilities for imzML handlers.
Definition ImzMLHandlerHelper.h:163
static void readMzArray(FILE *ibd, uint64_t offset, uint64_t count, ImzMLSpectrumIndex::DataType dt, std::vector< double > &out, const std::string &ibd_path)
Read an m/z array from the companion .ibd file.
static void readAuxArray(FILE *ibd, uint64_t offset, uint64_t count, ImzMLSpectrumIndex::DataType dt, std::vector< float > &out, const std::string &ibd_path, const std::string &array_name)
Read an auxiliary (non-m/z, non-intensity) array from the .ibd file.
static void writeFloat32Array(FILE *ibd, const float *data, uint64_t count, const std::string &ibd_path)
Write a float32 array to the companion .ibd file (little-endian).
static void writeMzAsFloat32(FILE *ibd, const std::vector< double > &mz, const std::string &ibd_path)
Write m/z values as float32 to the companion .ibd file.
static void writeMzAsFloat64(FILE *ibd, const std::vector< double > &mz, const std::string &ibd_path)
Write m/z values as float64 to the companion .ibd file.
static void readIntArray(FILE *ibd, uint64_t offset, uint64_t count, ImzMLSpectrumIndex::DataType dt, std::vector< float > &out, const std::string &ibd_path)
Read an intensity array from the companion .ibd file.
static void writeFloat64Array(FILE *ibd, const double *data, uint64_t count, const std::string &ibd_path)
Write a float64 array to the companion .ibd file (little-endian).
Per-spectrum rules shared by every imzML access path (in-memory, streaming, metadata-only,...
Definition ImzMLHandlerHelper.h:274
static void attachAuxArray(MSSpectrum &s, const std::string &name, const std::string &unit_accession, const std::vector< float > &values)
Attach the values of an external auxiliary array read from the .ibd.
static double scanStartTime(const MSSpectrum &s)
Acquisition (scan start) time of an imaging spectrum in seconds.
static void pruneEmptyDataArrays(MSSpectrum &s)
Drop the empty Float/Integer/StringDataArrays left by MzMLHandler for aux arrays that were not filled...
static bool isLoadableAuxArray(const std::string &name, uint64_t length, ImzMLSpectrumIndex::DataType type, uint64_t n_peaks, bool warn=false, uint32_t x=0, uint32_t y=0, uint32_t z=0)
Whether an external auxiliary array is read from the .ibd for a spectrum with n_peaks peaks (it needs...
static void applyIMPeakType(MSSpectrum &s, bool has_im_array)
Set the IM peak type after the auxiliary arrays are known: with an ion mobility array,...
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
@ UNKNOWN
Unknown or unrecognized ion type.
std::string int_data_type
same set as mz_data_type
Definition ImzMLHandlerHelper.h:73
std::string scan_pattern
"top down" | "bottom up" (IMS:1000401/402)
Definition ImzMLHandlerHelper.h:79
std::string mz_data_type
"float32" | "float64" | "int32" | "int64"
Definition ImzMLHandlerHelper.h:72
std::string line_scan_direction
"left-right" | "right-left" (IMS:1000491/492)
Definition ImzMLHandlerHelper.h:81
std::string polarity
"positive" | "negative" (MS:1000130/129)
Definition ImzMLHandlerHelper.h:82
std::string uuid
Dataset UUID (IMS:1000080)
Definition ImzMLHandlerHelper.h:66
std::string imaging_mode
"continuous" (shared m/z array) or "processed" (per-spectrum m/z).
Definition ImzMLHandlerHelper.h:57
std::string scan_direction
"flyback" | "meander" | "horizontal" | "vertical"
Definition ImzMLHandlerHelper.h:80
std::string ibd_md5
MD5 checksum (IMS:1000090), empty if absent.
Definition ImzMLHandlerHelper.h:65
std::string ibd_file_path
Absolute path to the .ibd file.
Definition ImzMLHandlerHelper.h:63
std::string ibd_sha1
SHA-1 checksum (IMS:1000091), empty if absent.
Definition ImzMLHandlerHelper.h:64
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::optional< int > lengthUnitExponent(const std::string &unit_accession)
SI exponent of the UO length unit unit_accession, i.e. its power of ten relative to meter.
Per-spectrum binary index entry for an imzML dataset.
Definition ImzMLHandlerHelper.h:119
std::vector< AuxArray > aux
Extra external arrays (IM, …) in document order.
Definition ImzMLHandlerHelper.h:154
std::string unit_accession
unitAccession on the array-identity cvParam (may be empty)
Definition ImzMLHandlerHelper.h:134
DataType
Scalar type identifier for binary array elements.
Definition ImzMLHandlerHelper.h:121
std::string name
Ontology / free-text array name (FloatDataArray::getName)
Definition ImzMLHandlerHelper.h:132
std::string accession
MS accession (e.g. MS:1003006), may be empty.
Definition ImzMLHandlerHelper.h:133
Index entry for one auxiliary (non-m/z, non-intensity) external array.
Definition ImzMLHandlerHelper.h:131