Allen atlas alignment follow-ups#121
Open
FIrgolitsch wants to merge 5 commits into
Open
Conversation
…lace rint/clip, contig once, sample bg estimate)
…test
The Allen ABC Atlas docs describe `average_template_<res>.nrrd` as ASL
("first axis is anterior-to-posterior, second is superior-to-inferior,
third is left-to-right"), while the rest of linumpy uses the
NIfTI/radiology convention where each letter names the direction the
axis points toward -- under which the same layout is PIR. Both names
describe the identical voxel layout, but the existing docstring only
mentioned PIR, which made it easy to suspect the conversion code when a
downstream RAS preview looked flipped.
* Rewrite the `download_template_ras_aligned` docstring to spell out
both names, cite the empirical landmarks (olfactory tip vs. cerebellum
along SITK X), and note that the legacy informatics-archive nrrd and
the newer ABC-Atlas template share this orientation. The
`PermuteAxes((2, 0, 1)) + Flip(F, T, T)` recipe is unchanged --
verified correct on the cached 100 µm template.
* Add `TestRealAllenTemplateOrientation` (skipped when the nrrd is not
cached) so future changes to either the upstream file or the RAS
recipe trip a regression test:
- raw nrrd: anterior tip < posterior mass on SITK X (PIR/ASL)
- RAS-aligned: +dim1 mass concentrated at anterior end
- RAS-aligned: dim2 (R) mass roughly L/R symmetric within 10 %
This was referenced May 20, 2026
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.
Allen atlas alignment follow-ups
Stacked on the new pr-q-perf-pipeline. Five small follow-ups to the Allen / RAS alignment work originally landed in #101.
Commits
apply_transformnow accepts a reference grid + py3.12 compat fixes.These could not be folded back into #101 because pr-i (#108) deletes
scripts/linum_align_to_ras.py; the follow-ups touch the script as it lives indev, so they belong after the script gets restored downstream.