If you use this script, please cite:
A collection of python scripts and functions to (po)st(p)rocess fmridata, preprocessed with fmriprep.
The main file is post_fmriprep.py
, which enables users to:
- remove fmri confounds
- filter data
- smooth data
- scrub data
- censor volumes
Many of the function in this file are wrappers of nilearn's functions.
To learn more about the input parameters and their default values type
python post_fmriprep.py --help
Exemplary use cases are detailed below
Uses default values of non-boolean parameters (ie, confounds, filtering, tr) and outputs data centred around a nonzero mean. The default values of these non-boolean parameters are optimised for resting-state fmri data.
python post_fmriprep.py --niipath /path/to/file/file_preproc.nii.gz
--maskpath /path/to/file/file_brainmask.nii.gz
--tsvpath /path/to/file/file_confounds.tsv
--detrend
--add_orig_mean_img
Uses default values of non-boolean parameters (ie, confounds, filtering, tr) and outputs zero-centred data (mean==0).
python post_fmriprep.py --niipath /path/to/file/file_preproc.nii.gz
--maskpath /path/to/file/file_brainmask.nii.gz
--tsvpath /path/to/file/file_confounds.tsv
--detrend
Does not regress `framwise displacement` -- used for task-fmri data
Does not filter.
Uses default value for smoothing the data
python post_fmriprep.py --niipath /path/to/file/file_preproc.nii.gz
--maskpath /path/to/file/file_brainmask.nii.gz
--tsvpath /path/to/file/file_confounds.tsv'
--detrend
--add_orig_mean_img
--low_pass None
--high_pass None
--fmw_disp_th None
python post_fmriprep.py --niipath /path/to/file/file_preproc.nii.gz
--maskpath /path/to/file/file_brainmask.nii.gz
--tsvpath /path/to/file/file_confounds.tsv'
--detrend
--add_orig_mean_img
--calculate_scrubbing_mask
--remove_volumes
python post_fmriprep.py --niipath /path/to/file/file_preproc.nii.gz
--maskpath /path/to/file/file_brainmask.nii.gz
--tsvpath /path/to/file/file_confounds.tsv'
--detrend
--add_orig_mean_img
--calculate_scrubbing_mask
python post_fmriprep.py --niipath /path/to/file/file_preproc.nii.gz
--maskpath /path/to/file/file_brainmask.nii.gz
--tsvpath /path/to/file/file_confounds.tsv'
--detrend
--add_orig_mean_img
--fwhm 1.5 2.5 1.0
python post_fmriprep.py --niipath /path/to/file/file_preproc.nii.gz
--maskpath /path/to/file/file_brainmask.nii.gz
--tsvpath /path/to/file/file_confounds.tsv
--detrend
--add_orig_mean_img
--confound_list "csf,white_matter"
--num_confounds 2