Open effigies opened 3 years ago
This is related to https://github.com/nipreps/fmriprep/issues/2477. See also https://github.com/poldrack/SliceTimingCorrection for an exploration of the problem.
Starting to think making DenseRunVariable
s into wrappers for xarray.DataArray
s might be cleanest.
To quickly note the decisions in last night's call:
1) Move to xarray, defining time axis ticks as we can. 2) Get metadata from fMRIPrep indicating the temporal shift. 3) Future: Add transform for performing boxcar windowing, allowing for averaging over TA
In most tools, slice-timing correction resamples values to the middle of the volume acquisition (TR / 2 for typical sequences).
If I understand the code correctly, we:
1) Create an HRF regressor at the collection sampling rate (default: 10Hz) https://github.com/bids-standard/pybids/blob/73bfdcac6c6f57a87146d88c9ff2f665a36fc19d/bids/modeling/transformations/compute.py#L53-L58 2) Resample to TR; since this is down-sampling, we apply a Butterworth filter: https://github.com/bids-standard/pybids/blob/28b068c2ebecd2bc0e613b02d30694f6f34d2785/bids/variables/variables.py#L556-L562 And then resample around the start of the volume times: https://github.com/bids-standard/pybids/blob/28b068c2ebecd2bc0e613b02d30694f6f34d2785/bids/variables/variables.py#L566-L570
So we need to reconsider how best to handle these. I think it's good that we're oversampling by default, but when we resample to
'TR'
, we need to ensure that the sampling point corresponds to the correct point in the time series.nilearn.glm
usesframe_times
to change the sampling. We could do that in step (1) above, but I think the more correct approach is to set the frame times at the resample stage.