Repository navigation
feat(viewer): carry RFC-4 axis orientation through to the reader - #163
Merged
davehorsfall merged 1 commit intoNov 5, 2026
Merged
Conversation
Phase 0 of #158: the metadata survives being read. Nothing in the interface uses it yet. Axes now reach `SourceData` as the metadata declared them, rather than only as a list of names, so orientation and unit are available to whatever reads them next. Two separate things were dropping the field, and either alone was enough to lose it. The schema stripped it, since a non-strict `z.object` discards what it does not declare; that is fixed in BioNGFF/zod-ome-ngff#2. And `getNgffAxes` rebuilt every axis from `name`, `type` and `unit`, which it now spreads instead -- the next RFC to add a field would otherwise be lost in the same place. WHILE THE SCHEMA PULL REQUEST IS OPEN this pins `zod-ome-ngff` to its branch. That must go back to `#dev` before this is merged, and is why this is a draft. A plain image, a plate and a well read their axes through different code, so each had its own way of losing the orientation, and the tests cover all three. An image never passes through `getNgffAxes` at all -- it reads axes through `getDefaultCoordinateSystem`, which returns them untouched -- so a test of images alone passed with the fix reverted. The plate and the well are what make it load-bearing. The generated fixtures gained orientation on their spatial axes, using the values from the RFC's own example, so the offline suite covers it at all: the conformance corpus is the better test and is remote, which means CI never runs it. The time and channel axes are left alone, since RFC-4 permits orientation only on axes of type `space`. Offline 46 to 50 tests. The corpus tests now assert orientation reaches the viewer rather than only that the corpus declares it. Refs #158 Co-Authored-By: Claude Opus 5 <[email protected]>
davehorsfall
added a commit
that referenced
this pull request
Nov 3, 2026
The page used "today" to mean two different things one section apart: that an image carrying orientation opens normally, which is true of the release, and that TC-C_invalid_vocabulary does not open, which is only true once the reader starts validating orientation on #163. A reader on the released viewer would have found the second claim false and had no way to tell why. Each behaviour now names the version it belongs to. The note about TC-C being untested says what the choice is -- not writing a test that pins down a decision still open -- rather than claiming the case cannot be opened at all, which is untrue on `dev`. Co-Authored-By: Claude Opus 5 <[email protected]>
davehorsfall
marked this pull request as ready for review
November 5, 2026 15:09
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Phase 0 of #158: RFC-4 axis orientation survives being read. Nothing in the interface uses
it yet.
Based on
test/rfc4-orientation-corpus(#160), notdev— it extends the corpus testsadded there with the orientation assertions this change makes possible.
What changed
Axes now reach
SourceDataas the metadata declared them, not only as a list of names, soorientation and unit are available to whatever reads them next.
Two separate things were dropping the field, and either alone was enough to lose it:
z.objectdiscards what it does not declare. Fixed inAdd RFC-4 axis orientation, and stop v0.6 dropping axis units zod-ome-ngff#2.
getNgffAxes, which rebuilt every axis fromname,typeandunit. It spreadsnow, so the next RFC to add a field is not lost in the same place.
A test that passed for the wrong reason
The first version of the offline test covered images only, and passed with the fix
reverted. A plain image never goes through
getNgffAxesat all: it reads its axes viagetDefaultCoordinateSystem, which returns them untouched. For images the schema was theonly thing stripping orientation.
getNgffAxesis on the plate and well paths. With those added, reverting the change failsproperly:
So the test now covers an image, a plate and a well, because each reaches its axes through
different code and each has its own way of losing the field.
Fixtures
The generated fixtures gained orientation on their spatial axes, using the values from the
RFC's own example so the two can be read side by side. The time and channel axes are left
alone — RFC-4 permits orientation only on
space.This is so the offline suite covers orientation at all: the conformance corpus is the
better test of it and is remote, which means CI never runs it. The fixture diff is purely
additive.
Checks
pnpm test— 50 passed, up from 46pnpm test:remotefor the corpus — 41 passed, now asserting orientation reaches theviewer rather than only that the corpus declares it
pnpm lint,pnpm check— cleanNext
Phase 1 is the interface: edge labels for in-plane axes, direction on the slider for the
through-plane one. Phase 2 is the warnings. Both are described in #158.
🤖 Generated with Claude Code