Skip to content

Latest commit

 

History

History
73 lines (40 loc) · 3.32 KB

2. fmriprepOnBeluga.md

File metadata and controls

73 lines (40 loc) · 3.32 KB

fmriprep, as a pre-processing pipeline

fmriprep

Here is the main website for information on the usage of fmriprep: https://fmriprep.readthedocs.io/en/stable/usage.html

While fmriprep is built using a docker container, beluga doesn't allow docker because the files are not secured. Hence, they only allow singularity.

What we will need to do is import and download a docker image inside a singularity. This will be done either on your scratch where you should run your analysis.

First on your directory of interest. In this case, your scratch.

cd /home/username/scratch

To download a singularity image, you will need to load the singularity module

module load singularity/3.2

Then you you will install the fmriprep image.

singularity pull --name fmriprep.VERSION.simg docker://poldracklab/fmriprep:VERSION

How to use fmriprep?

You need first to have a FreeSurfer License (free).

Here's a link to make one: https://surfer.nmr.mgh.harvard.edu/registration.html

Then you will need to copy the licence on your directory of interest, by doing a secured file transfer. This will be done outside the cluster. Hence, open a new terminal (or disconnect from Beluga), and type:

scp Path/to/License/License.txt username@beluga.computecanada.ca:/home/username/scratch

You also need the following: 1)fmriprep image installed 2) Working directory 3) Output directory 4) Data Directory (BIDS-validated)

  1. We already installed it. Yay!

  2. You will need a working directory. Those will be files used during the pre-processing (the in-between steps of the pre-processing, yet not our final results). Let's create one.

cd home/username/scratch
mkdir WorkingDirectory
  1. You will need an Output directory. This is where your final output will go. It will include the fmriprep result as well as the free-surfer image (if specified). Same thing, let's create one. Let's same sure we still are on our scratch directory.
cd home/username/scratch
mkdir fmriprepOutput
  1. The final and longer steps is to make sure that your BIDS is validated. This can be tricky, especially if you have a big dataset or if you datasat is in Nifti (3D image) and not DICOM (2D image).

Before transfering your dataset, let's make sure it is BIDS (Brain Imaging Data Structure) - validated.

BIDS

Example of a path for single subject file for the resting state in my study. Path/to/Data/DatasetFolder/sub-001/ses-2/func/sub-001_ses-2_task-rest_run-1_bold.nii.gz

Notice that there is a consistent structure and naming.

In the name, it includes the participant, session, task, run labels. We can dissociated whether it is a functional or anatomical file by it's end (_bold vs _T1w).

Here's the link to validate: https://bids-standard.github.io/bids-validator/

To convert from DICOM to BIDS, here's the detailed slides from a workshop that allows you to either use Docker from your remote computer or to use python and other specified requirements. See: http://nipy.org/workshops/2017-03-boston/lectures/bids-heudiconv/#19

For more information, see the original info website: https://bids-specification.readthedocs.io/en/stable/

How to use fmriprep

See the next topics on sbatch.