Skip to content

xenium: read planar RGB aligned images (OME axes SYX) - #446

Open
timtreis wants to merge 2 commits into
scverse:mainfrom
timtreis:xenium-planar-rgb
Open

timtreis wants to merge 2 commits into
scverse:mainfrom
timtreis:xenium-planar-rgb

Conversation

@timtreis

@timtreis timtreis commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

xenium_aligned_image assumes that a 4-D aligned image is interleaved RGB, (1, y, x, 3), so a planar RGB OME-TIFF (axes SYX), which reads as (1, 3, y, x), fails its assertion. The function now picks the axis order from the shape, so both layouts read.

We hit this on Atera v1 bundles from Xenium Onboard Analysis 1.1.1, whose H&E image is planar. We haven't checked public Xenium bundles.

Tests: a new test writes the same image planar and interleaved and reads both to the same array. On main the planar case fails. The other 17 local failures in tests/test_xenium.py are example bundles that CI downloads.

xenium_aligned_image took a 4-D aligned image to be interleaved RGB,
(1, y, x, 3), and asserted that the last axis has length 3. A planar
RGB OME-TIFF reads as (1, 3, y, x) and failed that assertion. Pick the
axis order from the shape instead.
@codecov-commenter

codecov-commenter commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.13%. Comparing base (51ef276) to head (1a5d79b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #446      +/-   ##
==========================================
+ Coverage   66.60%   67.13%   +0.52%     
==========================================
  Files          26       26              
  Lines        3345     3347       +2     
==========================================
+ Hits         2228     2247      +19     
+ Misses       1117     1100      -17     
Files with missing lines Coverage Δ
src/spatialdata_io/readers/xenium.py 82.07% <100.00%> (+3.54%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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