Skip to content

Commit

Permalink
Merge pull request #366 from effigies/test/msm-sloppy
Browse files Browse the repository at this point in the history
TEST: Add sloppy MSM configuration for use in debugging/CI
  • Loading branch information
mgxd authored Sep 6, 2023
2 parents 37ad1c6 + 4e6fdd3 commit b8a1949
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
1 change: 0 additions & 1 deletion .circleci/ds005_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ docker run -it -e FMRIPREP_DEV=1 -u $(id -u) \
--skull-strip-template MNI152NLin2009cAsym:res-2 \
--sloppy --mem-gb 4 \
--ncpus 2 --omp-nthreads 2 -vv \
--no-msm \
--fs-license-file /tmp/fslicense/license.txt \
--fs-subjects-dir /tmp/ds005/freesurfer \
${@:1}
18 changes: 18 additions & 0 deletions smriprep/data/msm/MSMSulcStrainSloppyconf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--simval=3,2
--sigma_in=0,0
--sigma_ref=0,0
--lambda=0,10
--it=20,5
--opt=AFFINE,DISCRETE
--CPgrid=6,2
--SGgrid=6,4
--datagrid=6,4
--regoption=3
--regexp=2
--dopt=HOCR
--VN
--rescaleL
--triclique
--k_exponent=2
--bulkmod=1.6
--shearmod=0.4
2 changes: 1 addition & 1 deletion smriprep/workflows/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def _check_img(img):
name="surface_recon_wf", omp_nthreads=omp_nthreads, hires=hires
)
applyrefined = pe.Node(fsl.ApplyMask(), name="applyrefined")
sphere_reg_wf = init_sphere_reg_wf(msm_sulc=msm_sulc, name="sphere_reg_wf")
sphere_reg_wf = init_sphere_reg_wf(msm_sulc=msm_sulc, sloppy=sloppy, name="sphere_reg_wf")

if t2w:
t2w_template_wf = init_anat_template_wf(
Expand Down
14 changes: 10 additions & 4 deletions smriprep/workflows/surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,12 @@ def _dedup(in_list):
return workflow


def init_sphere_reg_wf(*, msm_sulc: bool = False, name: str = "sphere_reg_wf"):
def init_sphere_reg_wf(
*,
msm_sulc: bool = False,
sloppy: bool = False,
name: str = "sphere_reg_wf",
):
"""Generate GIFTI registration files to fsLR space"""
from ..interfaces.surf import FixGiftiMetadata
from ..interfaces.workbench import SurfaceSphereProjectUnproject
Expand Down Expand Up @@ -564,7 +569,7 @@ def init_sphere_reg_wf(*, msm_sulc: bool = False, name: str = "sphere_reg_wf"):
fix_sphere_meta = pe.MapNode(
FixGiftiMetadata(), iterfield='in_file', name='fix_sphere_meta',
)
msm_sulc_wf = init_msm_sulc_wf()
msm_sulc_wf = init_msm_sulc_wf(sloppy=sloppy)
# fmt:off
workflow.connect([
(get_surfaces, sphere_gii, [(('sphere', _sorted_by_basename), 'in_file')]),
Expand All @@ -578,7 +583,7 @@ def init_sphere_reg_wf(*, msm_sulc: bool = False, name: str = "sphere_reg_wf"):
return workflow


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

0 comments on commit b8a1949

Please sign in to comment.