Quality control scripts for WAND diffusion data
Carolyn McNabb, Cardiff University Brain Research Imaging Centre (CUBRIC)
Last updated: November 2023
Here are the scripts that were used to run quality control on the diffusion (CHARMED) data from the Welsh Advanced Neuroimaging Database (WAND). The scripts use eddy_cuda and eddy_qc from the FMRIB Software Library (FSL). Note that some of these scripts will not be relevant for external users (those not in CUBRIC). However, outputs are provided, so these scripts are included for completeness.
Scale Correction Factor
Get the scale correction factor for the CHARMED acquisition and adjust data with SCR=4 to match the rest of the datasets (SCR=1).
python3.6 10.0.1_get_CHARMED_ScaleCorrFactor.py
This will produce a .txt file with the paths and scale correction factors in. Next, create tables with the SCRs.
Rscript --vanilla 10.0.2_check_SCFs.R
Motion and eddy QC
Create WAND subject list from participants with diffusion data.
10.0_make_subj_list.sh
Perform eddy current and motion correction and run FSL's QUality Assessment for DMRI (QUAD)
Run eddy_cuda followed by eddy_quad - FSL's quality control tool for diffusion data. Note the there was a problem when including the contrast to noise maps and so these have been ignored.
sbatch 10.1_eddy_qc_SLURM.sh
Study-wise QUality Assessment for DMRI (SQUAD)
Run the Study-wise QUality Assessment for DMRI (SQUAD). This tool reads all the single subject outputs from QUAD, generates study-wise reports and, optionally, enters these into a database. Moreover, SQUAD can optionally update single subject reports, indicating how the subject’s dataset compares to other data, using either a study-specific group database or a pre-generated database obtained from a different dataset.
cd /cubric/collab/314_wand/bids/derivatives/eddy_qc/preprocessed
ls -d */*.qc >> ~/gitlab/WAND_microstructural/QualityControl/eddy_qc/qc_folders.txt
eddy_squad ~/gitlab/WAND_microstructural/QualityControl/eddy_qc/qc_folders.txt -o /cubric/collab/314_wand/bids/derivatives/eddy_qc/analysis/
References for FSL functions
EDDY QC - Bastiani, M., Cottaar, M., Fitzgibbon, S.P., Suri, S., Alfaro-Almagro, F., Sotiropoulos, S.N., Jbabdi, S., and Andersson, J.L.R. Automated quality control for within and between diffusion MRI studies using a non-parametric framework for movement and distortion correction. NeuroImage, 184:801-812, 2019. EDDY - Andersson, J.L.R. and Sotiropoulos, S.N. An integrated approach to correction for off-resonance effects and subject movement in diffusion MR imaging. NeuroImage, 125:1063-1078, 2016. repol - Andersson, J.L.R., Graham, M.S., Zsoldos, E., and Sotiropoulos, S.N. Incorporating outlier detection and replacement into a non-parametric framework for movement and distortion correction of diffusion MR images. NeuroImage, 141:556-572, 2016. Slice-to-volume motion model - Andersson, J.L.R., Graham, M.S., Drobnjak, I., Zhang, H., Filippini, N., and Bastiani, M. Towards a comprehensive framework for movement and distortion correction of diffusion MR images: Within volume movement. NeuroImage, 152:450-466, 2017.