Skip to content

Drop tissue-mask transforms from longitudinal anat (Stage 4 of #301)#314

Merged
nx10 merged 2 commits into
mainfrom
refactor/longitudinal-stage-4
Apr 15, 2026
Merged

Drop tissue-mask transforms from longitudinal anat (Stage 4 of #301)#314
nx10 merged 2 commits into
mainfrom
refactor/longitudinal-stage-4

Conversation

@nx10
Copy link
Copy Markdown
Contributor

@nx10 nx10 commented Apr 15, 2026

Summary

  • Tracker: Longitudinal pipeline: refactor and release readiness (tracker) #301, Stage 4. Drops csf/gm/wm tissue-mask transforms from the longitudinal anatomical workflow (Jason handover comment Update project description, reorg modules #5 — nothing downstream consumes them in longitudinal space, so the transforms were wasted work).
  • Removes csf_mask/gm_mask/wm_mask from AnatomicalLongOutputs, the matching _xfm(...) calls in workflows/longitudinal/anatomical.py::longitudinal_process, and the corresponding entries in bids/longitudinal/anatomical.py::{resolve_longitudinal_anat, export_longitudinal_anat}.
  • Trims the three obsolete *_space-longitudinal_desc-{csf,gm,wm}_mask.nii.gz rows from docs/data_dictionary.md.

Stage checklist

  • Remove tissue-mask fields from AnatomicalLongOutputs
  • Drop the corresponding _xfm() calls in longitudinal_process
  • Simplify export_longitudinal_anat to keep only brain + brain_mask + xfms
  • Remove tissue-mask keys from resolve_longitudinal_anat
  • Explicit unit test asserting csf/gm/wm masks are NOT produced under space-longitudinal
  • Update docs/data_dictionary.md

Test plan

  • uv run pytest -m unit — 769 passed, 1 skipped
  • uv run ruff check src/ tests/
  • uv run ruff format src/ tests/
  • uv run mypy src/ tests/
  • Nightly pytest -m integration --runner docker once merged (per plan; longitudinal integration tier reuses the ds000114 fixture from Add ds000114 fixture infrastructure for longitudinal tests #307)

Tissue masks (csf/gm/wm) were being warped into longitudinal template
space even though nothing downstream consumes them there; per Jason's
handover note #5 this is wasted work. Removes the fields from
`AnatomicalLongOutputs`, the `_xfm()` calls in `longitudinal_process`,
and the matching resolve/export entries under `space-longitudinal`.

Adds a unit test asserting the tissue masks are not produced, and trims
the three obsolete rows from `docs/data_dictionary.md`.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 15, 2026

Coverage

Tests Skipped Failures Errors Time
773 0 💤 0 ❌ 0 🔥 11.432s ⏱️

- Flag the xfm filename quirk (space-longitudinal + from-/to- is
  redundant) with a comment pointing at handover note #18, so the
  hard-coded expected names are not mistaken for a spec.
- Replace the Mock-based longitudinal anat outputs in the orchestration
  tests with a real AnatomicalLongOutputs NamedTuple so attribute typos
  fail loudly instead of silently returning a new Mock.
- Add resolve_longitudinal_anat unit tests covering the happy path,
  brain_mask optionality, and bids_safe_label round-trip for session
  labels with non-alphanumerics.
@nx10 nx10 merged commit 1e51d03 into main Apr 15, 2026
8 checks passed
@nx10 nx10 deleted the refactor/longitudinal-stage-4 branch April 15, 2026 21:43
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