Supporting code to perform the analyses and create the figures of the manuscript with the same title available at 10.1002/hbm.25713.
To cite this repository, please cite the corresponding manuscript:
Alexander Bowring, Thomas Nichols*, Camille Maumet* "Isolating the sources of pipeline-variability in group-level task-fMRI results" (2021). Human Brain Mapping, https://doi.org/10.1002/hbm.25713 .
-
From a Terminal, run:
jupyter notebook ./figures/ds001_notebook.ipynb
-
Run all cells
Displayed by the cell that includes:
correlation_tables.new_correlation_tables(old_afni_stat_file, afni_stat_file, fsl_afni_subject_level_stat_file, afni_drift_stat_file, afni_design_stat_file, fsl_stat_file, old_fsl_stat_file, title= "Correlations: AFNI and FSL")
Displayed by the cell that includes:
correlation_tables.new_correlation_tables(old_afni_perm_z, afni_perm, fsl_afni_subject_level_perm, afni_drift_perm, afni_design_perm, fsl_perm, old_fsl_perm, "Perm Correlations: AFNI and FSL", 15)
Displayed by the cell that includes:
new_dice.new_dice(old_afni_exc_set_file, afni_exc_set_file, fsl_afni_subject_level_exc_set_file, afni_drift_exc_set_file, afni_design_exc_set_file, fsl_exc_set_file, old_fsl_exc_set_file,
old_afni_stat_file, afni_stat_file, fsl_afni_subject_level_stat_file, afni_drift_stat_file, afni_design_stat_file, fsl_stat_file, old_fsl_stat_file,
Title='Dice (Positive Activations): AFNI and FSL')
Displayed by the cell that includes:
new_dice.new_dice(old_afni_perm_pos_exc, afni_perm_pos_exc, fsl_afni_subject_level_perm_pos_exc, afni_drift_perm_pos_exc, afni_design_perm_pos_exc, fsl_perm_pos_exc, old_fsl_perm_pos_exc,
old_afni_perm_z, afni_perm, fsl_afni_subject_level_perm, afni_drift_perm, afni_design_perm, fsl_perm, old_fsl_perm,
Title='Perm Dice (Positive Activations): AFNI and FSL')
-
From a Terminal, run:
jupyter notebook ./figures/ds109_notebook.ipynb
-
Run all cells
-
From a Terminal, run:
jupyter notebook ./figures/ds120_notebook.ipynb
-
Run all cells
-
From a Terminal, run:
jupyter notebook ./figures/ds001_notebook.ipynb
-
The consensus analysis is displayed by the cell that stars with:
from lib import consensus_analysis
-
From a Terminal, run:
jupyter notebook ./figures/ds109_notebook.ipynb
-
The consensus analysis is displayed by the cell that stars with:
from lib import consensus_analysis
We have used three publicly available datasets from the OpenNeuro online data repository: ds000001 (version 00006), ds000109 (version 00001) and ds000120 (version 00001).
For compatibility with the analysis scripts, the ds000001 data should be downloaded to ./data/raw/ds001_R2.0.4
, the ds000109 data should be downloaded to ./data/raw/ds000109_R2.0.1
, and the ds000120 data should be downloaded to ./data/raw/ds120_R1.0.0
.
Users will need to edit the ./src/config.py
and ./src/config.mat
configuration files, providing absolute paths to the fundamental directories and files needed to run the analyses.
In ./src/config.py
, set each of the variables following the instructions provided as comments in the file. Users can obtain a freesurfer license from here if they do not already have one.
Open up matlab and load the ./src/config.mat
file with A = load('./src/config.mat')
. Then set A.home_dir = PATH_TO_SC2_DIR
and save with save('./src/config.mat','A')
The preprocessing of all the data with fMRIprep is carried out from the ./src/process_fmriprep.py
master script. For each of the three studies, the master script creates a shell script to preprocess each subject saved to ./data/processed/STUDY_DIR/scripts/STUDY_SUB_fmriprep.sh
and submits the job to the HPC. From the terminal, run python ./src/process_fmriprep.py
.
Each subject's preprocessed data is outputted to ./data/processed/STUDY_DIR/fmriprep/SUB_DIR
.
The AFNI analysis is conducted via the master script ./src/ds001/process_ds001_ANFI.py
. From a terminal, run:
python ./src/ds001/process_ds001_AFNI.py
This will create the onsets, extract the motion regressors from the fMRIprep'd preprocessed data, orthogonalize the relevant onset files, run the first- and group-level analyses, and finally, extract the columns of the subject-level design matrices and convert the AFNI .BRIK files to .NII files (for further, intermixed analyses within FSL).
All results will be outpped to ./results/ds001/AFNI
The FSL analysis is conducted via the master script ./src/ds001/process_ds001_FSL.py
. To run just the FSL analysis (with fMRIprep'd preprocessed data) users should comment out all lines from process_ds001_FSL.py
after the first instance where run_permutation_test
is called. Then, from a terminal, run:
python ./src/ds001/process_ds001_FSL.py
This will create the onsets, extract the motion regressors from the fMRIprep'd preprocessed data, and run the first- and group-level analyses.
All results will be outputted to ./results/ds001/FSL
The SPM analysis is conducted via the master script ./src/ds001/process_ds001_SPM.m
. The analysis is carried out within Octave using the standalone version of SPM12 (SPM12-r7771). The permutation analysis is carried out using the SnPM13 toolbox. To run the analysis, open Octave, add the relevant directories to the Octave path using the addpath()
function (i.e. the SC2 directory, the standalone SPM12 directory and SnPM toolbox), and then run:
save_default_options('-mat-binary');
process_ds001_SPM.m
This will create the onsets, extract the motion regressors from the fMRIprep'd preprocessed data, unzip the relevant files from the preprocessed data so they can be used for first-level analyses, run the first- and group-level analyses, and finally, extract the columns of the subject-level design matrices (for further, intermixed analyses within FSL).
All results will be outputted to ./results/ds001/SPM
Same as for ds000001, except replacing all occurences of 001 with 109.