Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .circleci/ds005_fasttrack_outputs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,23 @@ logs/CITATION.md
logs/CITATION.tex
sub-01
sub-01/anat
sub-01/anat/sub-01_desc-aparcaseg_dseg.nii.gz
sub-01/anat/sub-01_desc-aseg_dseg.nii.gz
sub-01/anat/sub-01_desc-ribbon_mask.json
sub-01/anat/sub-01_desc-ribbon_mask.nii.gz
sub-01/anat/sub-01_hemi-L_desc-cortex_mask.json
sub-01/anat/sub-01_hemi-L_desc-cortex_mask.label.gii
sub-01/anat/sub-01_hemi-L_desc-preproc_curv.shape.gii
sub-01/anat/sub-01_hemi-L_desc-preproc_inflated.surf.gii
sub-01/anat/sub-01_hemi-L_desc-preproc_sphere.surf.gii
sub-01/anat/sub-01_hemi-L_desc-preproc_white.surf.gii
sub-01/anat/sub-01_hemi-L_space-fsLR_desc-msmsulc_sphere.surf.gii
sub-01/anat/sub-01_hemi-L_space-fsLR_desc-reg_sphere.surf.gii
sub-01/anat/sub-01_hemi-L_space-fsaverage_desc-reg_sphere.surf.gii
sub-01/anat/sub-01_hemi-R_desc-cortex_mask.json
sub-01/anat/sub-01_hemi-R_desc-cortex_mask.label.gii
sub-01/anat/sub-01_hemi-R_desc-preproc_curv.shape.gii
sub-01/anat/sub-01_hemi-R_desc-preproc_inflated.surf.gii
sub-01/anat/sub-01_hemi-R_desc-preproc_sphere.surf.gii
sub-01/anat/sub-01_hemi-R_desc-preproc_white.surf.gii
sub-01/anat/sub-01_hemi-R_space-fsLR_desc-msmsulc_sphere.surf.gii
Expand Down
6 changes: 6 additions & 0 deletions .circleci/ds005_outputs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ logs/CITATION.md
logs/CITATION.tex
sub-01
sub-01/anat
sub-01/anat/sub-01_desc-aparcaseg_dseg.nii.gz
sub-01/anat/sub-01_desc-aseg_dseg.nii.gz
sub-01/anat/sub-01_desc-brain_mask.json
sub-01/anat/sub-01_desc-brain_mask.nii.gz
sub-01/anat/sub-01_desc-preproc_T1w.json
Expand All @@ -21,8 +23,10 @@ sub-01/anat/sub-01_from-fsnative_to-T1w_mode-image_xfm.txt
sub-01/anat/sub-01_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5
sub-01/anat/sub-01_from-T1w_to-fsnative_mode-image_xfm.txt
sub-01/anat/sub-01_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5
sub-01/anat/sub-01_hemi-L_curv.shape.gii
sub-01/anat/sub-01_hemi-L_desc-cortex_mask.json
sub-01/anat/sub-01_hemi-L_desc-cortex_mask.label.gii
sub-01/anat/sub-01_hemi-L_inflated.surf.gii
sub-01/anat/sub-01_hemi-L_midthickness.surf.gii
sub-01/anat/sub-01_hemi-L_pial.surf.gii
sub-01/anat/sub-01_hemi-L_space-fsLR_desc-msmsulc_sphere.surf.gii
Expand All @@ -32,8 +36,10 @@ sub-01/anat/sub-01_hemi-L_sphere.surf.gii
sub-01/anat/sub-01_hemi-L_sulc.shape.gii
sub-01/anat/sub-01_hemi-L_thickness.shape.gii
sub-01/anat/sub-01_hemi-L_white.surf.gii
sub-01/anat/sub-01_hemi-R_curv.shape.gii
sub-01/anat/sub-01_hemi-R_desc-cortex_mask.json
sub-01/anat/sub-01_hemi-R_desc-cortex_mask.label.gii
sub-01/anat/sub-01_hemi-R_inflated.surf.gii
sub-01/anat/sub-01_hemi-R_midthickness.surf.gii
sub-01/anat/sub-01_hemi-R_pial.surf.gii
sub-01/anat/sub-01_hemi-R_space-fsLR_desc-msmsulc_sphere.surf.gii
Expand Down
6 changes: 6 additions & 0 deletions .circleci/ds005_partial_fasttrack_outputs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ logs/CITATION.md
logs/CITATION.tex
sub-01
sub-01/anat
sub-01/anat/sub-01_desc-aparcaseg_dseg.nii.gz
sub-01/anat/sub-01_desc-aseg_dseg.nii.gz
sub-01/anat/sub-01_desc-ribbon_mask.json
sub-01/anat/sub-01_desc-ribbon_mask.nii.gz
sub-01/anat/sub-01_hemi-L_desc-cortex_mask.json
sub-01/anat/sub-01_hemi-L_desc-cortex_mask.label.gii
sub-01/anat/sub-01_hemi-L_desc-preproc_curv.shape.gii
sub-01/anat/sub-01_hemi-L_desc-preproc_inflated.surf.gii
sub-01/anat/sub-01_hemi-L_desc-preproc_sphere.surf.gii
sub-01/anat/sub-01_hemi-L_desc-preproc_white.surf.gii
sub-01/anat/sub-01_hemi-L_space-fsLR_den-32k_desc-preproc_midthickness.surf.gii
Expand All @@ -24,6 +28,8 @@ sub-01/anat/sub-01_hemi-L_space-fsLR_desc-reg_sphere.surf.gii
sub-01/anat/sub-01_hemi-L_space-fsaverage_desc-reg_sphere.surf.gii
sub-01/anat/sub-01_hemi-R_desc-cortex_mask.json
sub-01/anat/sub-01_hemi-R_desc-cortex_mask.label.gii
sub-01/anat/sub-01_hemi-R_desc-preproc_curv.shape.gii
sub-01/anat/sub-01_hemi-R_desc-preproc_inflated.surf.gii
sub-01/anat/sub-01_hemi-R_desc-preproc_sphere.surf.gii
sub-01/anat/sub-01_hemi-R_desc-preproc_white.surf.gii
sub-01/anat/sub-01_hemi-R_space-fsLR_den-32k_desc-preproc_midthickness.surf.gii
Expand Down
10 changes: 8 additions & 2 deletions .circleci/ds005_partial_outputs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ logs/CITATION.md
logs/CITATION.tex
sub-01
sub-01/anat
sub-01/anat/sub-01_desc-aparcaseg_dseg.nii.gz
sub-01/anat/sub-01_desc-aseg_dseg.nii.gz
sub-01/anat/sub-01_desc-brain_mask.json
sub-01/anat/sub-01_desc-brain_mask.nii.gz
sub-01/anat/sub-01_desc-preproc_T1w.json
Expand All @@ -23,8 +25,10 @@ sub-01/anat/sub-01_from-MNI152NLin6Asym_to-T1w_mode-image_xfm.h5
sub-01/anat/sub-01_from-T1w_to-fsnative_mode-image_xfm.txt
sub-01/anat/sub-01_from-T1w_to-MNI152NLin2009cAsym_mode-image_xfm.h5
sub-01/anat/sub-01_from-T1w_to-MNI152NLin6Asym_mode-image_xfm.h5
sub-01/anat/sub-01_hemi-L_curv.shape.gii
sub-01/anat/sub-01_hemi-L_desc-cortex_mask.json
sub-01/anat/sub-01_hemi-L_desc-cortex_mask.label.gii
sub-01/anat/sub-01_hemi-L_inflated.surf.gii
sub-01/anat/sub-01_hemi-L_midthickness.surf.gii
sub-01/anat/sub-01_hemi-L_pial.surf.gii
sub-01/anat/sub-01_hemi-L_space-fsLR_den-32k_midthickness.surf.gii
Expand All @@ -37,8 +41,10 @@ sub-01/anat/sub-01_hemi-L_sphere.surf.gii
sub-01/anat/sub-01_hemi-L_sulc.shape.gii
sub-01/anat/sub-01_hemi-L_thickness.shape.gii
sub-01/anat/sub-01_hemi-L_white.surf.gii
sub-01/anat/sub-01_hemi-L_desc-cortex_mask.json
sub-01/anat/sub-01_hemi-L_desc-cortex_mask.label.gii
sub-01/anat/sub-01_hemi-R_curv.shape.gii
sub-01/anat/sub-01_hemi-R_desc-cortex_mask.json
sub-01/anat/sub-01_hemi-R_desc-cortex_mask.label.gii
sub-01/anat/sub-01_hemi-R_inflated.surf.gii
sub-01/anat/sub-01_hemi-R_midthickness.surf.gii
sub-01/anat/sub-01_hemi-R_pial.surf.gii
sub-01/anat/sub-01_hemi-R_space-fsLR_den-32k_midthickness.surf.gii
Expand Down
43 changes: 42 additions & 1 deletion fmriprep/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def init_single_subject_wf(subject_id: str):
if 't2w' in config.workflow.ignore:
subject_data['t2w'] = []

freesurfer = config.workflow.run_reconall
anat_only = config.workflow.anat_only
# Make sure we always go through these two checks
if not anat_only and not subject_data['bold']:
Expand Down Expand Up @@ -319,7 +320,7 @@ def init_single_subject_wf(subject_id: str):
anat_fit_wf = init_anat_fit_wf(
bids_root=bids_root,
output_dir=fmriprep_dir,
freesurfer=config.workflow.run_reconall,
freesurfer=freesurfer,
hires=config.workflow.hires,
fs_no_resume=config.workflow.fs_no_resume,
longitudinal=config.workflow.longitudinal,
Expand Down Expand Up @@ -419,6 +420,46 @@ def init_single_subject_wf(subject_id: str):
]),
]) # fmt:skip

if freesurfer:
from smriprep.workflows.outputs import init_ds_fs_segs_wf, init_ds_surface_metrics_wf
from smriprep.workflows.surfaces import init_surface_derivatives_wf

ds_fs_segs_wf = init_ds_fs_segs_wf(bids_root=bids_root, output_dir=fmriprep_dir)
surface_derivatives_wf = init_surface_derivatives_wf()
ds_surfaces_wf = init_ds_surfaces_wf(output_dir=fmriprep_dir, surfaces=['inflated'])
ds_curv_wf = init_ds_surface_metrics_wf(
bids_root=bids_root,
output_dir=fmriprep_dir,
metrics=['curv'],
name='ds_curv_wf',
)

workflow.connect([
(anat_fit_wf, surface_derivatives_wf, [
('outputnode.t1w_preproc', 'inputnode.reference'),
('outputnode.subjects_dir', 'inputnode.subjects_dir'),
('outputnode.subject_id', 'inputnode.subject_id'),
('outputnode.fsnative2t1w_xfm', 'inputnode.fsnative2anat_xfm'),
]),
(anat_fit_wf, ds_surfaces_wf, [
('outputnode.t1w_valid_list', 'inputnode.source_files'),
]),
(surface_derivatives_wf, ds_surfaces_wf, [
('outputnode.inflated', 'inputnode.inflated'),
]),
(anat_fit_wf, ds_curv_wf, [
('outputnode.t1w_valid_list', 'inputnode.source_files'),
]),
(surface_derivatives_wf, ds_curv_wf, [('outputnode.curv', 'inputnode.curv')]),
(anat_fit_wf, ds_fs_segs_wf, [
('outputnode.t1w_valid_list', 'inputnode.source_files'),
]),
(surface_derivatives_wf, ds_fs_segs_wf, [
('outputnode.out_aseg', 'inputnode.anat_fs_aseg'),
('outputnode.out_aparc', 'inputnode.anat_fs_aparc'),
]),
]) # fmt:skip

# Thread MNI152NLin6Asym standard outputs to CIFTI subworkflow, skipping
# the iterator, which targets only output spaces.
# This can lead to duplication in the working directory if people actually
Expand Down
Loading