Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add MSMSulc #3085

Merged
merged 3 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ ENV LANG="C.UTF-8" \
ENV MKL_NUM_THREADS=1 \
OMP_NUM_THREADS=1

# MSM HOCR (Nov 19, 2019 release)
RUN curl -L -H "Accept: application/octet-stream" https://api.github.com/repos/ecr05/MSM_HOCR/releases/assets/16253707 -o /usr/local/bin/msm \
&& chmod +x /usr/local/bin/msm

# Installing FMRIPREP
COPY --from=src /src/fmriprep/dist/*.whl .
RUN pip install --no-cache-dir $( ls *.whl )[container,test]
Expand Down
6 changes: 6 additions & 0 deletions fmriprep/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,12 @@ def _slice_time_ref(value, parser):
"Optionally, the number of grayordinate can be specified "
"(default is 91k, which equates to 2mm resolution)",
)
g_outputs.add_argument(
"--no-msm",
action="store_false",
dest="run_msmsulc",
help="Disable Multimodal Surface Matching surface registration.",
)

g_aroma = parser.add_argument_group("[DEPRECATED] Options for running ICA_AROMA")
g_aroma.add_argument(
Expand Down
8 changes: 8 additions & 0 deletions fmriprep/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,8 @@ class workflow(_Config):
"""Ignore particular steps for *fMRIPrep*."""
longitudinal = False
"""Run FreeSurfer ``recon-all`` with the ``-logitudinal`` flag."""
run_msmsulc = True
"""Run Multimodal Surface Matching surface registration."""
medial_surface_nan = None
"""Fill medial surface with :abbr:`NaNs (not-a-number)` when sampling."""
project_goodvoxels = False
Expand Down Expand Up @@ -574,6 +576,12 @@ 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
1 change: 1 addition & 0 deletions fmriprep/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def init_single_subject_wf(subject_id: str):
hires=config.workflow.hires,
longitudinal=config.workflow.longitudinal,
omp_nthreads=config.nipype.omp_nthreads,
msm_sulc=config.workflow.run_msmsulc,
output_dir=fmriprep_dir,
skull_strip_fixed_seed=config.workflow.skull_strip_fixed_seed,
skull_strip_mode=config.workflow.skull_strip_t1w,
Expand Down
3 changes: 3 additions & 0 deletions scripts/fetch_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,14 @@ def fetch_fsaverage():
tpl-fsaverage/tpl-fsaverage_hemi-R_den-164k_desc-vaavg_midthickness.shape.gii
tpl-fsaverage/tpl-fsaverage_hemi-L_den-164k_midthickness.surf.gii
tpl-fsaverage/tpl-fsaverage_hemi-R_den-164k_midthickness.surf.gii
tpl-fsaverage/tpl-fsaverage_hemi-L_den-164k_sulc.shape.gii
tpl-fsaverage/tpl-sfaverage_hemi-R_den-164k_sulc.shape.gii
"""
template = "fsaverage"

tf.get(template, density="164k", desc="std", suffix="sphere")
tf.get(template, density="164k", suffix="midthickness")
tf.get(template, density="164k", suffix="sulc")


def fetch_fsLR():
Expand Down