Skip to content

Standardized preprocessing in one go with fMRIPrep

What is fMRIPrep?

fMRIPrep is a standardize preprocessing pipeline that uses different programs to do structural and functional MRI preprocessing.

How to use it?

When you are using the clinic server follow these instructions: 1. Download templateflow from Github Templateflow is a collection of brain templates (atlases). Download it as a ZIP file and unzip it in your HOME directory (e.g. home/yourname).

  1. Change the server to mri043 by running the following command in a terminal:

    Bash
    ssh -X mri043
    

    This is the server where singularity is installed, a containerization software that we will use to run the fMRIprep image. You will need to type in your password to change to this server.

  2. Run in a terminal the commands:

    Bash
    export TEMPLATEFLOW_HOME=/home/yourname/templateflow
    export SINGULARITYENV_TEMPLATEFLOW_HOME=/home/fmriprep/.cache/templateflow
    

    This sets two environment variables that will tell fMRIprep where to look for the brain templates from templateflow.

  3. To run the singularity image, execute the following command:

    Bash
    singularity run --home $HOME --cleanenv -B /path/to/dataset/:/base /imaging/Vogelbacher/transfer/fmriprep-20-2-0rc.simg /base /base/derivatives participant --participant-label 01 02 03 --fs-license-file path/to/license.txt --nthreads 16
    

    /path/to/dataset/ is the path to where you stored your BIDS conform dataset. The numbers after --participant-label are the number labels of the participants that you want to preprocess. path/to/license.txt refers to the path where you saved the Freesurfer license. A good place to store it is in the /code subfolder of your data set, as this will be ignored by the BIDS validation in the beginning of the fMRIprep workflow. See the fMRIprep documentation for additional options you might want to specify.