Skip to content

Commit

Permalink
FIX: Minor fixes to work with MSMSulc-enabled smriprep-next (#3098)
Browse files Browse the repository at this point in the history
Companion PR to nipreps/smriprep#370.
  • Loading branch information
effigies authored Oct 12, 2023
1 parent 1d9c55a commit 511c838
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 69 deletions.
6 changes: 0 additions & 6 deletions fmriprep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`)."""
Expand Down
64 changes: 1 addition & 63 deletions fmriprep/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
)

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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,
)
)

Expand Down

0 comments on commit 511c838

Please sign in to comment.