fmriprep is a package developed by the Poldrack lab to do the minimal preprocessing of fMRI data required. It covers brain extraction, motion correction, field unwarping, and registration. It uses a combination of well-known software packages (e.g., FSL, SPM, ANTS, AFNI) and selects the 'best' implementation of each preprocessing step.
Once installed, fmriprep
can be invoked from the command line. We can even run it inside this notebook! The following command should work after you remove the 'hashtag' #
.
However, running fmriprep takes quite some time (we included the hashtag to prevent you from accidentally running it). You'll most likely want to run it in parallel on a computing cluster.
#!fmriprep \
# --ignore slicetiming \
# --ignore fieldmaps \
# --output-space template \
# --template MNI152NLin2009cAsym \
# --template-resampling-grid 2mm \
# --fs-no-reconall \
# --fs-license-file \
# ../license.txt \
# ../data/ds000030 ../data/ds000030/derivatives/fmriprep participant
The command above consists of the following parts:
--ignore slicetiming
tells fmriprep to not perform slice timing correction--ignore fieldmaps
tells fmriprep to not perform distortion correction (unfortunately, there are no field maps available in this data set)--output-space template
tells fmriprep to normalize (register) data to a template--template MNI152NLin2009cAsym
tells fmriprep that the template should be MNI152 version 6 (2009c)--template-resampling-grid 2mm
tells fmriprep to resample the output images to 2mm isotropic resolution--fs-license-file ../../license.txt
tells fmriprep where to find the license.txt-file for freesurfer - you can ignore thisbids
is the name of the folder containing the data in bids formatoutput_folder
is the name of the folder where we want the preprocessed data to be stored,participant
tells fmriprep to run only at the participant level (and not, for example, at the group level - you can forget about this)The official documentation contains all possible arguments you can pass.
fmriprep makes use of Nipype, a pipelining tool for preprocessing neuroimaging data. Nipype makes it easy to share and document pipelines and run them in parallel on a computing cluster. If you would like to build your own preprocessing pipelines, a good resource to get started is this tutorial.