Skip to content

Commit 2065965

Browse files
authored
ENH: Add MSMSulc (#3085)
Closes #2694 This PR adds MSMSulc surface registration, and enables it by default. To disable it, the `--no-msm` flag has been added, and behaves similar to `--no-fs-reconall`.
2 parents 9bde234 + 603ce44 commit 2065965

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ ENV LANG="C.UTF-8" \
242242
ENV MKL_NUM_THREADS=1 \
243243
OMP_NUM_THREADS=1
244244

245+
# MSM HOCR (Nov 19, 2019 release)
246+
RUN curl -L -H "Accept: application/octet-stream" https://api.github.com/repos/ecr05/MSM_HOCR/releases/assets/16253707 -o /usr/local/bin/msm \
247+
&& chmod +x /usr/local/bin/msm
248+
245249
# Installing FMRIPREP
246250
COPY --from=src /src/fmriprep/dist/*.whl .
247251
RUN pip install --no-cache-dir $( ls *.whl )[container,test]

fmriprep/cli/parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,12 @@ def _slice_time_ref(value, parser):
425425
"Optionally, the number of grayordinate can be specified "
426426
"(default is 91k, which equates to 2mm resolution)",
427427
)
428+
g_outputs.add_argument(
429+
"--no-msm",
430+
action="store_false",
431+
dest="run_msmsulc",
432+
help="Disable Multimodal Surface Matching surface registration.",
433+
)
428434

429435
g_aroma = parser.add_argument_group("[DEPRECATED] Options for running ICA_AROMA")
430436
g_aroma.add_argument(

fmriprep/config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,8 @@ class workflow(_Config):
537537
"""Ignore particular steps for *fMRIPrep*."""
538538
longitudinal = False
539539
"""Run FreeSurfer ``recon-all`` with the ``-logitudinal`` flag."""
540+
run_msmsulc = True
541+
"""Run Multimodal Surface Matching surface registration."""
540542
medial_surface_nan = None
541543
"""Fill medial surface with :abbr:`NaNs (not-a-number)` when sampling."""
542544
project_goodvoxels = False
@@ -574,6 +576,12 @@ class workflow(_Config):
574576
me_t2s_fit_method = "curvefit"
575577
"""The method by which to estimate T2*/S0 for multi-echo data"""
576578

579+
@classmethod
580+
def init(cls):
581+
# Avoid additional runtime if not required
582+
if not cls.cifti_output:
583+
cls.run_msmsulc = False
584+
577585

578586
class loggers:
579587
"""Keep loggers easily accessible (see :py:func:`init`)."""

fmriprep/workflows/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ def init_single_subject_wf(subject_id: str):
312312
hires=config.workflow.hires,
313313
longitudinal=config.workflow.longitudinal,
314314
omp_nthreads=config.nipype.omp_nthreads,
315+
msm_sulc=config.workflow.run_msmsulc,
315316
output_dir=fmriprep_dir,
316317
skull_strip_fixed_seed=config.workflow.skull_strip_fixed_seed,
317318
skull_strip_mode=config.workflow.skull_strip_t1w,

scripts/fetch_templates.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,14 @@ def fetch_fsaverage():
8181
tpl-fsaverage/tpl-fsaverage_hemi-R_den-164k_desc-vaavg_midthickness.shape.gii
8282
tpl-fsaverage/tpl-fsaverage_hemi-L_den-164k_midthickness.surf.gii
8383
tpl-fsaverage/tpl-fsaverage_hemi-R_den-164k_midthickness.surf.gii
84+
tpl-fsaverage/tpl-fsaverage_hemi-L_den-164k_sulc.shape.gii
85+
tpl-fsaverage/tpl-sfaverage_hemi-R_den-164k_sulc.shape.gii
8486
"""
8587
template = "fsaverage"
8688

8789
tf.get(template, density="164k", desc="std", suffix="sphere")
8890
tf.get(template, density="164k", suffix="midthickness")
91+
tf.get(template, density="164k", suffix="sulc")
8992

9093

9194
def fetch_fsLR():

0 commit comments

Comments
 (0)