Skip to content

Two spec mismatches from cellmap-flow: source_voxel_size under relabel, box under resample (0.3.1) - #5

Merged
davidackerman merged 3 commits into
mainfrom
fix-source-voxel-size
Oct 23, 2026
Merged

davidackerman merged 3 commits into
mainfrom
fix-source-voxel-size

Conversation

@davidackerman

@davidackerman davidackerman commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Two fixes from cellmap-flow's migration, both cases where the code disagreed with the spec, and two small additions. No voxel moves in any read.

  • source_voxel_size now reports the stored level's voxel size under on_mismatch="relabel", as spec section 2 says. It used to report the relabelled size, because relabel renames the grid and the property read the renamed grid. A funlib level at 16, 4, 4 nm opened with voxel_size=(8, 8, 8) and relabel reported 8, 8, 8.
  • box of an array opened with a resample target is now the extent of the target voxels shape counts, as the spec's [corner, corner + shape * voxel_size) says and as Grid.from_meta(meta, voxel_size=t).box already was. It used to be the stored data's extent, so read(box) could return fewer voxels than shape: 7 voxels of 8 nm read at 24 nm gave a box ending at 56 nm, with shape saying 3. Now it ends at 72 nm.
  • The unit table knows kilometres (kilometer, kilometre, km, 1e3 m): they convert, abbreviate to km, and ome_multiscales writes them as OME's kilometer instead of as given. chunkmirage asked for this so it can drop its own unit table.
  • The README's placement rule gains the corner formula corner = translation - voxel_size / 2, a worked example (8 nm voxels, corner 0, translation 4), why the centre is the model, and how the read rule follows from it.

No consumer repo reads source_voxel_size today; cellmap-flow reads resampled arrays by read_index and is unaffected by the box change. Version 0.3.1, changelog entries added, and both new fix tests fail on main.

https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64

on_mismatch="relabel" renamed the grid and source_voxel_size read the renamed
grid, so it reported the requested size; the spec says the stored level's.
Reads, voxel_size, translation and corner are unchanged. Reported by
cellmap-flow. Version 0.3.1.

Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
With a resample target, box was the stored data's extent while shape,
voxel_size and translation were the target grid's, so read(box) could return
fewer voxels than shape (7 voxels of 8 nm at 24 nm: box ended at 56 nm, shape
said 3). box is now the extent of the target voxels shape counts, as the
spec's [corner, corner + shape * voxel_size) says and as Grid.from_meta's box
already was. resample.target_range is shared by both. Found by cellmap-flow.

Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
@davidackerman davidackerman changed the title source_voxel_size is the stored level's under relabel (0.3.1) Two spec mismatches from cellmap-flow: source_voxel_size under relabel, box under resample (0.3.1) Oct 22, 2026
kilometer/kilometre/km at 1e3 m convert, abbreviate to km and are written as OME's
kilometer (chunkmirage's ask). The README's placement rule gains the corner formula, a
worked example, why the centre is the model and how the read rule follows from it.

Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
@davidackerman
davidackerman marked this pull request as ready for review October 23, 2026 00:20
@davidackerman
davidackerman merged commit 9072492 into main Oct 23, 2026
4 checks passed
@davidackerman
davidackerman deleted the fix-source-voxel-size branch October 23, 2026 00:20
@davidackerman davidackerman mentioned this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant