Skip to main content

bioio-imzml

CI PyPI License

A basic BioIO reader plugin for imzML mass spectrometry imaging (MSI) data, read with pyimzML.

Installation

pip install bioio-imzml

Requires a sibling .imzML + .ibd file pair (the standard imzML layout).

Usage

from bioio import BioImage

img = BioImage("sample.imzML")
img.dims.order  # "TCZYX" -- C is the m/z axis
img.channel_names  # m/z values, formatted as strings
img.data  # (T, C, Z, Y, X) numpy array

imzML-specific options (mz, mz_step, n_bins, mz_tolerance) work the same way through BioImage(..., mz=[...]), since BioImage forwards unrecognized keyword arguments straight to the reader. Or use the reader directly:

from bioio_imzml import Reader

# "processed" mode files (one m/z axis per pixel) need target channels:
reader = Reader("sample.imzML", mz=[798.54, 826.57, 885.55])

# reject a target with no real peak nearby instead of returning whatever
# peak happens to be closest, however far away. mz_tolerance is in the same
# units as mz itself (m/z, i.e. Da):
reader = Reader("sample.imzML", mz=[798.54, 826.57], mz_tolerance=0.005)

# or let the reader pick evenly spaced channels across the file's m/z range,
# either a fixed count (n_bins) or a fixed step (mz_step) in m/z units:
reader = Reader("sample.imzML", n_bins=512)
reader = Reader("sample.imzML", mz_step=0.1)

Continuous vs. processed mode

imzML stores spectra in one of two ways:

  • continuous: every pixel shares one m/z axis, so intensities already line up across pixels. Detected automatically (identical m/z byte offset and length for every spectrum) and read directly -- no resampling, no channel arguments needed.
  • processed: each pixel has its own m/z axis (typical for high-resolution profile data). There's no single true channel set, so this reader resamples every spectrum onto shared target m/z values by nearest-neighbor lookup, given via mz= or auto-generated with n_bins=.

reader.is_continuous reports which case applies to a given file.

Development

uv sync --extra test
uv run pytest
uv run ruff check .
uv run ruff format .
uv run ty check

Bump the version (updates pyproject.toml) and tag a release to publish to PyPI via CI:

uv version --bump patch  # or minor / major
git commit -am "Bump version"
git tag "v$(uv version --short)"
git push --tags

License

BSD-3-Clause

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bioio_imzml-0.1.2.tar.gz (93.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bioio_imzml-0.1.2-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file bioio_imzml-0.1.2.tar.gz.

File metadata

  • Download URL: bioio_imzml-0.1.2.tar.gz
  • Upload date:
  • Size: 93.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bioio_imzml-0.1.2.tar.gz
Algorithm Hash digest
SHA256 3b6390a152ef69f5a03b9456b73cb01ae603d23ea8e447f9cd3d1d883fa635ab
MD5 9ca19d346276fb32d2d1e6becae6b770
BLAKE2b-256 586ea4c719c08589c25755cfeed67665284ea8b60dec767fc855e489bf869347

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioio_imzml-0.1.2.tar.gz:

Publisher: ci.yml on DBP008/bioio-imzml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioio_imzml-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: bioio_imzml-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bioio_imzml-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6d333d56ce06d3cd79c079952ef4ea14b5988dee5c8cff6522997692208e393e
MD5 0d4e0b982e224c6852c7b4fdb9a18e57
BLAKE2b-256 5f23f21872f6e7fda729180ebf0e2219b9ad04f5efccb027f1398cee71a5dfd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioio_imzml-0.1.2-py3-none-any.whl:

Publisher: ci.yml on DBP008/bioio-imzml

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

This release

0.1.2 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page