ENH: Reconcile PET timing and decay correction when combining runs#326
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #326 +/- ##
==========================================
+ Coverage 86.43% 87.05% +0.62%
==========================================
Files 89 89
Lines 10077 10525 +448
Branches 1060 1129 +69
==========================================
+ Hits 8710 9163 +453
+ Misses 1134 1133 -1
+ Partials 233 229 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@mathesong and @bendhouseart - any feedback to this? Otherwise, I will go ahead and merge it, and then we can update it, if any issues appear. |
|
A few review points at this stage: [P1] Incompatible decay correction silently falls through to concatenation. [P1] Heuristic “contiguous run” offsets are treated as exact decay timing. [P2] TimeZero and InjectionStart are not checked for consistency. |
…to fix_combine_runs_time
Summary
This PR addresses issue #325 by improving PETPreps
--combine-runsworkflow handling for PET datasets where multiple runs belong to the same tracer injection but later runs use their ownTimeZero.Previously, PETPrep treated runs whose
FrameTimesStartbegan at0as contiguous with the previous run, which could incorrectly remove real gaps between acquisitions. The combine step now uses BIDS PET timing metadata to place all runs onto the first run’s timing reference.Changes
FrameTimesStartusingTimeZero, falling back toInjectionStartwhen needed.FrameReferenceTimeand merge frame-wise metadata across runs.ImageDecayCorrectionTimewhen runs were corrected to different reference times andRadionuclideHalfLifeis available.--combine-runstiming behavior.