Repository navigation
Run on a region in the browser: a box or the whole volume, saved as OME-Zarr in a folder on the machine - #135
Merged
Merged
Conversation
…hole volume, saved as OME-Zarr in a folder on the machine A browser-only Run tab. Tick the served models (all by default); draw a box in the viewer (Draw a box adds a run_region annotation layer whose tool is Neuroglancer's bounding box, two Ctrl+clicks at opposite corners; a legacy annotation tool, which toolBindings cannot take), or pick Whole volume, or type the offset and size in nm. The tab says each model's box in voxels and chunks at the level it is served at and warns of a run of more than 2,000 chunks. Choose folder... picks a folder with the File System Access API (kept in IndexedDB, its write permission asked again in the Run click after a reload). Run writes each model, one after another, to <folder>/<model>.zarr through chunkmirage's Engine.materialize (the layer's own view at its one level: what the viewer shows, postprocessing applied), as zarr v2 with OME-Zarr 0.4 metadata, gzip or none (Compression: None for Fiji, which reads no gzip), empty chunks left out, with progress, time left and Cancel; the viewer's own chunks go first. A <model>.zarr already there is replaced only after a confirm. The group attributes record the model, variant, chain, dataset, region and time under cellmap_flow. Show the saved predictions in the viewer opens each zarr as a "<model> (saved)" layer read back through the service worker's local/ route. Without File System Access (Firefox, Safari) a run of up to 256 MB is offered as a zip. Nothing of the walk or the zarr writing is here: it is the engine's. web/chunkmirage.lock still names 9eaf308, which has no materialize; it is bumped once chunkmirage has the method. Checked in headless Chromium: the box drawn with two Ctrl+clicks fills the fields; a 4-chunk box of setup_53_2d written to a folder (the origin's private file system standing in for the picker) in 15 s; the result opened by zarr-python 2.18 (scale 16 nm, translation 4 nm, the level's full shape, values in [0, 1], zero outside the box, provenance in the attributes) and by the viewer as the saved layer.
…SciComp/chunkmirage#39), which Run on a region calls
… be dropped on it
Typing in the region's fields redraws the run_region layer's box to match
once typing pauses (400 ms; at once on change), as a box drawn fills the
fields: withBox writes the region into the layer's own coordinate space
(coordsFromNm, pointerNm backwards) as its one box, and a box read back a
little off (Neuroglancer keeps corners as 32-bit floats) is not taken as a
new one (sameRegion).
A folder dropped on the Output folder block is used as the picker's would
be, the browser asking to allow writing to it at Run. The note says Chrome
refuses Downloads and the home folder themselves ("it contains system
files"): a folder made inside one works.
davidackerman
added a commit
that referenced
this pull request
Oct 16, 2026
…ize, a folder can be dropped # Conflicts: # web/test/unit/viewer-state.test.ts
… by its translation
The Run tab asks Engine.materialize for extent "box": the zarr is an array of
the region's voxels (hi − lo on the served level), not the level's whole shape
with the box's chunks in it, and its OME translation puts its voxel 0 on the
level's voxel lo, so Neuroglancer and napari still place it where the model's
layer is. chunkmirage stitches the saved chunks from the model's, so a box off
the chunks' edges computes more chunks than it saves: the plan says both
("saved as that box ...; computes N chunks"), its size is the saved chunks',
and the progress and time left go by the chunks computed.
Needs chunkmirage with extent "box" (feature/materialize-box); the lock is
bumped once that is merged.
davidackerman
added a commit
that referenced
this pull request
Oct 16, 2026
… memory, and can snap its corner onto a chunk edge A box whose corner is inside the model's chunks along several axes is stitched from them, and chunkmirage holds up to a slab of the saved array's chunks while it does. The tab asks Engine.materializePlan (computing nothing) and, above 512 MB, says how much and what putting the corner on a chunk edge along one axis would hold, with a button that does it (snappedRegion: the corner moved back to its chunk's start, rounded up to a whole nm so that a 10.48 nm voxel does not land it a voxel short, the far side kept). On jrc_hela-2 with setup_53, a box over 90% of the volume held 953 MB; Snap z brought it to 12 MB. The lock is chunkmirage d6fd94a, with #43's materializePlan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is part of the batch, #137. Merging #137 with a merge commit marks this PR merged too.
The browser app gets a Run tab. It computes the served models over a box, or over the whole volume, and saves each result as an OME-Zarr in a folder you pick on your machine. Until now, a model in the browser computed only the chunks the viewer asked for, and nothing was kept.
How to use it:
What it writes:
<folder>/<model>.zarrper ticked model.cellmap_flowin the attributes.The engine work is chunkmirage's
Engine.materialize(JaneliaSciComp/chunkmirage#39, merged): it walks the chunk grid in the background behind the viewer's requests, keeping a slot free for them. This PR pinsweb/chunkmirage.lockto its merge commit, 74ba52e. cellmap-flow only builds the panel, the region and the output folder:web/src/run-region/region.ts: the box in voxels and chunks.run.ts: one model's run.output.ts: the folder or zip store.panel.ts: the tab.The box is drawn with Neuroglancer's legacy
annotateBoundingBoxtool set on therun_regionlayer. That's why it's Ctrl+click: a key binding for that tool is silently dropped by this Neuroglancer build.Checked in headless Chromium against the merged chunkmirage:
setup_53_2don jrc_mus-liver was written in 14 s.cellmap_flow.npm run checkpasses (typecheck, 1465 tests, build).