ImzMLFile#

class pyopenms.ImzMLFile#

Bases: object

File adapter for imzML 1.1.0 mass spectrometry imaging files (.imzML + companion .ibd).

Load into an MSImagingExperiment (imaging-only, like BrukerTimsImagingFile) for pixel (x, y) access, or stream via IMSDataConsumer (batched delivery after spectrumList parsing). PeakFileOptions apply during load and store (filtering, sort, binary precision on export). Use store() to export imzML + UUID-linked companion .ibd (binary precision via PeakFileOptions).

__init__() → None#

Methods

__init__()

buildImagingGeometry(exp, geom)

Build MSImagingGeometry from a loaded imzML MSExperiment (reads imzml:x/y MetaValues).

endProgress([bytes_processed])

Ends the progress display

getLogType()

Returns the type of progress log being used

getOptions()

Returns the options for loading

isValid(filename)

Validate against mzML schema; returns (is_valid, error_text)

load(filename, exp)

Overloaded function.

loadSpectraIndex(filename)

Parse imzML XML and return (ImzMLMeta, list[ImzMLSpectrumIndex], MSExperiment) without loading peaks; the MSExperiment holds every spectrum's metadata (no peaks; data arrays empty, with their metadata) in index order plus the dataset settings

nextProgress()

Increment progress by 1 (according to range begin-end)

setLogType(type)

Sets the progress log that should be used.

setOptions(options)

Set PeakFileOptions for filtering during load

setProgress(value)

Sets the current progress

startProgress(begin, end, label)

store(filename, exp)

Overloaded function.

static buildImagingGeometry(exp: pyopenms.MSExperiment, geom: pyopenms.MSImagingGeometry) → None#

Build MSImagingGeometry from a loaded imzML MSExperiment (reads imzml:x/y MetaValues). Duplicate pixel coordinates are warned about: only the first spectrum per pixel is mapped into the geometry, while the later duplicates stay in the MSExperiment and remain reachable by index

endProgress(bytes_processed: int = 0) → None#

Ends the progress display

getLogType() → pyopenms.ProgressLogger.LogType#

Returns the type of progress log being used

getOptions() → pyopenms.PeakFileOptions#

Returns the options for loading

isValid(filename: str) → tuple#

Validate against mzML schema; returns (is_valid, error_text)

load(filename: str, exp: pyopenms.MSImagingExperiment) → None#
load(filename: str, consumer: object) → None

Overloaded function.

  1. load(filename: str, exp: pyopenms.MSImagingExperiment) -> None

Load an imzML file into an MSImagingExperiment with pixel lookup

  1. load(filename: str, consumer: object) -> None

Stream-load imzML; spectra are delivered after spectrumList parsing

loadSpectraIndex(filename: str) → tuple#

Parse imzML XML and return (ImzMLMeta, list[ImzMLSpectrumIndex], MSExperiment) without loading peaks; the MSExperiment holds every spectrum’s metadata (no peaks; data arrays empty, with their metadata) in index order plus the dataset settings

nextProgress() → None#

Increment progress by 1 (according to range begin-end)

setLogType(type: pyopenms.ProgressLogger.LogType) → None#

Sets the progress log that should be used. The default type is NONE!

setOptions(options: pyopenms.PeakFileOptions) → None#

Set PeakFileOptions for filtering during load

setProgress(value: int) → None#

Sets the current progress

startProgress(begin: int, end: int, label: str) → None#
store(filename: str, exp: pyopenms.MSExperiment) → None#
store(filename: str, exp: pyopenms.MSImagingExperiment) → None

Overloaded function.

  1. store(filename: str, exp: pyopenms.MSExperiment) -> None

Store an MSExperiment as imzML (.imzML + .ibd); spectra must carry imzml:x/y MetaValues

  1. store(filename: str, exp: pyopenms.MSImagingExperiment) -> None

Store an MSImagingExperiment as imzML (.imzML + .ibd); coordinates come from its MSImagingGeometry