Skip to content

Present axes in another order on request (0.10.0) - #16

Merged
davidackerman merged 1 commit into
mainfrom
axes-order-0.10
Nov 3, 2026
Merged

davidackerman merged 1 commit into
mainfrom
axes-order-0.10

Conversation

@davidackerman

@davidackerman davidackerman commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

TensorSwitch writes OME-Zarr v3 with dimension_names x, y, z, and worldarray presents the store's C order. Code that indexes axes by position then gets such an array transposed. mesh-n-bone meshes it transposed with no error, cellmap-analyze's read_onto refuses it, and cellmap-flow's blockwise input reads it transposed.

The option. open, open_pyramid and metadata take axes_order:

  • "stored" is the default, permanently: an x, y, z store read faithfully is x, y, z with its names, which name-based readers (Neuroglancer, chunkmirage, mirrors) need.
  • "zyx" moves the axes named z, y and x last, in that order, with the other axes first in stored order. A channel-last array comes out channel-first, and an array with none of those names is unchanged.
  • A sequence of names gives exactly that order.

What moves with it. The names move with the data, and shape, chunks, shards, units, voxel size and translation move with them. That covers .ts, meta, grid, reads, writes, blocks, a pyramid's placements and level_meta, level choice by voxel size, base_voxel_size, reopen and pickling. open_tensorstore stays in the store's order.

Write paths.

  • chunk_key, parse_chunk_key and list_chunks take and give indices in the presented order; the keys themselves are the store's. A selected axis keeps its stored place in a key index, as it does in level_meta.
  • add_level takes its per-axis arguments in the pyramid's order and creates the array in the group's own order.
  • codecs_of returns shards in the store's order; the spec says a mirror of a reordered handle takes vol.meta.shard_shape instead.

Spec. Convention 2 states the option and why the default stays, with Behaviours 14 and 15 and the tests section updated. It also removes a stray \1 that had been in the spec since the first draft.

https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64

TensorSwitch writes OME-Zarr v3 with dimension_names x, y, z, and
worldarray presents the store's C order, so a reader that indexes axes
by position (mesh-n-bone, cellmap-analyze's read_onto, cellmap-flow's
blockwise input) meshes or reads such an array transposed, or refuses
it.

open, open_pyramid and metadata take axes_order: "stored" (the
default, for good: an x, y, z store read faithfully is x, y, z with
its names), "zyx" (the axes named z, y and x last, the others first in
stored order) or a sequence of names. Names move with the data, and
shape, chunks, shards, units, voxel size and translation with them,
through reads, writes, a pyramid's placements and level_meta, level
choice, base_voxel_size, reopen and a pickle. Chunk keys take and give
presented indices with the store's keys, and add_level takes its
arguments in the pyramid's order. open_tensorstore stays in the
store's order.

Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
@davidackerman
davidackerman merged commit 3f5a07d into main Nov 3, 2026
4 checks passed
@davidackerman
davidackerman deleted the axes-order-0.10 branch November 3, 2026 17:17
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