21#include <unordered_map>
29 class ImzMLInterceptConsumer;
65 friend class ImzMLInterceptConsumer;
77 const std::string& filename,
95 void openIBD(
const std::string& ibd_path);
104 const std::vector<ImzMLSpectrumIndex>&
getIndex() const noexcept {
return index_; }
113 bool append_spectra_to_map,
114 bool decode_ibd =
true);
130 const std::string& unit_accession =
"");
139 bool is_mz {
false };
140 bool is_int {
false };
141 bool is_ext {
false };
142 uint64_t offset { 0 };
143 uint64_t count { 0 };
144 uint64_t encoded_bytes { 0 };
146 bool compressed {
false };
163 uint32_t x {0}, y {0}, z {1};
175 FILE* ibd_ {
nullptr };
178 bool in_spectrum_ {
false };
179 bool in_scan_ {
false };
180 bool in_bda_ {
false };
181 uint32_t cur_x_ { 0 };
182 uint32_t cur_y_ { 0 };
183 uint32_t cur_z_ { 1 };
201 std::unordered_map<std::string, std::vector<CvEntry>>
ref_groups_;
203 bool in_ref_group_ {
false };
204 bool decode_ibd_ {
true };
205 bool cur_x_seen_ {
false };
206 bool cur_y_seen_ {
false };
The interface of a consumer of spectra and chromatograms.
Definition IMSDataConsumer.h:46
SAX2 handler for imzML 1.1.0 files, extending OpenMS MzMLHandler.
Definition ImzMLHandler.h:64
ImzMLMeta & getImzMLMeta() noexcept
Non-const access for ImzMLFile to set the .ibd path before parse.
Definition ImzMLHandler.h:101
ImzMLMeta meta_
Definition ImzMLHandler.h:176
ImzMLHandler(const ImzMLHandler &)=delete
void onStartElement(const char16_t *qname, const XMLAttributes &attrs) override
Parsing method for opening tags.
ImzMLHandler(PeakMap &exp, const std::string &filename, const ProgressLogger &logger)
Construct an ImzMLHandler.
void applyRefGroup_(const std::string &id)
std::vector< SpecIMS > spec_ims_
IMS state per spectrum (document order)
Definition ImzMLHandler.h:190
void openIBD(const std::string &ibd_path)
Open the companion .ibd file for random-access binary reads.
ArrayMeta int_meta
Definition ImzMLHandler.h:165
std::unordered_map< std::string, std::vector< CvEntry > > ref_groups_
Definition ImzMLHandler.h:201
std::vector< ArrayMeta > cur_aux_metas_
Definition ImzMLHandler.h:187
std::string value
Definition ImzMLHandler.h:198
const std::vector< ImzMLSpectrumIndex > & getIndex() const noexcept
Per-spectrum binary index built during parse (one entry per spectrum).
Definition ImzMLHandler.h:104
std::string unit_accession
Definition ImzMLHandler.h:199
std::vector< ImzMLSpectrumIndex > index_
Full index for OnDiscImzMLExperiment.
Definition ImzMLHandler.h:191
ArrayMeta cur_mz_meta_
Definition ImzMLHandler.h:185
ArrayMeta cur_int_meta_
Definition ImzMLHandler.h:186
const ImzMLMeta & getImzMLMeta() const noexcept
Imaging metadata accumulated during SAX parse (read after parse_() returns).
Definition ImzMLHandler.h:98
ArrayMeta cur_array_
Definition ImzMLHandler.h:184
~ImzMLHandler() override
Closes the .ibd FILE* if open.
void connectDecodeConsumer(Interfaces::IMSDataConsumer *downstream, bool append_spectra_to_map, bool decode_ibd=true)
Wire ImzMLInterceptConsumer between MzMLHandler and an optional downstream consumer.
std::vector< std::string > inline_aux_names
Non-external aux arrays seen while peaks come from the .ibd (warned and dropped).
Definition ImzMLHandler.h:169
std::string name
Definition ImzMLHandler.h:197
std::string cur_ref_id_
Definition ImzMLHandler.h:202
ImzMLHandler & operator=(const ImzMLHandler &)=delete
std::vector< ArrayMeta > aux_meta
Auxiliary external arrays (ion mobility, SNR, …) in document order.
Definition ImzMLHandler.h:167
void handleIMSCvParam_(const std::string &acc, const std::string &name, const std::string &val, const std::string &unit_accession="")
void onEndElement(const char16_t *qname) override
Parsing method for closing tags.
std::vector< std::string > cur_inline_aux_names_
Definition ImzMLHandler.h:188
std::unique_ptr< ImzMLInterceptConsumer > decode_bridge_
Definition ImzMLHandler.h:208
ArrayMeta mz_meta
Definition ImzMLHandler.h:164
std::string accession
Definition ImzMLHandler.h:196
A cvParam captured inside a referenceableParamGroup.
Definition ImzMLHandler.h:195
Definition ImzMLHandler.h:162
Handler for mzML file format.
Definition MzMLHandler.h:93
Xerces-free, lightweight view over the attribute list of an XML element.
Definition XMLAttributes.h:32
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:27
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
DataType
Scalar type identifier for binary array elements.
Definition ImzMLHandlerHelper.h:105