Layer images, cells, and transcripts in 3D, in one reactive widget.
You have a spatial dataset and a hunch. milume turns a notebook cell into a tactile,
reactive surface where you can look at your tissue, select what catches your eye, and
carry that selection straight into code. Cells, landmarks and measurements stay in
plain AnnData / obs_names / geometry, so what you see on the surface is what you
analyze next.
One call opens it:
import milume
w = milume.peek(adata, color="cell_type")
Draw selections and landmarks, color by category or gene, expand neighborhoods, and
read everything back in Python. The name comes from mille (thousand, as in
mille-feuille, layers) + lume (light).
Note: Milume was formerly spatial-rx. The API is unchanged; only the names moved:
pip uninstall spatial-rx
pip install milume
import milume # was: import spatial_rx
Alongside other viewers
Milume complements other viewers. Use milume to form intuition: layer images, cells,
and transcripts in a notebook, select what stands out, and carry the selection straight
into your analysis code. Use heavier viewers when you need to inspect in depth.
Landmarks and selections round-trip as plain geometry and obs_names, so you can hand
the same regions to any viewer.
API
milume.peek(data, **kwargs) opens the surface on your data and returns a widget w
you read results from. Full widget guide and generated API reference:
docs site.
import milume
w = milume.peek(adata, color="cell_type") # AnnData with obsm["spatial"]
w = milume.peek(sdata, color="cell_type") # SpatialData on disk: adds the 3D cube
Argument
Meaning
data
AnnData with obsm["spatial"], or a SpatialData
color
obs column to color cells by
genes
gene(s) to expose for coloring; limits the catalog on large matrices
spatial_key
obsm key holding coordinates (default "spatial")
table, image, labels
override what is inferred from a SpatialData
contrast_limits
display range for the 3D image (default: its 1st percentile to its max, from the coarsest pyramid level)
milume.peek works on AnnData and on-disk SpatialData (including Pyxa-backed
mosaics). For Xenium, Atera, CosMx, and other readers, see
Other platforms below and the
LandmarksWidget guide on the docs site.