bioio-imzml
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 withn_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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b6390a152ef69f5a03b9456b73cb01ae603d23ea8e447f9cd3d1d883fa635ab
|
|
| MD5 |
9ca19d346276fb32d2d1e6becae6b770
|
|
| BLAKE2b-256 |
586ea4c719c08589c25755cfeed67665284ea8b60dec767fc855e489bf869347
|
Provenance
The following attestation bundles were made for bioio_imzml-0.1.2.tar.gz:
Publisher:
ci.yml on DBP008/bioio-imzml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bioio_imzml-0.1.2.tar.gz -
Subject digest:
3b6390a152ef69f5a03b9456b73cb01ae603d23ea8e447f9cd3d1d883fa635ab - Sigstore transparency entry: 2462496590
- Sigstore integration time:
-
Permalink:
DBP008/bioio-imzml@74245e93f8a5974f290db7041e3789c784c8f0c3 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/DBP008
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@74245e93f8a5974f290db7041e3789c784c8f0c3 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d333d56ce06d3cd79c079952ef4ea14b5988dee5c8cff6522997692208e393e
|
|
| MD5 |
0d4e0b982e224c6852c7b4fdb9a18e57
|
|
| BLAKE2b-256 |
5f23f21872f6e7fda729180ebf0e2219b9ad04f5efccb027f1398cee71a5dfd4
|
Provenance
The following attestation bundles were made for bioio_imzml-0.1.2-py3-none-any.whl:
Publisher:
ci.yml on DBP008/bioio-imzml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bioio_imzml-0.1.2-py3-none-any.whl -
Subject digest:
6d333d56ce06d3cd79c079952ef4ea14b5988dee5c8cff6522997692208e393e - Sigstore transparency entry: 2462496685
- Sigstore integration time:
-
Permalink:
DBP008/bioio-imzml@74245e93f8a5974f290db7041e3789c784c8f0c3 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/DBP008
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@74245e93f8a5974f290db7041e3789c784c8f0c3 -
Trigger Event:
push
-
Statement type: