spora [io]#
spora [io] is the interface for spora [data]. It gives access to H&E, IHC, and diverse multiplex technologies, so you can open a tissue, stream a tile, or sample across cohorts.
- [data]harmonized datasets
- [io]load and sample
- [bench]evaluate models
Why spora [io]#
Spatial proteomics datasets differ widely in file format, channel naming, resolution, and annotation across laboratories and imaging technologies. spora [data] brings them into one harmonized format, and spora [io] gives you a single, consistent way to access them, so your code stays the same from the first cohort to the thirty-fifth.
SporaDataset.
Model-ready Tensors
Channel filtering, standardization statistics, and typed outputs hand
your model consistent (C, H, W) tensors.
Load a Tissue#
Point a dataset class at a spora [data] directory and ask for a tissue. You get a
(C, H, W) tensor together with its channel annotations, and only that
tissue’s image is read from disk.
This example needs no tile coordinates or standardization statistics. The Quick Start shows tiles, multimodal datasets, and sampling across cohorts.
from spora_io import SporaDataset
dataset = SporaDataset(
dataset_names=["my_dataset"],
# Parent directory; if omitted, uses SPORA_DATASETS_DIR.
datasets_dir="/path/to/datasets",
modalities=["imc"],
resolution=1.0,
sampling_unit="tissues",
modality_kwargs={"imc": {"standardization": "identity"}},
)
sample = dataset.get_tissue_sample(
dataset_name="my_dataset",
tissue_id=dataset.get_tissue_ids("my_dataset")[0],
kind="complete",
)
tissue = sample["modalities"]["imc"]
print(tissue.image.shape) # (C, H, W)
print(tissue.channel_names)
Built on spora [data]#
spora [io] reads the harmonized collection of spora [data]: images, masks, cell types, and patient metadata, standardized across cohorts and technologies.
- IF 43.2%
- Orion 21.0%
- IMC 20.2%
- CODEX 10.9%
- MIBI 4.7%
- Unimodal 69.3%
- Multimodal 30.7%
- Registered 26.1%
- Matched 4.7%
Percentages refer to the total number of multiplex tiles. Technology labels describe the collection; see the format reference for spora-io modality keys and file conventions.
Bring Your Own Data#
Any imaging dataset can join: write the images and channel metadata, then let the repository scripts derive masks, OME-Zarr stores, statistics, and tiles.
Directory layout, metadata tables, channel annotations, masks, and tiling.
The six steps from source images to tiles, with the commands for
hoefflin2026spatial.
Explore the Docs#
Loading interfaces, lazy loading from OME-Zarr, and typed outputs.
Standardization methods, their statistics, and the settings per model.
Compute tissue masks, convert to OME-Zarr, generate tiles, and inspect datasets.
Dataset classes, typed outputs, methods, and helper functions.