Skip to content

Commit 39a0e23

Browse files
committed
ENH: Pass sloppy parameter to MSM workflow to select cheaper config
1 parent 8794ec2 commit 39a0e23

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

smriprep/workflows/anatomical.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ def _check_img(img):
530530
name="surface_recon_wf", omp_nthreads=omp_nthreads, hires=hires
531531
)
532532
applyrefined = pe.Node(fsl.ApplyMask(), name="applyrefined")
533-
sphere_reg_wf = init_sphere_reg_wf(msm_sulc=msm_sulc, name="sphere_reg_wf")
533+
sphere_reg_wf = init_sphere_reg_wf(msm_sulc=msm_sulc, sloppy=sloppy, name="sphere_reg_wf")
534534

535535
if t2w:
536536
t2w_template_wf = init_anat_template_wf(

smriprep/workflows/surfaces.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,12 @@ def _dedup(in_list):
494494
return workflow
495495

496496

497-
def init_sphere_reg_wf(*, msm_sulc: bool = False, name: str = "sphere_reg_wf"):
497+
def init_sphere_reg_wf(
498+
*,
499+
msm_sulc: bool = False,
500+
sloppy: bool = False,
501+
name: str = "sphere_reg_wf",
502+
):
498503
"""Generate GIFTI registration files to fsLR space"""
499504
from ..interfaces.surf import FixGiftiMetadata
500505
from ..interfaces.workbench import SurfaceSphereProjectUnproject
@@ -564,7 +569,7 @@ def init_sphere_reg_wf(*, msm_sulc: bool = False, name: str = "sphere_reg_wf"):
564569
fix_sphere_meta = pe.MapNode(
565570
FixGiftiMetadata(), iterfield='in_file', name='fix_sphere_meta',
566571
)
567-
msm_sulc_wf = init_msm_sulc_wf()
572+
msm_sulc_wf = init_msm_sulc_wf(sloppy=sloppy)
568573
# fmt:off
569574
workflow.connect([
570575
(get_surfaces, sphere_gii, [(('sphere', _sorted_by_basename), 'in_file')]),
@@ -578,7 +583,7 @@ def init_sphere_reg_wf(*, msm_sulc: bool = False, name: str = "sphere_reg_wf"):
578583
return workflow
579584

580585

581-
def init_msm_sulc_wf(*, name: str = 'msm_sulc_wf'):
586+
def init_msm_sulc_wf(*, sloppy: bool = False, name: str = 'msm_sulc_wf'):
582587
"""Run MSMSulc registration to fsLR surfaces, per hemisphere."""
583588
from ..interfaces.msm import MSM
584589
from ..interfaces.workbench import SurfaceAffineRegression, SurfaceApplyAffine
@@ -618,8 +623,9 @@ def init_msm_sulc_wf(*, name: str = 'msm_sulc_wf'):
618623
# --indata=sub-${SUB}_ses-${SES}_hemi-${HEMI)_sulc.shape.gii \
619624
# --refdata=tpl-fsaverage_hemi-${HEMI}_den-164k_sulc.shape.gii \
620625
# --out=${HEMI}. --verbose
626+
msm_conf = load_resource(f'msm/MSMSulcStrain{"Sloppy" if sloppy else "Final"}conf')
621627
msmsulc = pe.MapNode(
622-
MSM(verbose=True, config_file=load_resource('msm/MSMSulcStrainFinalconf')),
628+
MSM(verbose=True, config_file=msm_conf),
623629
iterfield=['in_mesh', 'reference_mesh', 'in_data', 'reference_data', 'out_base'],
624630
name='msmsulc',
625631
mem_gb=2,

0 commit comments

Comments
 (0)