From 725fa734262e190156b28a6e802b6c1c9fb3eb85 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 14 Sep 2018 19:02:42 +0200 Subject: [PATCH 01/83] [MAINT] Pin grabbit and pybids in ``setup.py`` Continue #1281 and close #1279 --- fmriprep/__about__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fmriprep/__about__.py b/fmriprep/__about__.py index cb0b526dd..63521fdfc 100644 --- a/fmriprep/__about__.py +++ b/fmriprep/__about__.py @@ -94,8 +94,8 @@ 'sklearn', 'nibabel>=2.2.1', 'pandas', - 'grabbit', - 'pybids>=0.6.3', + 'grabbit==0.2.3', + 'pybids==0.6.5', 'nitime', 'nipype>=1.1.1', 'niworkflows>=0.4.3', From 375c7d38672bfcea0aa7d4cd6a9306c1562b478d Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 26 Sep 2018 15:18:42 -0400 Subject: [PATCH 02/83] FIX: Enhance T2 contrast in reference estimate --- fmriprep/workflows/bold/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fmriprep/workflows/bold/util.py b/fmriprep/workflows/bold/util.py index 4bcea4d7a..de7e3238a 100644 --- a/fmriprep/workflows/bold/util.py +++ b/fmriprep/workflows/bold/util.py @@ -105,7 +105,8 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, name='bold_reference_wf mem_gb=1) # OE: 128x128x128x50 * 64 / 8 ~ 900MB. # Re-run validation; no effect if no sbref; otherwise apply same validation to sbref as bold validate_ref = pe.Node(ValidateImage(), name='validate_ref', mem_gb=DEFAULT_MEMORY_MIN_GB) - enhance_and_skullstrip_bold_wf = init_enhance_and_skullstrip_bold_wf(omp_nthreads=omp_nthreads) + enhance_and_skullstrip_bold_wf = init_enhance_and_skullstrip_bold_wf(omp_nthreads=omp_nthreads, + enhance_t2=enhance_t2) workflow.connect([ (inputnode, validate, [('bold_file', 'in_file')]), From d8fbf00b2576f3b630434c709796afe87106b31e Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Thu, 9 Aug 2018 21:28:50 -0400 Subject: [PATCH 03/83] TEST: Plot old/new masks --- .circleci/config.yml | 4 +++- fmriprep/workflows/bold/tests/test_util.py | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0e1967359..ce14a36bf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -252,10 +252,12 @@ jobs: name: Run fMRIPrep tests no_output_timeout: 2h command: | + mkdir /tmp/data/reports && \ docker run -ti --rm=false \ -v /tmp/data:/tmp/data \ -e FMRIPREP_REGRESSION_SOURCE=/tmp/data/fmriprep_bold_truncated \ -e FMRIPREP_REGRESSION_TARGETS=/tmp/data/fmriprep_bold_mask \ + -e FMRIPREP_REGRESSION_REPORTS=/tmp/data/reports \ --entrypoint="py.test" poldracklab/fmriprep:latest \ /root/src/fmriprep/ \ --doctest-modules --ignore=/root/src/fmriprep/docs --ignore=setup.py @@ -284,7 +286,7 @@ jobs: fmriprep-docker -i poldracklab/fmriprep:latest --help fmriprep-docker -i poldracklab/fmriprep:latest --version - store_artifacts: - path: /home/circleci/out/tests + path: /tmp/data/reports build_docs: diff --git a/fmriprep/workflows/bold/tests/test_util.py b/fmriprep/workflows/bold/tests/test_util.py index ed2882971..a5e808b3a 100755 --- a/fmriprep/workflows/bold/tests/test_util.py +++ b/fmriprep/workflows/bold/tests/test_util.py @@ -3,8 +3,12 @@ import os import numpy as np +from nipype.pipeline import engine as pe from nipype.utils.filemanip import fname_presuffix from nilearn.image import load_img + +from niworkflows.interfaces.masks import ROIsPlot + from ..util import init_bold_reference_wf @@ -47,6 +51,24 @@ def symmetric_overlap(img1, img2): def test_masking(input_fname, expected_fname): bold_reference_wf = init_bold_reference_wf(omp_nthreads=1, enhance_t2=True) bold_reference_wf.inputs.inputnode.bold_file = input_fname + + # Reconstruct base_fname from above + dirname, basename = os.path.split(input_fname) + newpath = os.path.join(os.getenv('FMRIPREP_REGRESSION_REPORTS', '.'), + os.path.basename(dirname)) + out_fname = fname_presuffix(basename, suffix='_masks.svg', use_ext=False, + newpath=newpath) + os.makedirs(newpath, exist_ok=True) + + mask_diff_plot = pe.Node(ROIsPlot(), name='mask_diff_plot') + mask_diff_plot.inputs.in_mask = expected_fname + mask_diff_plot.inputs.out_report = out_fname + + bold_reference_wf.connect([ + (bold_reference_wf.get_node('outputnode'), mask_diff_plot, [ + ('ref_image', 'in_file'), + ('bold_mask', 'in_rois'), + ])]) res = bold_reference_wf.run(plugin='MultiProc') combine_masks = [node for node in res.nodes if node.name.endswith('combine_masks')][0] From 2c2ab47e1553389088a78a890a80346bfae37261 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 3 Oct 2018 17:33:15 -0400 Subject: [PATCH 04/83] FIX: Create template from one usable T1w image --- fmriprep/workflows/anatomical.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fmriprep/workflows/anatomical.py b/fmriprep/workflows/anatomical.py index b4425845a..b45655ad5 100644 --- a/fmriprep/workflows/anatomical.py +++ b/fmriprep/workflows/anatomical.py @@ -44,7 +44,7 @@ from ..engine import Workflow from ..interfaces import ( - DerivativesDataSink, MakeMidthickness, FSInjectBrainExtracted, + DerivativesDataSink, StructuralReference, MakeMidthickness, FSInjectBrainExtracted, FSDetectInputs, NormalizeSurf, GiftiNameSource, TemplateDimensions, Conform, ConcatAffines, RefineBrainMask, ) @@ -521,15 +521,16 @@ def _get_first(in_list): N4BiasFieldCorrection(dimension=3, copy_header=True), iterfield='input_image', name='n4_correct', n_procs=1) # n_procs=1 for reproducibility + # StructuralReference is fs.RobustTemplate if > 1 volume, copying otherwise t1_merge = pe.Node( - fs.RobustTemplate(auto_detect_sensitivity=True, - initial_timepoint=1, # For deterministic behavior - intensity_scaling=True, # 7-DOF (rigid + intensity) - subsample_threshold=200, - fixed_timepoint=not longitudinal, - no_iteration=not longitudinal, - transform_outputs=True, - ), + StructuralReference(auto_detect_sensitivity=True, + initial_timepoint=1, # For deterministic behavior + intensity_scaling=True, # 7-DOF (rigid + intensity) + subsample_threshold=200, + fixed_timepoint=not longitudinal, + no_iteration=not longitudinal, + transform_outputs=True, + ), mem_gb=2 * num_t1w - 1, name='t1_merge') From 3e55760b91514d794f91ddd439a2122115f425b9 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Wed, 3 Oct 2018 17:36:45 -0400 Subject: [PATCH 05/83] STY: Whitespace --- fmriprep/workflows/anatomical.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fmriprep/workflows/anatomical.py b/fmriprep/workflows/anatomical.py index b45655ad5..19a33eaf1 100644 --- a/fmriprep/workflows/anatomical.py +++ b/fmriprep/workflows/anatomical.py @@ -524,13 +524,13 @@ def _get_first(in_list): # StructuralReference is fs.RobustTemplate if > 1 volume, copying otherwise t1_merge = pe.Node( StructuralReference(auto_detect_sensitivity=True, - initial_timepoint=1, # For deterministic behavior - intensity_scaling=True, # 7-DOF (rigid + intensity) - subsample_threshold=200, - fixed_timepoint=not longitudinal, - no_iteration=not longitudinal, - transform_outputs=True, - ), + initial_timepoint=1, # For deterministic behavior + intensity_scaling=True, # 7-DOF (rigid + intensity) + subsample_threshold=200, + fixed_timepoint=not longitudinal, + no_iteration=not longitudinal, + transform_outputs=True, + ), mem_gb=2 * num_t1w - 1, name='t1_merge') From b7182422c960505a2d4508c0b9be53ac7b0e5f3f Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 3 Oct 2018 17:10:22 -0700 Subject: [PATCH 06/83] update circle outputs --- .circleci/ds005_outputs.txt | 4 ++++ .circleci/ds005_partial_outputs.txt | 2 ++ .circleci/ds054_outputs.txt | 4 ++++ .circleci/ds210_outputs.txt | 1 + 4 files changed, 11 insertions(+) diff --git a/.circleci/ds005_outputs.txt b/.circleci/ds005_outputs.txt index 1165ca397..a9516161e 100644 --- a/.circleci/ds005_outputs.txt +++ b/.circleci/ds005_outputs.txt @@ -47,6 +47,8 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_brainmas fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_label-aparcaseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_label-aseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-3dref_bold.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_AROMAnoiseICs.csv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_confounds.tsv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_MELODICmix.tsv @@ -61,5 +63,7 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-T1w_brainmas fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-T1w_label-aparcaseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-T1w_label-aseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-T1w_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_desc-3dref_bold.nii.gz fmriprep/sub-01.html /tmp/ds005/derivatives diff --git a/.circleci/ds005_partial_outputs.txt b/.circleci/ds005_partial_outputs.txt index 6b2863866..bfc73e301 100644 --- a/.circleci/ds005_partial_outputs.txt +++ b/.circleci/ds005_partial_outputs.txt @@ -47,5 +47,7 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_brainmas fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_label-aparcaseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_label-aseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-3dref_bold.nii.gz fmriprep/sub-01.html /tmp/ds005/derivatives_partial diff --git a/.circleci/ds054_outputs.txt b/.circleci/ds054_outputs.txt index cbaa9a05e..eb94f6e64 100644 --- a/.circleci/ds054_outputs.txt +++ b/.circleci/ds054_outputs.txt @@ -27,10 +27,14 @@ fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_bold_space-MNI152NLi fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_bold_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_bold_space-T1w_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_bold_space-T1w_preproc.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_desc-3dref_bold.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_bold_confounds.tsv fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_bold_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_bold_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_bold_space-T1w_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_bold_space-T1w_preproc.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_desc-3dref_bold.nii.gz fmriprep/sub-100185.html /tmp/ds054/derivatives diff --git a/.circleci/ds210_outputs.txt b/.circleci/ds210_outputs.txt index 0074926b7..51f0c544b 100644 --- a/.circleci/ds210_outputs.txt +++ b/.circleci/ds210_outputs.txt @@ -31,5 +31,6 @@ fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_bold_space-MNI152NLin2009 fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_bold_confounds.tsv fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_bold_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_bold_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz fmriprep/sub-02.html /tmp/ds210/derivatives From b8c897fe4154584e6addfe0d621e851fe3a4ac17 Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 3 Oct 2018 17:44:22 -0700 Subject: [PATCH 07/83] first steps in #960. Includes modifications pertaining to #1302 --- .circleci/ds005_outputs.txt | 108 ++++++++++++++-------------- .circleci/ds005_partial_outputs.txt | 80 ++++++++++----------- .circleci/ds054_outputs.txt | 50 ++++++------- .circleci/ds210_outputs.txt | 48 ++++++------- fmriprep/interfaces/bids.py | 10 ++- fmriprep/workflows/bold/base.py | 11 ++- 6 files changed, 160 insertions(+), 147 deletions(-) diff --git a/.circleci/ds005_outputs.txt b/.circleci/ds005_outputs.txt index a9516161e..e4bedc65a 100644 --- a/.circleci/ds005_outputs.txt +++ b/.circleci/ds005_outputs.txt @@ -6,64 +6,64 @@ fmriprep/logs/CITATION.md fmriprep/logs/CITATION.tex fmriprep/sub-01 fmriprep/sub-01/anat -fmriprep/sub-01/anat/sub-01_T1w_brainmask.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_class-CSF_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_class-GM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_class-WM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_dtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_inflated.L.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_inflated.R.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_label-aparcaseg_roi.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_label-aseg_roi.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_midthickness.L.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_midthickness.R.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_pial.L.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_pial.R.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_preproc.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_smoothwm.L.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_smoothwm.R.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_dtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_target-T1w_warp.h5 -fmriprep/sub-01/anat/sub-01_T1w_space-orig_target-T1w_affine.txt -fmriprep/sub-01/anat/sub-01_T1w_target-fsnative_affine.txt -fmriprep/sub-01/anat/sub-01_T1w_target-MNI152NLin2009cAsym_warp.h5 +fmriprep/sub-01/anat/sub-01_brainmask.nii.gz +fmriprep/sub-01/anat/sub-01_class-CSF_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_class-GM_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_class-WM_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_dtissue.nii.gz +fmriprep/sub-01/anat/sub-01_inflated.L.surf.gii +fmriprep/sub-01/anat/sub-01_inflated.R.surf.gii +fmriprep/sub-01/anat/sub-01_label-aparcaseg_roi.nii.gz +fmriprep/sub-01/anat/sub-01_label-aseg_roi.nii.gz +fmriprep/sub-01/anat/sub-01_midthickness.L.surf.gii +fmriprep/sub-01/anat/sub-01_midthickness.R.surf.gii +fmriprep/sub-01/anat/sub-01_pial.L.surf.gii +fmriprep/sub-01/anat/sub-01_pial.R.surf.gii +fmriprep/sub-01/anat/sub-01_preproc.nii.gz +fmriprep/sub-01/anat/sub-01_smoothwm.L.surf.gii +fmriprep/sub-01/anat/sub-01_smoothwm.R.surf.gii +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_brainmask.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_dtissue.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_target-T1w_warp.h5 +fmriprep/sub-01/anat/sub-01_space-orig_target-T1w_affine.txt +fmriprep/sub-01/anat/sub-01_target-fsnative_affine.txt +fmriprep/sub-01/anat/sub-01_target-MNI152NLin2009cAsym_warp.h5 fmriprep/sub-01/func -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_AROMAnoiseICs.csv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_confounds.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_MELODICmix.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-cifti_variant-space1_preproc.dtseries.json -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-cifti_variant-space1_preproc.dtseries.nii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-fsaverage5.L.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-fsaverage5.R.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_label-aparcaseg_roi.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_label-aseg_roi.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_confounds.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_MELODICmix.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-space1_preproc.dtseries.json +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-space1_preproc.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.L.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.R.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-3dref_bold.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_AROMAnoiseICs.csv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_confounds.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_MELODICmix.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-cifti_variant-space1_preproc.dtseries.json -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-cifti_variant-space1_preproc.dtseries.nii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-fsaverage5.L.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-fsaverage5.R.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-T1w_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-T1w_label-aparcaseg_roi.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-T1w_label-aseg_roi.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold_space-T1w_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_roi.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_roi.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_AROMAnoiseICs.csv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_confounds.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_MELODICmix.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-cifti_variant-space1_preproc.dtseries.json +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-cifti_variant-space1_preproc.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5.L.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5.R.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aparcaseg_roi.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aseg_roi.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_preproc.nii.gz fmriprep/sub-01.html /tmp/ds005/derivatives diff --git a/.circleci/ds005_partial_outputs.txt b/.circleci/ds005_partial_outputs.txt index bfc73e301..a5ee213f6 100644 --- a/.circleci/ds005_partial_outputs.txt +++ b/.circleci/ds005_partial_outputs.txt @@ -6,48 +6,48 @@ fmriprep/logs/CITATION.md fmriprep/logs/CITATION.tex fmriprep/sub-01 fmriprep/sub-01/anat -fmriprep/sub-01/anat/sub-01_T1w_brainmask.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_class-CSF_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_class-GM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_class-WM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_dtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_inflated.L.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_inflated.R.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_label-aparcaseg_roi.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_label-aseg_roi.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_midthickness.L.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_midthickness.R.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_pial.L.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_pial.R.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_preproc.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_smoothwm.L.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_smoothwm.R.surf.gii -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_dtissue.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-01/anat/sub-01_T1w_space-MNI152NLin2009cAsym_target-T1w_warp.h5 -fmriprep/sub-01/anat/sub-01_T1w_space-orig_target-T1w_affine.txt -fmriprep/sub-01/anat/sub-01_T1w_target-fsnative_affine.txt -fmriprep/sub-01/anat/sub-01_T1w_target-MNI152NLin2009cAsym_warp.h5 +fmriprep/sub-01/anat/sub-01_brainmask.nii.gz +fmriprep/sub-01/anat/sub-01_class-CSF_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_class-GM_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_class-WM_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_dtissue.nii.gz +fmriprep/sub-01/anat/sub-01_inflated.L.surf.gii +fmriprep/sub-01/anat/sub-01_inflated.R.surf.gii +fmriprep/sub-01/anat/sub-01_label-aparcaseg_roi.nii.gz +fmriprep/sub-01/anat/sub-01_label-aseg_roi.nii.gz +fmriprep/sub-01/anat/sub-01_midthickness.L.surf.gii +fmriprep/sub-01/anat/sub-01_midthickness.R.surf.gii +fmriprep/sub-01/anat/sub-01_pial.L.surf.gii +fmriprep/sub-01/anat/sub-01_pial.R.surf.gii +fmriprep/sub-01/anat/sub-01_preproc.nii.gz +fmriprep/sub-01/anat/sub-01_smoothwm.L.surf.gii +fmriprep/sub-01/anat/sub-01_smoothwm.R.surf.gii +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_brainmask.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_dtissue.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_target-T1w_warp.h5 +fmriprep/sub-01/anat/sub-01_space-orig_target-T1w_affine.txt +fmriprep/sub-01/anat/sub-01_target-fsnative_affine.txt +fmriprep/sub-01/anat/sub-01_target-MNI152NLin2009cAsym_warp.h5 fmriprep/sub-01/func -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_AROMAnoiseICs.csv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_confounds.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_MELODICmix.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-cifti_variant-space1_preproc.dtseries.json -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-cifti_variant-space1_preproc.dtseries.nii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-fsaverage5.L.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-fsaverage5.R.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_label-aparcaseg_roi.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_label-aseg_roi.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold_space-T1w_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_confounds.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_MELODICmix.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-space1_preproc.dtseries.json +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-space1_preproc.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.L.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.R.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_roi.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_roi.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_preproc.nii.gz fmriprep/sub-01.html /tmp/ds005/derivatives_partial diff --git a/.circleci/ds054_outputs.txt b/.circleci/ds054_outputs.txt index eb94f6e64..03829c4f3 100644 --- a/.circleci/ds054_outputs.txt +++ b/.circleci/ds054_outputs.txt @@ -6,35 +6,35 @@ fmriprep/logs/CITATION.md fmriprep/logs/CITATION.tex fmriprep/sub-100185 fmriprep/sub-100185/anat -fmriprep/sub-100185/anat/sub-100185_T1w_brainmask.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_class-CSF_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_class-GM_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_class-WM_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_dtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_preproc.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_space-MNI152NLin2009cAsym_dtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-100185/anat/sub-100185_T1w_space-MNI152NLin2009cAsym_target-T1w_warp.h5 -fmriprep/sub-100185/anat/sub-100185_T1w_space-orig_target-T1w_affine.txt -fmriprep/sub-100185/anat/sub-100185_T1w_target-MNI152NLin2009cAsym_warp.h5 +fmriprep/sub-100185/anat/sub-100185_brainmask.nii.gz +fmriprep/sub-100185/anat/sub-100185_class-CSF_probtissue.nii.gz +fmriprep/sub-100185/anat/sub-100185_class-GM_probtissue.nii.gz +fmriprep/sub-100185/anat/sub-100185_class-WM_probtissue.nii.gz +fmriprep/sub-100185/anat/sub-100185_dtissue.nii.gz +fmriprep/sub-100185/anat/sub-100185_preproc.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_brainmask.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_dtissue.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_target-T1w_warp.h5 +fmriprep/sub-100185/anat/sub-100185_space-orig_target-T1w_affine.txt +fmriprep/sub-100185/anat/sub-100185_target-MNI152NLin2009cAsym_warp.h5 fmriprep/sub-100185/func -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_bold_confounds.tsv -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_bold_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_bold_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_bold_space-T1w_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_bold_space-T1w_preproc.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_confounds.tsv +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_desc-3dref_bold.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_bold_confounds.tsv -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_bold_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_bold_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_bold_space-T1w_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_bold_space-T1w_preproc.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_preproc.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_confounds.tsv +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_desc-3dref_bold.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_preproc.nii.gz fmriprep/sub-100185.html /tmp/ds054/derivatives diff --git a/.circleci/ds210_outputs.txt b/.circleci/ds210_outputs.txt index 51f0c544b..3eb7e04a3 100644 --- a/.circleci/ds210_outputs.txt +++ b/.circleci/ds210_outputs.txt @@ -6,31 +6,31 @@ fmriprep/logs/CITATION.md fmriprep/logs/CITATION.tex fmriprep/sub-02 fmriprep/sub-02/anat -fmriprep/sub-02/anat/sub-02_T1w_brainmask.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_class-CSF_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_class-GM_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_class-WM_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_dtissue.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_preproc.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_space-MNI152NLin2009cAsym_dtissue.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-02/anat/sub-02_T1w_space-MNI152NLin2009cAsym_target-T1w_warp.h5 -fmriprep/sub-02/anat/sub-02_T1w_space-orig_target-T1w_affine.txt -fmriprep/sub-02/anat/sub-02_T1w_target-MNI152NLin2009cAsym_warp.h5 +fmriprep/sub-02/anat/sub-02_brainmask.nii.gz +fmriprep/sub-02/anat/sub-02_class-CSF_probtissue.nii.gz +fmriprep/sub-02/anat/sub-02_class-GM_probtissue.nii.gz +fmriprep/sub-02/anat/sub-02_class-WM_probtissue.nii.gz +fmriprep/sub-02/anat/sub-02_dtissue.nii.gz +fmriprep/sub-02/anat/sub-02_preproc.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_brainmask.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_dtissue.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_target-T1w_warp.h5 +fmriprep/sub-02/anat/sub-02_space-orig_target-T1w_affine.txt +fmriprep/sub-02/anat/sub-02_target-MNI152NLin2009cAsym_warp.h5 fmriprep/sub-02/func -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_bold_confounds.tsv -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_bold_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_bold_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_bold_confounds.tsv -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_bold_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_bold_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_bold_confounds.tsv -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_bold_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_bold_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_confounds.tsv +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_brainmask.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_confounds.tsv +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_brainmask.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_confounds.tsv +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_brainmask.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz fmriprep/sub-02.html /tmp/ds210/derivatives diff --git a/fmriprep/interfaces/bids.py b/fmriprep/interfaces/bids.py index 1a1e4a340..5bb9b5aa4 100644 --- a/fmriprep/interfaces/bids.py +++ b/fmriprep/interfaces/bids.py @@ -163,6 +163,7 @@ class DerivativesDataSinkInputSpec(BaseInterfaceInputSpec): in_file = InputMultiPath(File(exists=True), mandatory=True, desc='the object to be saved') source_file = File(exists=False, mandatory=True, desc='the input func file') + keep_dtype = traits.Bool(False, usedefault=True, desc='keep datatype suffix') suffix = traits.Str('', mandatory=True, desc='suffix appended to source_file') extra_values = traits.List(traits.Str) compress = traits.Bool(desc="force compression (True) or uncompression (False)" @@ -189,10 +190,11 @@ class DerivativesDataSink(SimpleInterface): >>> dsink = DerivativesDataSink(base_directory=tmpdir) >>> dsink.inputs.in_file = tmpfile >>> dsink.inputs.source_file = collect_data('ds114', '01')[0]['t1w'][0] + >>> dsink.inputs.keep_dtype = True >>> dsink.inputs.suffix = 'target-mni' >>> res = dsink.run() >>> res.outputs.out_file # doctest: +ELLIPSIS - '.../fmriprep/sub-01/ses-retest/anat/sub-01_ses-retest_T1w_target-mni.nii.gz' + '.../fmriprep/sub-01/ses-retest/anat/sub-01_ses-retest_target-mni_T1w.nii.gz' """ input_spec = DerivativesDataSinkInputSpec @@ -208,6 +210,7 @@ def __init__(self, out_path_base=None, **inputs): def _run_interface(self, runtime): src_fname, _ = _splitext(self.inputs.source_file) + src_fname, dtype = src_fname.rsplit('_', 1) _, ext = _splitext(self.inputs.in_file[0]) if self.inputs.compress is True and not ext.endswith('.gz'): ext += '.gz' @@ -241,9 +244,9 @@ def _run_interface(self, runtime): base_fname = op.join(out_path, src_fname) - formatstr = '{bname}_{suffix}{ext}' + formatstr = '{bname}_{suffix}{dtype}{ext}' if len(self.inputs.in_file) > 1 and not isdefined(self.inputs.extra_values): - formatstr = '{bname}_{suffix}{i:04d}{ext}' + formatstr = '{bname}_{suffix}{i:04d}{dtype}{ext}' self._results['compression'] = [] for i, fname in enumerate(self.inputs.in_file): @@ -251,6 +254,7 @@ def _run_interface(self, runtime): bname=base_fname, suffix=self.inputs.suffix, i=i, + dtype='' if not self.inputs.keep_dtype else ('_%s' % dtype), ext=ext) if isdefined(self.inputs.extra_values): out_file = out_file.format(extra_value=self.inputs.extra_values[i]) diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index 13c2a7d3d..63f72459d 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -835,6 +835,10 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, base_directory=output_dir, suffix=suffix_fmt('T1w', 'preproc'), compress=True), name='ds_bold_t1', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) + ds_bold_t1_ref = pe.Node(DerivativesDataSink( + base_directory=output_dir, suffix=suffix_fmt('T1w', 'desc-3dref'), + keep_dtype=True), name='ds_bold_t1_ref', run_without_submitting=True, + mem_gb=DEFAULT_MEMORY_MIN_GB) ds_bold_mask_t1 = pe.Node(DerivativesDataSink( base_directory=output_dir, suffix=suffix_fmt('T1w', 'brainmask')), @@ -850,9 +854,14 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, # Resample to template (default: MNI) if 'template' in output_spaces: ds_bold_mni = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix=suffix_fmt(template, 'preproc')), + base_directory=output_dir, suffix=suffix_fmt(template, 'preproc'), compress=True), name='ds_bold_mni', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) + ds_bold_mni_ref = pe.Node(DerivativesDataSink( + base_directory=output_dir, suffix=suffix_fmt(template, 'desc-3dref'), + keep_dtype=True), name='ds_bold_mni_ref', run_without_submitting=True, + mem_gb=DEFAULT_MEMORY_MIN_GB) + ds_bold_mask_mni = pe.Node(DerivativesDataSink( base_directory=output_dir, suffix=suffix_fmt(template, 'brainmask')), name='ds_bold_mask_mni', run_without_submitting=True, From 15f48fd8af327f18c69b72199535a26116e840cd Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 3 Oct 2018 19:46:34 -0700 Subject: [PATCH 08/83] actually generate references --- fmriprep/workflows/bold/base.py | 20 ++++++++++++---- fmriprep/workflows/bold/registration.py | 32 +++++++++++++++---------- fmriprep/workflows/bold/resampling.py | 9 ++++++- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index 63f72459d..97dab14cc 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -347,10 +347,10 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, inputnode.inputs.sbref_file = sbref_file outputnode = pe.Node(niu.IdentityInterface( - fields=['bold_t1', 'bold_mask_t1', 'bold_aseg_t1', 'bold_aparc_t1', 'cifti_variant', - 'bold_mni', 'bold_mask_mni', 'bold_cifti', 'confounds', 'surfaces', - 't2s_map', 'aroma_noise_ics', 'melodic_mix', 'nonaggr_denoised_file', - 'cifti_variant_key']), + fields=['bold_t1', 'bold_t1_ref', 'bold_mask_t1', 'bold_aseg_t1', 'bold_aparc_t1', + 'bold_mni', 'bold_mni_ref' 'bold_mask_mni', 'bold_cifti', + 'cifti_variant', 'cifti_variant_key', 'confounds', 'surfaces', + 't2s_map', 'aroma_noise_ics', 'melodic_mix', 'nonaggr_denoised_file']), name='outputnode') # BOLD buffer: an identity used as a pointer to either the original BOLD @@ -376,10 +376,12 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, (inputnode, func_derivatives_wf, [('bold_file', 'inputnode.source_file')]), (outputnode, func_derivatives_wf, [ ('bold_t1', 'inputnode.bold_t1'), + ('bold_t1_ref', 'inputnode.bold_t1_ref'), ('bold_aseg_t1', 'inputnode.bold_aseg_t1'), ('bold_aparc_t1', 'inputnode.bold_aparc_t1'), ('bold_mask_t1', 'inputnode.bold_mask_t1'), ('bold_mni', 'inputnode.bold_mni'), + ('bold_mni_ref', 'inputnode.bold_mni_ref'), ('bold_mask_mni', 'inputnode.bold_mask_mni'), ('confounds', 'inputnode.confounds'), ('surfaces', 'inputnode.surfaces'), @@ -501,6 +503,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, (bold_reg_wf, bold_t1_trans_wf, [ ('outputnode.itk_bold_to_t1', 'inputnode.itk_bold_to_t1')]), (bold_t1_trans_wf, outputnode, [('outputnode.bold_t1', 'bold_t1'), + ('outputnode.bold_t1_ref', 'bold_t1_ref'), ('outputnode.bold_aseg_t1', 'bold_aseg_t1'), ('outputnode.bold_aparc_t1', 'bold_aparc_t1')]), (bold_reg_wf, summary, [('outputnode.fallback', 'fallback')]), @@ -676,6 +679,7 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, (bold_sdc_wf, bold_mni_trans_wf, [ ('outputnode.out_warp', 'inputnode.fieldwarp')]), (bold_mni_trans_wf, outputnode, [('outputnode.bold_mni', 'bold_mni'), + ('outputnode.bold_mni_ref', 'bold_mni_ref'), ('outputnode.bold_mask_mni', 'bold_mask_mni')]), (bold_bold_trans_wf, carpetplot_wf, [ ('outputnode.bold', 'inputnode.bold'), @@ -811,7 +815,9 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, inputnode = pe.Node( niu.IdentityInterface( - fields=['source_file', 'bold_t1', 'bold_mask_t1', 'bold_mni', 'bold_mask_mni', + fields=['source_file', + 'bold_t1', 'bold_t1_ref', 'bold_mask_t1', + 'bold_mni', 'bold_mni_ref', 'bold_mask_mni', 'bold_aseg_t1', 'bold_aparc_t1', 'cifti_variant_key', 'confounds', 'surfaces', 'aroma_noise_ics', 'melodic_mix', 'nonaggr_denoised_file', 'bold_cifti', 'cifti_variant']), @@ -847,6 +853,8 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, workflow.connect([ (inputnode, ds_bold_t1, [('source_file', 'source_file'), ('bold_t1', 'in_file')]), + (inputnode, ds_bold_t1_ref, [('source_file', 'source_file'), + ('bold_t1_ref', 'in_file')]), (inputnode, ds_bold_mask_t1, [('source_file', 'source_file'), ('bold_mask_t1', 'in_file')]), ]) @@ -869,6 +877,8 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, workflow.connect([ (inputnode, ds_bold_mni, [('source_file', 'source_file'), ('bold_mni', 'in_file')]), + (inputnode, ds_bold_mni_ref, [('source_file', 'source_file'), + ('bold_mni_ref', 'in_file')]), (inputnode, ds_bold_mask_mni, [('source_file', 'source_file'), ('bold_mask_mni', 'in_file')]), ]) diff --git a/fmriprep/workflows/bold/registration.py b/fmriprep/workflows/bold/registration.py index b889b33ec..a3c4284d1 100644 --- a/fmriprep/workflows/bold/registration.py +++ b/fmriprep/workflows/bold/registration.py @@ -112,8 +112,8 @@ def init_bold_reg_wf(freesurfer, use_bbr, bold2t1w_dof, mem_gb, omp_nthreads, **Subworkflows** - * :py:func:`~fmriprep.workflows.util.init_bbreg_wf` - * :py:func:`~fmriprep.workflows.util.init_fsl_bbr_wf` + * :py:func:`~fmriprep.workflows.bold.registration.init_bbreg_wf` + * :py:func:`~fmriprep.workflows.bold.registration.init_fsl_bbr_wf` """ workflow = Workflow(name=name) @@ -232,6 +232,8 @@ def init_bold_t1_trans_wf(freesurfer, mem_gb, omp_nthreads, use_fieldwarp=False, bold_t1 Motion-corrected BOLD series in T1 space + bold_t1_ref + Reference, contrast-enhanced summary of the motion-corrected BOLD series in T1w space bold_mask_t1 BOLD mask in T1 space bold_aseg_t1 @@ -244,10 +246,11 @@ def init_bold_t1_trans_wf(freesurfer, mem_gb, omp_nthreads, use_fieldwarp=False, **Subworkflows** - * :py:func:`~fmriprep.workflows.util.init_bbreg_wf` - * :py:func:`~fmriprep.workflows.util.init_fsl_bbr_wf` + * :py:func:`~fmriprep.workflows.bold.registration.init_bbreg_wf` + * :py:func:`~fmriprep.workflows.bold.registration.init_fsl_bbr_wf` """ + from ..util import init_bold_reference_wf workflow = Workflow(name=name) inputnode = pe.Node( niu.IdentityInterface( @@ -260,7 +263,7 @@ def init_bold_t1_trans_wf(freesurfer, mem_gb, omp_nthreads, use_fieldwarp=False, outputnode = pe.Node( niu.IdentityInterface(fields=[ - 'bold_t1', 'bold_mask_t1', + 'bold_t1', 'bold_t1_ref', 'bold_mask_t1', 'bold_aseg_t1', 'bold_aparc_t1']), name='outputnode' ) @@ -320,6 +323,9 @@ def init_bold_t1_trans_wf(freesurfer, mem_gb, omp_nthreads, use_fieldwarp=False, merge = pe.Node(Merge(compress=use_compression), name='merge', mem_gb=mem_gb) + # Generate a reference on the target T1w space + gen_final_ref = init_bold_reference_wf(omp_nthreads) + workflow.connect([ (inputnode, merge_xforms, [('itk_bold_to_t1', 'in1')]), (merge_xforms, bold_to_t1w_transform, [('out', 'transforms')]), @@ -327,7 +333,9 @@ def init_bold_t1_trans_wf(freesurfer, mem_gb, omp_nthreads, use_fieldwarp=False, (inputnode, bold_to_t1w_transform, [('bold_split', 'input_image')]), (gen_ref, bold_to_t1w_transform, [('out_file', 'reference_image')]), (bold_to_t1w_transform, merge, [('out_files', 'in_files')]), + (merge, gen_final_ref, [('out_file', 'inputnode.bold_file')]), (merge, outputnode, [('out_file', 'bold_t1')]), + (gen_final_ref, outputnode, [('outputnode.ref_image', 'bold_t1_ref')]), ]) return workflow @@ -338,7 +346,7 @@ def init_bbreg_wf(use_bbr, bold2t1w_dof, omp_nthreads, name='bbreg_wf'): This workflow uses FreeSurfer's ``bbregister`` to register a BOLD image to a T1-weighted structural image. - It is a counterpart to :py:func:`~fmriprep.workflows.util.init_fsl_bbr_wf`, + It is a counterpart to :py:func:`~fmriprep.workflows.bold.registration.init_fsl_bbr_wf`, which performs the same task using FSL's FLIRT with a BBR cost function. The ``use_bbr`` option permits a high degree of control over registration. @@ -381,9 +389,9 @@ def init_bbreg_wf(use_bbr, bold2t1w_dof, omp_nthreads, name='bbreg_wf'): subject_id FreeSurfer subject ID (must have folder in SUBJECTS_DIR) t1_brain - Unused (see :py:func:`~fmriprep.workflows.util.init_fsl_bbr_wf`) + Unused (see :py:func:`~fmriprep.workflows.bold.registration.init_fsl_bbr_wf`) t1_seg - Unused (see :py:func:`~fmriprep.workflows.util.init_fsl_bbr_wf`) + Unused (see :py:func:`~fmriprep.workflows.bold.registration.init_fsl_bbr_wf`) Outputs @@ -556,17 +564,17 @@ def init_fsl_bbr_wf(use_bbr, bold2t1w_dof, name='fsl_bbr_wf'): t1_seg FAST segmentation of ``t1_brain`` t1_2_fsnative_reverse_transform - Unused (see :py:func:`~fmriprep.workflows.util.init_bbreg_wf`) + Unused (see :py:func:`~fmriprep.workflows.bold.registration.init_bbreg_wf`) subjects_dir - Unused (see :py:func:`~fmriprep.workflows.util.init_bbreg_wf`) + Unused (see :py:func:`~fmriprep.workflows.bold.registration.init_bbreg_wf`) subject_id - Unused (see :py:func:`~fmriprep.workflows.util.init_bbreg_wf`) + Unused (see :py:func:`~fmriprep.workflows.bold.registration.init_bbreg_wf`) Outputs itk_bold_to_t1 - Affine transform from ``ref_bold_brain`` to T1 space (ITK format) + Affine transform from ``ref_bold_brain`` to T1w space (ITK format) itk_t1_to_bold Affine transform from T1 space to BOLD space (ITK format) out_report diff --git a/fmriprep/workflows/bold/resampling.py b/fmriprep/workflows/bold/resampling.py index 114f2309b..6c19c342e 100644 --- a/fmriprep/workflows/bold/resampling.py +++ b/fmriprep/workflows/bold/resampling.py @@ -227,6 +227,8 @@ def init_bold_mni_trans_wf(template, mem_gb, omp_nthreads, bold_mni BOLD series, resampled to template space + bold_mni_ref + Reference, contrast-enhanced summary of the BOLD series, resampled to template space bold_mask_mni BOLD series mask in template space @@ -251,7 +253,7 @@ def init_bold_mni_trans_wf(template, mem_gb, omp_nthreads, ) outputnode = pe.Node( - niu.IdentityInterface(fields=['bold_mni', 'bold_mask_mni']), + niu.IdentityInterface(fields=['bold_mni', 'bold_mni_ref', 'bold_mask_mni']), name='outputnode') def _aslist(in_value): @@ -298,6 +300,9 @@ def _aslist(in_value): merge = pe.Node(Merge(compress=use_compression), name='merge', mem_gb=mem_gb * 3) + # Generate a reference on the target T1w space + gen_final_ref = init_bold_reference_wf(omp_nthreads) + workflow.connect([ (inputnode, merge_xforms, [('t1_2_mni_forward_transform', 'in1'), (('itk_bold_to_t1', _aslist), 'in2')]), @@ -305,7 +310,9 @@ def _aslist(in_value): (inputnode, merge, [('name_source', 'header_source')]), (inputnode, bold_to_mni_transform, [('bold_split', 'input_image')]), (bold_to_mni_transform, merge, [('out_files', 'in_files')]), + (merge, gen_final_ref, [('out_file', 'inputnode.bold_file')]), (merge, outputnode, [('out_file', 'bold_mni')]), + (gen_final_ref, outputnode, [('outputnode.ref_image', 'bold_mni_ref')]), ]) if template_out_grid == 'native': From 3a20826e224c727b03087964611b91965f1188d9 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Wed, 3 Oct 2018 23:17:53 -0400 Subject: [PATCH 09/83] CI: Deploy poldracklab/fmriprep:unstable tracking master --- .circleci/config.yml | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ce14a36bf..1b2467b1a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -668,7 +668,7 @@ jobs: - store_artifacts: path: /tmp/ds210 - deploy: + deploy_docker: machine: image: circleci/classic:201711-01 working_directory: /tmp/src/fmriprep @@ -692,10 +692,22 @@ jobs: command: | if [[ -n "$DOCKER_PASS" ]]; then docker login -u $DOCKER_USER -p $DOCKER_PASS - docker push poldracklab/fmriprep:latest - docker tag poldracklab/fmriprep poldracklab/fmriprep:$CIRCLE_TAG - docker push poldracklab/fmriprep:$CIRCLE_TAG + docker tag poldracklab/fmriprep poldracklab/fmriprep:unstable + docker push poldracklab/fmriprep:unstable + if [[ -n "$CIRCLE_TAG" ]]; then + docker push poldracklab/fmriprep:latest + docker tag poldracklab/fmriprep poldracklab/fmriprep:$CIRCLE_TAG + docker push poldracklab/fmriprep:$CIRCLE_TAG + fi fi + + deploy_pypi: + machine: + image: circleci/classic:201711-01 + working_directory: /tmp/src/fmriprep + steps: + - attach_workspace: + at: /tmp - run: name: Deploy to PyPi command: | @@ -785,7 +797,21 @@ workflows: tags: only: /.*/ - - deploy: + - deploy_docker: + requires: + - build + - test_pytest + - build_docs + - ds005 + - ds054 + - ds210 + filters: + branches: + only: master + tags: + only: /.*/ + + - deploy_pypi: requires: - build - test_pytest From 887cd3e108140b2d21d1687c9a6773d3790e6591 Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 3 Oct 2018 22:20:55 -0700 Subject: [PATCH 10/83] fix import path --- fmriprep/workflows/bold/registration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmriprep/workflows/bold/registration.py b/fmriprep/workflows/bold/registration.py index a3c4284d1..fbd2dd6b6 100644 --- a/fmriprep/workflows/bold/registration.py +++ b/fmriprep/workflows/bold/registration.py @@ -250,7 +250,7 @@ def init_bold_t1_trans_wf(freesurfer, mem_gb, omp_nthreads, use_fieldwarp=False, * :py:func:`~fmriprep.workflows.bold.registration.init_fsl_bbr_wf` """ - from ..util import init_bold_reference_wf + from .util import init_bold_reference_wf workflow = Workflow(name=name) inputnode = pe.Node( niu.IdentityInterface( From b8674537830927151ab57122ee31e3d64909cdbe Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 3 Oct 2018 23:40:45 -0700 Subject: [PATCH 11/83] fix ds210 --- .circleci/ds210_outputs.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/ds210_outputs.txt b/.circleci/ds210_outputs.txt index 3eb7e04a3..bb2c9ce17 100644 --- a/.circleci/ds210_outputs.txt +++ b/.circleci/ds210_outputs.txt @@ -24,13 +24,15 @@ fmriprep/sub-02/anat/sub-02_target-MNI152NLin2009cAsym_warp.h5 fmriprep/sub-02/func fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_confounds.tsv fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_brainmask.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_confounds.tsv fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_brainmask.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_confounds.tsv fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_brainmask.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz fmriprep/sub-02.html /tmp/ds210/derivatives From 9f2e25db340ceafc1fb94ad24f337179b317e368 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 4 Oct 2018 06:54:40 -0700 Subject: [PATCH 12/83] use _boldref suffix. close #960 --- .circleci/ds005_outputs.txt | 8 ++++---- .circleci/ds005_partial_outputs.txt | 4 ++-- .circleci/ds054_outputs.txt | 8 ++++---- .circleci/ds210_outputs.txt | 6 +++--- fmriprep/workflows/bold/base.py | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.circleci/ds005_outputs.txt b/.circleci/ds005_outputs.txt index e4bedc65a..c640b163e 100644 --- a/.circleci/ds005_outputs.txt +++ b/.circleci/ds005_outputs.txt @@ -41,11 +41,11 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-spa fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_boldref.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_preproc.nii.gz @@ -57,11 +57,11 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-cifti_variant-spa fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5.L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5.R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_boldref.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_desc-boldref.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aparcaseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_preproc.nii.gz diff --git a/.circleci/ds005_partial_outputs.txt b/.circleci/ds005_partial_outputs.txt index a5ee213f6..35e508ab5 100644 --- a/.circleci/ds005_partial_outputs.txt +++ b/.circleci/ds005_partial_outputs.txt @@ -41,11 +41,11 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-spa fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-3dref_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_boldref.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_preproc.nii.gz diff --git a/.circleci/ds054_outputs.txt b/.circleci/ds054_outputs.txt index 03829c4f3..ff63e1aa1 100644 --- a/.circleci/ds054_outputs.txt +++ b/.circleci/ds054_outputs.txt @@ -24,17 +24,17 @@ fmriprep/sub-100185/anat/sub-100185_target-MNI152NLin2009cAsym_warp.h5 fmriprep/sub-100185/func fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_confounds.tsv fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_desc-3dref_bold.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_boldref.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_preproc.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_confounds.tsv fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_boldref.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_desc-3dref_bold.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_boldref.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_preproc.nii.gz fmriprep/sub-100185.html /tmp/ds054/derivatives diff --git a/.circleci/ds210_outputs.txt b/.circleci/ds210_outputs.txt index bb2c9ce17..e4e0b0879 100644 --- a/.circleci/ds210_outputs.txt +++ b/.circleci/ds210_outputs.txt @@ -24,15 +24,15 @@ fmriprep/sub-02/anat/sub-02_target-MNI152NLin2009cAsym_warp.h5 fmriprep/sub-02/func fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_confounds.tsv fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_boldref.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_confounds.tsv fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_boldref.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_confounds.tsv fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_desc-3dref_bold.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_boldref.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-02.html /tmp/ds210/derivatives diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index 97dab14cc..b73ff02bd 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -842,8 +842,8 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, name='ds_bold_t1', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) ds_bold_t1_ref = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix=suffix_fmt('T1w', 'desc-3dref'), - keep_dtype=True), name='ds_bold_t1_ref', run_without_submitting=True, + base_directory=output_dir, suffix=suffix_fmt('T1w', 'boldref')), + name='ds_bold_t1_ref', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) ds_bold_mask_t1 = pe.Node(DerivativesDataSink( @@ -866,8 +866,8 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, name='ds_bold_mni', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) ds_bold_mni_ref = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix=suffix_fmt(template, 'desc-3dref'), - keep_dtype=True), name='ds_bold_mni_ref', run_without_submitting=True, + base_directory=output_dir, suffix=suffix_fmt(template, 'boldref')), + name='ds_bold_mni_ref', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) ds_bold_mask_mni = pe.Node(DerivativesDataSink( From 1da14195b7c04cabe78d1a56660c5697f67b035f Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 4 Oct 2018 08:20:17 -0700 Subject: [PATCH 13/83] fix ordering of derivatives --- .circleci/ds005_outputs.txt | 8 ++++---- .circleci/ds005_partial_outputs.txt | 4 ++-- .circleci/ds054_outputs.txt | 8 ++++---- .circleci/ds210_outputs.txt | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.circleci/ds005_outputs.txt b/.circleci/ds005_outputs.txt index c640b163e..0a4f54236 100644 --- a/.circleci/ds005_outputs.txt +++ b/.circleci/ds005_outputs.txt @@ -40,12 +40,12 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-spa fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-space1_preproc.dtseries.nii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.R.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_boldref.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_preproc.nii.gz @@ -56,12 +56,12 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-cifti_variant-spa fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-cifti_variant-space1_preproc.dtseries.nii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5.L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5.R.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_boldref.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_boldref.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_desc-boldref.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aparcaseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_preproc.nii.gz diff --git a/.circleci/ds005_partial_outputs.txt b/.circleci/ds005_partial_outputs.txt index 35e508ab5..afca57030 100644 --- a/.circleci/ds005_partial_outputs.txt +++ b/.circleci/ds005_partial_outputs.txt @@ -40,12 +40,12 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-spa fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-space1_preproc.dtseries.nii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.R.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_boldref.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_roi.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_preproc.nii.gz diff --git a/.circleci/ds054_outputs.txt b/.circleci/ds054_outputs.txt index ff63e1aa1..a1dc5fcd5 100644 --- a/.circleci/ds054_outputs.txt +++ b/.circleci/ds054_outputs.txt @@ -23,18 +23,18 @@ fmriprep/sub-100185/anat/sub-100185_space-orig_target-T1w_affine.txt fmriprep/sub-100185/anat/sub-100185_target-MNI152NLin2009cAsym_warp.h5 fmriprep/sub-100185/func fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_confounds.tsv -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_boldref.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_preproc.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_confounds.tsv -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_boldref.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_boldref.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_brainmask.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_preproc.nii.gz fmriprep/sub-100185.html /tmp/ds054/derivatives diff --git a/.circleci/ds210_outputs.txt b/.circleci/ds210_outputs.txt index e4e0b0879..ff00333f9 100644 --- a/.circleci/ds210_outputs.txt +++ b/.circleci/ds210_outputs.txt @@ -23,16 +23,16 @@ fmriprep/sub-02/anat/sub-02_space-orig_target-T1w_affine.txt fmriprep/sub-02/anat/sub-02_target-MNI152NLin2009cAsym_warp.h5 fmriprep/sub-02/func fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_confounds.tsv -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_boldref.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_confounds.tsv -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_boldref.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_confounds.tsv -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_boldref.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_brainmask.nii.gz fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_preproc.nii.gz fmriprep/sub-02.html /tmp/ds210/derivatives From 165df97f663a37c2dd31e7963ba105fbb7bb7461 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 4 Oct 2018 10:53:57 -0700 Subject: [PATCH 14/83] Version 1.1.8 - Update CHANGES [skip ci] --- CHANGES.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index fdab4483a..a0f66531c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,14 @@ +1.1.8 (October 4, 2018) +======================= + +Several bug fixes. This release is intended to be the last before start +adopting BIDS-Derivatives RC1 (which will trigger 1.2.x versions). + +* [DOC] Switch to orig graph for ``init_bold_t2s_wf`` (#1298) @effigies +* [FIX] Enhance T2 contrast ``enhance_t2`` in reference estimate (#1299) @effigies +* [FIX] Create template from one usable T1w image (#1305) @effigies +* [MAINT] Pin grabbit and pybids in ``setup.py`` (#1284) @oesteban + 1.1.7 (September 25, 2018) ========================== From 3befabb064d316f7d7cbb209360d2f7699608865 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 4 Oct 2018 17:37:04 -0700 Subject: [PATCH 15/83] [skip ci] Add YAML file with list of subject that were included in the paper --- fmriprep/data/paper_sample.yml | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 fmriprep/data/paper_sample.yml diff --git a/fmriprep/data/paper_sample.yml b/fmriprep/data/paper_sample.yml new file mode 100644 index 000000000..3c6913ef8 --- /dev/null +++ b/fmriprep/data/paper_sample.yml @@ -0,0 +1,55 @@ +ds000001: ["01", "02", "07", 08] +ds000002: ["02", "03", "04", "10"] +ds000003: ["02", "09", "10", "11"] +ds000005: ["01", "04", "05", "15"] +ds000007: ["03", "04", "08", "12"] +ds000008: ["10", "12", "13", "15"] +ds000009: ["17", "18", "21", "23"] +ds000011: ["03", "09", "11", "14"] +ds000017: ["2", "5", "7", "8"] +ds000030: ["10440", "10638", "10668", "10855"] +ds000031: ["01"] +ds000051: ["02", "04", "06", "09"] +ds000052: ["05", "10", "12", "13"] +ds000053: ["002", "003", "005", "006"] +ds000101: ["05", "11", "17", "20"] +ds000102: ["08", "10", "16", "20"] +ds000105: ["1", "4", "5", "6"] +ds000107: ["05", "36", "39", "47"] +ds000108: ["03", "10", "24", "26"] +ds000109: ["02", "11", "15", "39"] +ds000110: ["01", "02", "03", "06"] +ds000114: ["02", "03", "04", "07"] +ds000115: ["31", "68", "77", "78"] +ds000116: ["08", "12", "15", "17"] +ds000119: ["11", "26", "56", "58"] +ds000120: ["04", "05", "08", "24"] +ds000121: ["01", "18", "22", "26"] +ds000133: ["06", "21", "22", "23"] +ds000140: ["05", "27", "32", "33"] +ds000148: ["09", "26", "28", "33"] +ds000157: ["04", "21", "23", "28"] +ds000158: ["064", "081", "122", "149"] +ds000164: ["006", "012", "019", "027"] +ds000168: ["08", "27", "30", "49"] +ds000170: ["1700", "1708", "1710", "1713"] +ds000171: [control04, control08, control14, mdd03] +ds000177: ["04", "07", "10", "11"] +ds000200: ["2004", "2011", "2012", "2014"] +ds000205: ["01", "05", "06", "07"] +ds000208: ["27", "45", "56", "69"] +ds000212: ["07", "13", "20", "29"] +ds000213: ["06", "10", "12", "13"] +ds000214: [EESS006, EESS031, EESS033, EESS034] +ds000216: ["01", "02", "03", "04"] +ds000218: ["02", "07", "12", "17"] +ds000219: ["04", "09", "10", "12"] +ds000220: [tbi03, tbi05, tbi06, tbi10] +ds000221: ["010016","010064","010125","010251"] +ds000224: [MSC05, MSC08, MSC09, MSC10] +ds000228: [pixar001, pixar017, pixar103, pixar132] +ds000229: ["02", "05", "07", "10"] +ds000231: ["01", "02", "03", "09"] +ds000233: [rid000001, rid000017, rid000031, rid000032] +ds000237: ["01", "03", "04", "06"] +ds000243: ["023", "066", "089", "094"] \ No newline at end of file From 2ee473ecf165778044b8472d4d29a0504d730689 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 4 Oct 2018 17:48:27 -0700 Subject: [PATCH 16/83] [skip ci] Add quotes to string --- fmriprep/data/paper_sample.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fmriprep/data/paper_sample.yml b/fmriprep/data/paper_sample.yml index 3c6913ef8..2d0133cfb 100644 --- a/fmriprep/data/paper_sample.yml +++ b/fmriprep/data/paper_sample.yml @@ -1,4 +1,4 @@ -ds000001: ["01", "02", "07", 08] +ds000001: ["01", "02", "07", "08"] ds000002: ["02", "03", "04", "10"] ds000003: ["02", "09", "10", "11"] ds000005: ["01", "04", "05", "15"] @@ -52,4 +52,4 @@ ds000229: ["02", "05", "07", "10"] ds000231: ["01", "02", "03", "09"] ds000233: [rid000001, rid000017, rid000031, rid000032] ds000237: ["01", "03", "04", "06"] -ds000243: ["023", "066", "089", "094"] \ No newline at end of file +ds000243: ["023", "066", "089", "094"] From 4384681fbf3658160db85304b8654d48517c8a64 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Fri, 5 Oct 2018 20:28:43 -0700 Subject: [PATCH 17/83] clean-up caches --- .circleci/config.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ce14a36bf..a01c05f36 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -352,10 +352,10 @@ jobs: at: /tmp - restore_cache: keys: - - ds005-anat-v7-{{ .Branch }}-{{ epoch }} - - ds005-anat-v7-{{ .Branch }} - - ds005-anat-v7-master - - ds005-anat-v7- + - ds005-anat-v8-{{ .Branch }}-{{ epoch }} + - ds005-anat-v8-{{ .Branch }} + - ds005-anat-v8-master + - ds005-anat-v8- - run: name: Setting up test command: | @@ -389,7 +389,7 @@ jobs: --debug --write-graph --mem_mb 4096 \ --nthreads 2 --anat-only -vv - save_cache: - key: ds005-anat-v7-{{ .Branch }}-{{ epoch }} + key: ds005-anat-v8-{{ .Branch }}-{{ epoch }} paths: - /tmp/ds005/work - /tmp/ds005/derivatives/fmriprep @@ -481,10 +481,10 @@ jobs: at: /tmp - restore_cache: keys: - - ds054-anat-v5-{{ .Branch }}-{{ epoch }} - - ds054-anat-v5-{{ .Branch }} - - ds054-anat-v5-master - - ds054-anat-v5- + - ds054-anat-v6-{{ .Branch }}-{{ epoch }} + - ds054-anat-v6-{{ .Branch }} + - ds054-anat-v6-master + - ds054-anat-v6- - run: name: Setting up test command: | @@ -518,7 +518,7 @@ jobs: --fs-no-reconall --debug --write-graph \ --mem_mb 4096 --nthreads 2 --anat-only -vv - save_cache: - key: ds054-anat-v5-{{ .Branch }}-{{ epoch }} + key: ds054-anat-v6-{{ .Branch }}-{{ epoch }} paths: - /tmp/ds054/work - /tmp/ds054/derivatives @@ -599,8 +599,8 @@ jobs: at: /tmp - restore_cache: keys: - - ds210-anat-v2-{{ epoch }} - - ds210-anat-v2- + - ds210-anat-v3-{{ epoch }} + - ds210-anat-v3- - run: name: Setting up test command: | @@ -634,7 +634,7 @@ jobs: --fs-no-reconall --debug --write-graph \ --mem_mb 4096 --nthreads 2 --anat-only -vv - save_cache: - key: ds210-anat-v2-{{ epoch }} + key: ds210-anat-v3-{{ epoch }} paths: - /tmp/ds210/work - /tmp/ds210/derivatives From c19a51a886e434ad18f8a15d08e444bdaba62be0 Mon Sep 17 00:00:00 2001 From: surchs Date: Tue, 9 Oct 2018 16:13:32 -0400 Subject: [PATCH 18/83] fix BIDS-validator link --- docs/usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage.rst b/docs/usage.rst index 37b204cd1..30fadd453 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -18,7 +18,7 @@ The input dataset is required to be in valid :abbr:`BIDS (Brain Imaging Data Structure)` format, and it must include at least one T1w structural image and (unless disabled with a flag) a BOLD series. We highly recommend that you validate your dataset with the free, online -`BIDS Validator `_. +`BIDS Validator `_. The exact command to run ``fmriprep`` depends on the Installation_ method. The common parts of the command follow the `BIDS-Apps From ec5e651e61b96306f6b575075c8af760b3a5e541 Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 15 Oct 2018 11:43:42 -0700 Subject: [PATCH 19/83] [ENH] Template-based masking of EPI boldrefs --- docker/scripts/get_templates.sh | 8 +++- fmriprep/__about__.py | 2 + fmriprep/workflows/bold/util.py | 71 +++++++++++++++++++++++++++------ requirements.txt | 2 +- 4 files changed, 67 insertions(+), 16 deletions(-) diff --git a/docker/scripts/get_templates.sh b/docker/scripts/get_templates.sh index bd3663668..d060531bb 100755 --- a/docker/scripts/get_templates.sh +++ b/docker/scripts/get_templates.sh @@ -6,10 +6,12 @@ ASYM_09C_TEMPLATE="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/ ASYM_09C_SHA256="a24699ba0d13f72d0f8934cc211cb80bfd9c9a077b481d9b64295cf5275235a9" OASIS_TEMPLATE="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/584123a29ad5a1020913609d" OASIS_SHA256="d87300e91346c16f55baf6f54f5f990bc020b61e8d5df9bcc3abb0cc4b943113" -NKI_TEMPLATE="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/59cd90f46c613b02b3d79782" -NKI_SHA256="4bba067f6675d15be96b205cb227e18a540673fd7e4577e13feedcef3a6f0ec5" +NKI_TEMPLATE="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/5bc3fad82aa873001bc5a553" +NKI_SHA256="9c08713d067bcf13baa61b01a9495e526b55d1f148d951da01e082679f076fa9" OASIS_DKT31_TEMPLATE="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/5b16f17aeca4a80012bd7542" OASIS_DKT31_SHA256="623fa7141712b1a7263331dba16eb069a4443e9640f52556c89d461611478145" +EPI_TEMPLATE="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/5bc12155ac011000176bff82" +EPI_SHA256="fcd6980ef98c9d7622c6dc2a7747ff51ba3909d98e2a740df9a8265d50920d1b" GET(){ URL=$1; SHA256=$2; @@ -36,4 +38,6 @@ echo "Getting NKI template" GET "$NKI_TEMPLATE" "$NKI_SHA256" echo "Getting OASIS DKT31 template" GET "$OASIS_DKT31_TEMPLATE" "$OASIS_DKT31_SHA256" +echo "Getting fMRIPrep's BOLDref template" +GET "$EPI_TEMPLATE" "$EPI_SHA256" echo "Done!" diff --git a/fmriprep/__about__.py b/fmriprep/__about__.py index 04a87e61a..3a844b20c 100644 --- a/fmriprep/__about__.py +++ b/fmriprep/__about__.py @@ -108,6 +108,8 @@ ] LINKS_REQUIRES = [ + "git+https://github.com/oesteban/niworkflows.git" + "@11ea24fc4f1bb93768a0cef8b4252c498534f76e#egg=niworkflows-0.4.3", ] TESTS_REQUIRES = [ diff --git a/fmriprep/workflows/bold/util.py b/fmriprep/workflows/bold/util.py index de7e3238a..73efcd18b 100644 --- a/fmriprep/workflows/bold/util.py +++ b/fmriprep/workflows/bold/util.py @@ -10,11 +10,20 @@ .. autofunction:: init_skullstrip_bold_wf """ +from packaging.version import parse as parseversion, Version +from pkg_resources import resource_filename as pkgr_fn + from nipype.pipeline import engine as pe from nipype.interfaces import utility as niu, fsl, afni, ants -from niworkflows.interfaces.utils import CopyXForm +from niworkflows.data import get_template +from niworkflows.interfaces.ants import AI +from niworkflows.interfaces.fixes import ( + FixHeaderRegistration as Registration, + FixHeaderApplyTransforms as ApplyTransforms, +) from niworkflows.interfaces.masks import SimpleShowMaskRPT from niworkflows.interfaces.registration import EstimateReferenceImage +from niworkflows.interfaces.utils import CopyXForm from ...engine import Workflow from ...interfaces.nilearn import MaskEPI @@ -105,8 +114,8 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, name='bold_reference_wf mem_gb=1) # OE: 128x128x128x50 * 64 / 8 ~ 900MB. # Re-run validation; no effect if no sbref; otherwise apply same validation to sbref as bold validate_ref = pe.Node(ValidateImage(), name='validate_ref', mem_gb=DEFAULT_MEMORY_MIN_GB) - enhance_and_skullstrip_bold_wf = init_enhance_and_skullstrip_bold_wf(omp_nthreads=omp_nthreads, - enhance_t2=enhance_t2) + enhance_and_skullstrip_bold_wf = init_enhance_and_skullstrip_bold_wf( + omp_nthreads=omp_nthreads) workflow.connect([ (inputnode, validate, [('bold_file', 'in_file')]), @@ -137,7 +146,7 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, name='bold_reference_wf def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', - omp_nthreads=1, enhance_t2=False): + omp_nthreads=1): """ This workflow takes in a :abbr:`BOLD (blood-oxygen level-dependant)` :abbr:`fMRI (functional MRI)` average/summary (e.g. a reference image @@ -177,10 +186,6 @@ def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', Name of workflow (default: ``enhance_and_skullstrip_bold_wf``) omp_nthreads : int number of threads available to parallel nodes - enhance_t2 : bool - perform logarithmic transform of input BOLD image to improve contrast - before calculating the preliminary mask - **Inputs** @@ -207,9 +212,43 @@ def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', outputnode = pe.Node(niu.IdentityInterface(fields=[ 'mask_file', 'skull_stripped_file', 'bias_corrected_file']), name='outputnode') - # Create a loose mask to avoid N4 internal's Otsu mask - n4_mask = pe.Node(MaskEPI(upper_cutoff=0.75, enhance_t2=enhance_t2, opening=1, - no_sanitize=True), name='n4_mask') + bold_template = get_template('fMRIPrep') / 'tpl-fMRIPrep_space-MNI_res-02_boldref.nii.gz' + brain_mask = get_template('MNI152NLin2009cAsym') / \ + 'tpl-MNI152NLin2009cAsym_space-MNI_res-02_brainmask.nii.gz' + + # Initialize transforms with antsAI + init_aff = pe.Node(AI( + fixed_image=str(bold_template), + fixed_image_mask=str(brain_mask), + metric=('Mattes', 32, 'Regular', 0.2), + transform=('Affine', 0.1), + search_factor=(20, 0.12), + principal_axes=False, + convergence=(10, 1e-6, 10), + verbose=True), + name='init_aff', + n_procs=omp_nthreads) + + if parseversion(Registration().version) > Version('2.2.0'): + init_aff.inputs.search_grid = (40, (0, 40, 40)) + + # Set up spatial normalization + norm = pe.Node(Registration( + from_file=pkgr_fn( + 'fmriprep.data', + 'epi_registration_settings.json')), + name='norm', + n_procs=omp_nthreads) + fixed_mask_trait = 'fixed_image_mask' + norm.inputs.fixed_image = str(bold_template) + if parseversion(Registration().version) >= Version('2.2.0'): + fixed_mask_trait += 's' + setattr(norm.inputs, fixed_mask_trait, str(brain_mask)) + + map_brainmask = pe.Node( + ApplyTransforms(interpolation='MultiLabel', float=True, input_image=str(brain_mask)), + name='map_brainmask' + ) # Run N4 normally, force num_threads=1 for stability (images are small, no need for >1) n4_correct = pe.Node(ants.N4BiasFieldCorrection(dimension=3, copy_header=True), @@ -246,11 +285,17 @@ def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', apply_mask = pe.Node(fsl.ApplyMask(), name='apply_mask') workflow.connect([ - (inputnode, n4_mask, [('in_file', 'in_files')]), + (inputnode, init_aff, [('in_file', 'moving_image')]), + (inputnode, map_brainmask, [('in_file', 'reference_image')]), + (inputnode, norm, [('in_file', 'moving_image')]), + (init_aff, norm, [('output_transform', 'initial_moving_transform')]), + (norm, map_brainmask, [ + ('reverse_invert_flags', 'invert_transform_flags'), + ('reverse_transforms', 'transforms')]), (inputnode, n4_correct, [('in_file', 'input_image')]), (inputnode, fixhdr_unifize, [('in_file', 'hdr_file')]), (inputnode, fixhdr_skullstrip2, [('in_file', 'hdr_file')]), - (n4_mask, n4_correct, [('out_mask', 'mask_image')]), + (map_brainmask, n4_correct, [('output_image', 'mask_image')]), (n4_correct, skullstrip_first_pass, [('output_image', 'in_file')]), (skullstrip_first_pass, bet_dilate, [('mask_file', 'in_file')]), (bet_dilate, bet_mask, [('out_file', 'mask_file')]), diff --git a/requirements.txt b/requirements.txt index 01add8634..b0f54a5ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -niworkflows>=0.4.3 +git+https://github.com/oesteban/niworkflows.git@11ea24fc4f1bb93768a0cef8b4252c498534f76e#egg=niworkflows-0.4.3 grabbit==0.2.3 pybids==0.6.5 versioneer From 3e344dba74450a189ad2b7ee42810515a1e33fce Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 15 Oct 2018 11:52:31 -0700 Subject: [PATCH 20/83] fix flake8 error --- fmriprep/workflows/bold/util.py | 1 - 1 file changed, 1 deletion(-) diff --git a/fmriprep/workflows/bold/util.py b/fmriprep/workflows/bold/util.py index 73efcd18b..3123f0ee3 100644 --- a/fmriprep/workflows/bold/util.py +++ b/fmriprep/workflows/bold/util.py @@ -26,7 +26,6 @@ from niworkflows.interfaces.utils import CopyXForm from ...engine import Workflow -from ...interfaces.nilearn import MaskEPI from ...interfaces import ValidateImage From 2679533f4d538786df34fbf8052fad23e34dd195 Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 15 Oct 2018 13:42:19 -0700 Subject: [PATCH 21/83] use poldracklab/niworkflows@0946bad69867840718d4aeeb54ef11bd535c1a9c --- fmriprep/__about__.py | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fmriprep/__about__.py b/fmriprep/__about__.py index 3a844b20c..01c62f93c 100644 --- a/fmriprep/__about__.py +++ b/fmriprep/__about__.py @@ -109,7 +109,7 @@ LINKS_REQUIRES = [ "git+https://github.com/oesteban/niworkflows.git" - "@11ea24fc4f1bb93768a0cef8b4252c498534f76e#egg=niworkflows-0.4.3", + "@0946bad69867840718d4aeeb54ef11bd535c1a9c#egg=niworkflows-0.4.3", ] TESTS_REQUIRES = [ diff --git a/requirements.txt b/requirements.txt index b0f54a5ae..37767211e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -git+https://github.com/oesteban/niworkflows.git@11ea24fc4f1bb93768a0cef8b4252c498534f76e#egg=niworkflows-0.4.3 +git+https://github.com/oesteban/niworkflows.git@0946bad69867840718d4aeeb54ef11bd535c1a9c#egg=niworkflows-0.4.3 grabbit==0.2.3 pybids==0.6.5 versioneer From af0cd52be8b0fbc6e31cf9eb9561ed57dc43d921 Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 15 Oct 2018 14:43:06 -0700 Subject: [PATCH 22/83] update pinning to release --- docs/environment.yml | 2 +- fmriprep/__about__.py | 4 +--- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/environment.yml b/docs/environment.yml index 2c92a97dc..850916563 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -29,4 +29,4 @@ dependencies: - svgutils - nitime - nilearn - - niworkflows>=0.4.2 + - niworkflows>=0.4.4 diff --git a/fmriprep/__about__.py b/fmriprep/__about__.py index 01c62f93c..bae53895e 100644 --- a/fmriprep/__about__.py +++ b/fmriprep/__about__.py @@ -98,7 +98,7 @@ 'pybids==0.6.5', 'nitime', 'nipype>=1.1.3', - 'niworkflows>=0.4.3', + 'niworkflows>=0.4.4', 'statsmodels', 'seaborn', 'indexed_gzip>=0.8.2', @@ -108,8 +108,6 @@ ] LINKS_REQUIRES = [ - "git+https://github.com/oesteban/niworkflows.git" - "@0946bad69867840718d4aeeb54ef11bd535c1a9c#egg=niworkflows-0.4.3", ] TESTS_REQUIRES = [ diff --git a/requirements.txt b/requirements.txt index 37767211e..c184845fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -git+https://github.com/oesteban/niworkflows.git@0946bad69867840718d4aeeb54ef11bd535c1a9c#egg=niworkflows-0.4.3 +niworkflows>=0.4.4 grabbit==0.2.3 pybids==0.6.5 versioneer From b5aa8bd5fda5d58884e0a678f2fffbe79aaffa7c Mon Sep 17 00:00:00 2001 From: Ali Cohen Date: Mon, 15 Oct 2018 18:15:17 -0400 Subject: [PATCH 23/83] update reports.py --- fmriprep/viz/reports.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fmriprep/viz/reports.py b/fmriprep/viz/reports.py index 7dd72ff24..27813ea56 100644 --- a/fmriprep/viz/reports.py +++ b/fmriprep/viz/reports.py @@ -145,7 +145,7 @@ def _read_pkl(path): @staticmethod def _read_txt(path): - lines = path.read_text().splitlines() + lines = path.read_text(encoding='UTF-8').splitlines() data = {'file': str(path)} traceback_start = 0 if lines[0].startswith('Node'): @@ -170,7 +170,7 @@ def generate_report(self): boiler_idx = 0 if (logs_path / 'CITATION.html').exists(): - text = (logs_path / 'CITATION.html').read_text() + text = (logs_path / 'CITATION.html').read_text(encoding='UTF-8') text = '
%s
' % re.compile( '(.*?)', re.DOTALL | re.IGNORECASE).findall(text)[0].strip() @@ -178,19 +178,19 @@ def generate_report(self): boiler_idx += 1 if (logs_path / 'CITATION.md').exists(): - text = '
%s
\n' % (logs_path / 'CITATION.md').read_text() + text = '
%s
\n' % (logs_path / 'CITATION.md').read_text(encoding='UTF-8') boilerplate.append((boiler_idx, 'Markdown', text)) boiler_idx += 1 if (logs_path / 'CITATION.tex').exists(): - text = (logs_path / 'CITATION.tex').read_text() + text = (logs_path / 'CITATION.tex').read_text(encoding='UTF-8') text = re.compile( r'\\begin{document}(.*?)\\end{document}', re.DOTALL | re.IGNORECASE).findall(text)[0].strip() text = '
%s
\n' % text text += '

Bibliography

\n' text += '
%s
\n' % Path( - pkgrf('fmriprep', 'data/boilerplate.bib')).read_text() + pkgrf('fmriprep', 'data/boilerplate.bib')).read_text(encoding='UTF-8') boilerplate.append((boiler_idx, 'LaTeX', text)) boiler_idx += 1 @@ -204,7 +204,7 @@ def generate_report(self): boilerplate=boilerplate) # Write out report - (self.out_dir / 'fmriprep' / self.out_filename).write_text(report_render) + (self.out_dir / 'fmriprep' / self.out_filename).write_text(report_render, encoding='UTF-8') return len(self.errors) From c088fb6fc9b33b45da72e333b977755a50f616da Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 15 Oct 2018 23:09:29 -0700 Subject: [PATCH 24/83] new registration parameters --- fmriprep/data/epi_atlasbased_brainmask.json | 20 ++++++++++++++++++++ fmriprep/workflows/bold/tests/test_util.py | 2 +- fmriprep/workflows/bold/util.py | 10 +++++----- 3 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 fmriprep/data/epi_atlasbased_brainmask.json diff --git a/fmriprep/data/epi_atlasbased_brainmask.json b/fmriprep/data/epi_atlasbased_brainmask.json new file mode 100644 index 000000000..94066b4bd --- /dev/null +++ b/fmriprep/data/epi_atlasbased_brainmask.json @@ -0,0 +1,20 @@ +{ + "winsorize_upper_quantile": 0.98, + "winsorize_lower_quantile": 0.05, + "float": true, + "metric": ["Mattes", "Mattes"], + "metric_weight": [1, 1], + "radius_or_number_of_bins": [64, 64], + "transforms": ["Affine", "Affine"], + "transform_parameters": [[0.1], [0.1]], + "number_of_iterations": [[200], [15]], + "convergence_window_size": [10, 3], + "convergence_threshold": [1e-08, 1e-09], + "sampling_strategy": ["Random", "Random"], + "smoothing_sigmas": [[4], [2]], + "sigma_units": ["mm", "mm", "mm"], + "shrink_factors": [[2], [1]], + "sampling_percentage": [0.2, 0.2], + "use_histogram_matching": [true, true], + "use_estimate_learning_rate_once": [true, true] +} diff --git a/fmriprep/workflows/bold/tests/test_util.py b/fmriprep/workflows/bold/tests/test_util.py index a5e808b3a..dde36f382 100755 --- a/fmriprep/workflows/bold/tests/test_util.py +++ b/fmriprep/workflows/bold/tests/test_util.py @@ -49,7 +49,7 @@ def symmetric_overlap(img1, img2): ) ]) def test_masking(input_fname, expected_fname): - bold_reference_wf = init_bold_reference_wf(omp_nthreads=1, enhance_t2=True) + bold_reference_wf = init_bold_reference_wf(omp_nthreads=1) bold_reference_wf.inputs.inputnode.bold_file = input_fname # Reconstruct base_fname from above diff --git a/fmriprep/workflows/bold/util.py b/fmriprep/workflows/bold/util.py index 3123f0ee3..6a346ca80 100644 --- a/fmriprep/workflows/bold/util.py +++ b/fmriprep/workflows/bold/util.py @@ -235,14 +235,14 @@ def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', norm = pe.Node(Registration( from_file=pkgr_fn( 'fmriprep.data', - 'epi_registration_settings.json')), + 'epi_atlasbased_brainmask.json')), name='norm', n_procs=omp_nthreads) - fixed_mask_trait = 'fixed_image_mask' norm.inputs.fixed_image = str(bold_template) - if parseversion(Registration().version) >= Version('2.2.0'): - fixed_mask_trait += 's' - setattr(norm.inputs, fixed_mask_trait, str(brain_mask)) + # fixed_mask_trait = 'fixed_image_mask' + # if parseversion(Registration().version) >= Version('2.2.0'): + # fixed_mask_trait += 's' + # setattr(norm.inputs, fixed_mask_trait, str(brain_mask)) map_brainmask = pe.Node( ApplyTransforms(interpolation='MultiLabel', float=True, input_image=str(brain_mask)), From 966d4122652dd1c2c6ec93c13ecf05db80d4eead Mon Sep 17 00:00:00 2001 From: oesteban Date: Mon, 15 Oct 2018 23:10:05 -0700 Subject: [PATCH 25/83] pre-cache template getter --- docker/scripts/get_templates.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/scripts/get_templates.sh b/docker/scripts/get_templates.sh index d060531bb..c55f60e9d 100755 --- a/docker/scripts/get_templates.sh +++ b/docker/scripts/get_templates.sh @@ -2,8 +2,10 @@ MNI_TEMPLATE="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705eb594d9001ed622649" MNI_SHA256="608b1d609255424d51300e189feacd5ec74b04e244628303e802a6c0b0f9d9db" -ASYM_09C_TEMPLATE="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9" -ASYM_09C_SHA256="a24699ba0d13f72d0f8934cc211cb80bfd9c9a077b481d9b64295cf5275235a9" +ASYM_09C_TEMPLATE_OLD="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/580705089ad5a101f17944a9" +ASYM_09C_SHA256_OLD="a24699ba0d13f72d0f8934cc211cb80bfd9c9a077b481d9b64295cf5275235a9" +ASYM_09C_TEMPLATE="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/5b0dbce20f461a000db8fa3d" +ASYM_09C_SHA256="2851302474359c2c48995155aadb48b861e5dcf87aefda71af8010f671e8ed66" OASIS_TEMPLATE="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/584123a29ad5a1020913609d" OASIS_SHA256="d87300e91346c16f55baf6f54f5f990bc020b61e8d5df9bcc3abb0cc4b943113" NKI_TEMPLATE="https://files.osf.io/v1/resources/fvuh8/providers/osfstorage/5bc3fad82aa873001bc5a553" @@ -30,6 +32,8 @@ GET(){ set -e echo "Getting MNI template" GET "$MNI_TEMPLATE" "$MNI_SHA256" +echo "Getting (deprecated version of) MNI152NLin2009cAsym template" +GET "$ASYM_09C_TEMPLATE_OLD" "$ASYM_09C_SHA256_OLD" echo "Getting MNI152NLin2009cAsym template" GET "$ASYM_09C_TEMPLATE" "$ASYM_09C_SHA256" echo "Getting OASIS template" From be17090f88bf5a68d535116c53d68cb5fb3a9526 Mon Sep 17 00:00:00 2001 From: oesteban Date: Tue, 16 Oct 2018 07:26:22 -0700 Subject: [PATCH 26/83] fix ds005 problem --- fmriprep/interfaces/cifti.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fmriprep/interfaces/cifti.py b/fmriprep/interfaces/cifti.py index 793a00286..e9726ecc6 100644 --- a/fmriprep/interfaces/cifti.py +++ b/fmriprep/interfaces/cifti.py @@ -130,10 +130,9 @@ def _fetch_data(self): raise IOError("Freesurfer annotations for %s not found in %s" % ( self.inputs.surface_target, self.inputs.subjects_dir)) - label_space = 'tpl-OASISTRT20' - label_dir = getters.get_oasis_dkt31_mni152() - label_file = os.path.join(label_dir, - 'tpl-OASISTRT20_variant-DKT31_space-MNI152NLin2009cAsym.nii.gz') + label_space = 'OASISTRT20' + label_file = str(getters.get_template(label_space) / + 'tpl-OASISTRT20_variant-DKT31_space-MNI152NLin2009cAsym.nii.gz') download_link = getters.OSF_PROJECT_URL + getters.OSF_RESOURCES[label_space][0] return annotation_files, label_file, download_link From 76d0f701c0d719d0be3052889e0369d18eb8fe7d Mon Sep 17 00:00:00 2001 From: oesteban Date: Tue, 16 Oct 2018 12:46:42 -0700 Subject: [PATCH 27/83] 1) shorten registration; 2) accept a ``pre_mask`` --- fmriprep/data/epi_atlasbased_brainmask.json | 26 ++-- fmriprep/workflows/bold/base.py | 5 +- fmriprep/workflows/bold/registration.py | 3 +- fmriprep/workflows/bold/resampling.py | 4 +- fmriprep/workflows/bold/util.py | 138 ++++++++++++-------- fmriprep/workflows/fieldmap/unwarp.py | 5 +- scripts/generate_reference_mask.py | 5 +- 7 files changed, 110 insertions(+), 76 deletions(-) diff --git a/fmriprep/data/epi_atlasbased_brainmask.json b/fmriprep/data/epi_atlasbased_brainmask.json index 94066b4bd..31fed8bd2 100644 --- a/fmriprep/data/epi_atlasbased_brainmask.json +++ b/fmriprep/data/epi_atlasbased_brainmask.json @@ -2,19 +2,19 @@ "winsorize_upper_quantile": 0.98, "winsorize_lower_quantile": 0.05, "float": true, - "metric": ["Mattes", "Mattes"], - "metric_weight": [1, 1], - "radius_or_number_of_bins": [64, 64], - "transforms": ["Affine", "Affine"], - "transform_parameters": [[0.1], [0.1]], - "number_of_iterations": [[200], [15]], - "convergence_window_size": [10, 3], - "convergence_threshold": [1e-08, 1e-09], + "metric": ["Mattes"], + "metric_weight": [1], + "radius_or_number_of_bins": [64], + "transforms": ["Affine"], + "transform_parameters": [[0.1]], + "number_of_iterations": [[200]], + "convergence_window_size": [10], + "convergence_threshold": [1e-09], "sampling_strategy": ["Random", "Random"], - "smoothing_sigmas": [[4], [2]], + "smoothing_sigmas": [[2]], "sigma_units": ["mm", "mm", "mm"], - "shrink_factors": [[2], [1]], - "sampling_percentage": [0.2, 0.2], - "use_histogram_matching": [true, true], - "use_estimate_learning_rate_once": [true, true] + "shrink_factors": [[2]], + "sampling_percentage": [0.2], + "use_histogram_matching": [true], + "use_estimate_learning_rate_once": [true] } diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index b73ff02bd..ae07741f7 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -394,9 +394,8 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, ]), ]) - # The first reference uses T2 contrast enhancement - bold_reference_wf = init_bold_reference_wf( - omp_nthreads=omp_nthreads, enhance_t2=True) + # Generate a tentative boldref + bold_reference_wf = init_bold_reference_wf(omp_nthreads=omp_nthreads) # Top-level BOLD splitter bold_split = pe.Node(FSLSplit(dimension='t'), name='bold_split', diff --git a/fmriprep/workflows/bold/registration.py b/fmriprep/workflows/bold/registration.py index fbd2dd6b6..60150a135 100644 --- a/fmriprep/workflows/bold/registration.py +++ b/fmriprep/workflows/bold/registration.py @@ -324,7 +324,7 @@ def init_bold_t1_trans_wf(freesurfer, mem_gb, omp_nthreads, use_fieldwarp=False, merge = pe.Node(Merge(compress=use_compression), name='merge', mem_gb=mem_gb) # Generate a reference on the target T1w space - gen_final_ref = init_bold_reference_wf(omp_nthreads) + gen_final_ref = init_bold_reference_wf(omp_nthreads, pre_mask=True) workflow.connect([ (inputnode, merge_xforms, [('itk_bold_to_t1', 'in1')]), @@ -334,6 +334,7 @@ def init_bold_t1_trans_wf(freesurfer, mem_gb, omp_nthreads, use_fieldwarp=False, (gen_ref, bold_to_t1w_transform, [('out_file', 'reference_image')]), (bold_to_t1w_transform, merge, [('out_files', 'in_files')]), (merge, gen_final_ref, [('out_file', 'inputnode.bold_file')]), + (mask_t1w_tfm, gen_final_ref, [('output_image', 'inputnode.bold_mask')]), (merge, outputnode, [('out_file', 'bold_t1')]), (gen_final_ref, outputnode, [('outputnode.ref_image', 'bold_t1_ref')]), ]) diff --git a/fmriprep/workflows/bold/resampling.py b/fmriprep/workflows/bold/resampling.py index 6c19c342e..cc40acfb0 100644 --- a/fmriprep/workflows/bold/resampling.py +++ b/fmriprep/workflows/bold/resampling.py @@ -301,7 +301,8 @@ def _aslist(in_value): mem_gb=mem_gb * 3) # Generate a reference on the target T1w space - gen_final_ref = init_bold_reference_wf(omp_nthreads) + gen_final_ref = init_bold_reference_wf( + omp_nthreads=omp_nthreads, pre_mask=True) workflow.connect([ (inputnode, merge_xforms, [('t1_2_mni_forward_transform', 'in1'), @@ -311,6 +312,7 @@ def _aslist(in_value): (inputnode, bold_to_mni_transform, [('bold_split', 'input_image')]), (bold_to_mni_transform, merge, [('out_files', 'in_files')]), (merge, gen_final_ref, [('out_file', 'inputnode.bold_file')]), + (mask_mni_tfm, gen_final_ref, [('output_image', 'inputnode.bold_mask')]), (merge, outputnode, [('out_file', 'bold_mni')]), (gen_final_ref, outputnode, [('outputnode.ref_image', 'bold_mni_ref')]), ]) diff --git a/fmriprep/workflows/bold/util.py b/fmriprep/workflows/bold/util.py index 6a346ca80..517fdd29f 100644 --- a/fmriprep/workflows/bold/util.py +++ b/fmriprep/workflows/bold/util.py @@ -32,8 +32,8 @@ DEFAULT_MEMORY_MIN_GB = 0.01 -def init_bold_reference_wf(omp_nthreads, bold_file=None, name='bold_reference_wf', - gen_report=False, enhance_t2=False): +def init_bold_reference_wf(omp_nthreads, bold_file=None, pre_mask=False, + name='bold_reference_wf', gen_report=False): """ This workflow generates reference BOLD images for a series @@ -66,6 +66,9 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, name='bold_reference_wf bold_file BOLD series NIfTI file + bold_mask : bool + A tentative brain mask to initialize the workflow (requires ``pre_mask`` + parameter set ``True``). **Outputs** @@ -95,7 +98,7 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, name='bold_reference_wf First, a reference volume and its skull-stripped version were generated using a custom methodology of *fMRIPrep*. """ - inputnode = pe.Node(niu.IdentityInterface(fields=['bold_file', 'sbref_file']), + inputnode = pe.Node(niu.IdentityInterface(fields=['bold_file', 'sbref_file', 'bold_mask']), name='inputnode') outputnode = pe.Node( niu.IdentityInterface(fields=['bold_file', 'raw_ref_image', 'skip_vols', 'ref_image', @@ -114,7 +117,7 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, name='bold_reference_wf # Re-run validation; no effect if no sbref; otherwise apply same validation to sbref as bold validate_ref = pe.Node(ValidateImage(), name='validate_ref', mem_gb=DEFAULT_MEMORY_MIN_GB) enhance_and_skullstrip_bold_wf = init_enhance_and_skullstrip_bold_wf( - omp_nthreads=omp_nthreads) + omp_nthreads=omp_nthreads, pre_mask=pre_mask) workflow.connect([ (inputnode, validate, [('bold_file', 'in_file')]), @@ -132,6 +135,11 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, name='bold_reference_wf ('outputnode.skull_stripped_file', 'ref_image_brain')]), ]) + if pre_mask: + workflow.connect([ + (inputnode, enhance_and_skullstrip_bold_wf, [('bold_mask', 'inputnode.pre_mask')]), + ]) + if gen_report: mask_reportlet = pe.Node(SimpleShowMaskRPT(), name='mask_reportlet') workflow.connect([ @@ -144,8 +152,10 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, name='bold_reference_wf return workflow -def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', - omp_nthreads=1): +def init_enhance_and_skullstrip_bold_wf( + name='enhance_and_skullstrip_bold_wf', + pre_mask=False, + omp_nthreads=1): """ This workflow takes in a :abbr:`BOLD (blood-oxygen level-dependant)` :abbr:`fMRI (functional MRI)` average/summary (e.g. a reference image @@ -156,8 +166,11 @@ def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', Steps of this workflow are: - - 1. Calculate a conservative mask using Nilearn's ``create_epi_mask``. + 1. Calculate a tentative mask by registering (9-parameters) to *fMRIPrep*'s + :abbr:`EPI (echo-planar imaging)` -*boldref* template, which + is in MNI space. + The tentative mask is obtained by resampling the MNI template's + brainmask into *boldref*-space. 2. Run ANTs' ``N4BiasFieldCorrection`` on the input :abbr:`BOLD (blood-oxygen level-dependant)` average, using the mask generated in 1) instead of the internal Otsu thresholding. @@ -171,6 +184,9 @@ def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', 6. Calculate a final mask as the intersection of 3) and 5). 7. Apply final mask on the enhanced reference. + Step 1 can be skipped if the ``pre_mask`` argument is set to ``True`` and + a tentative mask is passed in to the workflow throught the ``pre_mask`` + Nipype input. .. workflow :: @@ -183,6 +199,9 @@ def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', **Parameters** name : str Name of workflow (default: ``enhance_and_skullstrip_bold_wf``) + pre_mask : bool + Indicates whether the ``pre_mask`` input will be set (and thus, step 1 + should be skipped). omp_nthreads : int number of threads available to parallel nodes @@ -190,6 +209,9 @@ def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', in_file BOLD image (single volume) + pre_mask : bool + A tentative brain mask to initialize the workflow (requires ``pre_mask`` + parameter set ``True``). **Outputs** @@ -206,48 +228,15 @@ def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', .. _N4BiasFieldCorrection: https://hdl.handle.net/10380/3053 """ workflow = Workflow(name=name) - inputnode = pe.Node(niu.IdentityInterface(fields=['in_file']), + inputnode = pe.Node(niu.IdentityInterface(fields=['in_file', 'pre_mask']), name='inputnode') outputnode = pe.Node(niu.IdentityInterface(fields=[ 'mask_file', 'skull_stripped_file', 'bias_corrected_file']), name='outputnode') - bold_template = get_template('fMRIPrep') / 'tpl-fMRIPrep_space-MNI_res-02_boldref.nii.gz' - brain_mask = get_template('MNI152NLin2009cAsym') / \ - 'tpl-MNI152NLin2009cAsym_space-MNI_res-02_brainmask.nii.gz' - - # Initialize transforms with antsAI - init_aff = pe.Node(AI( - fixed_image=str(bold_template), - fixed_image_mask=str(brain_mask), - metric=('Mattes', 32, 'Regular', 0.2), - transform=('Affine', 0.1), - search_factor=(20, 0.12), - principal_axes=False, - convergence=(10, 1e-6, 10), - verbose=True), - name='init_aff', - n_procs=omp_nthreads) - - if parseversion(Registration().version) > Version('2.2.0'): - init_aff.inputs.search_grid = (40, (0, 40, 40)) - - # Set up spatial normalization - norm = pe.Node(Registration( - from_file=pkgr_fn( - 'fmriprep.data', - 'epi_atlasbased_brainmask.json')), - name='norm', - n_procs=omp_nthreads) - norm.inputs.fixed_image = str(bold_template) - # fixed_mask_trait = 'fixed_image_mask' - # if parseversion(Registration().version) >= Version('2.2.0'): - # fixed_mask_trait += 's' - # setattr(norm.inputs, fixed_mask_trait, str(brain_mask)) - - map_brainmask = pe.Node( - ApplyTransforms(interpolation='MultiLabel', float=True, input_image=str(brain_mask)), - name='map_brainmask' - ) + # Dilate pre_mask + pre_dilate = pe.Node(fsl.DilateImage( + operation='max', kernel_shape='sphere', kernel_size=3.0, + internal_datatype='char'), name='pre_mask_dilate') # Run N4 normally, force num_threads=1 for stability (images are small, no need for >1) n4_correct = pe.Node(ants.N4BiasFieldCorrection(dimension=3, copy_header=True), @@ -283,18 +272,59 @@ def init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', # Compute masked brain apply_mask = pe.Node(fsl.ApplyMask(), name='apply_mask') + if not pre_mask: + bold_template = get_template('fMRIPrep') / 'tpl-fMRIPrep_space-MNI_res-02_boldref.nii.gz' + brain_mask = get_template('MNI152NLin2009cAsym') / \ + 'tpl-MNI152NLin2009cAsym_space-MNI_res-02_brainmask.nii.gz' + + # Initialize transforms with antsAI + init_aff = pe.Node(AI( + fixed_image=str(bold_template), + fixed_image_mask=str(brain_mask), + metric=('Mattes', 32, 'Regular', 0.2), + transform=('Affine', 0.1), + search_factor=(20, 0.12), + principal_axes=False, + convergence=(10, 1e-6, 10), + verbose=True), + name='init_aff', + n_procs=omp_nthreads) + + if parseversion(Registration().version) > Version('2.2.0'): + init_aff.inputs.search_grid = (40, (0, 40, 40)) + + # Set up spatial normalization + norm = pe.Node(Registration( + from_file=pkgr_fn( + 'fmriprep.data', + 'epi_atlasbased_brainmask.json')), + name='norm', + n_procs=omp_nthreads) + norm.inputs.fixed_image = str(bold_template) + map_brainmask = pe.Node( + ApplyTransforms(interpolation='MultiLabel', float=True, input_image=str(brain_mask)), + name='map_brainmask' + ) + workflow.connect([ + (inputnode, init_aff, [('in_file', 'moving_image')]), + (inputnode, map_brainmask, [('in_file', 'reference_image')]), + (inputnode, norm, [('in_file', 'moving_image')]), + (init_aff, norm, [('output_transform', 'initial_moving_transform')]), + (norm, map_brainmask, [ + ('reverse_invert_flags', 'invert_transform_flags'), + ('reverse_transforms', 'transforms')]), + (map_brainmask, pre_dilate, [('output_image', 'in_file')]), + ]) + else: + workflow.connect([ + (inputnode, pre_dilate, [('pre_mask', 'in_file')]), + ]) + workflow.connect([ - (inputnode, init_aff, [('in_file', 'moving_image')]), - (inputnode, map_brainmask, [('in_file', 'reference_image')]), - (inputnode, norm, [('in_file', 'moving_image')]), - (init_aff, norm, [('output_transform', 'initial_moving_transform')]), - (norm, map_brainmask, [ - ('reverse_invert_flags', 'invert_transform_flags'), - ('reverse_transforms', 'transforms')]), + (pre_dilate, n4_correct, [('out_file', 'mask_image')]), (inputnode, n4_correct, [('in_file', 'input_image')]), (inputnode, fixhdr_unifize, [('in_file', 'hdr_file')]), (inputnode, fixhdr_skullstrip2, [('in_file', 'hdr_file')]), - (map_brainmask, n4_correct, [('output_image', 'mask_image')]), (n4_correct, skullstrip_first_pass, [('output_image', 'in_file')]), (skullstrip_first_pass, bet_dilate, [('mask_file', 'in_file')]), (bet_dilate, bet_mask, [('out_file', 'mask_file')]), diff --git a/fmriprep/workflows/fieldmap/unwarp.py b/fmriprep/workflows/fieldmap/unwarp.py index 188572eda..cd0e5fcfb 100644 --- a/fmriprep/workflows/fieldmap/unwarp.py +++ b/fmriprep/workflows/fieldmap/unwarp.py @@ -152,7 +152,8 @@ def init_sdc_unwarp_wf(omp_nthreads, fmap_demean, debug, name='sdc_unwarp_wf'): apply_fov_mask = pe.Node(fsl.ApplyMask(), name="apply_fov_mask") - enhance_and_skullstrip_bold_wf = init_enhance_and_skullstrip_bold_wf(omp_nthreads=omp_nthreads) + enhance_and_skullstrip_bold_wf = init_enhance_and_skullstrip_bold_wf(omp_nthreads=omp_nthreads, + pre_mask=True) workflow.connect([ (inputnode, fmap2ref_reg, [('fmap_ref', 'moving_image')]), @@ -187,6 +188,8 @@ def init_sdc_unwarp_wf(omp_nthreads, fmap_demean, debug, name='sdc_unwarp_wf'): (fmap_fov2ref_apply, apply_fov_mask, [('output_image', 'mask_file')]), (unwarp_reference, apply_fov_mask, [('output_image', 'in_file')]), (apply_fov_mask, enhance_and_skullstrip_bold_wf, [('out_file', 'inputnode.in_file')]), + (fmap_mask2ref_apply, enhance_and_skullstrip_bold_wf, + [('output_image', 'inputnode.pre_mask')]), (apply_fov_mask, outputnode, [('out_file', 'out_reference')]), (enhance_and_skullstrip_bold_wf, outputnode, [ ('outputnode.mask_file', 'out_mask'), diff --git a/scripts/generate_reference_mask.py b/scripts/generate_reference_mask.py index 4084e9695..9f9745aa0 100755 --- a/scripts/generate_reference_mask.py +++ b/scripts/generate_reference_mask.py @@ -15,8 +15,7 @@ def sink_mask_file(in_file, orig_file, out_dir): def init_main_wf(bold_file, out_dir, base_dir=None, name='main_wf'): - wf = init_bold_reference_wf(enhance_t2=True, - omp_nthreads=4, + wf = init_bold_reference_wf(omp_nthreads=4, name=name) wf.base_dir = base_dir wf.inputs.inputnode.bold_file = bold_file @@ -27,7 +26,7 @@ def init_main_wf(bold_file, out_dir, base_dir=None, name='main_wf'): sink.inputs.orig_file = bold_file wf.connect([ (wf.get_node('outputnode'), sink, [('bold_mask', 'in_file')]), - ]) + ]) return wf From 713132f0577943e5439f99371556149afd4c9c8a Mon Sep 17 00:00:00 2001 From: oesteban Date: Tue, 16 Oct 2018 12:49:55 -0700 Subject: [PATCH 28/83] [skip ci] update documentation --- fmriprep/workflows/bold/util.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/fmriprep/workflows/bold/util.py b/fmriprep/workflows/bold/util.py index 517fdd29f..219c78684 100644 --- a/fmriprep/workflows/bold/util.py +++ b/fmriprep/workflows/bold/util.py @@ -171,18 +171,19 @@ def init_enhance_and_skullstrip_bold_wf( is in MNI space. The tentative mask is obtained by resampling the MNI template's brainmask into *boldref*-space. - 2. Run ANTs' ``N4BiasFieldCorrection`` on the input + 2. Binary dilation of the tentative mask with a sphere of 3mm diameter. + 3. Run ANTs' ``N4BiasFieldCorrection`` on the input :abbr:`BOLD (blood-oxygen level-dependant)` average, using the mask generated in 1) instead of the internal Otsu thresholding. - 3. Calculate a loose mask using FSL's ``bet``, with one mathematical morphology + 4. Calculate a loose mask using FSL's ``bet``, with one mathematical morphology dilation of one iteration and a sphere of 6mm as structuring element. - 4. Mask the :abbr:`INU (intensity non-uniformity)`-corrected image + 5. Mask the :abbr:`INU (intensity non-uniformity)`-corrected image with the latest mask calculated in 3), then use AFNI's ``3dUnifize`` to *standardize* the T2* contrast distribution. - 5. Calculate a mask using AFNI's ``3dAutomask`` after the contrast + 6. Calculate a mask using AFNI's ``3dAutomask`` after the contrast enhancement of 4). - 6. Calculate a final mask as the intersection of 3) and 5). - 7. Apply final mask on the enhanced reference. + 7. Calculate a final mask as the intersection of 3) and 5). + 8. Apply final mask on the enhanced reference. Step 1 can be skipped if the ``pre_mask`` argument is set to ``True`` and a tentative mask is passed in to the workflow throught the ``pre_mask`` From 0c9e665158fc42c2ecbb077cb87c3380c686daec Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 16 Oct 2018 17:10:47 -0700 Subject: [PATCH 29/83] CI: Update expected anatomical outputs --- .circleci/ds005_outputs.txt | 52 ++++++++++++++--------------- .circleci/ds005_partial_outputs.txt | 52 ++++++++++++++--------------- .circleci/ds054_outputs.txt | 30 ++++++++--------- .circleci/ds210_outputs.txt | 30 ++++++++--------- 4 files changed, 82 insertions(+), 82 deletions(-) diff --git a/.circleci/ds005_outputs.txt b/.circleci/ds005_outputs.txt index 0a4f54236..2345cc599 100644 --- a/.circleci/ds005_outputs.txt +++ b/.circleci/ds005_outputs.txt @@ -6,32 +6,32 @@ fmriprep/logs/CITATION.md fmriprep/logs/CITATION.tex fmriprep/sub-01 fmriprep/sub-01/anat -fmriprep/sub-01/anat/sub-01_brainmask.nii.gz -fmriprep/sub-01/anat/sub-01_class-CSF_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_class-GM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_class-WM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_dtissue.nii.gz -fmriprep/sub-01/anat/sub-01_inflated.L.surf.gii -fmriprep/sub-01/anat/sub-01_inflated.R.surf.gii -fmriprep/sub-01/anat/sub-01_label-aparcaseg_roi.nii.gz -fmriprep/sub-01/anat/sub-01_label-aseg_roi.nii.gz -fmriprep/sub-01/anat/sub-01_midthickness.L.surf.gii -fmriprep/sub-01/anat/sub-01_midthickness.R.surf.gii -fmriprep/sub-01/anat/sub-01_pial.L.surf.gii -fmriprep/sub-01/anat/sub-01_pial.R.surf.gii -fmriprep/sub-01/anat/sub-01_preproc.nii.gz -fmriprep/sub-01/anat/sub-01_smoothwm.L.surf.gii -fmriprep/sub-01/anat/sub-01_smoothwm.R.surf.gii -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_dtissue.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_target-T1w_warp.h5 -fmriprep/sub-01/anat/sub-01_space-orig_target-T1w_affine.txt -fmriprep/sub-01/anat/sub-01_target-fsnative_affine.txt -fmriprep/sub-01/anat/sub-01_target-MNI152NLin2009cAsym_warp.h5 +fmriprep/sub-01/anat/sub-01_desc-brain_mask.nii.gz +fmriprep/sub-01/anat/sub-01_desc-preproc_T1w.nii.gz +fmriprep/sub-01/anat/sub-01_dseg.nii.gz +fmriprep/sub-01/anat/sub-01_from-MNI152NLin2009cAsym_to-T1w_xfm.h5 +fmriprep/sub-01/anat/sub-01_from-orig_to-T1w_xfm.txt +fmriprep/sub-01/anat/sub-01_from-T1w_to-fsnative_xfm.txt +fmriprep/sub-01/anat/sub-01_from-T1w_to-MNI152NLin2009cAsym_xfm.h5 +fmriprep/sub-01/anat/sub-01_hemi-L_inflated.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-L_midthickness.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-L_pial.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-L_smoothwm.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-R_inflated.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-R_midthickness.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-R_pial.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-R_smoothwm.surf.gii +fmriprep/sub-01/anat/sub-01_label-aparcaseg_dseg.nii.gz +fmriprep/sub-01/anat/sub-01_label-aseg_dseg.nii.gz +fmriprep/sub-01/anat/sub-01_label-CSF_probseg.nii.gz +fmriprep/sub-01/anat/sub-01_label-GM_probseg.nii.gz +fmriprep/sub-01/anat/sub-01_label-WM_probseg.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_dseg.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-01/func fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_confounds.tsv diff --git a/.circleci/ds005_partial_outputs.txt b/.circleci/ds005_partial_outputs.txt index afca57030..e77779138 100644 --- a/.circleci/ds005_partial_outputs.txt +++ b/.circleci/ds005_partial_outputs.txt @@ -6,32 +6,32 @@ fmriprep/logs/CITATION.md fmriprep/logs/CITATION.tex fmriprep/sub-01 fmriprep/sub-01/anat -fmriprep/sub-01/anat/sub-01_brainmask.nii.gz -fmriprep/sub-01/anat/sub-01_class-CSF_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_class-GM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_class-WM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_dtissue.nii.gz -fmriprep/sub-01/anat/sub-01_inflated.L.surf.gii -fmriprep/sub-01/anat/sub-01_inflated.R.surf.gii -fmriprep/sub-01/anat/sub-01_label-aparcaseg_roi.nii.gz -fmriprep/sub-01/anat/sub-01_label-aseg_roi.nii.gz -fmriprep/sub-01/anat/sub-01_midthickness.L.surf.gii -fmriprep/sub-01/anat/sub-01_midthickness.R.surf.gii -fmriprep/sub-01/anat/sub-01_pial.L.surf.gii -fmriprep/sub-01/anat/sub-01_pial.R.surf.gii -fmriprep/sub-01/anat/sub-01_preproc.nii.gz -fmriprep/sub-01/anat/sub-01_smoothwm.L.surf.gii -fmriprep/sub-01/anat/sub-01_smoothwm.R.surf.gii -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_dtissue.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_target-T1w_warp.h5 -fmriprep/sub-01/anat/sub-01_space-orig_target-T1w_affine.txt -fmriprep/sub-01/anat/sub-01_target-fsnative_affine.txt -fmriprep/sub-01/anat/sub-01_target-MNI152NLin2009cAsym_warp.h5 +fmriprep/sub-01/anat/sub-01_desc-brain_mask.nii.gz +fmriprep/sub-01/anat/sub-01_desc-preproc_T1w.nii.gz +fmriprep/sub-01/anat/sub-01_dseg.nii.gz +fmriprep/sub-01/anat/sub-01_from-MNI152NLin2009cAsym_to-T1w_xfm.h5 +fmriprep/sub-01/anat/sub-01_from-orig_to-T1w_xfm.txt +fmriprep/sub-01/anat/sub-01_from-T1w_to-fsnative_xfm.txt +fmriprep/sub-01/anat/sub-01_from-T1w_to-MNI152NLin2009cAsym_xfm.h5 +fmriprep/sub-01/anat/sub-01_hemi-L_inflated.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-L_midthickness.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-L_pial.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-L_smoothwm.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-R_inflated.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-R_midthickness.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-R_pial.surf.gii +fmriprep/sub-01/anat/sub-01_hemi-R_smoothwm.surf.gii +fmriprep/sub-01/anat/sub-01_label-aparcaseg_dseg.nii.gz +fmriprep/sub-01/anat/sub-01_label-aseg_dseg.nii.gz +fmriprep/sub-01/anat/sub-01_label-CSF_probseg.nii.gz +fmriprep/sub-01/anat/sub-01_label-GM_probseg.nii.gz +fmriprep/sub-01/anat/sub-01_label-WM_probseg.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_dseg.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz +fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-01/func fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_confounds.tsv diff --git a/.circleci/ds054_outputs.txt b/.circleci/ds054_outputs.txt index a1dc5fcd5..ca526c8d9 100644 --- a/.circleci/ds054_outputs.txt +++ b/.circleci/ds054_outputs.txt @@ -6,21 +6,21 @@ fmriprep/logs/CITATION.md fmriprep/logs/CITATION.tex fmriprep/sub-100185 fmriprep/sub-100185/anat -fmriprep/sub-100185/anat/sub-100185_brainmask.nii.gz -fmriprep/sub-100185/anat/sub-100185_class-CSF_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_class-GM_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_class-WM_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_dtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_preproc.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_dtissue.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_target-T1w_warp.h5 -fmriprep/sub-100185/anat/sub-100185_space-orig_target-T1w_affine.txt -fmriprep/sub-100185/anat/sub-100185_target-MNI152NLin2009cAsym_warp.h5 +fmriprep/sub-100185/anat/sub-100185_class-CSF_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_class-GM_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_class-WM_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_desc-brain_mask.nii.gz +fmriprep/sub-100185/anat/sub-100185_desc-preproc_T1w.nii.gz +fmriprep/sub-100185/anat/sub-100185_dseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_from-MNI152NLin2009cAsym_to-T1w_xfm.h5 +fmriprep/sub-100185/anat/sub-100185_from-orig_to-T1w_xfm.txt +fmriprep/sub-100185/anat/sub-100185_from-T1w_target-MNI152NLin2009cAsym_xfm.h5 +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-CSF_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-GM_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-WM_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_dseg.nii.gz fmriprep/sub-100185/func fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_confounds.tsv fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz diff --git a/.circleci/ds210_outputs.txt b/.circleci/ds210_outputs.txt index ff00333f9..9a1ed33ea 100644 --- a/.circleci/ds210_outputs.txt +++ b/.circleci/ds210_outputs.txt @@ -6,21 +6,21 @@ fmriprep/logs/CITATION.md fmriprep/logs/CITATION.tex fmriprep/sub-02 fmriprep/sub-02/anat -fmriprep/sub-02/anat/sub-02_brainmask.nii.gz -fmriprep/sub-02/anat/sub-02_class-CSF_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_class-GM_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_class-WM_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_dtissue.nii.gz -fmriprep/sub-02/anat/sub-02_preproc.nii.gz -fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_class-CSF_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_class-GM_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_class-WM_probtissue.nii.gz -fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_dtissue.nii.gz -fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_target-T1w_warp.h5 -fmriprep/sub-02/anat/sub-02_space-orig_target-T1w_affine.txt -fmriprep/sub-02/anat/sub-02_target-MNI152NLin2009cAsym_warp.h5 +fmriprep/sub-02/anat/sub-02_desc-brain_mask.nii.gz +fmriprep/sub-02/anat/sub-02_desc-preproc_T1w.nii.gz +fmriprep/sub-02/anat/sub-02_dseg.nii.gz +fmriprep/sub-02/anat/sub-02_from-MNI152NLin2009cAsym_to-T1w_xfm.h5 +fmriprep/sub-02/anat/sub-02_from-orig_to-T1w_xfm.txt +fmriprep/sub-02/anat/sub-02_from-T1w_to-MNI152NLin2009cAsym_xfm.h5 +fmriprep/sub-02/anat/sub-02_label-CSF_probseg.nii.gz +fmriprep/sub-02/anat/sub-02_label-GM_probseg.nii.gz +fmriprep/sub-02/anat/sub-02_label-WM_probseg.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_dseg.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz +fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-02/func fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_confounds.tsv fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_boldref.nii.gz From bc502a13819bfce37ae614564bc39466f0ed2b92 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 16 Oct 2018 17:11:11 -0700 Subject: [PATCH 30/83] RF: Update anatomical derivatives for RC1 --- .circleci/ds054_outputs.txt | 6 +++--- fmriprep/interfaces/bids.py | 11 +++++++++-- fmriprep/workflows/anatomical.py | 30 ++++++++++++++---------------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.circleci/ds054_outputs.txt b/.circleci/ds054_outputs.txt index ca526c8d9..84cf15814 100644 --- a/.circleci/ds054_outputs.txt +++ b/.circleci/ds054_outputs.txt @@ -6,15 +6,15 @@ fmriprep/logs/CITATION.md fmriprep/logs/CITATION.tex fmriprep/sub-100185 fmriprep/sub-100185/anat -fmriprep/sub-100185/anat/sub-100185_class-CSF_probseg.nii.gz -fmriprep/sub-100185/anat/sub-100185_class-GM_probseg.nii.gz -fmriprep/sub-100185/anat/sub-100185_class-WM_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_desc-brain_mask.nii.gz fmriprep/sub-100185/anat/sub-100185_desc-preproc_T1w.nii.gz fmriprep/sub-100185/anat/sub-100185_dseg.nii.gz fmriprep/sub-100185/anat/sub-100185_from-MNI152NLin2009cAsym_to-T1w_xfm.h5 fmriprep/sub-100185/anat/sub-100185_from-orig_to-T1w_xfm.txt fmriprep/sub-100185/anat/sub-100185_from-T1w_target-MNI152NLin2009cAsym_xfm.h5 +fmriprep/sub-100185/anat/sub-100185_label-CSF_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_label-GM_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_label-WM_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-CSF_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-GM_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-WM_probseg.nii.gz diff --git a/fmriprep/interfaces/bids.py b/fmriprep/interfaces/bids.py index 5bb9b5aa4..b1c3987fe 100644 --- a/fmriprep/interfaces/bids.py +++ b/fmriprep/interfaces/bids.py @@ -163,6 +163,8 @@ class DerivativesDataSinkInputSpec(BaseInterfaceInputSpec): in_file = InputMultiPath(File(exists=True), mandatory=True, desc='the object to be saved') source_file = File(exists=False, mandatory=True, desc='the input func file') + space = traits.Str(desc='Label for space field') + desc = traits.Str(desc='Label for description field') keep_dtype = traits.Bool(False, usedefault=True, desc='keep datatype suffix') suffix = traits.Str('', mandatory=True, desc='suffix appended to source_file') extra_values = traits.List(traits.Str) @@ -244,14 +246,19 @@ def _run_interface(self, runtime): base_fname = op.join(out_path, src_fname) - formatstr = '{bname}_{suffix}{dtype}{ext}' + formatstr = '{bname}_{space}{desc}{suffix}{dtype}{ext}' if len(self.inputs.in_file) > 1 and not isdefined(self.inputs.extra_values): - formatstr = '{bname}_{suffix}{i:04d}{dtype}{ext}' + formatstr = '{bname}_{space}{desc}{suffix}{i:04d}{dtype}{ext}' + + space = 'space-{space}'.format(self.inputs.space) if self.inputs.space else '' + desc = 'desc-{desc}'.format(self.inputs.desc) if self.inputs.desc else '' self._results['compression'] = [] for i, fname in enumerate(self.inputs.in_file): out_file = formatstr.format( bname=base_fname, + space=space, + desc=desc, suffix=self.inputs.suffix, i=i, dtype='' if not self.inputs.keep_dtype else ('_%s' % dtype), diff --git a/fmriprep/workflows/anatomical.py b/fmriprep/workflows/anatomical.py index 19a33eaf1..8bcfaa35a 100644 --- a/fmriprep/workflows/anatomical.py +++ b/fmriprep/workflows/anatomical.py @@ -1227,70 +1227,68 @@ def init_anat_derivatives_wf(output_dir, output_spaces, template, freesurfer, t1_name = pe.Node(niu.Function(function=fix_multi_T1w_source_name), name='t1_name') ds_t1_preproc = pe.Node( - DerivativesDataSink(base_directory=output_dir, suffix='preproc'), + DerivativesDataSink(base_directory=output_dir, desc='preproc', keep_dtype=True), name='ds_t1_preproc', run_without_submitting=True) ds_t1_mask = pe.Node( - DerivativesDataSink(base_directory=output_dir, suffix='brainmask'), + DerivativesDataSink(base_directory=output_dir, desc='brain', suffix='mask'), name='ds_t1_mask', run_without_submitting=True) ds_t1_seg = pe.Node( - DerivativesDataSink(base_directory=output_dir, suffix='dtissue'), + DerivativesDataSink(base_directory=output_dir, suffix='dseg'), name='ds_t1_seg', run_without_submitting=True) ds_t1_tpms = pe.Node( DerivativesDataSink(base_directory=output_dir, - suffix='class-{extra_value}_probtissue'), + suffix='label-{extra_value}_probseg'), name='ds_t1_tpms', run_without_submitting=True) ds_t1_tpms.inputs.extra_values = ['CSF', 'GM', 'WM'] - suffix_fmt = 'space-{}_{}'.format ds_t1_mni = pe.Node( DerivativesDataSink(base_directory=output_dir, - suffix=suffix_fmt(template, 'preproc')), + space=template, desc='preproc', keep_dtype=True), name='ds_t1_mni', run_without_submitting=True) ds_mni_mask = pe.Node( DerivativesDataSink(base_directory=output_dir, - suffix=suffix_fmt(template, 'brainmask')), + space=template, desc='brain', suffix='mask'), name='ds_mni_mask', run_without_submitting=True) ds_mni_seg = pe.Node( DerivativesDataSink(base_directory=output_dir, - suffix=suffix_fmt(template, 'dtissue')), + space=template, suffix='dseg'), name='ds_mni_seg', run_without_submitting=True) ds_mni_tpms = pe.Node( DerivativesDataSink(base_directory=output_dir, - suffix=suffix_fmt(template, 'class-{extra_value}_probtissue')), + space=template, suffix='label-{extra_value}_probseg'), name='ds_mni_tpms', run_without_submitting=True) ds_mni_tpms.inputs.extra_values = ['CSF', 'GM', 'WM'] # Transforms - suffix_fmt = 'space-{}_target-{}_{}'.format + suffix_fmt = 'from-{}_to-{}_mode-image_xfm'.format ds_t1_mni_inv_warp = pe.Node( DerivativesDataSink(base_directory=output_dir, - suffix=suffix_fmt(template, 'T1w', 'warp')), + suffix=suffix_fmt(template, 'T1w')), name='ds_t1_mni_inv_warp', run_without_submitting=True) ds_t1_template_transforms = pe.MapNode( - DerivativesDataSink(base_directory=output_dir, suffix=suffix_fmt('orig', 'T1w', 'affine')), + DerivativesDataSink(base_directory=output_dir, suffix=suffix_fmt('orig', 'T1w')), iterfield=['source_file', 'in_file'], name='ds_t1_template_transforms', run_without_submitting=True) - suffix_fmt = 'target-{}_{}'.format ds_t1_mni_warp = pe.Node( - DerivativesDataSink(base_directory=output_dir, suffix=suffix_fmt(template, 'warp')), + DerivativesDataSink(base_directory=output_dir, suffix=suffix_fmt('T1w', template)), name='ds_t1_mni_warp', run_without_submitting=True) lta_2_itk = pe.Node(LTAConvert(out_itk=True), name='lta_2_itk') ds_t1_fsnative = pe.Node( - DerivativesDataSink(base_directory=output_dir, suffix=suffix_fmt('fsnative', 'affine')), + DerivativesDataSink(base_directory=output_dir, suffix=suffix_fmt('T1w', 'fsnative')), name='ds_t1_fsnative', run_without_submitting=True) name_surfs = pe.MapNode(GiftiNameSource(pattern=r'(?P[lr])h.(?P.+)_converted.gii', - template='{surf}.{LR}.surf'), + template='hemi-{LR}_{surf}.surf'), iterfield='in_file', name='name_surfs', run_without_submitting=True) From 9f6ca760cb60fe623d49eb7cb8731b89149223c1 Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 00:08:35 -0700 Subject: [PATCH 31/83] [HOTFIX] Missing BOLD reports In #1306, ``DataSink``s were updated and the modality entity was not writen on the name anymore. However, I missed to update the reports configuration to contemplate the change. This hotfix addresses the problem. --- fmriprep/viz/config.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fmriprep/viz/config.json b/fmriprep/viz/config.json index bf6c80187..045c3b51d 100644 --- a/fmriprep/viz/config.json +++ b/fmriprep/viz/config.json @@ -82,43 +82,43 @@ }, { "name": "epi/unwarp", - "file_pattern": "func/.*bold_sdc_.*\\.", + "file_pattern": "func/.*_sdc_.*\\.", "title": "Susceptibility distortion correction", "description": "Results of performing susceptibility distortion correction (SDC) on the EPI" }, { "name": "epi/sdc_syn", - "file_pattern": "func/.*bold_forcedsyn", + "file_pattern": "func/.*_forcedsyn", "title": "Experimental fieldmap-less susceptibility distortion correction", "description": "The dataset contained some fieldmap information, but the argument --force-syn was used. The higher-priority SDC method was used. Here, we show the results of performing SyN-based SDC on the EPI for comparison." }, { "name": "epi/rois", - "file_pattern": "func/.*bold_rois", + "file_pattern": "func/.*_rois", "title": "ROIs in BOLD space", "description": "Brain mask calculated on the BOLD signal (red contour), along with the masks used for a/tCompCor.
The aCompCor mask (magenta contour) is a conservative CSF and white-matter mask for extracting physiological and movement confounds.
The fCompCor mask (blue contour) contains the top 5% most variable voxels within a heavily-eroded brain-mask." }, { "name": "epi_mean_t1_registration/flirt", - "file_pattern": "func/.*_bold_flirt", + "file_pattern": "func/.*_flirt", "title": "EPI to T1 registration", "description": "FSL flirt was used to generate transformations from EPI space to T1 Space - BBR refinement rejected" }, { "name": "epi_mean_t1_registration/coreg", - "file_pattern": "func/.*_bold_coreg", + "file_pattern": "func/.*_coreg", "title": "EPI to T1 registration", "description": "mri_coreg (FreeSurfer) was used to generate transformations from EPI space to T1 Space - bbregister refinement rejected" }, { "name": "epi_mean_t1_registration/flt_bbr", - "file_pattern": "func/.*_bold_flt_bbr", + "file_pattern": "func/.*_flt_bbr", "title": "EPI to T1 registration", "description": "FSL flirt was used to generate transformations from EPI-space to T1w-space - The white matter mask calculated with FSL fast (brain tissue segmentation) was used for BBR" }, { "name": "epi_mean_t1_registration/bbr", - "file_pattern": "func/.*_bold_bbr", + "file_pattern": "func/.*_bbr", "title": "EPI to T1 registration", "description": "bbregister was used to generate transformations from EPI-space to T1w-space" }, From ba58d8d7c7637aa6ad9a90810ef5b6345de03447 Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 00:33:08 -0700 Subject: [PATCH 32/83] fix problems in derivatives datasink --- fmriprep/interfaces/bids.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fmriprep/interfaces/bids.py b/fmriprep/interfaces/bids.py index b1c3987fe..167b75015 100644 --- a/fmriprep/interfaces/bids.py +++ b/fmriprep/interfaces/bids.py @@ -246,12 +246,12 @@ def _run_interface(self, runtime): base_fname = op.join(out_path, src_fname) - formatstr = '{bname}_{space}{desc}{suffix}{dtype}{ext}' + formatstr = '{bname}{space}{desc}{suffix}{dtype}{ext}' if len(self.inputs.in_file) > 1 and not isdefined(self.inputs.extra_values): - formatstr = '{bname}_{space}{desc}{suffix}{i:04d}{dtype}{ext}' + formatstr = '{bname}{space}{desc}{suffix}{i:04d}{dtype}{ext}' - space = 'space-{space}'.format(self.inputs.space) if self.inputs.space else '' - desc = 'desc-{desc}'.format(self.inputs.desc) if self.inputs.desc else '' + space = '_space-{}'.format(self.inputs.space) if self.inputs.space else '' + desc = '_desc-{}'.format(self.inputs.desc) if self.inputs.desc else '' self._results['compression'] = [] for i, fname in enumerate(self.inputs.in_file): @@ -259,7 +259,7 @@ def _run_interface(self, runtime): bname=base_fname, space=space, desc=desc, - suffix=self.inputs.suffix, + suffix=('_%s' % self.inputs.suffix) if self.inputs.suffix else '', i=i, dtype='' if not self.inputs.keep_dtype else ('_%s' % dtype), ext=ext) From 9ef8ee114bdab4eb196106e888ff03a9f5d78479 Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 05:06:59 -0700 Subject: [PATCH 33/83] [HOTFIX] Reportlets - bbregister vs flirtbbr (continues #1326) --- fmriprep/viz/config.json | 8 ++++---- fmriprep/workflows/bold/registration.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fmriprep/viz/config.json b/fmriprep/viz/config.json index 045c3b51d..e87b6a550 100644 --- a/fmriprep/viz/config.json +++ b/fmriprep/viz/config.json @@ -111,14 +111,14 @@ "description": "mri_coreg (FreeSurfer) was used to generate transformations from EPI space to T1 Space - bbregister refinement rejected" }, { - "name": "epi_mean_t1_registration/flt_bbr", - "file_pattern": "func/.*_flt_bbr", + "name": "epi_mean_t1_registration/flirtbbr", + "file_pattern": "func/.*_flirtbbr", "title": "EPI to T1 registration", "description": "FSL flirt was used to generate transformations from EPI-space to T1w-space - The white matter mask calculated with FSL fast (brain tissue segmentation) was used for BBR" }, { - "name": "epi_mean_t1_registration/bbr", - "file_pattern": "func/.*_bbr", + "name": "epi_mean_t1_registration/bbregister", + "file_pattern": "func/.*_bbregister", "title": "EPI to T1 registration", "description": "bbregister was used to generate transformations from EPI-space to T1w-space" }, diff --git a/fmriprep/workflows/bold/registration.py b/fmriprep/workflows/bold/registration.py index fbd2dd6b6..05dd9b688 100644 --- a/fmriprep/workflows/bold/registration.py +++ b/fmriprep/workflows/bold/registration.py @@ -158,7 +158,7 @@ def init_bold_reg_wf(freesurfer, use_bbr, bold2t1w_dof, mem_gb, omp_nthreads, def _bold_reg_suffix(fallback, freesurfer): if fallback: return 'coreg' if freesurfer else 'flirt' - return 'bbr' if freesurfer else 'flt_bbr' + return 'bbregister' if freesurfer else 'flirtbbr' workflow.connect([ (bbr_wf, ds_report_reg, [ From 96f97d6b1c5b22482642b31c26716524daad58ac Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 05:31:15 -0700 Subject: [PATCH 34/83] fix mandatory suffix --- fmriprep/interfaces/bids.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fmriprep/interfaces/bids.py b/fmriprep/interfaces/bids.py index 167b75015..0409809ab 100644 --- a/fmriprep/interfaces/bids.py +++ b/fmriprep/interfaces/bids.py @@ -163,10 +163,10 @@ class DerivativesDataSinkInputSpec(BaseInterfaceInputSpec): in_file = InputMultiPath(File(exists=True), mandatory=True, desc='the object to be saved') source_file = File(exists=False, mandatory=True, desc='the input func file') - space = traits.Str(desc='Label for space field') - desc = traits.Str(desc='Label for description field') + space = traits.Str('', usedefault=True, desc='Label for space field') + desc = traits.Str('', usedefault=True, desc='Label for description field') + suffix = traits.Str('', usedefault=True, desc='suffix appended to source_file') keep_dtype = traits.Bool(False, usedefault=True, desc='keep datatype suffix') - suffix = traits.Str('', mandatory=True, desc='suffix appended to source_file') extra_values = traits.List(traits.Str) compress = traits.Bool(desc="force compression (True) or uncompression (False)" " of the output file (default: same as input)") @@ -252,6 +252,8 @@ def _run_interface(self, runtime): space = '_space-{}'.format(self.inputs.space) if self.inputs.space else '' desc = '_desc-{}'.format(self.inputs.desc) if self.inputs.desc else '' + suffix = '_{}'.format(self.inputs.suffix) if self.inputs.suffix else '' + dtype = '' if not self.inputs.keep_dtype else ('_%s' % dtype) self._results['compression'] = [] for i, fname in enumerate(self.inputs.in_file): @@ -259,9 +261,9 @@ def _run_interface(self, runtime): bname=base_fname, space=space, desc=desc, - suffix=('_%s' % self.inputs.suffix) if self.inputs.suffix else '', + suffix=suffix, i=i, - dtype='' if not self.inputs.keep_dtype else ('_%s' % dtype), + dtype=dtype, ext=ext) if isdefined(self.inputs.extra_values): out_file = out_file.format(extra_value=self.inputs.extra_values[i]) From 5da2e925f2be75a4da8597d4d13390d275da3c4a Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 08:17:10 -0700 Subject: [PATCH 35/83] disambiguate flirt reportlets --- fmriprep/viz/config.json | 2 +- fmriprep/workflows/bold/registration.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fmriprep/viz/config.json b/fmriprep/viz/config.json index e87b6a550..235ab5ce7 100644 --- a/fmriprep/viz/config.json +++ b/fmriprep/viz/config.json @@ -100,7 +100,7 @@ }, { "name": "epi_mean_t1_registration/flirt", - "file_pattern": "func/.*_flirt", + "file_pattern": "func/.*_flirtnobbr", "title": "EPI to T1 registration", "description": "FSL flirt was used to generate transformations from EPI space to T1 Space - BBR refinement rejected" }, diff --git a/fmriprep/workflows/bold/registration.py b/fmriprep/workflows/bold/registration.py index 05dd9b688..861a3b6f2 100644 --- a/fmriprep/workflows/bold/registration.py +++ b/fmriprep/workflows/bold/registration.py @@ -157,7 +157,7 @@ def init_bold_reg_wf(freesurfer, use_bbr, bold2t1w_dof, mem_gb, omp_nthreads, def _bold_reg_suffix(fallback, freesurfer): if fallback: - return 'coreg' if freesurfer else 'flirt' + return 'coreg' if freesurfer else 'flirtnobbr' return 'bbregister' if freesurfer else 'flirtbbr' workflow.connect([ From aa0841bb42ab2c4aa9525e48ce914977648464f5 Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 13:03:53 -0700 Subject: [PATCH 36/83] ``_roi`` -> ``_dseg`` (incl. functionals) --- .circleci/ds005_outputs.txt | 16 ++++++++-------- .circleci/ds005_partial_outputs.txt | 12 ++++++------ .circleci/ds054_outputs.txt | 6 +++--- .circleci/ds210_outputs.txt | 6 +++--- fmriprep/workflows/anatomical.py | 4 ++-- fmriprep/workflows/bold/base.py | 4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.circleci/ds005_outputs.txt b/.circleci/ds005_outputs.txt index 2345cc599..755118304 100644 --- a/.circleci/ds005_outputs.txt +++ b/.circleci/ds005_outputs.txt @@ -9,10 +9,10 @@ fmriprep/sub-01/anat fmriprep/sub-01/anat/sub-01_desc-brain_mask.nii.gz fmriprep/sub-01/anat/sub-01_desc-preproc_T1w.nii.gz fmriprep/sub-01/anat/sub-01_dseg.nii.gz -fmriprep/sub-01/anat/sub-01_from-MNI152NLin2009cAsym_to-T1w_xfm.h5 -fmriprep/sub-01/anat/sub-01_from-orig_to-T1w_xfm.txt -fmriprep/sub-01/anat/sub-01_from-T1w_to-fsnative_xfm.txt -fmriprep/sub-01/anat/sub-01_from-T1w_to-MNI152NLin2009cAsym_xfm.h5 +fmriprep/sub-01/anat/sub-01_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5 +fmriprep/sub-01/anat/sub-01_from-orig_to-T1w_mode-image_xfm.txt +fmriprep/sub-01/anat/sub-01_from-T1w_to-fsnative_mode-image_xfm.txt +fmriprep/sub-01/anat/sub-01_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5 fmriprep/sub-01/anat/sub-01_hemi-L_inflated.surf.gii fmriprep/sub-01/anat/sub-01_hemi-L_midthickness.surf.gii fmriprep/sub-01/anat/sub-01_hemi-L_pial.surf.gii @@ -46,8 +46,8 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAs fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_boldref.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_roi.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_roi.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_dseg.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_dseg.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_AROMAnoiseICs.csv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_confounds.tsv @@ -62,8 +62,8 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAs fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_boldref.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aparcaseg_roi.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aseg_roi.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aparcaseg_dseg.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aseg_dseg.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_preproc.nii.gz fmriprep/sub-01.html /tmp/ds005/derivatives diff --git a/.circleci/ds005_partial_outputs.txt b/.circleci/ds005_partial_outputs.txt index e77779138..5de4e1cc4 100644 --- a/.circleci/ds005_partial_outputs.txt +++ b/.circleci/ds005_partial_outputs.txt @@ -9,10 +9,10 @@ fmriprep/sub-01/anat fmriprep/sub-01/anat/sub-01_desc-brain_mask.nii.gz fmriprep/sub-01/anat/sub-01_desc-preproc_T1w.nii.gz fmriprep/sub-01/anat/sub-01_dseg.nii.gz -fmriprep/sub-01/anat/sub-01_from-MNI152NLin2009cAsym_to-T1w_xfm.h5 -fmriprep/sub-01/anat/sub-01_from-orig_to-T1w_xfm.txt -fmriprep/sub-01/anat/sub-01_from-T1w_to-fsnative_xfm.txt -fmriprep/sub-01/anat/sub-01_from-T1w_to-MNI152NLin2009cAsym_xfm.h5 +fmriprep/sub-01/anat/sub-01_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5 +fmriprep/sub-01/anat/sub-01_from-orig_to-T1w_mode-image_xfm.txt +fmriprep/sub-01/anat/sub-01_from-T1w_to-fsnative_mode-image_xfm.txt +fmriprep/sub-01/anat/sub-01_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5 fmriprep/sub-01/anat/sub-01_hemi-L_inflated.surf.gii fmriprep/sub-01/anat/sub-01_hemi-L_midthickness.surf.gii fmriprep/sub-01/anat/sub-01_hemi-L_pial.surf.gii @@ -46,8 +46,8 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAs fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_boldref.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_roi.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_roi.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_dseg.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_dseg.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_preproc.nii.gz fmriprep/sub-01.html /tmp/ds005/derivatives_partial diff --git a/.circleci/ds054_outputs.txt b/.circleci/ds054_outputs.txt index 84cf15814..222bdc9a8 100644 --- a/.circleci/ds054_outputs.txt +++ b/.circleci/ds054_outputs.txt @@ -9,9 +9,9 @@ fmriprep/sub-100185/anat fmriprep/sub-100185/anat/sub-100185_desc-brain_mask.nii.gz fmriprep/sub-100185/anat/sub-100185_desc-preproc_T1w.nii.gz fmriprep/sub-100185/anat/sub-100185_dseg.nii.gz -fmriprep/sub-100185/anat/sub-100185_from-MNI152NLin2009cAsym_to-T1w_xfm.h5 -fmriprep/sub-100185/anat/sub-100185_from-orig_to-T1w_xfm.txt -fmriprep/sub-100185/anat/sub-100185_from-T1w_target-MNI152NLin2009cAsym_xfm.h5 +fmriprep/sub-100185/anat/sub-100185_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5 +fmriprep/sub-100185/anat/sub-100185_from-orig_to-T1w_mode-image_xfm.txt +fmriprep/sub-100185/anat/sub-100185_from-T1w_target-MNI152NLin2009cAsym_mode-image_xfm.h5 fmriprep/sub-100185/anat/sub-100185_label-CSF_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_label-GM_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_label-WM_probseg.nii.gz diff --git a/.circleci/ds210_outputs.txt b/.circleci/ds210_outputs.txt index 9a1ed33ea..adb423eab 100644 --- a/.circleci/ds210_outputs.txt +++ b/.circleci/ds210_outputs.txt @@ -9,9 +9,9 @@ fmriprep/sub-02/anat fmriprep/sub-02/anat/sub-02_desc-brain_mask.nii.gz fmriprep/sub-02/anat/sub-02_desc-preproc_T1w.nii.gz fmriprep/sub-02/anat/sub-02_dseg.nii.gz -fmriprep/sub-02/anat/sub-02_from-MNI152NLin2009cAsym_to-T1w_xfm.h5 -fmriprep/sub-02/anat/sub-02_from-orig_to-T1w_xfm.txt -fmriprep/sub-02/anat/sub-02_from-T1w_to-MNI152NLin2009cAsym_xfm.h5 +fmriprep/sub-02/anat/sub-02_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5 +fmriprep/sub-02/anat/sub-02_from-orig_to-T1w_mode-image_xfm.txt +fmriprep/sub-02/anat/sub-02_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5 fmriprep/sub-02/anat/sub-02_label-CSF_probseg.nii.gz fmriprep/sub-02/anat/sub-02_label-GM_probseg.nii.gz fmriprep/sub-02/anat/sub-02_label-WM_probseg.nii.gz diff --git a/fmriprep/workflows/anatomical.py b/fmriprep/workflows/anatomical.py index 8bcfaa35a..51a1e7477 100644 --- a/fmriprep/workflows/anatomical.py +++ b/fmriprep/workflows/anatomical.py @@ -1313,10 +1313,10 @@ def init_anat_derivatives_wf(output_dir, output_spaces, template, freesurfer, if freesurfer: ds_t1_fsaseg = pe.Node( - DerivativesDataSink(base_directory=output_dir, suffix='label-aseg_roi'), + DerivativesDataSink(base_directory=output_dir, suffix='label-aseg_dseg'), name='ds_t1_fsaseg', run_without_submitting=True) ds_t1_fsparc = pe.Node( - DerivativesDataSink(base_directory=output_dir, suffix='label-aparcaseg_roi'), + DerivativesDataSink(base_directory=output_dir, suffix='label-aparcaseg_dseg'), name='ds_t1_fsparc', run_without_submitting=True) workflow.connect([ (inputnode, lta_2_itk, [('t1_2_fsnative_forward_transform', 'in_lta')]), diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index b73ff02bd..3d5153fbf 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -885,11 +885,11 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, if freesurfer: ds_bold_aseg_t1 = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix='space-T1w_label-aseg_roi'), + base_directory=output_dir, suffix='space-T1w_label-aseg_dseg'), name='ds_bold_aseg_t1', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) ds_bold_aparc_t1 = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix='space-T1w_label-aparcaseg_roi'), + base_directory=output_dir, suffix='space-T1w_label-aparcaseg_dseg'), name='ds_bold_aparc_t1', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) workflow.connect([ From 621577988f783da4beeac3adb6e98b8a8d3e32ff Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 14:18:38 -0700 Subject: [PATCH 37/83] [TST] Add heavily-nonuniform boldrefs for regression tests Refs. #1000, #1050, #1321. Also includes a new filter of branches so builds other than tests are skipped if the name of the branch starts with ``tests?/``. --- .circleci/config.yml | 26 +++++++++++++++------- fmriprep/workflows/bold/tests/test_util.py | 8 +++++++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a01c05f36..378cae838 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -165,8 +165,8 @@ jobs: steps: - restore_cache: keys: - - regression-v0-{{ epoch }} - - regression-v0- + - regression-v1-{{ epoch }} + - regression-v1- - run: name: Get truncated BOLD series command: | @@ -193,7 +193,7 @@ jobs: paths: - data - save_cache: - key: regression-v0-{{ epoch }} + key: regression-v1-{{ epoch }} paths: - /tmp/data @@ -719,7 +719,9 @@ workflows: - get_data: filters: branches: - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /tests?\/.*/ tags: only: /.*/ @@ -740,7 +742,9 @@ workflows: - build filters: branches: - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /tests?\/.*/ tags: only: /.*/ @@ -760,7 +764,9 @@ workflows: - build filters: branches: - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /tests?\/.*/ tags: only: /.*/ @@ -770,7 +776,9 @@ workflows: - build filters: branches: - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /tests?\/.*/ tags: only: /.*/ @@ -781,7 +789,9 @@ workflows: filters: branches: # only: /meepi.*/ - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /tests?\/.*/ tags: only: /.*/ diff --git a/fmriprep/workflows/bold/tests/test_util.py b/fmriprep/workflows/bold/tests/test_util.py index a5e808b3a..57fa83a57 100755 --- a/fmriprep/workflows/bold/tests/test_util.py +++ b/fmriprep/workflows/bold/tests/test_util.py @@ -46,6 +46,14 @@ def symmetric_overlap(img1, img2): 'ds000216/sub-03_task-rest_echo-4_bold.nii.gz', 'ds000237/sub-03_task-MemorySpan_acq-multiband_run-01_bold.nii.gz', 'ds000237/sub-06_task-MemorySpan_acq-multiband_run-01_bold.nii.gz', + 'ds001240/sub-26_task-localizerimagination_bold.nii.gz', + 'ds001240/sub-26_task-localizerviewing_bold.nii.gz', + 'ds001240/sub-26_task-molencoding_run-01_bold.nii.gz', + 'ds001240/sub-26_task-molencoding_run-02_bold.nii.gz', + 'ds001240/sub-26_task-molretrieval_run-01_bold.nii.gz', + 'ds001240/sub-26_task-molretrieval_run-02_bold.nii.gz', + 'ds001240/sub-26_task-rest_bold.nii.gz', + 'ds001362/sub-01_task-taskname_run-01_bold.nii.gz', ) ]) def test_masking(input_fname, expected_fname): From 48fdaa00fb2f7b98d53a95d09dcb5dbee5f18b1a Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 14:23:01 -0700 Subject: [PATCH 38/83] do not build docs on ``test/`` branches --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 378cae838..f2eeb74a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -734,6 +734,8 @@ workflows: requires: - build filters: + branches: + ignore: /tests?\/.*/ tags: only: /.*/ From 8a974fb210e62d920b3882955b4ed0be828b9704 Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 16:40:28 -0700 Subject: [PATCH 39/83] make cache key consistent --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f2eeb74a3..508cf8fee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -229,8 +229,8 @@ jobs: at: /tmp - restore_cache: keys: - - regression-v0-{{ epoch }} - - regression-v0- + - regression-v1-{{ epoch }} + - regression-v1- - run: name: Check PyPi preconditions command: | From f36e2eb9db9277924454e23f639644d357815ec3 Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 20:49:52 -0700 Subject: [PATCH 40/83] is restoring cache necessary in the job? --- .circleci/config.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 508cf8fee..5553cc197 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -227,10 +227,6 @@ jobs: fi - attach_workspace: at: /tmp - - restore_cache: - keys: - - regression-v1-{{ epoch }} - - regression-v1- - run: name: Check PyPi preconditions command: | From b814d61bf262e058f98a9cf8493498cd0a7d3614 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 16 Oct 2018 10:13:17 -0700 Subject: [PATCH 41/83] CI: Tar up directory for OSF publication --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5553cc197..669b8541e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -257,6 +257,12 @@ jobs: --entrypoint="py.test" poldracklab/fmriprep:latest \ /root/src/fmriprep/ \ --doctest-modules --ignore=/root/src/fmriprep/docs --ignore=setup.py + - run: + name: Zip new masks + no_output_timeout: 10m + working_directory: /tmp/data/reports + command: | + tar cfz fmriprep_bold_mask.tar.gz fmriprep_bold_mask/*.nii.gz - run: name: Test fmriprep-wrapper (Python 2) command: | From b6021c4d1ba1bfe8c4a28cbd1769217dc9f7ebad Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 16 Oct 2018 11:26:24 -0700 Subject: [PATCH 42/83] FIX: Set inputs in inputs object --- fmriprep/workflows/bold/tests/test_util.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fmriprep/workflows/bold/tests/test_util.py b/fmriprep/workflows/bold/tests/test_util.py index 57fa83a57..f9385c351 100755 --- a/fmriprep/workflows/bold/tests/test_util.py +++ b/fmriprep/workflows/bold/tests/test_util.py @@ -72,6 +72,13 @@ def test_masking(input_fname, expected_fname): mask_diff_plot.inputs.in_mask = expected_fname mask_diff_plot.inputs.out_report = out_fname + mask_dir = os.path.join(newpath, 'fmriprep_bold_mask') + save_mask = pe.Node(niu.Function(function=copyfile), name='save_mask') + save_mask.inputs.copy = True + save_mask.inputs.newfile = fname_presuffix(basename, suffix='_mask', + use_ext=True, newpath=mask_dir) + + outputnode = bold_reference_wf.get_node('outputnode') bold_reference_wf.connect([ (bold_reference_wf.get_node('outputnode'), mask_diff_plot, [ ('ref_image', 'in_file'), From da18127bdfb89ff0f9e640ed6b6c2857dd2dd7f9 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Tue, 16 Oct 2018 14:05:04 -0700 Subject: [PATCH 43/83] CI: Add -svx options to pytest --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 669b8541e..5068540f1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -256,7 +256,7 @@ jobs: -e FMRIPREP_REGRESSION_REPORTS=/tmp/data/reports \ --entrypoint="py.test" poldracklab/fmriprep:latest \ /root/src/fmriprep/ \ - --doctest-modules --ignore=/root/src/fmriprep/docs --ignore=setup.py + -svx --doctest-modules --ignore=/root/src/fmriprep/docs --ignore=setup.py - run: name: Zip new masks no_output_timeout: 10m From edaa53b254c9ee96f007f67d745d99f7fabfcf15 Mon Sep 17 00:00:00 2001 From: oesteban Date: Tue, 16 Oct 2018 18:44:52 -0700 Subject: [PATCH 44/83] fix problems --- fmriprep/workflows/bold/tests/test_util.py | 30 ++++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/fmriprep/workflows/bold/tests/test_util.py b/fmriprep/workflows/bold/tests/test_util.py index f9385c351..715942769 100755 --- a/fmriprep/workflows/bold/tests/test_util.py +++ b/fmriprep/workflows/bold/tests/test_util.py @@ -1,6 +1,7 @@ ''' Testing module for fmriprep.workflows.bold.util ''' import pytest import os +from pathlib import Path import numpy as np from nipype.pipeline import engine as pe @@ -62,28 +63,22 @@ def test_masking(input_fname, expected_fname): # Reconstruct base_fname from above dirname, basename = os.path.split(input_fname) - newpath = os.path.join(os.getenv('FMRIPREP_REGRESSION_REPORTS', '.'), - os.path.basename(dirname)) + dsname = os.path.basename(dirname) + reports_dir = Path(os.getenv('FMRIPREP_REGRESSION_REPORTS', '')) + newpath = reports_dir / dirname out_fname = fname_presuffix(basename, suffix='_masks.svg', use_ext=False, - newpath=newpath) - os.makedirs(newpath, exist_ok=True) + newpath=str(newpath)) + newpath.mkdir(parents=True, exist_ok=True) mask_diff_plot = pe.Node(ROIsPlot(), name='mask_diff_plot') mask_diff_plot.inputs.in_mask = expected_fname mask_diff_plot.inputs.out_report = out_fname - mask_dir = os.path.join(newpath, 'fmriprep_bold_mask') - save_mask = pe.Node(niu.Function(function=copyfile), name='save_mask') - save_mask.inputs.copy = True - save_mask.inputs.newfile = fname_presuffix(basename, suffix='_mask', - use_ext=True, newpath=mask_dir) - outputnode = bold_reference_wf.get_node('outputnode') bold_reference_wf.connect([ - (bold_reference_wf.get_node('outputnode'), mask_diff_plot, [ - ('ref_image', 'in_file'), - ('bold_mask', 'in_rois'), - ])]) + (outputnode, mask_diff_plot, [('ref_image', 'in_file'), + ('bold_mask', 'in_rois')]) + ]) res = bold_reference_wf.run(plugin='MultiProc') combine_masks = [node for node in res.nodes if node.name.endswith('combine_masks')][0] @@ -91,3 +86,10 @@ def test_masking(input_fname, expected_fname): combine_masks.result.outputs.out_file) assert overlap > 0.95, input_fname + + mask_dir = reports_dir / 'fmriprep_bold_mask' / dsname + mask_dir.mkdir(parents=True, exist_ok=True) + copyfile(combine_masks.result.outputs.out_file, + fname_presuffix(basename, suffix='_mask', + use_ext=True, newpath=str(mask_dir)), + copy=True) From c1bea4ae0a92b30c762197e8202f87d82e09d747 Mon Sep 17 00:00:00 2001 From: oesteban Date: Tue, 16 Oct 2018 21:56:29 -0700 Subject: [PATCH 45/83] fix tarring new masks --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5068540f1..c908b7d8a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -258,11 +258,11 @@ jobs: /root/src/fmriprep/ \ -svx --doctest-modules --ignore=/root/src/fmriprep/docs --ignore=setup.py - run: - name: Zip new masks + name: Package new masks no_output_timeout: 10m working_directory: /tmp/data/reports command: | - tar cfz fmriprep_bold_mask.tar.gz fmriprep_bold_mask/*.nii.gz + tar cfz fmriprep_bold_mask.tar.gz fmriprep_bold_mask/*/*.nii.gz - run: name: Test fmriprep-wrapper (Python 2) command: | From 20325c6022784a36af46c7257b10dc550f50129c Mon Sep 17 00:00:00 2001 From: oesteban Date: Tue, 16 Oct 2018 21:59:10 -0700 Subject: [PATCH 46/83] pacify flake8 --- fmriprep/workflows/bold/tests/test_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmriprep/workflows/bold/tests/test_util.py b/fmriprep/workflows/bold/tests/test_util.py index 715942769..458f09026 100755 --- a/fmriprep/workflows/bold/tests/test_util.py +++ b/fmriprep/workflows/bold/tests/test_util.py @@ -5,7 +5,7 @@ import numpy as np from nipype.pipeline import engine as pe -from nipype.utils.filemanip import fname_presuffix +from nipype.utils.filemanip import fname_presuffix, copyfile from nilearn.image import load_img from niworkflows.interfaces.masks import ROIsPlot From 9f69ba79320da3ec76b4c0c442d16ce1e17635ae Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 23:13:40 -0700 Subject: [PATCH 47/83] minor fixes to test --- fmriprep/workflows/bold/tests/test_util.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fmriprep/workflows/bold/tests/test_util.py b/fmriprep/workflows/bold/tests/test_util.py index 458f09026..1f19772bc 100755 --- a/fmriprep/workflows/bold/tests/test_util.py +++ b/fmriprep/workflows/bold/tests/test_util.py @@ -65,7 +65,7 @@ def test_masking(input_fname, expected_fname): dirname, basename = os.path.split(input_fname) dsname = os.path.basename(dirname) reports_dir = Path(os.getenv('FMRIPREP_REGRESSION_REPORTS', '')) - newpath = reports_dir / dirname + newpath = reports_dir / dsname out_fname = fname_presuffix(basename, suffix='_masks.svg', use_ext=False, newpath=str(newpath)) newpath.mkdir(parents=True, exist_ok=True) @@ -85,11 +85,12 @@ def test_masking(input_fname, expected_fname): overlap = symmetric_overlap(expected_fname, combine_masks.result.outputs.out_file) - assert overlap > 0.95, input_fname - mask_dir = reports_dir / 'fmriprep_bold_mask' / dsname mask_dir.mkdir(parents=True, exist_ok=True) copyfile(combine_masks.result.outputs.out_file, fname_presuffix(basename, suffix='_mask', use_ext=True, newpath=str(mask_dir)), copy=True) + + assert overlap > 0.95, input_fname + From ecb1185fe1a748338486d870cff0a64871b5852c Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 17 Oct 2018 23:14:53 -0700 Subject: [PATCH 48/83] clear regression tests cache --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c908b7d8a..36e3d94f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -165,8 +165,8 @@ jobs: steps: - restore_cache: keys: - - regression-v1-{{ epoch }} - - regression-v1- + - regression-v2-{{ epoch }} + - regression-v2- - run: name: Get truncated BOLD series command: | @@ -193,7 +193,7 @@ jobs: paths: - data - save_cache: - key: regression-v1-{{ epoch }} + key: regression-v2-{{ epoch }} paths: - /tmp/data From 36b369e31a97c93d880fda098f1a65aa64b59059 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 18 Oct 2018 08:31:19 -0700 Subject: [PATCH 49/83] [skip ci] pacify flake8 --- fmriprep/workflows/bold/tests/test_util.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fmriprep/workflows/bold/tests/test_util.py b/fmriprep/workflows/bold/tests/test_util.py index 1f19772bc..ffa742ea3 100755 --- a/fmriprep/workflows/bold/tests/test_util.py +++ b/fmriprep/workflows/bold/tests/test_util.py @@ -55,8 +55,8 @@ def symmetric_overlap(img1, img2): 'ds001240/sub-26_task-molretrieval_run-02_bold.nii.gz', 'ds001240/sub-26_task-rest_bold.nii.gz', 'ds001362/sub-01_task-taskname_run-01_bold.nii.gz', - ) - ]) + ) +]) def test_masking(input_fname, expected_fname): bold_reference_wf = init_bold_reference_wf(omp_nthreads=1, enhance_t2=True) bold_reference_wf.inputs.inputnode.bold_file = input_fname @@ -78,7 +78,7 @@ def test_masking(input_fname, expected_fname): bold_reference_wf.connect([ (outputnode, mask_diff_plot, [('ref_image', 'in_file'), ('bold_mask', 'in_rois')]) - ]) + ]) res = bold_reference_wf.run(plugin='MultiProc') combine_masks = [node for node in res.nodes if node.name.endswith('combine_masks')][0] @@ -91,6 +91,5 @@ def test_masking(input_fname, expected_fname): fname_presuffix(basename, suffix='_mask', use_ext=True, newpath=str(mask_dir)), copy=True) - - assert overlap > 0.95, input_fname + assert overlap > 0.95, input_fname From 9b67991c7a84851bcd83ca509b74a3804b31b21e Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 18 Oct 2018 08:47:47 -0700 Subject: [PATCH 50/83] [FIX] Quick update to new template structure --- fmriprep/__about__.py | 2 +- fmriprep/interfaces/cifti.py | 7 +++---- requirements.txt | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fmriprep/__about__.py b/fmriprep/__about__.py index 04a87e61a..bae53895e 100644 --- a/fmriprep/__about__.py +++ b/fmriprep/__about__.py @@ -98,7 +98,7 @@ 'pybids==0.6.5', 'nitime', 'nipype>=1.1.3', - 'niworkflows>=0.4.3', + 'niworkflows>=0.4.4', 'statsmodels', 'seaborn', 'indexed_gzip>=0.8.2', diff --git a/fmriprep/interfaces/cifti.py b/fmriprep/interfaces/cifti.py index 793a00286..e9726ecc6 100644 --- a/fmriprep/interfaces/cifti.py +++ b/fmriprep/interfaces/cifti.py @@ -130,10 +130,9 @@ def _fetch_data(self): raise IOError("Freesurfer annotations for %s not found in %s" % ( self.inputs.surface_target, self.inputs.subjects_dir)) - label_space = 'tpl-OASISTRT20' - label_dir = getters.get_oasis_dkt31_mni152() - label_file = os.path.join(label_dir, - 'tpl-OASISTRT20_variant-DKT31_space-MNI152NLin2009cAsym.nii.gz') + label_space = 'OASISTRT20' + label_file = str(getters.get_template(label_space) / + 'tpl-OASISTRT20_variant-DKT31_space-MNI152NLin2009cAsym.nii.gz') download_link = getters.OSF_PROJECT_URL + getters.OSF_RESOURCES[label_space][0] return annotation_files, label_file, download_link diff --git a/requirements.txt b/requirements.txt index 01add8634..c184845fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -niworkflows>=0.4.3 +niworkflows>=0.4.4 grabbit==0.2.3 pybids==0.6.5 versioneer From acb8584d5263a8432b1e76019cfa765c9fc01898 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 18 Oct 2018 09:23:25 -0700 Subject: [PATCH 51/83] fix ds054 whitelist of outputs --- .circleci/ds054_outputs.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/ds054_outputs.txt b/.circleci/ds054_outputs.txt index 222bdc9a8..217a93498 100644 --- a/.circleci/ds054_outputs.txt +++ b/.circleci/ds054_outputs.txt @@ -11,13 +11,13 @@ fmriprep/sub-100185/anat/sub-100185_desc-preproc_T1w.nii.gz fmriprep/sub-100185/anat/sub-100185_dseg.nii.gz fmriprep/sub-100185/anat/sub-100185_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5 fmriprep/sub-100185/anat/sub-100185_from-orig_to-T1w_mode-image_xfm.txt -fmriprep/sub-100185/anat/sub-100185_from-T1w_target-MNI152NLin2009cAsym_mode-image_xfm.h5 +fmriprep/sub-100185/anat/sub-100185_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5 fmriprep/sub-100185/anat/sub-100185_label-CSF_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_label-GM_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_label-WM_probseg.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-CSF_probseg.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-GM_probseg.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_class-WM_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_dseg.nii.gz From 2fffaedce8c6bfcd0a48634627ad105a6b818535 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 18 Oct 2018 09:27:43 -0700 Subject: [PATCH 52/83] [skip ds210][skip tests][skip docs] Clear ds005 cache --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 36e3d94f5..6e1863b72 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -354,10 +354,10 @@ jobs: at: /tmp - restore_cache: keys: - - ds005-anat-v8-{{ .Branch }}-{{ epoch }} - - ds005-anat-v8-{{ .Branch }} - - ds005-anat-v8-master - - ds005-anat-v8- + - ds005-anat-v9-{{ .Branch }}-{{ epoch }} + - ds005-anat-v9-{{ .Branch }} + - ds005-anat-v9-master + - ds005-anat-v9- - run: name: Setting up test command: | @@ -391,7 +391,7 @@ jobs: --debug --write-graph --mem_mb 4096 \ --nthreads 2 --anat-only -vv - save_cache: - key: ds005-anat-v8-{{ .Branch }}-{{ epoch }} + key: ds005-anat-v9-{{ .Branch }}-{{ epoch }} paths: - /tmp/ds005/work - /tmp/ds005/derivatives/fmriprep From 235aa1ca9392e6df8e29aea3e96d81ee62e2b54e Mon Sep 17 00:00:00 2001 From: James Kent Date: Thu, 18 Oct 2018 15:59:52 -0500 Subject: [PATCH 53/83] [skip tests][skip docs][skip ds210][skip ds054] pass mask into ica-aroma and merge with upstream --- .circleci/config.yml | 40 +++++++++++++++------- fmriprep/__about__.py | 2 +- fmriprep/interfaces/cifti.py | 7 ++-- fmriprep/workflows/bold/confounds.py | 3 +- fmriprep/workflows/bold/tests/test_util.py | 39 +++++++++++++++------ requirements.txt | 2 +- 6 files changed, 62 insertions(+), 31 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a01c05f36..36e3d94f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -165,8 +165,8 @@ jobs: steps: - restore_cache: keys: - - regression-v0-{{ epoch }} - - regression-v0- + - regression-v2-{{ epoch }} + - regression-v2- - run: name: Get truncated BOLD series command: | @@ -193,7 +193,7 @@ jobs: paths: - data - save_cache: - key: regression-v0-{{ epoch }} + key: regression-v2-{{ epoch }} paths: - /tmp/data @@ -227,10 +227,6 @@ jobs: fi - attach_workspace: at: /tmp - - restore_cache: - keys: - - regression-v0-{{ epoch }} - - regression-v0- - run: name: Check PyPi preconditions command: | @@ -260,7 +256,13 @@ jobs: -e FMRIPREP_REGRESSION_REPORTS=/tmp/data/reports \ --entrypoint="py.test" poldracklab/fmriprep:latest \ /root/src/fmriprep/ \ - --doctest-modules --ignore=/root/src/fmriprep/docs --ignore=setup.py + -svx --doctest-modules --ignore=/root/src/fmriprep/docs --ignore=setup.py + - run: + name: Package new masks + no_output_timeout: 10m + working_directory: /tmp/data/reports + command: | + tar cfz fmriprep_bold_mask.tar.gz fmriprep_bold_mask/*/*.nii.gz - run: name: Test fmriprep-wrapper (Python 2) command: | @@ -719,7 +721,9 @@ workflows: - get_data: filters: branches: - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /tests?\/.*/ tags: only: /.*/ @@ -732,6 +736,8 @@ workflows: requires: - build filters: + branches: + ignore: /tests?\/.*/ tags: only: /.*/ @@ -740,7 +746,9 @@ workflows: - build filters: branches: - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /tests?\/.*/ tags: only: /.*/ @@ -760,7 +768,9 @@ workflows: - build filters: branches: - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /tests?\/.*/ tags: only: /.*/ @@ -770,7 +780,9 @@ workflows: - build filters: branches: - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /tests?\/.*/ tags: only: /.*/ @@ -781,7 +793,9 @@ workflows: filters: branches: # only: /meepi.*/ - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /tests?\/.*/ tags: only: /.*/ diff --git a/fmriprep/__about__.py b/fmriprep/__about__.py index 04a87e61a..bae53895e 100644 --- a/fmriprep/__about__.py +++ b/fmriprep/__about__.py @@ -98,7 +98,7 @@ 'pybids==0.6.5', 'nitime', 'nipype>=1.1.3', - 'niworkflows>=0.4.3', + 'niworkflows>=0.4.4', 'statsmodels', 'seaborn', 'indexed_gzip>=0.8.2', diff --git a/fmriprep/interfaces/cifti.py b/fmriprep/interfaces/cifti.py index 793a00286..e9726ecc6 100644 --- a/fmriprep/interfaces/cifti.py +++ b/fmriprep/interfaces/cifti.py @@ -130,10 +130,9 @@ def _fetch_data(self): raise IOError("Freesurfer annotations for %s not found in %s" % ( self.inputs.surface_target, self.inputs.subjects_dir)) - label_space = 'tpl-OASISTRT20' - label_dir = getters.get_oasis_dkt31_mni152() - label_file = os.path.join(label_dir, - 'tpl-OASISTRT20_variant-DKT31_space-MNI152NLin2009cAsym.nii.gz') + label_space = 'OASISTRT20' + label_file = str(getters.get_template(label_space) / + 'tpl-OASISTRT20_variant-DKT31_space-MNI152NLin2009cAsym.nii.gz') download_link = getters.OSF_PROJECT_URL + getters.OSF_RESOURCES[label_space][0] return annotation_files, label_file, download_link diff --git a/fmriprep/workflows/bold/confounds.py b/fmriprep/workflows/bold/confounds.py index feaac5915..33aba7e75 100755 --- a/fmriprep/workflows/bold/confounds.py +++ b/fmriprep/workflows/bold/confounds.py @@ -581,7 +581,8 @@ def _getbtthresh(medianval): # connect nodes to ICA-AROMA (smooth, ica_aroma, [('smoothed_file', 'in_file')]), (bold_mni_trans_wf, ica_aroma, [ - ('outputnode.bold_mask_mni', 'report_mask')]), + ('outputnode.bold_mask_mni', 'report_mask'), + ('outputnode.bold_mask_mni', 'mask')]), (melodic, ica_aroma, [('out_dir', 'melodic_dir')]), # generate tsvs from ICA-AROMA (ica_aroma, ica_aroma_confound_extraction, [('out_dir', 'in_directory')]), diff --git a/fmriprep/workflows/bold/tests/test_util.py b/fmriprep/workflows/bold/tests/test_util.py index a5e808b3a..ffa742ea3 100755 --- a/fmriprep/workflows/bold/tests/test_util.py +++ b/fmriprep/workflows/bold/tests/test_util.py @@ -1,10 +1,11 @@ ''' Testing module for fmriprep.workflows.bold.util ''' import pytest import os +from pathlib import Path import numpy as np from nipype.pipeline import engine as pe -from nipype.utils.filemanip import fname_presuffix +from nipype.utils.filemanip import fname_presuffix, copyfile from nilearn.image import load_img from niworkflows.interfaces.masks import ROIsPlot @@ -46,33 +47,49 @@ def symmetric_overlap(img1, img2): 'ds000216/sub-03_task-rest_echo-4_bold.nii.gz', 'ds000237/sub-03_task-MemorySpan_acq-multiband_run-01_bold.nii.gz', 'ds000237/sub-06_task-MemorySpan_acq-multiband_run-01_bold.nii.gz', - ) - ]) + 'ds001240/sub-26_task-localizerimagination_bold.nii.gz', + 'ds001240/sub-26_task-localizerviewing_bold.nii.gz', + 'ds001240/sub-26_task-molencoding_run-01_bold.nii.gz', + 'ds001240/sub-26_task-molencoding_run-02_bold.nii.gz', + 'ds001240/sub-26_task-molretrieval_run-01_bold.nii.gz', + 'ds001240/sub-26_task-molretrieval_run-02_bold.nii.gz', + 'ds001240/sub-26_task-rest_bold.nii.gz', + 'ds001362/sub-01_task-taskname_run-01_bold.nii.gz', + ) +]) def test_masking(input_fname, expected_fname): bold_reference_wf = init_bold_reference_wf(omp_nthreads=1, enhance_t2=True) bold_reference_wf.inputs.inputnode.bold_file = input_fname # Reconstruct base_fname from above dirname, basename = os.path.split(input_fname) - newpath = os.path.join(os.getenv('FMRIPREP_REGRESSION_REPORTS', '.'), - os.path.basename(dirname)) + dsname = os.path.basename(dirname) + reports_dir = Path(os.getenv('FMRIPREP_REGRESSION_REPORTS', '')) + newpath = reports_dir / dsname out_fname = fname_presuffix(basename, suffix='_masks.svg', use_ext=False, - newpath=newpath) - os.makedirs(newpath, exist_ok=True) + newpath=str(newpath)) + newpath.mkdir(parents=True, exist_ok=True) mask_diff_plot = pe.Node(ROIsPlot(), name='mask_diff_plot') mask_diff_plot.inputs.in_mask = expected_fname mask_diff_plot.inputs.out_report = out_fname + outputnode = bold_reference_wf.get_node('outputnode') bold_reference_wf.connect([ - (bold_reference_wf.get_node('outputnode'), mask_diff_plot, [ - ('ref_image', 'in_file'), - ('bold_mask', 'in_rois'), - ])]) + (outputnode, mask_diff_plot, [('ref_image', 'in_file'), + ('bold_mask', 'in_rois')]) + ]) res = bold_reference_wf.run(plugin='MultiProc') combine_masks = [node for node in res.nodes if node.name.endswith('combine_masks')][0] overlap = symmetric_overlap(expected_fname, combine_masks.result.outputs.out_file) + mask_dir = reports_dir / 'fmriprep_bold_mask' / dsname + mask_dir.mkdir(parents=True, exist_ok=True) + copyfile(combine_masks.result.outputs.out_file, + fname_presuffix(basename, suffix='_mask', + use_ext=True, newpath=str(mask_dir)), + copy=True) + assert overlap > 0.95, input_fname diff --git a/requirements.txt b/requirements.txt index 01add8634..c184845fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -niworkflows>=0.4.3 +niworkflows>=0.4.4 grabbit==0.2.3 pybids==0.6.5 versioneer From cbcf075ad61aafef71f5213aad640ebda47984e5 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 18 Oct 2018 14:40:50 -0700 Subject: [PATCH 54/83] [skip ci] Fix ordering of ds054 outputs whitelist --- .circleci/ds054_outputs.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/ds054_outputs.txt b/.circleci/ds054_outputs.txt index 217a93498..c39a3b005 100644 --- a/.circleci/ds054_outputs.txt +++ b/.circleci/ds054_outputs.txt @@ -15,12 +15,12 @@ fmriprep/sub-100185/anat/sub-100185_from-T1w_to-MNI152NLin2009cAsym_mode-image_x fmriprep/sub-100185/anat/sub-100185_label-CSF_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_label-GM_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_label-WM_probseg.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz -fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_desc-preproc_T1w.nii.gz fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_dseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz +fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-100185/func fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_confounds.tsv fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz From c6a740568ba5f0c75e9a4ef583fb4bd0a8dc1c00 Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Thu, 18 Oct 2018 20:16:37 -0700 Subject: [PATCH 55/83] [skip ds005][skip tests][skip docs] Clear caches ds054 and ds210 require a clean slate. --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6e1863b72..d98fca470 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -483,10 +483,10 @@ jobs: at: /tmp - restore_cache: keys: - - ds054-anat-v6-{{ .Branch }}-{{ epoch }} - - ds054-anat-v6-{{ .Branch }} - - ds054-anat-v6-master - - ds054-anat-v6- + - ds054-anat-v7-{{ .Branch }}-{{ epoch }} + - ds054-anat-v7-{{ .Branch }} + - ds054-anat-v7-master + - ds054-anat-v7- - run: name: Setting up test command: | @@ -520,7 +520,7 @@ jobs: --fs-no-reconall --debug --write-graph \ --mem_mb 4096 --nthreads 2 --anat-only -vv - save_cache: - key: ds054-anat-v6-{{ .Branch }}-{{ epoch }} + key: ds054-anat-v7-{{ .Branch }}-{{ epoch }} paths: - /tmp/ds054/work - /tmp/ds054/derivatives @@ -601,8 +601,8 @@ jobs: at: /tmp - restore_cache: keys: - - ds210-anat-v3-{{ epoch }} - - ds210-anat-v3- + - ds210-anat-v4-{{ epoch }} + - ds210-anat-v4- - run: name: Setting up test command: | @@ -636,7 +636,7 @@ jobs: --fs-no-reconall --debug --write-graph \ --mem_mb 4096 --nthreads 2 --anat-only -vv - save_cache: - key: ds210-anat-v3-{{ epoch }} + key: ds210-anat-v4-{{ epoch }} paths: - /tmp/ds210/work - /tmp/ds210/derivatives From b3f34a51c001f06a1f3bf8805a28c0727dc5261d Mon Sep 17 00:00:00 2001 From: James Kent Date: Fri, 19 Oct 2018 20:54:49 -0500 Subject: [PATCH 56/83] [skip tests][skip docs][skip ds210][skip ds054] wip: remove non steady state volumes from aroma calculation --- fmriprep/interfaces/confounds.py | 20 ++++--- fmriprep/workflows/bold/base.py | 11 ++++ fmriprep/workflows/bold/confounds.py | 88 +++++++++++++++++++++++----- 3 files changed, 96 insertions(+), 23 deletions(-) diff --git a/fmriprep/interfaces/confounds.py b/fmriprep/interfaces/confounds.py index 48d64a6c6..98461e06b 100644 --- a/fmriprep/interfaces/confounds.py +++ b/fmriprep/interfaces/confounds.py @@ -94,6 +94,7 @@ def _run_interface(self, runtime): class ICAConfoundsInputSpec(BaseInterfaceInputSpec): in_directory = Directory(mandatory=True, desc='directory where ICA derivatives are found') + n_volumes = traits.Int(desc='number of non steady state volumes identified') ignore_aroma_err = traits.Bool(False, usedefault=True, desc='ignore ICA-AROMA errors') @@ -111,7 +112,7 @@ class ICAConfounds(SimpleInterface): def _run_interface(self, runtime): aroma_confounds, motion_ics_out, melodic_mix_out = _get_ica_confounds( - self.inputs.in_directory, newpath=runtime.cwd) + self.inputs.in_directory, self.inputs.n_volumes, newpath=runtime.cwd) if aroma_confounds is not None: self._results['aroma_confounds'] = aroma_confounds @@ -198,7 +199,7 @@ def _adjust_indices(left_df, right_df): return combined_out, confounds_list -def _get_ica_confounds(ica_out_dir, newpath=None): +def _get_ica_confounds(ica_out_dir, n_volumes, newpath=None): if newpath is None: newpath = os.getcwd() @@ -210,13 +211,6 @@ def _get_ica_confounds(ica_out_dir, newpath=None): melodic_mix_out = os.path.join(newpath, 'MELODICmix.tsv') motion_ics_out = os.path.join(newpath, 'AROMAnoiseICs.csv') - # melodic_mix replace spaces with tabs - with open(melodic_mix, 'r') as melodic_file: - melodic_mix_out_char = melodic_file.read().replace(' ', '\t') - # write to output file - with open(melodic_mix_out, 'w+') as melodic_file_out: - melodic_file_out.write(melodic_mix_out_char) - # copy metion_ics file to derivatives name shutil.copyfile(motion_ics, motion_ics_out) @@ -224,6 +218,14 @@ def _get_ica_confounds(ica_out_dir, newpath=None): motion_ic_indices = np.loadtxt(motion_ics, dtype=int, delimiter=',', ndmin=1) - 1 melodic_mix_arr = np.loadtxt(melodic_mix, ndmin=2) + # pad melodic_mix_arr with rows of zeros corresponding to number non steadystate volumes + if n_volumes > 0: + zeros = np.zeros([n_volumes, melodic_mix_arr.shape[1]]) + melodic_mix_arr = np.vstack([zeros, melodic_mix_arr]) + + # save melodic_mix_arr + np.savetxt(melodic_mix_out, melodic_mix_arr, delimiter='\t') + # Return dummy list of ones if no noise compnents were found if motion_ic_indices.size == 0: LOGGER.warning('No noise components were classified') diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index 3d5153fbf..f7684d874 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -18,6 +18,7 @@ from nipype.interfaces.fsl import Split as FSLSplit from nipype.pipeline import engine as pe from nipype.interfaces import utility as niu +from nipype.algorithms import confounds as nac from ...interfaces import ( DerivativesDataSink, @@ -424,6 +425,9 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, omp_nthreads=omp_nthreads, use_compression=False) + # get non steady-state volumes + non_steady_state = pe.Node(nac.NonSteadyStateDetector(), name='non_steady_state') + # get confounds bold_confounds_wf = init_bold_confs_wf( mem_gb=mem_gb['largemem'], @@ -525,6 +529,9 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, ('outputnode.out_warp', 'inputnode.fieldwarp'), ('outputnode.bold_mask', 'inputnode.bold_mask')]), (bold_sdc_wf, summary, [('outputnode.method', 'distortion_correction')]), + # Calculate nonsteady state + (bold_bold_trans_wf, non_steady_state, [ + ('outputnode.bold', 'in_file')]), # Connect bold_confounds_wf (inputnode, bold_confounds_wf, [('t1_tpms', 'inputnode.t1_tpms'), ('t1_mask', 'inputnode.t1_mask')]), @@ -532,6 +539,8 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, ('outputnode.movpar_file', 'inputnode.movpar_file')]), (bold_reg_wf, bold_confounds_wf, [ ('outputnode.itk_t1_to_bold', 'inputnode.t1_bold_xform')]), + (non_steady_state, bold_confounds_wf, [ + ('n_volumes_to_discard', 'inputnode.n_volumes_to_discard')]), (bold_confounds_wf, outputnode, [ ('outputnode.confounds_file', 'confounds'), ]), @@ -730,6 +739,8 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, ('outputnode.bold_mask', 'inputnode.bold_mask')]), (bold_sdc_wf, ica_aroma_wf, [ ('outputnode.out_warp', 'inputnode.fieldwarp')]), + (non_steady_state, ica_aroma_wf, [ + ('n_volumes_to_discard', 'inputnode.n_volumes_to_discard')]), (bold_confounds_wf, join, [ ('outputnode.confounds_file', 'in_file')]), (ica_aroma_wf, join, diff --git a/fmriprep/workflows/bold/confounds.py b/fmriprep/workflows/bold/confounds.py index feaac5915..71036c478 100755 --- a/fmriprep/workflows/bold/confounds.py +++ b/fmriprep/workflows/bold/confounds.py @@ -92,6 +92,8 @@ def init_bold_confs_wf(mem_gb, metadata, name="bold_confs_wf"): BOLD series mask movpar_file SPM-formatted motion parameters file + n_volumes_to_discard + number of non steady state volumes t1_mask Mask of the skull-stripped template image t1_tpms @@ -136,8 +138,8 @@ def init_bold_confs_wf(mem_gb, metadata, name="bold_confs_wf"): placed within the corresponding confounds file. """ inputnode = pe.Node(niu.IdentityInterface( - fields=['bold', 'bold_mask', 'movpar_file', 't1_mask', 't1_tpms', - 't1_bold_xform']), + fields=['bold', 'bold_mask', 'movpar_file', 'n_volumes_to_discard', + 't1_mask', 't1_tpms', 't1_bold_xform']), name='inputnode') outputnode = pe.Node(niu.IdentityInterface( fields=['confounds_file']), @@ -178,7 +180,6 @@ def init_bold_confs_wf(mem_gb, metadata, name="bold_confs_wf"): name="fdisp", mem_gb=mem_gb) # a/t-CompCor - non_steady_state = pe.Node(nac.NonSteadyStateDetector(), name='non_steady_state') tcompcor = pe.Node(TCompCor( components_file='tcompcor.tsv', pre_filter='cosine', save_pre_filter=True, percentile_threshold=.05), name="tcompcor", mem_gb=mem_gb) @@ -250,18 +251,15 @@ def _pick_wm(files): ('bold_mask', 'in_mask')]), (inputnode, fdisp, [('movpar_file', 'in_file')]), - # Calculate nonsteady state - (inputnode, non_steady_state, [('bold', 'in_file')]), - # tCompCor (inputnode, tcompcor, [('bold', 'realigned_file')]), - (non_steady_state, tcompcor, [('n_volumes_to_discard', 'ignore_initial_volumes')]), + (inputnode, tcompcor, [('n_volumes_to_discard', 'ignore_initial_volumes')]), (tcc_tfm, tcc_msk, [('output_image', 'roi_file')]), (tcc_msk, tcompcor, [('out', 'mask_files')]), # aCompCor (inputnode, acompcor, [('bold', 'realigned_file')]), - (non_steady_state, acompcor, [('n_volumes_to_discard', 'ignore_initial_volumes')]), + (inputnode, acompcor, [('n_volumes_to_discard', 'ignore_initial_volumes')]), (acc_tfm, acc_msk, [('output_image', 'roi_file')]), (acc_msk, acompcor, [('out', 'mask_files')]), @@ -494,6 +492,7 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads, 'itk_bold_to_t1', 't1_2_mni_forward_transform', 'name_source', + 'n_volumes_to_discard', 'bold_split', 'bold_mask', 'hmc_xforms', @@ -516,6 +515,10 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads, ) bold_mni_trans_wf.__desc__ = None + rm_non_steady_state = pe.Node(niu.Function(function=_remove_volumes, + output_names=['bold_cut']), + name='rm_nonsteady') + calc_median_val = pe.Node(fsl.ImageStats(op_string='-k %s -p 50'), name='calc_median_val') calc_bold_mean = pe.Node(fsl.MeanImage(), name='calc_bold_mean') @@ -539,6 +542,10 @@ def _getusans_func(image, thresh): denoise_type='nonaggr', generate_report=True, TR=metadata['RepetitionTime']), name='ica_aroma') + add_non_steady_state = pe.Node(niu.Function(function=_add_volumes, + output_names=['bold_add']), + name='add_nonsteady') + # extract the confound ICs from the results ica_aroma_confound_extraction = pe.Node(ICAConfounds(ignore_aroma_err=ignore_aroma_err), name='ica_aroma_confound_extraction') @@ -562,16 +569,21 @@ def _getbtthresh(medianval): ('t1_2_mni_forward_transform', 'inputnode.t1_2_mni_forward_transform'), ('fieldwarp', 'inputnode.fieldwarp')]), (inputnode, ica_aroma, [('movpar_file', 'motion_parameters')]), + (inputnode, rm_non_steady_state, [ + ('n_volumes_to_discard', 'n_volumes')]), + (bold_mni_trans_wf, rm_non_steady_state, [ + ('outputnode.bold_mni', 'bold_file')]), (bold_mni_trans_wf, calc_median_val, [ - ('outputnode.bold_mni', 'in_file'), ('outputnode.bold_mask_mni', 'mask_file')]), - (bold_mni_trans_wf, calc_bold_mean, [ - ('outputnode.bold_mni', 'in_file')]), + (rm_non_steady_state, calc_median_val, [ + ('bold_cut', 'in_file')]), + (rm_non_steady_state, calc_bold_mean, [ + ('bold_cut', 'in_file')]), (calc_bold_mean, getusans, [('out_file', 'image')]), (calc_median_val, getusans, [('out_stat', 'thresh')]), # Connect input nodes to complete smoothing - (bold_mni_trans_wf, smooth, [ - ('outputnode.bold_mni', 'in_file')]), + (rm_non_steady_state, smooth, [ + ('bold_cut', 'in_file')]), (getusans, smooth, [('usans', 'usans')]), (calc_median_val, smooth, [(('out_stat', _getbtthresh), 'brightness_threshold')]), # connect smooth to melodic @@ -585,17 +597,65 @@ def _getbtthresh(medianval): (melodic, ica_aroma, [('out_dir', 'melodic_dir')]), # generate tsvs from ICA-AROMA (ica_aroma, ica_aroma_confound_extraction, [('out_dir', 'in_directory')]), + (inputnode, ica_aroma_confound_extraction, [ + ('n_volumes_to_discard', 'n_volumes')]), # output for processing and reporting (ica_aroma_confound_extraction, outputnode, [('aroma_confounds', 'aroma_confounds'), ('aroma_noise_ics', 'aroma_noise_ics'), ('melodic_mix', 'melodic_mix')]), # TODO change melodic report to reflect noise and non-noise components - (ica_aroma, outputnode, [('nonaggr_denoised_file', 'nonaggr_denoised_file')]), + (ica_aroma, add_non_steady_state, [ + ('nonaggr_denoised_file', 'bold_cut_file')]), + (bold_mni_trans_wf, add_non_steady_state, [ + ('outputnode.bold_mni', 'bold_file')]), + (inputnode, add_non_steady_state, [ + ('n_volumes_to_discard', 'n_volumes')]), + (add_non_steady_state, outputnode, [('bold_add', 'nonaggr_denoised_file')]), (ica_aroma, ds_report_ica_aroma, [('out_report', 'in_file')]), ]) return workflow +def _remove_volumes(bold_file, n_volumes): + import nibabel as nb + from nipype.utils.filemanip import fname_presuffix + + # load the bold file and get the 4d matrix + bold_img = nb.load(bold_file) + bold_data = bold_img.get_data() + + # cut off the beginning volumes + bold_data_cut = bold_data[..., n_volumes:] + + # modify header with new shape (fewer volumes) + data_shape = list(bold_img.header.get_data_shape()) + data_shape[-1] -= n_volumes + bold_img.header.set_data_shape(tuple(data_shape)) + + # save the resulting bold file + out = fname_presuffix(bold_file, suffix='_cut') + bold_img.__class__(bold_data_cut, bold_img.affine, bold_img.header).to_filename(out) + return out + + +def _add_volumes(bold_file, bold_cut_file, n_volumes): + """prepend n_volumes from bold_file onto bold_cut_file""" + import nibabel as nb + from nipype.utils.filemanip import fname_presuffix + + # load the data + bold_img = nb.load(bold_file) + bold_data = bold_img.get_data() + bold_cut_img = nb.load(bold_cut_file) + bold_cut_data = bold_cut_img.get_data() + + # assign everything from n_volumes foward to bold_cut_data + bold_data[..., n_volumes:] = bold_cut_data + + out = fname_presuffix(bold_cut_file, suffix='_addnonsteady') + bold_img.__class__(bold_data, bold_img.affine, bold_img.header).to_filename(out) + return out + def _maskroi(in_mask, roi_file): import numpy as np From b4ab300466ccaff87398db0b036de93edd02b405 Mon Sep 17 00:00:00 2001 From: James Kent Date: Fri, 19 Oct 2018 23:22:06 -0500 Subject: [PATCH 57/83] [skip tests][skip docs][skip ds210][skip ds054] pacify flake8 --- fmriprep/workflows/bold/confounds.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fmriprep/workflows/bold/confounds.py b/fmriprep/workflows/bold/confounds.py index 71036c478..90aa0fd2f 100755 --- a/fmriprep/workflows/bold/confounds.py +++ b/fmriprep/workflows/bold/confounds.py @@ -138,7 +138,7 @@ def init_bold_confs_wf(mem_gb, metadata, name="bold_confs_wf"): placed within the corresponding confounds file. """ inputnode = pe.Node(niu.IdentityInterface( - fields=['bold', 'bold_mask', 'movpar_file', 'n_volumes_to_discard', + fields=['bold', 'bold_mask', 'movpar_file', 'n_volumes_to_discard', 't1_mask', 't1_tpms', 't1_bold_xform']), name='inputnode') outputnode = pe.Node(niu.IdentityInterface( @@ -515,7 +515,7 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads, ) bold_mni_trans_wf.__desc__ = None - rm_non_steady_state = pe.Node(niu.Function(function=_remove_volumes, + rm_non_steady_state = pe.Node(niu.Function(function=_remove_volumes, output_names=['bold_cut']), name='rm_nonsteady') @@ -542,7 +542,7 @@ def _getusans_func(image, thresh): denoise_type='nonaggr', generate_report=True, TR=metadata['RepetitionTime']), name='ica_aroma') - add_non_steady_state = pe.Node(niu.Function(function=_add_volumes, + add_non_steady_state = pe.Node(niu.Function(function=_add_volumes, output_names=['bold_add']), name='add_nonsteady') @@ -616,6 +616,7 @@ def _getbtthresh(medianval): return workflow + def _remove_volumes(bold_file, n_volumes): import nibabel as nb from nipype.utils.filemanip import fname_presuffix From 921bf5687d0cc79cda0704e484ce51d6570e624a Mon Sep 17 00:00:00 2001 From: James Kent Date: Sat, 20 Oct 2018 22:05:47 -0500 Subject: [PATCH 58/83] [skip ds210][skip ds054] update the documentation --- docs/workflows.rst | 4 ++ fmriprep/workflows/bold/confounds.py | 56 +++++++++++++++++----------- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/docs/workflows.rst b/docs/workflows.rst index f6eb41384..5b21a0c9e 100644 --- a/docs/workflows.rst +++ b/docs/workflows.rst @@ -588,6 +588,10 @@ be generated, so non-aggressive denoising can be manually performed in the T1w s -d sub-_task-_bold_MELODICmix.tsv \ -o sub-_task-_bold_space-_AromaNonAggressiveDenoised.nii.gz +*Note*: The non-steady state volumes are removed for the determination of components in melodic. +Therefore ``*MELODICmix.tsv`` may have zero padded rows to account for the volumes not used in +melodic's estimation of components. + A visualization of the AROMA component classification is also included in the HTML reports. .. figure:: _static/aroma.svg diff --git a/fmriprep/workflows/bold/confounds.py b/fmriprep/workflows/bold/confounds.py index 90aa0fd2f..ef3dfba83 100755 --- a/fmriprep/workflows/bold/confounds.py +++ b/fmriprep/workflows/bold/confounds.py @@ -397,6 +397,7 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads, The following steps are performed: + #. Remove non-steady state volumes from the bold series. #. Smooth data using FSL `susan`, with a kernel width FWHM=6.0mm. #. Run FSL `melodic` outside of ICA-AROMA to generate the report #. Run ICA-AROMA @@ -426,40 +427,53 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads, **Parameters** + aroma_melodic_dim: int or None + Set the dimensionality of the Melodic ICA decomposition + If None, MELODIC automatically estimates dimensionality. + ignore_aroma_err : bool + Do not fail on ICA-AROMA errors + mem_gb : float + Size of BOLD file in GB + metadata : dict + BIDS metadata for BOLD file + name : str + Name of workflow (default: ``bold_mni_trans_wf``) + omp_nthreads : int + Maximum number of threads an individual process may use template : str Spatial normalization template used as target when that registration step was previously calculated with :py:func:`~fmriprep.workflows.bold.registration.init_bold_reg_wf`. The template must be one of the MNI templates (fMRIPrep uses ``MNI152NLin2009cAsym`` by default). - metadata : dict - BIDS metadata for BOLD file - mem_gb : float - Size of BOLD file in GB - omp_nthreads : int - Maximum number of threads an individual process may use - name : str - Name of workflow (default: ``bold_mni_trans_wf``) susan_fwhm : float Kernel width (FWHM in mm) for the smoothing step with FSL ``susan`` (default: 6.0mm) use_fieldwarp : bool Include SDC warp in single-shot transform from BOLD to MNI - ignore_aroma_err : bool - Do not fail on ICA-AROMA errors - aroma_melodic_dim: int or None - Set the dimensionality of the Melodic ICA decomposition - If None, MELODIC automatically estimates dimensionality. **Inputs** - - bold_mni - BOLD series, resampled to template space + bold_mask + BOLD series mask in template space + bold_split + Individual 3D BOLD volumes, not motion corrected + fieldwarp + a :abbr:`DFM (displacements field map)` in ITK format + hmc_xforms + List of affine transforms aligning each volume to ``ref_image`` in ITK format + itk_bold_to_t1 + Affine transform from ``ref_bold_brain`` to T1 space (ITK format) movpar_file SPM-formatted motion parameters file - bold_mask_mni - BOLD series mask in template space + n_volumes_to_discard + number of non steady state volumes + name_source + BOLD series NIfTI file + Used to recover original information lost during processing + t1_2_mni_forward_transform + ANTs-compatible affine-and-warp transform file + **Outputs** @@ -472,15 +486,15 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads, nonaggr_denoised_file BOLD series with non-aggressive ICA-AROMA denoising applied - .. _ICA-AROMA: https://github.com/rhr-pruim/ICA-AROMA + .. _ICA-AROMA: https://github.com/maartenmennes/ICA-AROMA """ workflow = Workflow(name=name) workflow.__postdesc__ = """\ Automatic removal of motion artifacts using independent component analysis [ICA-AROMA, @aroma] was performed on the *preprocessed BOLD on MNI space* -time-series after a spatial smoothing with an isotropic, Gaussian kernel -of 6mm FWHM (full-width half-maximum). +time-series after removal of non-steady state volumes and spatial smoothing +with an isotropic, Gaussian kernel of 6mm FWHM (full-width half-maximum). Corresponding "non-aggresively" denoised runs were produced after such smoothing. Additionally, the "aggressive" noise-regressors were collected and placed From d773cfc15d861e740b366f0b3dbfab1b60d398a8 Mon Sep 17 00:00:00 2001 From: James Kent Date: Sat, 20 Oct 2018 22:18:09 -0500 Subject: [PATCH 59/83] [skip tests][skip docs][skip ds210][skip ds054][skip ds005] ignore project settings files from popular python/code editors --- .gitignore | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index e1d98e8f7..8caf06a79 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,16 @@ target/ #Ipython Notebook .ipynb_checkpoints +# pycharm project settings +.idea + +# vscode project settings +.vscode + +# Spyder project settings +.spyderproject +.spyproject + auth/ secrets.py local_settings.py From b9e5ff4720163ca76a853c2e4fe067e3f1ac528d Mon Sep 17 00:00:00 2001 From: James Kent Date: Mon, 22 Oct 2018 21:05:32 -0500 Subject: [PATCH 60/83] remove whitespace --- docs/workflows.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/workflows.rst b/docs/workflows.rst index 5b21a0c9e..44c8e7e16 100644 --- a/docs/workflows.rst +++ b/docs/workflows.rst @@ -589,7 +589,7 @@ be generated, so non-aggressive denoising can be manually performed in the T1w s -o sub-_task-_bold_space-_AromaNonAggressiveDenoised.nii.gz *Note*: The non-steady state volumes are removed for the determination of components in melodic. -Therefore ``*MELODICmix.tsv`` may have zero padded rows to account for the volumes not used in +Therefore ``*MELODICmix.tsv`` may have zero padded rows to account for the volumes not used in melodic's estimation of components. A visualization of the AROMA component classification is also included in the HTML reports. From 11ea1c24c39812f0c05fc4a6e4827da6d381ac10 Mon Sep 17 00:00:00 2001 From: James Kent Date: Mon, 22 Oct 2018 21:05:46 -0500 Subject: [PATCH 61/83] [skip ds210][skip ds054][skip tests] switch n_volumes* to skip_vols and use nonsteady calculation from bold_reference_wf (review by effigies) --- fmriprep/interfaces/confounds.py | 10 ++++----- fmriprep/workflows/bold/base.py | 15 ++++--------- fmriprep/workflows/bold/confounds.py | 32 ++++++++++++++-------------- 3 files changed, 25 insertions(+), 32 deletions(-) diff --git a/fmriprep/interfaces/confounds.py b/fmriprep/interfaces/confounds.py index 98461e06b..a8ce1a065 100644 --- a/fmriprep/interfaces/confounds.py +++ b/fmriprep/interfaces/confounds.py @@ -94,7 +94,7 @@ def _run_interface(self, runtime): class ICAConfoundsInputSpec(BaseInterfaceInputSpec): in_directory = Directory(mandatory=True, desc='directory where ICA derivatives are found') - n_volumes = traits.Int(desc='number of non steady state volumes identified') + skip_vols = traits.Int(desc='number of non steady state volumes identified') ignore_aroma_err = traits.Bool(False, usedefault=True, desc='ignore ICA-AROMA errors') @@ -112,7 +112,7 @@ class ICAConfounds(SimpleInterface): def _run_interface(self, runtime): aroma_confounds, motion_ics_out, melodic_mix_out = _get_ica_confounds( - self.inputs.in_directory, self.inputs.n_volumes, newpath=runtime.cwd) + self.inputs.in_directory, self.inputs.skip_vols, newpath=runtime.cwd) if aroma_confounds is not None: self._results['aroma_confounds'] = aroma_confounds @@ -199,7 +199,7 @@ def _adjust_indices(left_df, right_df): return combined_out, confounds_list -def _get_ica_confounds(ica_out_dir, n_volumes, newpath=None): +def _get_ica_confounds(ica_out_dir, skip_vols, newpath=None): if newpath is None: newpath = os.getcwd() @@ -219,8 +219,8 @@ def _get_ica_confounds(ica_out_dir, n_volumes, newpath=None): melodic_mix_arr = np.loadtxt(melodic_mix, ndmin=2) # pad melodic_mix_arr with rows of zeros corresponding to number non steadystate volumes - if n_volumes > 0: - zeros = np.zeros([n_volumes, melodic_mix_arr.shape[1]]) + if skip_vols > 0: + zeros = np.zeros([skip_vols, melodic_mix_arr.shape[1]]) melodic_mix_arr = np.vstack([zeros, melodic_mix_arr]) # save melodic_mix_arr diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index f7684d874..b1c838d25 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -18,7 +18,6 @@ from nipype.interfaces.fsl import Split as FSLSplit from nipype.pipeline import engine as pe from nipype.interfaces import utility as niu -from nipype.algorithms import confounds as nac from ...interfaces import ( DerivativesDataSink, @@ -425,9 +424,6 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, omp_nthreads=omp_nthreads, use_compression=False) - # get non steady-state volumes - non_steady_state = pe.Node(nac.NonSteadyStateDetector(), name='non_steady_state') - # get confounds bold_confounds_wf = init_bold_confs_wf( mem_gb=mem_gb['largemem'], @@ -529,9 +525,6 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, ('outputnode.out_warp', 'inputnode.fieldwarp'), ('outputnode.bold_mask', 'inputnode.bold_mask')]), (bold_sdc_wf, summary, [('outputnode.method', 'distortion_correction')]), - # Calculate nonsteady state - (bold_bold_trans_wf, non_steady_state, [ - ('outputnode.bold', 'in_file')]), # Connect bold_confounds_wf (inputnode, bold_confounds_wf, [('t1_tpms', 'inputnode.t1_tpms'), ('t1_mask', 'inputnode.t1_mask')]), @@ -539,8 +532,8 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, ('outputnode.movpar_file', 'inputnode.movpar_file')]), (bold_reg_wf, bold_confounds_wf, [ ('outputnode.itk_t1_to_bold', 'inputnode.t1_bold_xform')]), - (non_steady_state, bold_confounds_wf, [ - ('n_volumes_to_discard', 'inputnode.n_volumes_to_discard')]), + (bold_reference_wf, bold_confounds_wf, [ + ('outputnode.skip_vols', 'inputnode.skip_vols')]), (bold_confounds_wf, outputnode, [ ('outputnode.confounds_file', 'confounds'), ]), @@ -739,8 +732,8 @@ def init_func_preproc_wf(bold_file, ignore, freesurfer, ('outputnode.bold_mask', 'inputnode.bold_mask')]), (bold_sdc_wf, ica_aroma_wf, [ ('outputnode.out_warp', 'inputnode.fieldwarp')]), - (non_steady_state, ica_aroma_wf, [ - ('n_volumes_to_discard', 'inputnode.n_volumes_to_discard')]), + (bold_reference_wf, ica_aroma_wf, [ + ('outputnode.skip_vols', 'inputnode.skip_vols')]), (bold_confounds_wf, join, [ ('outputnode.confounds_file', 'in_file')]), (ica_aroma_wf, join, diff --git a/fmriprep/workflows/bold/confounds.py b/fmriprep/workflows/bold/confounds.py index cbc5599cb..8e3dd9aa3 100755 --- a/fmriprep/workflows/bold/confounds.py +++ b/fmriprep/workflows/bold/confounds.py @@ -92,7 +92,7 @@ def init_bold_confs_wf(mem_gb, metadata, name="bold_confs_wf"): BOLD series mask movpar_file SPM-formatted motion parameters file - n_volumes_to_discard + skip_vols number of non steady state volumes t1_mask Mask of the skull-stripped template image @@ -138,7 +138,7 @@ def init_bold_confs_wf(mem_gb, metadata, name="bold_confs_wf"): placed within the corresponding confounds file. """ inputnode = pe.Node(niu.IdentityInterface( - fields=['bold', 'bold_mask', 'movpar_file', 'n_volumes_to_discard', + fields=['bold', 'bold_mask', 'movpar_file', 'skip_vols', 't1_mask', 't1_tpms', 't1_bold_xform']), name='inputnode') outputnode = pe.Node(niu.IdentityInterface( @@ -253,13 +253,13 @@ def _pick_wm(files): # tCompCor (inputnode, tcompcor, [('bold', 'realigned_file')]), - (inputnode, tcompcor, [('n_volumes_to_discard', 'ignore_initial_volumes')]), + (inputnode, tcompcor, [('skip_vols', 'ignore_initial_volumes')]), (tcc_tfm, tcc_msk, [('output_image', 'roi_file')]), (tcc_msk, tcompcor, [('out', 'mask_files')]), # aCompCor (inputnode, acompcor, [('bold', 'realigned_file')]), - (inputnode, acompcor, [('n_volumes_to_discard', 'ignore_initial_volumes')]), + (inputnode, acompcor, [('skip_vols', 'ignore_initial_volumes')]), (acc_tfm, acc_msk, [('output_image', 'roi_file')]), (acc_msk, acompcor, [('out', 'mask_files')]), @@ -466,7 +466,7 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads, Affine transform from ``ref_bold_brain`` to T1 space (ITK format) movpar_file SPM-formatted motion parameters file - n_volumes_to_discard + skip_vols number of non steady state volumes name_source BOLD series NIfTI file @@ -506,7 +506,7 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads, 'itk_bold_to_t1', 't1_2_mni_forward_transform', 'name_source', - 'n_volumes_to_discard', + 'skip_vols', 'bold_split', 'bold_mask', 'hmc_xforms', @@ -584,7 +584,7 @@ def _getbtthresh(medianval): ('fieldwarp', 'inputnode.fieldwarp')]), (inputnode, ica_aroma, [('movpar_file', 'motion_parameters')]), (inputnode, rm_non_steady_state, [ - ('n_volumes_to_discard', 'n_volumes')]), + ('skip_vols', 'skip_vols')]), (bold_mni_trans_wf, rm_non_steady_state, [ ('outputnode.bold_mni', 'bold_file')]), (bold_mni_trans_wf, calc_median_val, [ @@ -613,7 +613,7 @@ def _getbtthresh(medianval): # generate tsvs from ICA-AROMA (ica_aroma, ica_aroma_confound_extraction, [('out_dir', 'in_directory')]), (inputnode, ica_aroma_confound_extraction, [ - ('n_volumes_to_discard', 'n_volumes')]), + ('skip_vols', 'skip_vols')]), # output for processing and reporting (ica_aroma_confound_extraction, outputnode, [('aroma_confounds', 'aroma_confounds'), ('aroma_noise_ics', 'aroma_noise_ics'), @@ -624,7 +624,7 @@ def _getbtthresh(medianval): (bold_mni_trans_wf, add_non_steady_state, [ ('outputnode.bold_mni', 'bold_file')]), (inputnode, add_non_steady_state, [ - ('n_volumes_to_discard', 'n_volumes')]), + ('skip_vols', 'skip_vols')]), (add_non_steady_state, outputnode, [('bold_add', 'nonaggr_denoised_file')]), (ica_aroma, ds_report_ica_aroma, [('out_report', 'in_file')]), ]) @@ -632,7 +632,7 @@ def _getbtthresh(medianval): return workflow -def _remove_volumes(bold_file, n_volumes): +def _remove_volumes(bold_file, skip_vols): import nibabel as nb from nipype.utils.filemanip import fname_presuffix @@ -641,11 +641,11 @@ def _remove_volumes(bold_file, n_volumes): bold_data = bold_img.get_data() # cut off the beginning volumes - bold_data_cut = bold_data[..., n_volumes:] + bold_data_cut = bold_data[..., skip_vols:] # modify header with new shape (fewer volumes) data_shape = list(bold_img.header.get_data_shape()) - data_shape[-1] -= n_volumes + data_shape[-1] -= skip_vols bold_img.header.set_data_shape(tuple(data_shape)) # save the resulting bold file @@ -654,8 +654,8 @@ def _remove_volumes(bold_file, n_volumes): return out -def _add_volumes(bold_file, bold_cut_file, n_volumes): - """prepend n_volumes from bold_file onto bold_cut_file""" +def _add_volumes(bold_file, bold_cut_file, skip_vols): + """prepend skip_vols from bold_file onto bold_cut_file""" import nibabel as nb from nipype.utils.filemanip import fname_presuffix @@ -665,8 +665,8 @@ def _add_volumes(bold_file, bold_cut_file, n_volumes): bold_cut_img = nb.load(bold_cut_file) bold_cut_data = bold_cut_img.get_data() - # assign everything from n_volumes foward to bold_cut_data - bold_data[..., n_volumes:] = bold_cut_data + # assign everything from skip_vols foward to bold_cut_data + bold_data[..., skip_vols:] = bold_cut_data out = fname_presuffix(bold_cut_file, suffix='_addnonsteady') bold_img.__class__(bold_data, bold_img.affine, bold_img.header).to_filename(out) From fabc7c95aa58493199fdc2ac5e1d75b79bb56124 Mon Sep 17 00:00:00 2001 From: James Kent Date: Mon, 22 Oct 2018 21:48:48 -0500 Subject: [PATCH 62/83] [skip tests][skip ds210][skip ds054][skip ds005] add --bind method to singularity patch documentation --- docs/contributors.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/contributors.rst b/docs/contributors.rst index c6a71aeca..264f0d5a8 100644 --- a/docs/contributors.rst +++ b/docs/contributors.rst @@ -68,7 +68,15 @@ arguments in a ``docker`` command:: -v $HOME/projects/fmriprep/fmriprep:/usr/local/miniconda/lib/python3.6/site-packages/fmriprep:ro --entrypoint=bash \ poldracklab/fmriprep:latest -Patching containers can be achieved in Singularity by using the PYTHONPATH variable: :: +Patching containers can be achieved in Singularity analogous to ``docker`` +using the ``--bind`` (``-B``) option: :: + + $ singularity run \ + -B $HOME/projects/fmriprep/fmriprep:/usr/local/miniconda/lib/python3.6/site-packages/fmriprep \ + fmriprep.img \ + /scratch/dataset /scratch/out participant -w /out/work/ + +Or you can patch Singularity containers using the PYTHONPATH variable: :: $ PYTHONPATH="$HOME/projects/fmriprep" singularity run fmriprep.img \ /scratch/dataset /scratch/out participant -w /out/work/ From 05f445f65d6b8c3479fec3661961454c653bde19 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 16 Oct 2018 19:26:12 -0700 Subject: [PATCH 63/83] CI: Update functional outputs --- .circleci/ds005_outputs.txt | 44 ++++++++++++++--------------- .circleci/ds005_partial_outputs.txt | 22 +++++++-------- .circleci/ds054_outputs.txt | 20 ++++++------- .circleci/ds210_outputs.txt | 18 ++++++------ 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/.circleci/ds005_outputs.txt b/.circleci/ds005_outputs.txt index 755118304..6e9dc34c4 100644 --- a/.circleci/ds005_outputs.txt +++ b/.circleci/ds005_outputs.txt @@ -34,36 +34,36 @@ fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-01/func fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_confounds.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_MELODICmix.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-space1_preproc.dtseries.json -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-space1_preproc.dtseries.nii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.L.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.R.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-confounds_regressors.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-MELODIC_mixing.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-preproc_bold.dtseries.json +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-preproc_bold.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-L.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-smoothAROMAnonaggr_bold.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_boldref.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-brain_mask.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-preproc_bold.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_dseg.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_dseg.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_preproc.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_AROMAnoiseICs.csv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_confounds.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_MELODICmix.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-cifti_variant-space1_preproc.dtseries.json -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-cifti_variant-space1_preproc.dtseries.nii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5.L.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5.R.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-confounds_regressors.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-MELODIC_mixing.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-preproc_bold.dtseries.json +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-preproc_bold.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5_hemi-L.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5_hemi-R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_boldref.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_desc-smoothAROMAnonaggr_bold.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_boldref.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_brainmask.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_desc-brain_mask.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_desc-preproc_bold.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aparcaseg_dseg.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_label-aseg_dseg.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-T1w_preproc.nii.gz fmriprep/sub-01.html /tmp/ds005/derivatives diff --git a/.circleci/ds005_partial_outputs.txt b/.circleci/ds005_partial_outputs.txt index 5de4e1cc4..56cae3e9f 100644 --- a/.circleci/ds005_partial_outputs.txt +++ b/.circleci/ds005_partial_outputs.txt @@ -34,20 +34,20 @@ fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-01/func fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_confounds.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_MELODICmix.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-space1_preproc.dtseries.json -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-cifti_variant-space1_preproc.dtseries.nii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.L.func.gii -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5.R.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-confounds_regressors.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-MELODIC_mixing.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-preproc_bold.dtseries.json +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-preproc_bold.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-L.func.gii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_variant-smoothAROMAnonaggr_preproc.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_desc-smoothAROMAnonaggr_bold.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_boldref.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_brainmask.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-brain_mask.nii.gz +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-preproc_bold.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_dseg.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_dseg.nii.gz -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_preproc.nii.gz fmriprep/sub-01.html /tmp/ds005/derivatives_partial diff --git a/.circleci/ds054_outputs.txt b/.circleci/ds054_outputs.txt index c39a3b005..088cae4e5 100644 --- a/.circleci/ds054_outputs.txt +++ b/.circleci/ds054_outputs.txt @@ -22,19 +22,19 @@ fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-CSF_probseg. fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz fmriprep/sub-100185/anat/sub-100185_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-100185/func -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_confounds.tsv +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_desc-confounds_regressors.tsv fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_boldref.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_preproc.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_confounds.tsv +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_desc-brain_mask.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-01_space-T1w_desc-preproc_bold.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_desc-confounds_regressors.tsv fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_boldref.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_boldref.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_brainmask.nii.gz -fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_preproc.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_desc-brain_mask.nii.gz +fmriprep/sub-100185/func/sub-100185_task-machinegame_run-02_space-T1w_desc-preproc_bold.nii.gz fmriprep/sub-100185.html /tmp/ds054/derivatives diff --git a/.circleci/ds210_outputs.txt b/.circleci/ds210_outputs.txt index adb423eab..184b7d44e 100644 --- a/.circleci/ds210_outputs.txt +++ b/.circleci/ds210_outputs.txt @@ -22,17 +22,17 @@ fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_label-CSF_probseg.nii.gz fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz fmriprep/sub-02/anat/sub-02_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-02/func -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_confounds.tsv +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_desc-confounds_regressors.tsv fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_boldref.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_confounds.tsv +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-1_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_desc-confounds_regressors.tsv fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_boldref.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_preproc.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_confounds.tsv +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-2_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_desc-confounds_regressors.tsv fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_boldref.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_brainmask.nii.gz -fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_preproc.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_desc-brain_mask.nii.gz +fmriprep/sub-02/func/sub-02_task-cuedSGT_run-01_echo-3_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz fmriprep/sub-02.html /tmp/ds210/derivatives From 117fe8a164d270e3486a5bd80a0fc7117f14f8e1 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Wed, 17 Oct 2018 13:25:11 -0700 Subject: [PATCH 64/83] Functional derivatives --- fmriprep/interfaces/cifti.py | 4 ++-- fmriprep/workflows/bold/base.py | 41 ++++++++++++++++++--------------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/fmriprep/interfaces/cifti.py b/fmriprep/interfaces/cifti.py index e9726ecc6..a4f29d30e 100644 --- a/fmriprep/interfaces/cifti.py +++ b/fmriprep/interfaces/cifti.py @@ -273,8 +273,8 @@ class CiftiNameSource(SimpleInterface): output_spec = CiftiNameSourceOutputSpec def _run_interface(self, runtime): - suffix = 'space-cifti_variant-{}_preproc.dtseries'.format(self.inputs.variant) + suffix = '.dtseries' if 'hcp' in self.inputs.variant: - suffix = 'space-hcp_preproc.dtseries' + suffix = 'space-hcp.dtseries' self._results['out_name'] = suffix return runtime diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index 3d5153fbf..925a701ba 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -827,7 +827,7 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, variant_suffix_fmt = 'space-{}_variant-{}_{}'.format ds_confounds = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix='confounds'), + base_directory=output_dir, desc='confounds', suffix='regressors'), name="ds_confounds", run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) workflow.connect([ @@ -837,17 +837,19 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, # Resample to T1w space if 'T1w' in output_spaces: - ds_bold_t1 = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix=suffix_fmt('T1w', 'preproc'), compress=True), + ds_bold_t1 = pe.Node( + DerivativesDataSink(base_directory=output_dir, space='T1w', desc='preproc', + keep_dtype=True, compress=True), name='ds_bold_t1', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) - ds_bold_t1_ref = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix=suffix_fmt('T1w', 'boldref')), + ds_bold_t1_ref = pe.Node( + DerivativesDataSink(base_directory=output_dir, space='T1w', suffix='boldref'), name='ds_bold_t1_ref', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) - ds_bold_mask_t1 = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix=suffix_fmt('T1w', 'brainmask')), + ds_bold_mask_t1 = pe.Node( + DerivativesDataSink(base_directory=output_dir, space='T1w', desc='brain', + suffix='mask'), name='ds_bold_mask_t1', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) workflow.connect([ @@ -861,17 +863,19 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, # Resample to template (default: MNI) if 'template' in output_spaces: - ds_bold_mni = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix=suffix_fmt(template, 'preproc'), compress=True), + ds_bold_mni = pe.Node( + DerivativesDataSink(base_directory=output_dir, space=template, desc='preproc', + keep_dtype=True, compress=True), name='ds_bold_mni', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) - ds_bold_mni_ref = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix=suffix_fmt(template, 'boldref')), + ds_bold_mni_ref = pe.Node( + DerivativesDataSink(base_directory=output_dir, space=template, suffix='boldref'), name='ds_bold_mni_ref', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) - ds_bold_mask_mni = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix=suffix_fmt(template, 'brainmask')), + ds_bold_mask_mni = pe.Node( + DerivativesDataSink(base_directory=output_dir, space=template, desc='brain', + suffix='mask'), name='ds_bold_mask_mni', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) workflow.connect([ @@ -885,11 +889,11 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, if freesurfer: ds_bold_aseg_t1 = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix='space-T1w_label-aseg_dseg'), + base_directory=output_dir, space='T1w', suffix='label-aseg_dseg'), name='ds_bold_aseg_t1', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) ds_bold_aparc_t1 = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix='space-T1w_label-aparcaseg_dseg'), + base_directory=output_dir, space='T1w', suffix='label-aparcaseg_dseg'), name='ds_bold_aparc_t1', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) workflow.connect([ @@ -902,7 +906,7 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, # fsaverage space if freesurfer and any(space.startswith('fs') for space in output_spaces): name_surfs = pe.MapNode(GiftiNameSource( - pattern=r'(?P[lr])h.(?P\w+).gii', template='space-{space}.{LR}.func'), + pattern=r'(?P[lr])h.(?P\w+).gii', template='space-{space}_hemi-{LR}.func'), iterfield='in_file', name='name_surfs', mem_gb=DEFAULT_MEMORY_MIN_GB, run_without_submitting=True) ds_bold_surfs = pe.MapNode(DerivativesDataSink(base_directory=output_dir), @@ -922,8 +926,9 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, name_cifti = pe.MapNode( CiftiNameSource(), iterfield=['variant'], name='name_cifti', mem_gb=DEFAULT_MEMORY_MIN_GB, run_without_submitting=True) - cifti_bolds = pe.MapNode(DerivativesDataSink( - base_directory=output_dir, compress=False), + cifti_bolds = pe.MapNode( + DerivativesDataSink(base_directory=output_dir, desc='preproc', + keep_dtype=True, compress=False), iterfield=['in_file', 'suffix'], name='cifti_bolds', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) cifti_key = pe.MapNode(DerivativesDataSink( From 266ba15b7477d31c12f9f8bfa1a34b808078be3b Mon Sep 17 00:00:00 2001 From: oesteban Date: Fri, 19 Oct 2018 07:44:05 -0700 Subject: [PATCH 65/83] fix unused variable as excuse to trigger tests --- fmriprep/workflows/bold/base.py | 1 - 1 file changed, 1 deletion(-) diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index 925a701ba..35dd08367 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -823,7 +823,6 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, 'nonaggr_denoised_file', 'bold_cifti', 'cifti_variant']), name='inputnode') - suffix_fmt = 'space-{}_{}'.format variant_suffix_fmt = 'space-{}_variant-{}_{}'.format ds_confounds = pe.Node(DerivativesDataSink( From 7a512c37492af1574baf559d82b3237285ae59dd Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 23 Oct 2018 11:41:59 -0400 Subject: [PATCH 66/83] FIX: AROMA/CIFTI names --- fmriprep/interfaces/cifti.py | 4 ++-- fmriprep/workflows/bold/base.py | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/fmriprep/interfaces/cifti.py b/fmriprep/interfaces/cifti.py index a4f29d30e..1fe06ddc0 100644 --- a/fmriprep/interfaces/cifti.py +++ b/fmriprep/interfaces/cifti.py @@ -273,8 +273,8 @@ class CiftiNameSource(SimpleInterface): output_spec = CiftiNameSourceOutputSpec def _run_interface(self, runtime): - suffix = '.dtseries' + suffix = 'bold.dtseries' if 'hcp' in self.inputs.variant: - suffix = 'space-hcp.dtseries' + suffix = 'space-hcp_bold.dtseries' self._results['out_name'] = suffix return runtime diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index 35dd08367..75b10df14 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -926,8 +926,7 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, CiftiNameSource(), iterfield=['variant'], name='name_cifti', mem_gb=DEFAULT_MEMORY_MIN_GB, run_without_submitting=True) cifti_bolds = pe.MapNode( - DerivativesDataSink(base_directory=output_dir, desc='preproc', - keep_dtype=True, compress=False), + DerivativesDataSink(base_directory=output_dir, desc='preproc', compress=False), iterfield=['in_file', 'suffix'], name='cifti_bolds', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) cifti_key = pe.MapNode(DerivativesDataSink( @@ -950,12 +949,12 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, name="ds_aroma_noise_ics", run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) ds_melodic_mix = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix='MELODICmix'), + base_directory=output_dir, desc='MELODIC', suffix='mixing'), name="ds_melodic_mix", run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) - ds_aroma_mni = pe.Node(DerivativesDataSink( - base_directory=output_dir, suffix=variant_suffix_fmt( - template, 'smoothAROMAnonaggr', 'preproc')), + ds_aroma_mni = pe.Node( + DerivativesDataSink(base_directory=output_dir, space=template, + desc='smoothAROMAnonaggr', keep_dtype=True), name='ds_aroma_mni', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) From 51a102195433e9267e5554c7c6515cf4653624db Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Tue, 23 Oct 2018 12:35:44 -0400 Subject: [PATCH 67/83] STY: Unused variable [skip ds005][skip ds054][skip ds210] --- fmriprep/workflows/bold/base.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index 75b10df14..60b41b5b8 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -823,8 +823,6 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, 'nonaggr_denoised_file', 'bold_cifti', 'cifti_variant']), name='inputnode') - variant_suffix_fmt = 'space-{}_variant-{}_{}'.format - ds_confounds = pe.Node(DerivativesDataSink( base_directory=output_dir, desc='confounds', suffix='regressors'), name="ds_confounds", run_without_submitting=True, From 0448135c86450e0c2cf21131de3e8afca3a68d3e Mon Sep 17 00:00:00 2001 From: Inge Amlien Date: Wed, 24 Oct 2018 12:39:33 +0200 Subject: [PATCH 68/83] Fix to set mod See issue #1339 Previous version failed if 'anat', 'fmap', 'func', 'dwi' strings were found in file path, for example ses-noanatomicals. Changed to name of parent folder of source_file (requires valid BIDS structure). --- fmriprep/interfaces/bids.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/fmriprep/interfaces/bids.py b/fmriprep/interfaces/bids.py index 0409809ab..b0d8dd847 100644 --- a/fmriprep/interfaces/bids.py +++ b/fmriprep/interfaces/bids.py @@ -221,15 +221,7 @@ def _run_interface(self, runtime): m = BIDS_NAME.search(src_fname) - # TODO this quick and dirty modality detection needs to be implemented - # correctly - mod = 'func' - if 'anat' in op.dirname(self.inputs.source_file): - mod = 'anat' - elif 'dwi' in op.dirname(self.inputs.source_file): - mod = 'dwi' - elif 'fmap' in op.dirname(self.inputs.source_file): - mod = 'fmap' + mod = op.basename(op.dirname(self.inputs.source_file)) base_directory = runtime.cwd if isdefined(self.inputs.base_directory): From 949b5043a9b10f3f3151cad5c5ab349cb9e2eb99 Mon Sep 17 00:00:00 2001 From: James Kent Date: Wed, 24 Oct 2018 12:33:52 -0500 Subject: [PATCH 69/83] [skip ds210][skip ds054][skip tests][skip docs] edits from effigies review --- fmriprep/workflows/bold/confounds.py | 38 +++++++++++++--------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/fmriprep/workflows/bold/confounds.py b/fmriprep/workflows/bold/confounds.py index 8e3dd9aa3..ae2fee2de 100755 --- a/fmriprep/workflows/bold/confounds.py +++ b/fmriprep/workflows/bold/confounds.py @@ -633,43 +633,39 @@ def _getbtthresh(medianval): def _remove_volumes(bold_file, skip_vols): - import nibabel as nb - from nipype.utils.filemanip import fname_presuffix - - # load the bold file and get the 4d matrix - bold_img = nb.load(bold_file) - bold_data = bold_img.get_data() + """remove skip_vols from bold_file""" + import nibabel as nb + from nipype.utils.filemanip import fname_presuffix - # cut off the beginning volumes - bold_data_cut = bold_data[..., skip_vols:] + if skip_vols == 0: + return bold_file - # modify header with new shape (fewer volumes) - data_shape = list(bold_img.header.get_data_shape()) - data_shape[-1] -= skip_vols - bold_img.header.set_data_shape(tuple(data_shape)) + out = fname_presuffix(bold_file, suffix='_cut') + bold_img = nb.load(bold_file) + bold_img.__class__(bold_img.dataobj[..., skip_vols:], + bold_img.affine, bold_img.header).to_filename(out) - # save the resulting bold file - out = fname_presuffix(bold_file, suffix='_cut') - bold_img.__class__(bold_data_cut, bold_img.affine, bold_img.header).to_filename(out) - return out + return out def _add_volumes(bold_file, bold_cut_file, skip_vols): """prepend skip_vols from bold_file onto bold_cut_file""" import nibabel as nb + import numpy as np from nipype.utils.filemanip import fname_presuffix - # load the data + if skip_vols == 0: + return bold_cut_file + bold_img = nb.load(bold_file) - bold_data = bold_img.get_data() bold_cut_img = nb.load(bold_cut_file) - bold_cut_data = bold_cut_img.get_data() - # assign everything from skip_vols foward to bold_cut_data - bold_data[..., skip_vols:] = bold_cut_data + bold_data = np.concatenate((bold_img.dataobj[..., :skip_vols], + bold_cut_img.dataobj), axis=3) out = fname_presuffix(bold_cut_file, suffix='_addnonsteady') bold_img.__class__(bold_data, bold_img.affine, bold_img.header).to_filename(out) + return out From 698e82142c17e21359648ccc5b5a6266a8fb1166 Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 24 Oct 2018 11:05:56 -0700 Subject: [PATCH 70/83] fix header mismatch problem --- fmriprep/interfaces/__init__.py | 2 +- fmriprep/interfaces/images.py | 45 +++++++++++++++++++++++++++++++++ fmriprep/workflows/bold/util.py | 10 ++++++-- 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/fmriprep/interfaces/__init__.py b/fmriprep/interfaces/__init__.py index c0f4bc22b..32cdf5d1f 100644 --- a/fmriprep/interfaces/__init__.py +++ b/fmriprep/interfaces/__init__.py @@ -5,7 +5,7 @@ ReadSidecarJSON, DerivativesDataSink, BIDSDataGrabber, BIDSFreeSurferDir, BIDSInfo ) from .images import ( - IntraModalMerge, ValidateImage, TemplateDimensions, Conform + IntraModalMerge, ValidateImage, TemplateDimensions, Conform, MatchHeader ) from .freesurfer import ( StructuralReference, MakeMidthickness, FSInjectBrainExtracted, diff --git a/fmriprep/interfaces/images.py b/fmriprep/interfaces/images.py index d58db6cef..26666d423 100644 --- a/fmriprep/interfaces/images.py +++ b/fmriprep/interfaces/images.py @@ -479,6 +479,51 @@ def _run_interface(self, runtime): return runtime +class MatchHeaderInputSpec(BaseInterfaceInputSpec): + reference = File(exists=True, mandatory=True, + desc='NIfTI file with reference header') + in_file = File(exists=True, mandatory=True, + desc='NIfTI file which header will be checked') + + +class MatchHeaderOutputSpec(TraitedSpec): + out_file = File(exists=True, desc='NIfTI file with fixed header') + + +class MatchHeader(SimpleInterface): + input_spec = MatchHeaderInputSpec + output_spec = MatchHeaderOutputSpec + + def _run_interface(self, runtime): + refhdr = nb.load(self.inputs.reference).header.copy() + imgnii = nb.load(self.inputs.in_file) + imghdr = imgnii.header.copy() + + imghdr['dim_info'] = refhdr['dim_info'] # dim_info is lost sometimes + + # Set qform + qform, qcode = refhdr.get_qform(coded=True) + if not np.allclose(qform, imghdr.get_qform()): + LOGGER.warning( + 'q-forms of reference and mask are substantially different') + imghdr.set_qform(qform, int(qcode)) + + # Set sform + sform, scode = refhdr.get_sform(coded=True) + if not np.allclose(sform, imghdr.get_sform()): + LOGGER.warning( + 's-forms of reference and mask are substantially different') + imghdr.set_sform(sform, int(scode)) + + out_file = fname_presuffix(self.inputs.in_file, suffix='_hdr', + newpath=runtime.cwd) + + imgnii.__class__(imgnii.get_data(), imgnii.affine, imghdr).to_filename( + out_file) + self._results['out_file'] = out_file + return runtime + + def reorient(in_file, newpath=None): """Reorient Nifti files to RAS""" out_file = fname_presuffix(in_file, suffix='_ras', newpath=newpath) diff --git a/fmriprep/workflows/bold/util.py b/fmriprep/workflows/bold/util.py index 219c78684..f3d5554da 100644 --- a/fmriprep/workflows/bold/util.py +++ b/fmriprep/workflows/bold/util.py @@ -26,7 +26,7 @@ from niworkflows.interfaces.utils import CopyXForm from ...engine import Workflow -from ...interfaces import ValidateImage +from ...interfaces import ValidateImage, MatchHeader DEFAULT_MEMORY_MIN_GB = 0.01 @@ -239,6 +239,10 @@ def init_enhance_and_skullstrip_bold_wf( operation='max', kernel_shape='sphere', kernel_size=3.0, internal_datatype='char'), name='pre_mask_dilate') + # Ensure mask's header matches reference's + check_hdr = pe.Node(MatchHeader(), name='check_hdr', + run_without_submitting=True) + # Run N4 normally, force num_threads=1 for stability (images are small, no need for >1) n4_correct = pe.Node(ants.N4BiasFieldCorrection(dimension=3, copy_header=True), name='n4_correct', n_procs=1) @@ -322,7 +326,9 @@ def init_enhance_and_skullstrip_bold_wf( ]) workflow.connect([ - (pre_dilate, n4_correct, [('out_file', 'mask_image')]), + (inputnode, check_hdr, [('in_file', 'reference')]), + (pre_dilate, check_hdr, [('out_file', 'in_file')]), + (check_hdr, n4_correct, [('out_file', 'mask_image')]), (inputnode, n4_correct, [('in_file', 'input_image')]), (inputnode, fixhdr_unifize, [('in_file', 'hdr_file')]), (inputnode, fixhdr_skullstrip2, [('in_file', 'hdr_file')]), From e52394ed933d35e509d44432b0eda62f9e2c3c8b Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 24 Oct 2018 11:22:01 -0700 Subject: [PATCH 71/83] [skip ci] Pin niworkflows==0.4.4 --- docs/environment.yml | 2 +- fmriprep/__about__.py | 2 +- requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/environment.yml b/docs/environment.yml index 850916563..24d91fbba 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -29,4 +29,4 @@ dependencies: - svgutils - nitime - nilearn - - niworkflows>=0.4.4 + - niworkflows==0.4.4 diff --git a/fmriprep/__about__.py b/fmriprep/__about__.py index bae53895e..81590f460 100644 --- a/fmriprep/__about__.py +++ b/fmriprep/__about__.py @@ -98,7 +98,7 @@ 'pybids==0.6.5', 'nitime', 'nipype>=1.1.3', - 'niworkflows>=0.4.4', + 'niworkflows==0.4.4', 'statsmodels', 'seaborn', 'indexed_gzip>=0.8.2', diff --git a/requirements.txt b/requirements.txt index c184845fd..317e6899b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -niworkflows>=0.4.4 +niworkflows==0.4.4 grabbit==0.2.3 pybids==0.6.5 versioneer From 2a09ae8b3f49301b169f283d7e034042d229e81d Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 24 Oct 2018 11:32:23 -0700 Subject: [PATCH 72/83] address @effigies' comments on MatchHeader --- fmriprep/interfaces/images.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fmriprep/interfaces/images.py b/fmriprep/interfaces/images.py index 26666d423..bf667c2f3 100644 --- a/fmriprep/interfaces/images.py +++ b/fmriprep/interfaces/images.py @@ -502,24 +502,26 @@ def _run_interface(self, runtime): imghdr['dim_info'] = refhdr['dim_info'] # dim_info is lost sometimes # Set qform - qform, qcode = refhdr.get_qform(coded=True) + qform = refhdr.get_qform() + qcode = int(refhdr['qform_code']) if not np.allclose(qform, imghdr.get_qform()): LOGGER.warning( 'q-forms of reference and mask are substantially different') - imghdr.set_qform(qform, int(qcode)) + imghdr.set_qform(qform, qcode) # Set sform - sform, scode = refhdr.get_sform(coded=True) + sform = refhdr.get_sform() + scode = int(refhdr['sform_code']) if not np.allclose(sform, imghdr.get_sform()): LOGGER.warning( 's-forms of reference and mask are substantially different') - imghdr.set_sform(sform, int(scode)) + imghdr.set_sform(sform, scode) out_file = fname_presuffix(self.inputs.in_file, suffix='_hdr', newpath=runtime.cwd) - imgnii.__class__(imgnii.get_data(), imgnii.affine, imghdr).to_filename( - out_file) + imgnii.__class__(imgnii.get_data(), imghdr.get_best_affine(), + imghdr).to_filename(out_file) self._results['out_file'] = out_file return runtime From a44b9b4462c36b6ca92e3faae4fd6a1ed0d04339 Mon Sep 17 00:00:00 2001 From: James Kent Date: Wed, 24 Oct 2018 16:28:02 -0500 Subject: [PATCH 73/83] re-order parameters in docstrings [skip ds210][skip ds054][skip ds005] --- fmriprep/workflows/bold/confounds.py | 55 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/fmriprep/workflows/bold/confounds.py b/fmriprep/workflows/bold/confounds.py index ae2fee2de..c258d09e4 100755 --- a/fmriprep/workflows/bold/confounds.py +++ b/fmriprep/workflows/bold/confounds.py @@ -427,53 +427,52 @@ def init_ica_aroma_wf(template, metadata, mem_gb, omp_nthreads, **Parameters** - aroma_melodic_dim: int or None - Set the dimensionality of the Melodic ICA decomposition - If None, MELODIC automatically estimates dimensionality. - ignore_aroma_err : bool - Do not fail on ICA-AROMA errors - mem_gb : float - Size of BOLD file in GB - metadata : dict - BIDS metadata for BOLD file - name : str - Name of workflow (default: ``bold_mni_trans_wf``) - omp_nthreads : int - Maximum number of threads an individual process may use template : str Spatial normalization template used as target when that registration step was previously calculated with :py:func:`~fmriprep.workflows.bold.registration.init_bold_reg_wf`. The template must be one of the MNI templates (fMRIPrep uses ``MNI152NLin2009cAsym`` by default). + metadata : dict + BIDS metadata for BOLD file + mem_gb : float + Size of BOLD file in GB + omp_nthreads : int + Maximum number of threads an individual process may use + name : str + Name of workflow (default: ``bold_mni_trans_wf``) susan_fwhm : float Kernel width (FWHM in mm) for the smoothing step with FSL ``susan`` (default: 6.0mm) use_fieldwarp : bool Include SDC warp in single-shot transform from BOLD to MNI - + ignore_aroma_err : bool + Do not fail on ICA-AROMA errors + aroma_melodic_dim: int or None + Set the dimensionality of the Melodic ICA decomposition + If None, MELODIC automatically estimates dimensionality. **Inputs** - bold_mask - BOLD series mask in template space + + itk_bold_to_t1 + Affine transform from ``ref_bold_brain`` to T1 space (ITK format) + t1_2_mni_forward_transform + ANTs-compatible affine-and-warp transform file + name_source + BOLD series NIfTI file + Used to recover original information lost during processing + skip_vols + number of non steady state volumes bold_split Individual 3D BOLD volumes, not motion corrected - fieldwarp - a :abbr:`DFM (displacements field map)` in ITK format + bold_mask + BOLD series mask in template space hmc_xforms List of affine transforms aligning each volume to ``ref_image`` in ITK format - itk_bold_to_t1 - Affine transform from ``ref_bold_brain`` to T1 space (ITK format) + fieldwarp + a :abbr:`DFM (displacements field map)` in ITK format movpar_file SPM-formatted motion parameters file - skip_vols - number of non steady state volumes - name_source - BOLD series NIfTI file - Used to recover original information lost during processing - t1_2_mni_forward_transform - ANTs-compatible affine-and-warp transform file - **Outputs** From f86b543505b65bddab2d078157b6f1c77edd3760 Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 24 Oct 2018 16:40:37 -0700 Subject: [PATCH 74/83] fix master --- .circleci/config.yml | 24 +++++++++++++++++++++--- .circleci/ds005_outputs.txt | 8 ++++---- .circleci/ds005_partial_outputs.txt | 4 ++-- fmriprep/workflows/bold/base.py | 2 +- 4 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 30749074d..9a7a329bb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -742,14 +742,22 @@ workflows: - get_regression_data: filters: branches: - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /ds005\/.*/ + - /ds054\/.*/ + - /ds210\/.*/ - build_docs: requires: - build filters: branches: - ignore: /tests?\/.*/ + ignore: + - /tests?\/.*/ + - /ds005\/.*/ + - /ds054\/.*/ + - /ds210\/.*/ tags: only: /.*/ @@ -770,7 +778,11 @@ workflows: - get_regression_data filters: branches: - ignore: /docs?\/.*/ + ignore: + - /docs?\/.*/ + - /ds005\/.*/ + - /ds054\/.*/ + - /ds210\/.*/ tags: only: /.*/ @@ -783,6 +795,8 @@ workflows: ignore: - /docs?\/.*/ - /tests?\/.*/ + - /ds054\/.*/ + - /ds210\/.*/ tags: only: /.*/ @@ -795,6 +809,8 @@ workflows: ignore: - /docs?\/.*/ - /tests?\/.*/ + - /ds005\/.*/ + - /ds210\/.*/ tags: only: /.*/ @@ -808,6 +824,8 @@ workflows: ignore: - /docs?\/.*/ - /tests?\/.*/ + - /ds005\/.*/ + - /ds054\/.*/ tags: only: /.*/ diff --git a/.circleci/ds005_outputs.txt b/.circleci/ds005_outputs.txt index 6e9dc34c4..6e5b1a141 100644 --- a/.circleci/ds005_outputs.txt +++ b/.circleci/ds005_outputs.txt @@ -36,8 +36,8 @@ fmriprep/sub-01/func fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-confounds_regressors.tsv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-MELODIC_mixing.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-preproc_bold.dtseries.json -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-preproc_bold.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold.dtseries.json +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold.dtseries.nii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz @@ -52,8 +52,8 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_ds fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_AROMAnoiseICs.csv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-confounds_regressors.tsv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-MELODIC_mixing.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-preproc_bold.dtseries.json -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-preproc_bold.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold.dtseries.json +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold.dtseries.nii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5_hemi-L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5_hemi-R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_boldref.nii.gz diff --git a/.circleci/ds005_partial_outputs.txt b/.circleci/ds005_partial_outputs.txt index 56cae3e9f..6afee6b3b 100644 --- a/.circleci/ds005_partial_outputs.txt +++ b/.circleci/ds005_partial_outputs.txt @@ -36,8 +36,8 @@ fmriprep/sub-01/func fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-confounds_regressors.tsv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-MELODIC_mixing.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-preproc_bold.dtseries.json -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-preproc_bold.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold.dtseries.json +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold.dtseries.nii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz diff --git a/fmriprep/workflows/bold/base.py b/fmriprep/workflows/bold/base.py index 60b41b5b8..e05b885de 100755 --- a/fmriprep/workflows/bold/base.py +++ b/fmriprep/workflows/bold/base.py @@ -924,7 +924,7 @@ def init_func_derivatives_wf(output_dir, output_spaces, template, freesurfer, CiftiNameSource(), iterfield=['variant'], name='name_cifti', mem_gb=DEFAULT_MEMORY_MIN_GB, run_without_submitting=True) cifti_bolds = pe.MapNode( - DerivativesDataSink(base_directory=output_dir, desc='preproc', compress=False), + DerivativesDataSink(base_directory=output_dir, compress=False), iterfield=['in_file', 'suffix'], name='cifti_bolds', run_without_submitting=True, mem_gb=DEFAULT_MEMORY_MIN_GB) cifti_key = pe.MapNode(DerivativesDataSink( From ca32147600793524a1be4d7601cdb8a5e79ba3b4 Mon Sep 17 00:00:00 2001 From: oesteban Date: Wed, 24 Oct 2018 18:08:40 -0700 Subject: [PATCH 75/83] remove one branch --- fmriprep/workflows/bold/util.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fmriprep/workflows/bold/util.py b/fmriprep/workflows/bold/util.py index f3d5554da..abdfefdf7 100644 --- a/fmriprep/workflows/bold/util.py +++ b/fmriprep/workflows/bold/util.py @@ -120,6 +120,7 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, pre_mask=False, omp_nthreads=omp_nthreads, pre_mask=pre_mask) workflow.connect([ + (inputnode, enhance_and_skullstrip_bold_wf, [('bold_mask', 'inputnode.pre_mask')]), (inputnode, validate, [('bold_file', 'in_file')]), (inputnode, gen_ref, [('sbref_file', 'sbref_file')]), (validate, gen_ref, [('out_file', 'in_file')]), @@ -135,11 +136,6 @@ def init_bold_reference_wf(omp_nthreads, bold_file=None, pre_mask=False, ('outputnode.skull_stripped_file', 'ref_image_brain')]), ]) - if pre_mask: - workflow.connect([ - (inputnode, enhance_and_skullstrip_bold_wf, [('bold_mask', 'inputnode.pre_mask')]), - ]) - if gen_report: mask_reportlet = pe.Node(SimpleShowMaskRPT(), name='mask_reportlet') workflow.connect([ From 736d5d942e15477f987cdbc2811292cdd7c7f0dc Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 24 Oct 2018 19:10:05 -0700 Subject: [PATCH 76/83] fix ordering of expected outputs --- .circleci/ds005_outputs.txt | 8 ++++---- .circleci/ds005_partial_outputs.txt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/ds005_outputs.txt b/.circleci/ds005_outputs.txt index 6e5b1a141..b982322a0 100644 --- a/.circleci/ds005_outputs.txt +++ b/.circleci/ds005_outputs.txt @@ -34,10 +34,10 @@ fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-01/func fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-confounds_regressors.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-MELODIC_mixing.tsv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold.dtseries.json fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-confounds_regressors.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-MELODIC_mixing.tsv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz @@ -50,10 +50,10 @@ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_desc-preproc_ fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aparcaseg_dseg.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-T1w_label-aseg_dseg.nii.gz fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_AROMAnoiseICs.csv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-confounds_regressors.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-MELODIC_mixing.tsv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold.dtseries.json fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_bold.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-confounds_regressors.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_desc-MELODIC_mixing.tsv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5_hemi-L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-fsaverage5_hemi-R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-02_space-MNI152NLin2009cAsym_boldref.nii.gz diff --git a/.circleci/ds005_partial_outputs.txt b/.circleci/ds005_partial_outputs.txt index 6afee6b3b..4af6216c5 100644 --- a/.circleci/ds005_partial_outputs.txt +++ b/.circleci/ds005_partial_outputs.txt @@ -34,10 +34,10 @@ fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-GM_probseg.nii.gz fmriprep/sub-01/anat/sub-01_space-MNI152NLin2009cAsym_label-WM_probseg.nii.gz fmriprep/sub-01/func fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_AROMAnoiseICs.csv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-confounds_regressors.tsv -fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-MELODIC_mixing.tsv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold.dtseries.json fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_bold.dtseries.nii +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-confounds_regressors.tsv +fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_desc-MELODIC_mixing.tsv fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-L.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-fsaverage5_hemi-R.func.gii fmriprep/sub-01/func/sub-01_task-mixedgamblestask_run-01_space-MNI152NLin2009cAsym_boldref.nii.gz From 7535a08751179a38be6e53b1895ed22f58224fdb Mon Sep 17 00:00:00 2001 From: Oscar Esteban Date: Wed, 24 Oct 2018 20:06:23 -0700 Subject: [PATCH 77/83] [skip ci] fix minimal error in docs --- fmriprep/workflows/bold/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmriprep/workflows/bold/util.py b/fmriprep/workflows/bold/util.py index abdfefdf7..652f8f499 100644 --- a/fmriprep/workflows/bold/util.py +++ b/fmriprep/workflows/bold/util.py @@ -178,7 +178,7 @@ def init_enhance_and_skullstrip_bold_wf( to *standardize* the T2* contrast distribution. 6. Calculate a mask using AFNI's ``3dAutomask`` after the contrast enhancement of 4). - 7. Calculate a final mask as the intersection of 3) and 5). + 7. Calculate a final mask as the intersection of 4) and 6). 8. Apply final mask on the enhanced reference. Step 1 can be skipped if the ``pre_mask`` argument is set to ``True`` and From b71ddf3bf39d6466ccfc35ddaeb94f07f4fa7a3e Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Thu, 25 Oct 2018 09:51:02 -0400 Subject: [PATCH 78/83] ENH: Deprecate --debug with --sloppy --- fmriprep/cli/run.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fmriprep/cli/run.py b/fmriprep/cli/run.py index 816451e8b..d89b6c8c8 100755 --- a/fmriprep/cli/run.py +++ b/fmriprep/cli/run.py @@ -80,7 +80,7 @@ def get_parser(): g_perfm = parser.add_argument_group('Options to handle performance') g_perfm.add_argument('--debug', action='store_true', default=False, - help='run debug version of workflow') + help='DEPRECATED - Does not do what you want.') g_perfm.add_argument('--nthreads', '--n_cpus', '-n-cpus', action='store', type=int, help='maximum number of threads across all processes') g_perfm.add_argument('--omp-nthreads', action='store', type=int, default=0, @@ -238,6 +238,9 @@ def get_parser(): 'the FMRIPREP developers. This information helps to ' 'improve FMRIPREP and provides an indicator of real ' 'world usage crucial for obtaining funding.') + g_perfm.add_argument('--sloppy', action='store_true', default=False, + help='Use low-quality tools for speed ' + '- TESTING ONLY') return parser @@ -517,13 +520,15 @@ def build_workflow(opts, retval): 'Option --output-grid-reference is deprecated, please use ' '--template-resampling-grid') template_out_grid = template_out_grid or opts.output_grid_reference + if opts.debug is not None: + logger.warning('Option --debug is deprecated and has no effect') retval['workflow'] = init_fmriprep_wf( subject_list=subject_list, task_id=opts.task_id, run_uuid=run_uuid, ignore=opts.ignore, - debug=opts.debug, + debug=opts.sloppy, low_mem=opts.low_mem, anat_only=opts.anat_only, longitudinal=opts.longitudinal, From 6922e8dc04b39737e6e498fa7035365b4dbd8753 Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 25 Oct 2018 09:34:01 -0700 Subject: [PATCH 79/83] [TST] Add doctest for #1339 --- fmriprep/interfaces/bids.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/fmriprep/interfaces/bids.py b/fmriprep/interfaces/bids.py index 0409809ab..95ee8028c 100644 --- a/fmriprep/interfaces/bids.py +++ b/fmriprep/interfaces/bids.py @@ -184,13 +184,14 @@ class DerivativesDataSink(SimpleInterface): Saves the `in_file` into a BIDS-Derivatives folder provided by `base_directory`, given the input reference `source_file`. + >>> from pathlib import Path >>> import tempfile >>> from fmriprep.utils.bids import collect_data - >>> tmpdir = tempfile.mkdtemp() - >>> tmpfile = os.path.join(tmpdir, 'a_temp_file.nii.gz') - >>> open(tmpfile, 'w').close() # "touch" the file - >>> dsink = DerivativesDataSink(base_directory=tmpdir) - >>> dsink.inputs.in_file = tmpfile + >>> tmpdir = Path(tempfile.mkdtemp()) + >>> tmpfile = tmpdir / 'a_temp_file.nii.gz' + >>> tmpfile.open('w').close() # "touch" the file + >>> dsink = DerivativesDataSink(base_directory=str(tmpdir)) + >>> dsink.inputs.in_file = str(tmpfile) >>> dsink.inputs.source_file = collect_data('ds114', '01')[0]['t1w'][0] >>> dsink.inputs.keep_dtype = True >>> dsink.inputs.suffix = 'target-mni' @@ -198,6 +199,20 @@ class DerivativesDataSink(SimpleInterface): >>> res.outputs.out_file # doctest: +ELLIPSIS '.../fmriprep/sub-01/ses-retest/anat/sub-01_ses-retest_target-mni_T1w.nii.gz' + >>> bids_dir = tmpdir / 'bidsroot' / 'sub-02' / 'ses-noanat' / 'func' + >>> bids_dir.mkdir(parents=True, exist_ok=True) + >>> tricky_source = bids_dir / 'sub-02_ses-noanat_task-rest_run-01_bold.nii.gz' + >>> tricky_source.open('w').close() + >>> dsink = DerivativesDataSink(base_directory=str(tmpdir)) + >>> dsink.inputs.in_file = str(tmpfile) + >>> dsink.inputs.source_file = str(tricky_source) + >>> dsink.inputs.keep_dtype = True + >>> dsink.inputs.desc = 'preproc' + >>> res = dsink.run() + >>> res.outputs.out_file # doctest: +ELLIPSIS + '.../fmriprep/sub-02/ses-noanat/func/sub-02_ses-noanat_task-rest_run-01_\ +desc-preproc_bold.nii.gz' + """ input_spec = DerivativesDataSinkInputSpec output_spec = DerivativesDataSinkOutputSpec From 8eaf4724bb53e6f504760d7785eb7ae19b30f447 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 25 Oct 2018 13:00:36 -0400 Subject: [PATCH 80/83] DOC: Update order, grouping of options [skip ds005][skip ds054][skip ds210] --- fmriprep/cli/run.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fmriprep/cli/run.py b/fmriprep/cli/run.py index d89b6c8c8..819fb55d0 100755 --- a/fmriprep/cli/run.py +++ b/fmriprep/cli/run.py @@ -79,8 +79,6 @@ def get_parser(): help='select a specific task to be processed') g_perfm = parser.add_argument_group('Options to handle performance') - g_perfm.add_argument('--debug', action='store_true', default=False, - help='DEPRECATED - Does not do what you want.') g_perfm.add_argument('--nthreads', '--n_cpus', '-n-cpus', action='store', type=int, help='maximum number of threads across all processes') g_perfm.add_argument('--omp-nthreads', action='store', type=int, default=0, @@ -103,6 +101,8 @@ def get_parser(): 'signal') g_perfm.add_argument("-v", "--verbose", dest="verbose_count", action="count", default=0, help="increases log verbosity for each occurence, debug level is -vvv") + g_perfm.add_argument('--debug', action='store_true', default=False, + help='DEPRECATED - Does not do what you want.') g_conf = parser.add_argument_group('Workflow configuration') g_conf.add_argument( @@ -238,9 +238,8 @@ def get_parser(): 'the FMRIPREP developers. This information helps to ' 'improve FMRIPREP and provides an indicator of real ' 'world usage crucial for obtaining funding.') - g_perfm.add_argument('--sloppy', action='store_true', default=False, - help='Use low-quality tools for speed ' - '- TESTING ONLY') + g_other.add_argument('--sloppy', action='store_true', default=False, + help='Use low-quality tools for speed - TESTING ONLY') return parser From 666b3064909bc962fda960cbd1a3e1d42015265e Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Thu, 25 Oct 2018 13:02:40 -0400 Subject: [PATCH 81/83] CI: Run sloppy registration --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9a7a329bb..fb059b9b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -388,7 +388,7 @@ jobs: -e FMRIPREP_DEV 1 -u $(id -u) \ --config $PWD/nipype.cfg -w /tmp/ds005/work \ /tmp/data/ds005 /tmp/ds005/derivatives participant \ - --debug --write-graph --mem_mb 4096 \ + --sloppy --write-graph --mem_mb 4096 \ --nthreads 2 --anat-only -vv - save_cache: key: ds005-anat-v9-{{ .Branch }}-{{ epoch }} @@ -408,7 +408,7 @@ jobs: -e FMRIPREP_DEV 1 -u $(id -u) \ --config $PWD/nipype.cfg -w /tmp/ds005/work \ /tmp/data/ds005 /tmp/ds005/derivatives participant \ - --debug --write-graph --use-syn-sdc --mem_mb 4096 \ + --sloppy --write-graph --use-syn-sdc --mem_mb 4096 \ --ignore-aroma-denoising-errors --use-aroma \ --output-space T1w template fsaverage5 \ --template-resampling-grid native \ @@ -435,7 +435,7 @@ jobs: -e FMRIPREP_DEV 1 -u $(id -u) \ --config $PWD/nipype.cfg -w /tmp/ds005/work \ /tmp/data/ds005 /tmp/ds005/derivatives_partial participant \ - --debug --write-graph --use-syn-sdc --mem_mb 4096 \ + --sloppy --write-graph --use-syn-sdc --mem_mb 4096 \ --output-space T1w template fsaverage5 \ --ignore-aroma-denoising-errors --use-aroma \ --template-resampling-grid native \ @@ -517,7 +517,7 @@ jobs: -e FMRIPREP_DEV 1 \ --config $PWD/nipype.cfg -w /tmp/ds054/work \ /tmp/data/ds054 /tmp/ds054/derivatives participant \ - --fs-no-reconall --debug --write-graph \ + --fs-no-reconall --sloppy --write-graph \ --mem_mb 4096 --nthreads 2 --anat-only -vv - save_cache: key: ds054-anat-v7-{{ .Branch }}-{{ epoch }} @@ -537,7 +537,7 @@ jobs: -e FMRIPREP_DEV 1 \ --config $PWD/nipype.cfg -w /tmp/ds054/work \ /tmp/data/ds054 /tmp/ds054/derivatives participant \ - --fs-no-reconall --debug \ + --fs-no-reconall --sloppy \ --output-space T1w template \ --template-resampling-grid 2mm \ --mem_mb 4096 --nthreads 2 -vv @@ -562,7 +562,7 @@ jobs: -e FMRIPREP_DEV 1 \ --config $PWD/nipype.cfg -w /tmp/ds054/work \ /tmp/data/ds054 /tmp/ds054/derivatives participant \ - --fs-no-reconall --debug --write-graph \ + --fs-no-reconall --sloppy --write-graph \ --output-space T1w template \ --template-resampling-grid 2mm \ --reports-only --run-uuid $UUID @@ -633,7 +633,7 @@ jobs: -e FMRIPREP_DEV 1 \ --config $PWD/nipype.cfg -w /tmp/ds210/work \ /tmp/data/ds210 /tmp/ds210/derivatives participant \ - --fs-no-reconall --debug --write-graph \ + --fs-no-reconall --sloppy --write-graph \ --mem_mb 4096 --nthreads 2 --anat-only -vv - save_cache: key: ds210-anat-v4-{{ epoch }} @@ -651,7 +651,7 @@ jobs: /tmp/data/ds210 /tmp/ds210/derivatives participant \ --fs-no-reconall --t2s-coreg --use-syn-sdc \ --template-resampling-grid native \ - --debug --write-graph --mem_mb 4096 --nthreads 2 -vv + --sloppy --write-graph --mem_mb 4096 --nthreads 2 -vv - run: name: Checking outputs of fMRIPrep command: | From 3de98744e8bd7da06b0bd6cb6e9b47c7233214c3 Mon Sep 17 00:00:00 2001 From: Inge Amlien Date: Thu, 25 Oct 2018 19:35:49 +0200 Subject: [PATCH 82/83] Added name --- .zenodo.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.zenodo.json b/.zenodo.json index b812e9d65..b1c31a81b 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -78,6 +78,11 @@ "affiliation": "Department of Psychology, Florida International University", "orcid": "0000-0001-9813-3167" }, + { + "name": "Amlien, Inge K.", + "affiliation": "Department of Psychology, University of Oslo", + "orcid": "0000-0002-8508-9088" + }, { "name": "Poldrack, Russell A.", "affiliation": "Department of Psychology, Stanford University", From 8f734520370c26a82d46935f6f88c8e2e1040cae Mon Sep 17 00:00:00 2001 From: oesteban Date: Thu, 25 Oct 2018 16:24:08 -0700 Subject: [PATCH 83/83] [skip ci] Update notebooks --- notebooks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks b/notebooks index 413614054..9933a628d 160000 --- a/notebooks +++ b/notebooks @@ -1 +1 @@ -Subproject commit 413614054d7656eb01294d1513ade32ee52217e6 +Subproject commit 9933a628dfb759dc73e61701c144d67898b92de0