Skip to content

Commit d4786c3

Browse files
authored
Merge pull request #1586 from oesteban/pr/1487
ENH: Confound model enhancement
2 parents ca465df + b6e090e commit d4786c3

File tree

15 files changed

+314
-96
lines changed

15 files changed

+314
-96
lines changed

.circleci/ds005_outputs.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ fmriprep/sub-01/func
5353
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv
5454
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold.dtseries.json
5555
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold.dtseries.nii
56+
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-confounds_regressors.json
5657
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-confounds_regressors.tsv
5758
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-MELODIC_mixing.tsv
5859
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-L.func.gii
@@ -85,6 +86,7 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-preproc_
8586
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_AROMAnoiseICs.csv
8687
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold.dtseries.json
8788
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold.dtseries.nii
89+
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-confounds_regressors.json
8890
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-confounds_regressors.tsv
8991
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-MELODIC_mixing.tsv
9092
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5_hemi-L.func.gii

.circleci/ds005_partial_outputs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ fmriprep/sub-01/func
5353
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_AROMAnoiseICs.csv
5454
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold.dtseries.json
5555
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold.dtseries.nii
56+
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-confounds_regressors.json
5657
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-confounds_regressors.tsv
5758
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-MELODIC_mixing.tsv
5859
fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5_hemi-L.func.gii

.circleci/ds054_outputs.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-CSF_probseg.
2727
fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz
2828
fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz
2929
fmriprep/sub-100185/func
30+
fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_desc-confounds_regressors.json
3031
fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_desc-confounds_regressors.tsv
3132
fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz
3233
fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_desc-brain_mask.json
@@ -38,6 +39,7 @@ fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_desc-brain
3839
fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_desc-brain_mask.nii.gz
3940
fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_desc-preproc_bold.json
4041
fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_desc-preproc_bold.nii.gz
42+
fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_desc-confounds_regressors.json
4143
fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_desc-confounds_regressors.tsv
4244
fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_boldref.nii.gz
4345
fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_desc-brain_mask.json

.circleci/ds210_outputs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz
2727
fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz
2828
fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz
2929
fmriprep/sub-02/func
30+
fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_desc-confounds_regressors.json
3031
fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_desc-confounds_regressors.tsv
3132
fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz
3233
fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_space-MNI152NLin2009cAsym_desc-brain_mask.json

.zenodo.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@
116116
"affiliation": "Neuroscience Program, University of Iowa",
117117
"orcid": "0000-0002-3339-4857"
118118
},
119+
{
120+
"name": "Ciric, Rastko",
121+
"affiliation": "Stanford University",
122+
"orcid": "0000-0001-6347-7939"
123+
},
119124
{
120125
"name": "Poldrack, Russell A.",
121126
"affiliation": "Department of Psychology, Stanford University",

docs/outputs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ motion-correction parameters estimated by fMRIPrep;
173173
if present, ``non_steady_state_outlier_XX`` columns indicate non-steady state volumes with a single
174174
``1`` value and ``0`` elsewhere (*i.e.*, there is one ``non_steady_state_outlier_XX`` column per
175175
outlier/volume);
176-
six noise components are calculated using :abbr:`CompCor (Component Based Noise Correction)`,
176+
additional noise components are calculated using :abbr:`CompCor (Component Based Noise Correction)`,
177177
according to both the anatomical (``a_comp_cor_XX``) and temporal (``t_comp_cor_XX``) variants;
178178
and the motion-related components identified by
179179
:abbr:`ICA (independent components analysis)`-:abbr:`AROMA (Automatic Removal Of Motion Artifacts)`

docs/workflows.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ is presented below:
4646
('MNI152Lin', {}), ('fsaverage', {'density': '10k'}),
4747
('T1w', {}), ('fsnative', {})]),
4848
reportlets_dir='.',
49+
regressors_all_comps=False,
50+
regressors_dvars_th=1.5,
51+
regressors_fd_th=0.5,
4952
skull_strip_fixed_seed=False,
5053
skull_strip_template='OASIS30ANTs',
5154
subject_id='test',
@@ -299,6 +302,9 @@ BOLD preprocessing
299302
reportlets_dir='.',
300303
t2s_coreg=False,
301304
use_aroma=False,
305+
regressors_all_comps=False,
306+
regressors_fd_th=0.5,
307+
regressors_dvars_th=1.5,
302308
use_bbr=True,
303309
use_syn=True,
304310
layout=BIDSLayout('.'),
@@ -543,7 +549,11 @@ Confounds estimation
543549
name="discover_wf",
544550
mem_gb=1,
545551
metadata={"RepetitionTime": 2.0,
546-
"SliceTiming": [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]})
552+
"SliceTiming": [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]},
553+
regressors_all_comps=False,
554+
regressors_dvars_th=1.5,
555+
regressors_fd_th=0.5,
556+
)
547557

548558
Given a motion-corrected fMRI, a brain mask, ``mcflirt`` movement parameters and a
549559
segmentation, the `discover_wf` sub-workflow calculates potential

fmriprep/__about__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@
8686
'indexed_gzip>=0.8.8',
8787
'nibabel>=2.2.1',
8888
'nilearn!=0.5.0,!=0.5.1',
89-
'nipype>=1.1.6',
89+
'nipype @ git+https://github.com/nipy/nipype.git@'
90+
'd353f0d879826031334b09d33e9443b8c9b3e7fe',
9091
'nitime',
9192
'niworkflows<0.10.0a0,>=0.9.1.post1',
9293
'numpy',
@@ -103,6 +104,8 @@
103104

104105

105106
LINKS_REQUIRES = [
107+
'git+https://github.com/nipy/nipype.git@'
108+
'd353f0d879826031334b09d33e9443b8c9b3e7fe#egg=nipype',
106109
]
107110

108111
TESTS_REQUIRES = [

fmriprep/cli/run.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,22 @@ def get_parser():
182182
help='Exact or maximum number of MELODIC components to estimate '
183183
'(positive = exact, negative = maximum)')
184184

185+
# Confounds options
186+
g_confounds = parser.add_argument_group('Specific options for estimating confounds')
187+
g_confounds.add_argument(
188+
'--return-all-components', required=False, action='store_true', default=False,
189+
help='Include all components estimated in CompCor decomposition in the confounds '
190+
'file instead of only the components sufficient to explain 50 percent of '
191+
'BOLD variance in each CompCor mask')
192+
g_confounds.add_argument(
193+
'--fd-spike-threshold', required=False, action='store', default=0.5, type=float,
194+
help='Threshold for flagging a frame as an outlier on the basis of framewise '
195+
'displacement')
196+
g_confounds.add_argument(
197+
'--dvars-spike-threshold', required=False, action='store', default=1.5, type=float,
198+
help='Threshold for flagging a frame as an outlier on the basis of standardised '
199+
'DVARS')
200+
185201
# ANTs options
186202
g_ants = parser.add_argument_group('Specific options for ANTs registrations')
187203
g_ants.add_argument('--skull-strip-template', action='store', default='OASIS30ANTs',
@@ -574,6 +590,9 @@ def build_workflow(opts, retval):
574590
output_dir=str(output_dir),
575591
output_spaces=output_spaces,
576592
run_uuid=run_uuid,
593+
regressors_all_comps=opts.return_all_components,
594+
regressors_fd_th=opts.fd_spike_threshold,
595+
regressors_dvars_th=opts.dvars_spike_threshold,
577596
skull_strip_fixed_seed=opts.skull_strip_fixed_seed,
578597
skull_strip_template=opts.skull_strip_template,
579598
subject_list=subject_list,

fmriprep/data/boilerplate.bib

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,20 @@ @article{power_fd_dvars
241241
year = 2014
242242
}
243243

244+
@article{confounds_satterthwaite_2013,
245+
author = {Satterthwaite, Theodore D. and Elliott, Mark A. and Gerraty, Raphael T. and Ruparel, Kosha and Loughead, James and Calkins, Monica E. and Eickhoff, Simon B. and Hakonarson, Hakon and Gur, Ruben C. and Gur, Raquel E. and Wolf, Daniel H.},
246+
doi = {10.1016/j.neuroimage.2012.08.052},
247+
issn = {10538119},
248+
journal = {NeuroImage},
249+
number = 1,
250+
pages = {240--256},
251+
title = {{An improved framework for confound regression and filtering for control of motion artifact in the preprocessing of resting-state functional connectivity data}},
252+
url = {http://linkinghub.elsevier.com/retrieve/pii/S1053811912008609},
253+
volume = 64,
254+
year = 2013
255+
}
256+
257+
244258
@article{nilearn,
245259
author = {Abraham, Alexandre and Pedregosa, Fabian and Eickenberg, Michael and Gervais, Philippe and Mueller, Andreas and Kossaifi, Jean and Gramfort, Alexandre and Thirion, Bertrand and Varoquaux, Gael},
246260
doi = {10.3389/fninf.2014.00014},

0 commit comments

Comments
 (0)