Skip to content

WIP: Add partial volume correction workflow to PETPrep #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 6, 2025

Conversation

mnoergaard
Copy link
Collaborator

The work branch introduces partial volume correction (PVC) workflow options. Documentation now clarifies that when PVC is enabled, the corrected images are aligned to anatomy and propagate through subsequent spatial normalization steps. The CLI initializes output spaces to include native T1w by default, and configuration now records the chosen PVC tool alongside method and PSF parameters.

PVC interfaces include updated label handling: Binarise4DSegmentation now preserves background labels, and CSVtoNifti expects the label list to contain background as the first entry. Workflow logic uses these corrected images as inputs for standard‑space derivatives. When PVC is enabled, the workflow forwards the method name to output datasinks so derivative files include a _pvc- entity.

Tests verify that the PVC method propagates to derivatives and that PVC‑corrected images feed into standard‑space workflows. Unit tests for segmentation focus on helper functions and node selection.

Major changes

  1. PVC parameters are now stored in configuration and propagated through datasinks.
  2. Standard-space resampling uses PVC outputs when available, improving derivative consistency.

Copy link

codecov bot commented Jul 1, 2025

Codecov Report

Attention: Patch coverage is 0% with 117 lines in your changes missing coverage. Please review.

Project coverage is 0.39%. Comparing base (8c27a7a) to head (6d3339f).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
petprep/workflows/pet/tests/test_base.py 0.00% 44 Missing ⚠️
petprep/interfaces/pvc.py 0.00% 23 Missing ⚠️
petprep/workflows/pet/base.py 0.00% 21 Missing ⚠️
petprep/cli/parser.py 0.00% 12 Missing ⚠️
petprep/cli/tests/test_parser.py 0.00% 7 Missing ⚠️
petprep/workflows/pet/pvc.py 0.00% 4 Missing ⚠️
petprep/config.py 0.00% 2 Missing ⚠️
petprep/workflows/pet/outputs.py 0.00% 2 Missing ⚠️
petprep/workflows/pet/resampling.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main     #35      +/-   ##
========================================
- Coverage   0.40%   0.39%   -0.02%     
========================================
  Files         69      69              
  Lines       4893    5026     +133     
  Branches     533     540       +7     
========================================
  Hits          20      20              
- Misses      4873    5006     +133     

☔ 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.

@mnoergaard mnoergaard merged commit 5d166f4 into main Jul 6, 2025
0 of 13 checks passed
@mnoergaard mnoergaard mentioned this pull request Jul 9, 2025
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.

2 participants