Ressources numériques en sciences humaines et sociales OpenEdition Nos plateformes OpenEdition Books OpenEdition Journals Hypothèses Calenda Bibliothèques OpenEdition Freemium Suivez-nous

fmRIPREP

fMRI Preprocessing via fMRIPrep

 

This pipeline is developed by the Poldrack lab at Stanford University for use at the Center for Reproducible Neuroscience (CRN), as well as for open-source software distribution.

There are two ways to install fMRIPrep:

In this tutorial, we will present a quick overview of the installation via containers because the installation via a Manually Prepared Environment is not guaranteed on all Operator System (Windows OS in particular). Moreover, the use of containers has the huge advantage of promoting the reproducibility of MRI data pre-processing from one laboratory to another (since the development environment is the same). The disadvantage is that customization of pre-processing is sometimes not possible. 

  1. Running fMRIPrep via a Docker
  2. Running fMRI via Mesocentre  (Singularity)

 

Running fMRIPrep via a Docker


 

fmriprep-docker is a light weight python wrapper for fmriprep module, allowing fMRI proprocessing to be run from within a Docker environment. It requires Docker and python to be installed. Additionally, as fmriprep is a BIDS app, the input image files must have BIDS-format filenames.

  • Step3. Download a FreeSurfer Licence using registration form. FreeSurfer allows to reconstruct anatomical surfaces of the brain.
  • Step4. Install or update the fmriprep-docker image on Windows PowerShell (admin) prompt:
python -m pip install --user --upgrade fmriprep-docker
  • Step5. Download your raw dataset in BIDS format
  • Step6. Control the data format with BIDS validator online
  • Step7. Write your specific fmriprep-docker command  using the Standford tutorial. Here, an example for the command ‘fmriprep-docker’.
fmriprep-docker
<BIDS data input path> 
<fmriprep_output path>
participant # group-level analysis
--fs-license-file <freeSurfer Licence path> --fs-no-reconall # no brain segmentation via FreeSurfer --ignore slicetiming --skip_bids_validation --stop-on-first-crash

If you are not comfortable with the python language, you can consult the 2 following websites:

sh code https://github.com/andrewjahn/OpenScience_Scripts/blob/master/fmriprep_singleSubj.sh

Running fMRIPrep via Mesocentre *

Mesocentre is a High-Performance Computing centre of the University of Aix Marseille. You have to submit a call for projects to benefit from access rights.  In this section, we present an overview of the steps to install fMRIPREP on Mesocentre. Tests were made on Windows 10. For more information about the possibilities of Mesocenter, see the tutorials on their website.

The connection frontend is the gateway to the mesocenter, its address is login.mesocenter.univ-amu.fr, it is accessed through the secure SSH (Secure Shell) protocol. The port used is port 22 (standard).

Document écrit par Julien Sein:

1) se connecter à Mesocentre via une clé SSH:

-> voir détails spécifiques au mésocentre ici: https://mesocentre.univ-amu.fr/ssh-old/#win
 
(pour me connecter au mesocentre, mon login est achanoine et le nom du serveur est : login.mesocentre.univ-amu.fr)
 
2) installer l’image singularity de fmriprep:
– lancer le terminal connecté en ssh au mésocentre (par exemple mon login est achanoine et le nom du serveur est : login.mesocentre.univ-amu.fr)
>> mkdir /scratch/<ton.login>/my_images/
 
>> singularity build /scratch/<ton.login>/my_images/fmriprep-1.5.0.simg docker://poldracklab/fmriprep:1.5.0
 
singularity build /scratch/achanoine/my_images/fmriprep–1.5.0.simg docker://poldracklab/fmriprep:1.5.0
 
Cà y est fmriprep est installé!
 
3) configurer le batch pour lancer fmriprep sur le cluster: tu peux utiliser le fichier ci-joint 
 
et éditer les lignes suivantes:
 
#SBATCH —mail-user=julien.sein@univ-amu.fr >> remplacer par ton adresse email
#SBATCH -A a163  >> remplacer par ton numéro de projet
 
singularity run –cleanenv -B /scratch/jsein/BIDS:/work /scratch/jsein/my_images/fmriprep-1.5.0.simg –fs-license-file /work/freesurfer/license.txt /work/$study /work/$study/derivatives participant –participant-label $list_sub -w /work/temp_data –ignore slicetiming –low-mem –mem-mb 40000 –force-syn –output-spaces T1w MNI152NLin2009cAsym –fs-no-reconall
 
>> editer avec ton login
 
4)Préparer les données
a) copier le fichier de licence freesurfer: dans mon compte je l’ai mis
 
pscp H:\fMRI\SLIP\RawData\sub-01\* /scratch/achanoine/test
ici: /scratch/jsein/BIDS/freesurfer/license.txt
 
 

%userprofile%\AppData\Local\Packages\

Puis dans le dossier qui commence par : CanonicalGroupLimited.UbuntuonWindows_

Puis dans \LocalState\rootfs

Avec freesurfer installé ici : Freesurfer => usr\local\freesurfer Et Brainvisa => opt\brainvisa

Si tu n’en as pas, tu peux en télécharger un ici: https://surfer.nmr.mgh.harvard.edu/registration.html
b) copier les données sur le mesocentre: tu dois pouvoir le faire avec putty, ou filezilla
Mes données sont rangées de la sorte:/scratch/jsein/BIDS/TP_MASCO
 
5)Lancer le batch: en étant dans ton home (/home/<ton.login>), taper:>> sbatch fmriprep_slurm.sh

 

  • Thanks to Julien Sein for his valuable help.

 

 


smriprep

  • Install or update the smriprep-docker on Ubuntu
python -m pip install --user --upgrade smriprep

 

  •  

smriprep
<BIDS data input path> 
<smriprep_output path>
participant # level analysis
--participant-label # list of participant identifiers or a single identifier

--fs-license-file <freeSurfer Licence path>
--fs-subjects-dir <freeSurfer directory> --skip_bids_validation --stop-on-first-crash

 

 

                                                             posted byValérie Chanoine  on 2020/04/07

Blog du Centre de Ressources pour l'Expérimentation de l'ILCB