Skip to content

WIP: Add configurable longitudinal anatomical reference processing#301

Open
mnoergaard wants to merge 10 commits intomainfrom
add_longitudinal_proc
Open

WIP: Add configurable longitudinal anatomical reference processing#301
mnoergaard wants to merge 10 commits intomainfrom
add_longitudinal_proc

Conversation

@mnoergaard
Copy link
Copy Markdown
Collaborator

This PR addresses issue #300, updating the longitudinal processing by replacing the old boolean --longitudinal behavior with a new --subject-anatomical-reference option supporting:

  1. first-lex: default, aligns anatomical references to the first lexicographic T1w image

  2. unbiased: builds an unbiased longitudinal template, equivalent to the deprecated --longitudinal

  3. sessionwise: builds independent anatomical workflows per session

The workflow now creates explicit subject/session processing groups, applies session-specific BIDS filters when running sessionwise, names session workflows distinctly, and threads session-aware FreeSurfer subject IDs into the anatomical workflow. The deprecated --longitudinal flag remains available as an alias for --subject-anatomical-reference unbiased.

This also adds config serialization support for processing groups, updates documentation for longitudinal/sessionwise behavior, and expands tests around CLI parsing, config round-tripping, sessionwise workflow construction, and Nipype-safe subject/session ID generation.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

Codecov Report

❌ Patch coverage is 98.42105% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.30%. Comparing base (d4193e2) to head (e366441).

Files with missing lines Patch % Lines
petprep/cli/parser.py 95.45% 0 Missing and 1 partial ⚠️
petprep/config.py 97.14% 0 Missing and 1 partial ⚠️
petprep/workflows/base.py 97.36% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #301      +/-   ##
==========================================
+ Coverage   83.69%   84.30%   +0.61%     
==========================================
  Files          87       87              
  Lines        8600     8776     +176     
  Branches      916      946      +30     
==========================================
+ Hits         7198     7399     +201     
+ Misses       1174     1147      -27     
- Partials      228      230       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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