Skip to content

Conversation

@mnoergaard
Copy link
Collaborator

This PR addresses issue #169 by implementing a visualization of the head motion correction, similarly as produced by petprep_hmc. This allows the user to visually inspect the data before and after motion, and is a nice addition to the carpet plot visualization above showing the DVARS and framewise displacement.

@mnoergaard mnoergaard requested a review from mathesong November 17, 2025 12:55
@mnoergaard mnoergaard changed the title WIP: Add visualization of head motion correction ENH: Add visualization of head motion correction Nov 17, 2025
@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

❌ Patch coverage is 95.63319% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.23%. Comparing base (b76cd74) to head (217772b).
⚠️ Report is 38 commits behind head on main.

Files with missing lines Patch % Lines
petprep/interfaces/motion.py 95.27% 3 Missing and 4 partials ⚠️
petprep/workflows/pet/base.py 66.66% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   79.66%   80.23%   +0.57%     
==========================================
  Files          82       84       +2     
  Lines        6138     6366     +228     
  Branches      618      638      +20     
==========================================
+ Hits         4890     5108     +218     
- Misses       1092     1096       +4     
- Partials      156      162       +6     

☔ 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
Copy link
Collaborator Author

mnoergaard commented Nov 19, 2025

Think I am quite happy with the state of this now - @mathesong WDYT?

You can patch in the code from this PR when running PETPrep with Docker using
--patch petprep=/github_path/petprep/petprep

Skærmbillede 2025-11-19 kl  10 07 45 AM

@mnoergaard mnoergaard merged commit f895f87 into main Nov 19, 2025
21 checks passed
@mnoergaard mnoergaard deleted the add_hmc_visual branch November 19, 2025 14:54
@mathesong
Copy link

This looks awesome!! This is just what we've been missing. And I really like the markers of the larger overall displacement too! I've just been running PETPrep on a large dataset for the last two days, so maybe I'll run it again over the weekend to get the snazzy new motion plots.

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.

3 participants