This repository contains custom dcm2bids configuration files for our projects and run scripts for common MRI processing tasks such as MRIQC, fMRIPrep, and FreeSurfer setup.
For guidance on using the Neurodesk platform, see quickstart.md and FAQ.md. The quickstart tutorial shows how to use Neurodesk, the xnat_dcm2bids module, and the scripts provided in this repository, while the FAQ covers practical platform-related questions.
Specifically, this repository provides the following resources:
Custom configuration files for our projects:
➡️ ./dcm2bids
-
run_mriqc.sh subject bids_dirRuns MRIQC with custom resource settings and working directory. The framewise displacement (FD) threshold is set to0.3(adjust if needed). -
run_fmriprep_min.sh subject bids_dirRuns fMRIPrep with custom resource settings and working directory, without FreeSurfer reconstruction. -
run_fmriprep_kids_alicja.sh subject bids_dirFully customized fMRIPrep pipeline with:- cohort-specific atlas from TemplateFlow,
- BIDS filtering to include only specific task names and selected fieldmaps without the
run-xxlabel (note: fMRIPrep will not report missing fieldmaps but gives an error when there are multiple ones available).
-
freesurfer/freesurfer_init.sh subjects_dirInitializes environment variables and Freeview aliases. -
run_dcm2bids_noauto.sh xnat_id subject [session]⚠️ Deprecated: this script has been replaced by the xnat_dcm2bids module with the flag--auto_extract_entities False.
Caution: currently, fMRIPrep does not recognize BIDS-URIs produced bydcm2bidsand therun_dcm2bids_noauto.shscript. Please repair fieldmap JSONs using the following command:find bids_root -iname "*dir*.json" -exec ./fmriprep/json_fmaps_repair.sh {} \;
Typical workflow:
- Update repository using
git pullorlobi_scripts update(see below) - Copy a script into your project
./bids-dir/codedirectory. - Edit the local copy.
- Run the script from your project directory.
When using the xnat_dcm2bids module, you can use the lobi_scripts shortcuts:
lobi_scripts install
lobi_scripts update
lobi_scripts ls
lobi_scripts add run_mriqc.sh ~/bids-dir/code
~/bids-dir/code/run_mriqc.sh 03 ~/bids-dir ~/bids-dir/derivatives/mriqc