Slice timing after fmriprep with multi-echo data

Summary of what happened:

Hi,
I have multi-echo data.

I want to test Filtershift slice timing correction (GitHub - dpark6060/FilterShift_C: FilterShift, but now in C++).

I was considering this approach:

  1. Use fmriprep for multi-echo data without slice timing correction (STC).
  2. Apply Filtershit STC individually to each preprocessed bold echo output by fmriprep.

Does this sounds correct?

I guess a related question is if STC is done individually for each echo in fmriprep?

Thanks

Ruben

Command used (and if a helper script was used, a link to the helper script or the command generated):

PASTE CODE HERE

Version:

Environment (Docker, Singularity / Apptainer, custom installation):

Data formatted according to a validatable standard? Please provide the output of the validator:

PASTE VALIDATOR OUTPUT HERE

Relevant log outputs (up to 20 lines):

PASTE LOG OUTPUT HERE

Screenshots / relevant information:


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.

1 Like