21#include <unordered_map>
29 class ImzMLInterceptConsumer;
66 friend class ImzMLInterceptConsumer;
78 const std::string& filename,
96 void openIBD(
const std::string& ibd_path);
105 const std::vector<ImzMLSpectrumIndex>&
getIndex() const noexcept {
return index_; }
114 bool append_spectra_to_map,
115 bool decode_ibd =
true);
122 const XMLCh* localname,
124 const xercesc::Attributes& attrs)
override;
127 const XMLCh* localname,
128 const XMLCh* qname)
override;
144 bool is_mz {
false };
145 bool is_int {
false };
146 bool is_ext {
false };
147 uint64_t offset { 0 };
148 uint64_t count { 0 };
158 uint32_t x {0}, y {0}, z {1};
166 FILE* ibd_ {
nullptr };
169 bool in_spectrum_ {
false };
170 bool in_scan_ {
false };
171 bool in_bda_ {
false };
172 uint32_t cur_x_ { 0 };
173 uint32_t cur_y_ { 0 };
174 uint32_t cur_z_ { 1 };
182 using CvPair = std::pair<std::string, std::string>;
185 bool in_ref_group_ {
false };
186 bool decode_ibd_ {
true };
187 bool cur_x_seen_ {
false };
188 bool cur_y_seen_ {
false };
char16_t XMLCh
Definition ClassTest.h:30
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:65
ImzMLMeta & getImzMLMeta() noexcept
Non-const access for ImzMLFile to set the .ibd path before parse.
Definition ImzMLHandler.h:102
ImzMLMeta meta_
Definition ImzMLHandler.h:167
ImzMLHandler(const ImzMLHandler &)=delete
void handleIMSCvParam_(const std::string &acc, const std::string &val)
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:179
void openIBD(const std::string &ibd_path)
Open the companion .ibd file for random-access binary reads.
ArrayMeta int_meta
Definition ImzMLHandler.h:160
const std::vector< ImzMLSpectrumIndex > & getIndex() const noexcept
Per-spectrum binary index built during parse (one entry per spectrum).
Definition ImzMLHandler.h:105
std::vector< ImzMLSpectrumIndex > index_
Full index for OnDiscImzMLExperiment.
Definition ImzMLHandler.h:180
ArrayMeta cur_mz_meta_
Definition ImzMLHandler.h:176
ArrayMeta cur_int_meta_
Definition ImzMLHandler.h:177
const ImzMLMeta & getImzMLMeta() const noexcept
Imaging metadata accumulated during SAX parse (read after parse_() returns).
Definition ImzMLHandler.h:99
ArrayMeta cur_array_
Definition ImzMLHandler.h:175
~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::pair< std::string, std::string > CvPair
Definition ImzMLHandler.h:182
std::string cur_ref_id_
Definition ImzMLHandler.h:184
ImzMLHandler & operator=(const ImzMLHandler &)=delete
void startElement(const XMLCh *uri, const XMLCh *localname, const XMLCh *qname, const xercesc::Attributes &attrs) override
void endElement(const XMLCh *uri, const XMLCh *localname, const XMLCh *qname) override
std::unique_ptr< ImzMLInterceptConsumer > decode_bridge_
Definition ImzMLHandler.h:190
ArrayMeta mz_meta
Definition ImzMLHandler.h:159
std::unordered_map< std::string, std::vector< CvPair > > ref_groups_
Definition ImzMLHandler.h:183
Definition ImzMLHandler.h:157
Handler for mzML file format.
Definition MzMLHandler.h:94
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:97