A customizable pipeline to preprocess fMRI data in ABCD dataset, based on abcd-dicom2bids, fmriprep, and XCP-D
- Download this package
clone https://github.com/YuncongMa/abcd_fMRI_process.git
- Create Conda environment
conda create --name abcd python=3.8
- Activate Conda environment
conda activate abcd
- Install additional packages
pip install numpy bids nibabel
conda install -c conda-forge dcmtk
For Apple Silicon, use the homebrew to install dcmtk
brew install dcmtk
-
Install singularity https://github.com/sylabs/singularity/releases
-
Add dcm2bids, dcmtk, fmriprep and xcp_d singularity images (.simg) Check script /tool/download_simg.sh
A main python script is used to generate bash scripts for processing ABCD dataset in a cluster environment. There are three versions using different job scheduling function to control the large number of preprocessing jobs.
- Use a batch job to control individual workflows. It is least dependent on the server system.
python abcd_fmri_preprocess_cluster.py
- Use the array job function to do job scheduling on SGE system.
python abcd_fmri_preprocess_sge_array.py
- Use the array job function to do job scheduling on SLURM system.
python abcd_fmri_preprocess_slurm_array.py
Convert raw data (.tgz) to BIDS format (data in subfolders /anat/, /fmap/, /func/). Some imaging parameters are inserted based on vendors for future usage. One pair of field maps are selected automatically, but will need manual check for image artifacts or poor localization. Results will be saved in folder /BIDS with subfolder as sub-/ses-*. Temporay files will be saved in folder /BIDS_Temp
Generate graphs for T1, T2, field map, fMRI images in HTML-based web pages. It supports manual QC labeling (unwanted images with be labeled in red boxes), outputing manual QC results in plain text files (image data names with labels as either pass or fail). Results will be saved in folder /BIDS_QC. Manual QC results can be saved in the /BIDS_QC replacing automatically generated files.
Run fmriprep on BIDS formatted MRI data with or without manual QC files. This step will perform a widely used fMRI preprocessing including slicing timing, distortion correction, motion correction, brain segmentation, and image registration. Results will be saved in folder /fmriprep, and temporary files will be saved in /fmriprep_work.
Postprocess fMRI data to remove noises, including spatial smoothing, nuisance regression, temporal filtering. To get results in both NIFTI and CIFTI formats, two folders will be created (/xcpd and /xcpd_cifti). Temporary files will be saved into folder /xcpd_temp
collect HTML-based reports from fmriprep and xcpd, as well as final preprocessed data. Results will be saved into folder /Result.
https://github.com/ABCD-STUDY/abcd-dicom2bids/tree/master
https://dicom.offis.de/dcmtk.php.en