Skip to content

Allen atlas alignment follow-ups#121

Open
FIrgolitsch wants to merge 5 commits into
pr-q-perf-pipelinefrom
pr-r-allen-followups
Open

Allen atlas alignment follow-ups#121
FIrgolitsch wants to merge 5 commits into
pr-q-perf-pipelinefrom
pr-r-allen-followups

Conversation

@FIrgolitsch

@FIrgolitsch FIrgolitsch commented May 20, 2026

Copy link
Copy Markdown
Contributor

Stacked PR 18/22 — review order: #115#97#98#99#100#101#108#106#107#87#116#110#111#40#112#113#117#118#120#121#122#123#124#125

Base: pr-q-perf-pipeline. Retargets to main as upstream PRs merge.


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

  • align_to_ras zarr perf — read OME-Zarr metadata once and reuse cached arrays.
  • align_to_ras preview bg — render the preview background from the same window/level as the volume.
  • orientation bug — fix an off-by-axis when re-orienting WMO volumes.
  • ASL/PIR RAS test — extend the RAS test matrix with ASL and PIR source orientations.
  • WMO apply_transformapply_transform now 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 in dev, so they belong after the script gets restored downstream.

…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 %
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.

1 participant