Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

chunkmirage

Browse a computation as if it were a stored dataset: in any viewer, at any scale, before anyone has computed it.

chunkmirage serves virtual datasets that look, to any HTTP-capable viewer or library (Neuroglancer, BigDataViewer/Fiji, vizarr, napari, webKnossos, zarr-python, dask, tensorstore, ...), like ordinary Zarr v2, Zarr v3, N5 or Neuroglancer precomputed volumes, pyramid of levels included. Nothing exists on disk. Each chunk is computed when a viewer asks for it: read from a real source (zarr, N5, precomputed, HDF5, GeoTIFF; local, S3, GCS or HTTP) or generated, pushed through a pipeline of ops, encoded in the format the client asked for, and cached per stage. The chunks on screen are computed first, at the level shown, and work nobody waits for any more is dropped, which is what panning and zooming over an expensive op needs. Zoomed out, you see the ops run on that coarser level (an op bound to one resolution runs there and is downsampled), so a coarse view is a preview of the fine result, not its exact downsample. And since every stage is cached by what made it, changing a parameter recomputes only the stages after it, and viewers refetch.

▶ Try the demos in your browser, nothing to install. Every chunk on screen is computed in the page by chunkmirage's own Python, from public data, as the viewer asks for it.

Los Angeles fires: burn severity, read by Neuroglancer, a web map or GDAL A 3-D fractal 2^28 voxels across The Gulf Stream's fronts cellmap-flow: a model's predictions over an electron-microscopy volume, browsed as it predicts

They include burn severity of the Los Angeles fires, the Gulf Stream's fronts and hurricanes' cold wakes, landing slopes at the Moon's south pole, a 3-D fractal, microscope tiles stitched by RANSAC, two fly brains registered on your GPU, organelle contact sites, mRNA spots and nuclei tracked through a colony. The last is another project's page: cellmap-flow runs on chunkmirage in both its modes, serving a model's predictions over an electron-microscopy volume as you browse, from a cluster's GPUs or, in its browser mode, from your own on chunkmirage's browser engine. Each shows the chunkmirage serve command that serves the same from Python, and most take Python of your own, run on a layer's chunks in the page and edited live. The demos page lists them all, with the Python examples.

How it works

viewer  --HTTP-->  chunkmirage  --tensorstore/h5py-->  real data (zarr/n5/precomputed/hdf5, file/s3/gcs/http)
                      |
                      +-- pipeline: source -> [op, op, ...] -> encoded chunk
                      +-- per-stage chunk cache keyed by pipeline hash
                      +-- frontends: n5 | zarr (v2) | zarr3 | precomputed, all served at once
                      +-- REST API for live pipeline edits, and plugins for ops, sources and routes

It was inspired by example-virtual-n5 and cellmap-flow, which grew out of it, and makes their trick general: any format, any source, any per-chunk computation, any client.

Quick start

uv sync --extra all --group dev            # or: pip install -e ".[all]"
chunkmirage serve /path/to/data.zarr/em/fibsem-uint8 --op threshold:low=120

With no data at all, a generated 4096³ volume, segmented live:

uv run chunkmirage serve "synthetic://blobs+noise?shape=4096,4096,4096" \
    --op gaussian:sigma=1.5 --op threshold:low=110 \
    --op morphology:operation=open,radius=2 --op label:min_size=200 --python-viewer

Open the printed viewer link and pan and zoom: each chunk is computed as it comes on screen, the level you are at first, and zooming out runs the same ops on the coarser levels. Then open the control page (http://<your-ip>:8000/ui) and drag the threshold's low slider: only the changed stage recomputes. Or point any viewer at one of these:

viewer source URL format
n5://http://localhost:8000/<name>/n5 N5
zarr://http://localhost:8000/<name>/zarr Zarr v2 (+ OME-NGFF 0.4)
zarr3://http://localhost:8000/<name>/zarr3 Zarr v3 (+ OME-NGFF 0.5)
precomputed://http://localhost:8000/<name>/precomputed Neuroglancer precomputed

Edit the pipeline without restarting:

curl -X PUT localhost:8000/api/datasets/<name> -H 'content-type: application/json' \
  -d '{"source": "/path/to/data.zarr/em/fibsem-uint8", "ops": [{"op": "threshold", "low": 150}]}'

More in getting started, including viewing from another machine.

As a library

from chunkmirage import Pipeline, open_source, create_app
from chunkmirage.ops import Op
from chunkmirage_contrib.ops import Threshold

class MyModel(Op):
    name = "my_model"
    halo = 16          # voxels of context read on every side
    cache = True       # keep this stage's output chunks

    def apply(self, block):
        return run_my_network(block)

pipe = Pipeline(open_source("s3://bucket/data.zarr/em/s0"), ops=[MyModel(), Threshold(low=120)])
app = create_app({"em": pipe})                   # a Starlette ASGI app

Ops, source schemes and HTTP routes from other packages register through entry points (chunkmirage.ops, chunkmirage.sources, chunkmirage.routes), and the app can be mounted inside another one. See pipelines and the REST API.

What it does today

  • Sources: zarr v2/v3, N5, precomputed and HDF5 on file, S3, GCS or HTTP; xarray arrays and GeoTIFFs; computed synthetic:// volumes, scene:// resampling through OME-Zarr 0.6 transformations, register:// deformable registration solved on a GPU, stitch:// BigStitcher tiles stitched and fused as read, and warp://, stack:// and flip://.
  • Frontends: N5, Zarr v2, Zarr v3 and precomputed, all at once, and meshes made when fetched.
  • Ops: pointwise, filters, morphology, connected components, spots, contacts, downsampling, slope and hillshade, with halos handled for you.
  • Serving: per-stage cache, live REST edits, a control page, work ordered by what clients ask for and dropped when they stop waiting.
  • In the browser: the same ops run in Pyodide, and registration on WebGPU.
  • Your own Python: a python op carries its code in the pipeline, edited live like a Neuroglancer shader, in the browser demos (where a chat writes it from a request, with your own key for Claude, OpenAI, Gemini or others) and on a server started with --allow-code. An op you will reuse is a class in your own package.

Not yet: GPU ops other than registration, an MCP server. See the roadmap.

Documentation

https://janeliascicomp.github.io/chunkmirage/ (built from docs/; uv run mkdocs serve locally). the design page explains the architecture and the choices behind it.

License

BSD 3-Clause, Howard Hughes Medical Institute. Authors: TBD (collaborative project).

Metadata

Release files for chunkmirage 0.1.0a4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chunkmirage 0.1.0a4
File Size Uploaded Provenance
chunkmirage-0.1.0a4.tar.gz 1.8 MB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for chunkmirage 0.1.0a4
File Interpreter ABI Platform
chunkmirage-0.1.0a4-py3-none-any.whl Python 3 none any Details

Total release size: 2.0 MB

Release files / chunkmirage-0.1.0a4.tar.gz

Download URL chunkmirage-0.1.0a4.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
91c60886d7edbba43a25c5ff28742c06806addb3bb8a9e659dd7b2fd994844ed
BLAKE2b-256 checksum
How to use checksums
98ceb7f1de99e624e03218e36859eecd519e6498372f048e452d30e180d20604
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / chunkmirage-0.1.0a4-py3-none-any.whl

Download URL chunkmirage-0.1.0a4-py3-none-any.whl
Size 202.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
10d59dd8df5ac7c04a876c9b270aa96b29900c630acde16d172b690efb0aaf56
BLAKE2b-256 checksum
How to use checksums
db9bf5ff89b887be26b47f344f29e5cd12b80d90e3adc9f5106ac05c305721b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for chunkmirage 0.1.0a4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for chunkmirage-0.1.0a4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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