From 511c8388314ae41897fc6683330a81d5b5df1890 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 12 Oct 2023 10:01:07 -0400 Subject: [PATCH] FIX: Minor fixes to work with MSMSulc-enabled smriprep-next (#3098) Companion PR to nipreps/smriprep#370. --- fmriprep/config.py | 6 ---- fmriprep/workflows/base.py | 64 +------------------------------------- 2 files changed, 1 insertion(+), 69 deletions(-) diff --git a/fmriprep/config.py b/fmriprep/config.py index 015ab29aa..ed963a86a 100644 --- a/fmriprep/config.py +++ b/fmriprep/config.py @@ -587,12 +587,6 @@ class workflow(_Config): me_t2s_fit_method = "curvefit" """The method by which to estimate T2*/S0 for multi-echo data""" - @classmethod - def init(cls): - # Avoid additional runtime if not required - if not cls.cifti_output: - cls.run_msmsulc = False - class loggers: """Keep loggers easily accessible (see :py:func:`init`).""" diff --git a/fmriprep/workflows/base.py b/fmriprep/workflows/base.py index 679ad0a30..aa3fd48a1 100644 --- a/fmriprep/workflows/base.py +++ b/fmriprep/workflows/base.py @@ -146,7 +146,6 @@ def init_single_subject_fit_wf(subject_id: str): derivatives_dir=deriv_dir, subject_id=subject_id, std_spaces=std_spaces, - freesurfer=config.workflow.run_reconall, ) ) @@ -209,6 +208,7 @@ def init_single_subject_fit_wf(subject_id: str): freesurfer=config.workflow.run_reconall, hires=config.workflow.hires, longitudinal=config.workflow.longitudinal, + msm_sulc=config.workflow.run_msmsulc, t1w=subject_data['t1w'], t2w=subject_data['t2w'], skull_strip_mode=config.workflow.skull_strip_t1w, @@ -404,67 +404,6 @@ def init_single_subject_fit_wf(subject_id: str): if config.workflow.level == "minimal": return clean_datasinks(workflow) - if config.workflow.run_reconall: - from smriprep.workflows.outputs import init_ds_surfaces_wf - from smriprep.workflows.surfaces import ( - init_anat_ribbon_wf, - init_fsLR_reg_wf, - init_gifti_surfaces_wf, - ) - - gifti_surfaces_wf = init_gifti_surfaces_wf( - surfaces=["white", "pial", "midthickness"], - ) - gifti_spheres_wf = init_gifti_surfaces_wf( - surfaces=["sphere_reg"], to_scanner=False, name="gifti_spheres_wf" - ) - fsLR_reg_wf = init_fsLR_reg_wf() - ds_surfaces_wf = init_ds_surfaces_wf( - bids_root=str(config.execution.bids_dir), - output_dir=str(config.execution.output_dir), - surfaces=["white", "pial", "midthickness", "sphere_reg", "sphere_reg_fsLR"], - ) - anat_ribbon_wf = init_anat_ribbon_wf() - - # fmt:off - workflow.connect([ - (anat_fit_wf, gifti_surfaces_wf, [ - ("outputnode.subjects_dir", "inputnode.subjects_dir"), - ("outputnode.subject_id", "inputnode.subject_id"), - ("outputnode.fsnative2t1w_xfm", "inputnode.fsnative2t1w_xfm"), - ]), - (anat_fit_wf, gifti_spheres_wf, [ - ("outputnode.subjects_dir", "inputnode.subjects_dir"), - ("outputnode.subject_id", "inputnode.subject_id"), - # No transform for spheres, following HCP pipelines' lead - ]), - (gifti_spheres_wf, fsLR_reg_wf, [ - ("outputnode.sphere_reg", "inputnode.sphere_reg"), - ]), - (anat_fit_wf, anat_ribbon_wf, [ - ("outputnode.t1w_mask", "inputnode.ref_file"), - ]), - (gifti_surfaces_wf, anat_ribbon_wf, [ - ("outputnode.white", "inputnode.white"), - ("outputnode.pial", "inputnode.pial"), - ]), - (anat_fit_wf, ds_surfaces_wf, [ - ("outputnode.t1w_valid_list", "inputnode.source_files"), - ]), - (gifti_surfaces_wf, ds_surfaces_wf, [ - ("outputnode.white", "inputnode.white"), - ("outputnode.pial", "inputnode.pial"), - ("outputnode.midthickness", "inputnode.midthickness"), - ]), - (gifti_spheres_wf, ds_surfaces_wf, [ - ("outputnode.sphere_reg", "inputnode.sphere_reg"), - ]), - (fsLR_reg_wf, ds_surfaces_wf, [ - ("outputnode.sphere_reg_fsLR", "inputnode.sphere_reg_fsLR"), - ]), - ]) - # fmt:on - if config.workflow.level == "resampling": return clean_datasinks(workflow) @@ -549,7 +488,6 @@ def init_single_subject_wf(subject_id: str): derivatives_dir=deriv_dir, subject_id=subject_id, std_spaces=std_spaces, - freesurfer=config.workflow.run_reconall, ) )