phys2bids
phys2bids copied to clipboard
Add multi-run workflow synchronized with BIDS dataset
Closes #217 and supersedes #219.
This is a reduced version of #219, with all extraneous changes removed. Here are the general steps for the proposed workflow:
- Load relevant (currently just BOLD) scans from BIDS dataset and determine acquisition time, duration, and generalized name for each.
- Extract trigger onsets from
BlueprintInput
object. - Attempt to match physio trigger onsets to scan onsets.
- Interpolate any missing physio trigger periods from available scans.
- Identify onsets and offsets for physio trigger periods for each frequency in the physio object.
- Slice the physio object into acquisition-specific
BlueprintOutput
s. - Save
BlueprintOutput
objects to BIDS files. - Generate a figure showing timing of scans and physio trigger periods before and after synchronization, for QC purposes.
Proposed Changes
- Add a new module,
phys2bids.synchronization
, with a function namedworkflow()
meant to perform unsupervised separation of multi-run physio files using onset-time and duration information from a converted BIDS dataset. - Add a new function,
phys2bids.bids.update_bids_name()
, which adds entities to a BIDS-format filename. - Add
phys2bids.slice4phys.slice_phys()
, a function that slices a physio object into individual runs. This is based off ofphys2bids.slice4phys.slice4phys()
, but is not linked to the existing multi-run workflow. - Update package requirements to include
scipy
,pybids
, andpandas
.
Change Type
- [ ]
bugfix
(+0.0.1) - [X]
minor
(+0.1.0) - [ ]
major
(+1.0.0) - [ ]
refactoring
(no version update) - [ ]
test
(no version update) - [ ]
infrastructure
(no version update) - [ ]
documentation
(no version update) - [ ]
other
Checklist before review
- [ ] I added everything I wanted to add to this PR.
- [X] [Code or tests only] I wrote/updated the necessary docstrings.
- [ ] [Code or tests only] I ran and passed tests locally.
- [ ] [Documentation only] I built the docs locally.
- [ ] My contribution is harmonious with the rest of the code: I'm not introducing repetitions.
- [X] My code respects the adopted style, especially linting conventions.
- [X] The title of this PR is explanatory on its own, enough to be understood as part of a changelog.
- [X] I added or indicated the right labels.
- [ ] I added information regarding the timeline of completion for this PR.
- [X] Please, comment on my PR while it's a draft and give me feedback on the development!
Codecov Report
Merging #374 (cab25c7) into master (f587559) will decrease coverage by
17.78%
. The diff coverage is15.63%
.
@@ Coverage Diff @@
## master #374 +/- ##
===========================================
- Coverage 94.61% 76.83% -17.79%
===========================================
Files 8 9 +1
Lines 836 1079 +243
===========================================
+ Hits 791 829 +38
- Misses 45 250 +205
Impacted Files | Coverage Δ | |
---|---|---|
phys2bids/synchronization.py | 0.00% <0.00%> (ø) |
|
phys2bids/slice4phys.py | 40.00% <3.63%> (-57.15%) |
:arrow_down: |
phys2bids/bids.py | 95.80% <90.00%> (-2.26%) |
:arrow_down: |
@smoia I've realized over time that, not only is FIU's current physio setup suboptimal, but it's also pretty rare. I don't think that many folks would actually find this workflow useful, and I only ended up using it for one project (FIU's now in the process of updating their physio setup). Do you mind if I close this PR?