Skip to content

vitessce fixes for single cell - #3

Open
dv-klaus-eckelt wants to merge 5 commits into
mh/dep_updatefrom
ke/vitescce-fixes-4-single-cell
Open

vitessce fixes for single cell#3
dv-klaus-eckelt wants to merge 5 commits into
mh/dep_updatefrom
ke/vitescce-fixes-4-single-cell

Conversation

@dv-klaus-eckelt

@dv-klaus-eckelt dv-klaus-eckelt commented Jul 2, 2026

Copy link
Copy Markdown

Backports coordinate-transform changes shipped directly in aevidence's packaged libs (@vitessce/spatial-utils, @vitessce/spatial-zarr .tgz)

packages/utils/spatial-utils/src/spatial.js

  • fix(spatial-utils): correct 2D affine coordinate transform matrix
    Build the 2D affine Matrix4 directly in column-major order, mapping OME-NGFF input/output axes to world x/y. Old code filled a row-major matrix, applied the axis swap on the wrong side, then transposed the accumulated matrix — turned valid affines into projective transforms whenever rotation or shear was present. Throws if the x/y axis mapping is missing.
  • feat(spatial-utils): support mapAxis coordinate transformation type
    Handle mapAxis in coordinateTransformationsToMatrix — apply axis-swap matrix when spatial input/output axis orderings differ.
  • feat(spatial-utils): flatten sequence coordinate transformations
    In normalizeCoordinateTransformations, when any top-level transform is a sequence, flatten the sequences' inner transformations instead of processing the mixed list. Resolves SpatialData-style nested transformations correctly.

packages/file-types/spatial-zarr/src/ome-loaders/OmeZarrLoader.js

  • feat(spatial-zarr): use coordinate-system-aware transform in OmeZarrLoader
    When a coordinateSystem option is set and the file defines coordinate transformations, resolve the matrix via coordinateTransformationsToMatrixForSpatialData (honors SpatialData named coordinate systems). Falls back to the previous normalize + coordinateTransformationsToMatrix path otherwise.

Checklist

  • Have tested PR with one or more demo configurations
  • Documentation added, updated, or not applicable

dv-klaus-eckelt and others added 4 commits July 2, 2026 12:07
Build the 2D affine Matrix4 directly in column-major order, mapping the
OME-NGFF input/output axes to world x/y. The previous implementation
filled a row-major matrix, applied the axis swap on the wrong side, and
then transposed the accumulated matrix, which turned valid affines into
projective transforms whenever rotation or shear was present.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Handle the `mapAxis` transform type in coordinateTransformationsToMatrix
by applying an axis-swap matrix when the spatial input and output axis
orderings differ.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When any top-level coordinate transformation is a `sequence`, normalize
by flattening the sequences' inner transformations instead of processing
the mixed list, so SpatialData-style nested transformations resolve
correctly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…oader

When a `coordinateSystem` option is provided and the file defines
coordinate transformations, resolve the transform matrix via
coordinateTransformationsToMatrixForSpatialData so SpatialData named
coordinate systems are honored. Fall back to the previous
normalize + coordinateTransformationsToMatrix path otherwise.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dv-klaus-eckelt
dv-klaus-eckelt marked this pull request as ready for review July 2, 2026 11:45
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.

2 participants