Applying slice-timing correction after head motion correction is GIGO. The slice times are no longer meaningful after any translation outside of the axial plane or rotation outside the vertical axis (assuming axial slices).
That said, fMRIPrep has been reworked to make it easier to mix-and-match with other tools. I would use fmriprep with --level minimal
to calculate the transforms you need, then apply FilterShift to the raw data, and then apply the fMRIPrep transforms.
Just to throw together a directory structure:
study/
rawdata/ # Original BIDS
derivatives/
fmriprep/
freesurfer/
filtershift/
final/
You would create your minimal fmriprep derivatives with:
fmriprep rawdata derivatives/fmriprep participant \
--level=minimal --fs-subjects-dir derivatives/freesurfer \
--output-spaces $SPACES
The $SPACES
would be whatever target spaces you want at the end. fMRIPrep will calculate the transforms, but not actually resample the data into those spaces.
You would populate filtershift
as a BIDS directory. I don’t know how it’s called, but you might do something like:
cp rawdata/dataset_description.json derivatives/filtershift/
for BOLD in rawdata/**/*_bold.nii.gz; do
OUT=derivatives/filtershift/${BOLD#rawdata/}
mkdir -p $( dirname $OUT )
filtershift $BOLD $OUT
cp ${BOLD%.nii.gz}.json ${OUT%.nii.gz}.json
done
Finally, you would run fmriprep on the filtershift data with the precomputed derivatives:
fmriprep derivatives/filtershift derivatives/final participant \
--fs-subjects-dir derivatives/freesufer --fs-no-resume \
--derivatives fmriprep=derivatives/fmriprep \
--output-spaces $SPACES --ignore slicetiming
The important things here:
derivatives/filtershift
: Use the STC data as your input dataset
--derivatives fmriprep=derivatives/fmriprep
: Find precomputed anatomical and fieldmap images, along with transforms to target spaces.
--ignore slicetiming
- Don’t even try STC.
If you want to use tedana or some other ME tool for denoising, you would probably want --me-output-echos
instead of --output-spaces
at this stage.
Your final outputs will be split between fmriprep
and final
, as fMRIPrep will not copy files from input to output unnecessarily. You could combine them into a single dataset if necessary for further analysis.
This is all a bit theoretical. It’s how it should work, but there might be some kinks in the process. Please feel free to report back with your experience and we can fix bugs you find or help you work around limitations.