Repository navigation
Conversation
…its keypoints Xenium Explorer's alignment CSV is the least-squares fit to the keypoints the user placed. When a bundle has <sample>_he_image.ome.tif and <sample>_keypoints.csv but no alignment CSV, fit that affine and set it as the global transformation. The keypoints must have the four Xenium Explorer columns, at least 3 finite rows and points that aren't collinear; otherwise warn and leave the image at Identity, as before. A full affine rather than a similarity, because scans with 0.2% anisotropy leave about 22 px of error under a similarity fit. The aligned-image search now skips macOS ._ sidecar files, which were read as TIFFs and failed.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #447 +/- ##
==========================================
+ Coverage 66.60% 67.70% +1.09%
==========================================
Files 26 26
Lines 3345 3372 +27
==========================================
+ Hits 2228 2283 +55
+ Misses 1117 1089 -28
🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
xenium()leaves an H&E image without an alignment CSV at the identity transformation. When the bundle has<sample>_keypoints.csv, the reader now fits an affine to the keypoints and uses it, which is the least-squares fit that Xenium Explorer writes to the alignment CSV. An alignment CSV still takes precedence, and unusable keypoints give a warning and the identity, as before.We fit an affine instead of a similarity transform, because the scans we tested have about 0.2% anisotropy. A similarity fit left about 22 px of residual, and the affine left under 8 px.
We hit this on the Atera WTA preview bundles, which ship keypoints but no alignment CSV. We haven't checked public Xenium bundles. The reader also skips macOS
._files when it collects the aligned images.Tests: new tests cover the fit, the precedence of the alignment CSV and the unusable cases (other columns, fewer than 3 rows, NaN rows, collinear points, another sample's keypoints). On main, 9 of the 10 new cases fail. The other 17 local failures in
tests/test_xenium.pyare example bundles that CI downloads.