![]() |
OpenMS
|
Writer for imzML 1.1.0 files (.imzML + companion .ibd). More...
#include <OpenMS/FORMAT/HANDLERS/ImzMLWriter.h>
Static Public Member Functions | |
| static void | store (const std::string &imzml_path, const MSExperiment &exp, const PeakFileOptions &options, ProgressLogger &logger) |
| Store an MSExperiment as imzML + .ibd. | |
Writer for imzML 1.1.0 files (.imzML + companion .ibd).
|
static |
Store an MSExperiment as imzML + .ibd.
Supports continuous (shared m/z array) and processed (per-spectrum m/z) modes. Pixel coordinates are read from imzml:x/y/z MetaValues on each spectrum (required for export); dataset metadata is taken from experiment MetaValues when present.
Export writes external binary arrays with a 16-byte UUID header in the .ibd file. Binary precision for m/z and intensity follows PeakFileOptions (getMz32Bit, getIntensity32Bit).
Per-spectrum FloatDataArray values are exported as additional external binary arrays after m/z and intensity (standard imzML multi-array layout). Scope of that path:
FloatDataArray only (not integer/string data arrays)MS:1000514 "m/z array", MS:1000515 "intensity array") are skipped with a warning: such an array would be read back as the spectrum's peak metadataMS:1000576 on the array and on the m/z and intensity referenceableParamGroup entries)MS:1000513). If the term declares exactly one allowed unit, that unit is written (accession, name, cvRef). Terms with several allowed units get no unit attributes (no arbitrary choice). Unknown names become MS:1000786 "non-standard data array"Viewers can rely on MSSpectrum::containsIMData() after load for IM arrays.
PeakFileOptions spectrum/peak filters (MS level, RT, precursor m/z, m/z and intensity ranges, metadata-only, sort-by-m/z) are applied to a temporary copy before export.
Spectra sharing a pixel coordinate are written out as-is with a warning, matching what the reader accepts for the same dataset (readers map only the first spectrum per pixel into the imaging geometry).
| [in] | imzml_path | Path to the output .imzML file. |
| [in] | exp | Experiment to store (must contain at least one spectrum). |
| [in] | options | Peak file options (filtering, sort, binary precision). |
| [in] | logger | Progress logger for status output. |
| Exception::MissingInformation | if exp has no spectra or lacks imzml:x/y on any spectrum. |
| Exception::InvalidValue | if pixel coordinates are invalid. |
| Exception::InvalidParameter | if continuous export is requested but spectra are incompatible. |
| Exception::UnableToCreateFile | if output files cannot be written. |
| Exception::ParseError | if binary array serialization fails. |