From ae428348a77341cee9541c9946d96fcb7ba74c97 Mon Sep 17 00:00:00 2001 From: bpinsard Date: Fri, 29 Sep 2023 16:35:23 -0400 Subject: [PATCH] wip: add a flag to reuse freesurfer as is, for longitudinal base case --- fmriprep/cli/parser.py | 6 ++++++ fmriprep/config.py | 2 ++ fmriprep/workflows/base.py | 1 + 3 files changed, 9 insertions(+) diff --git a/fmriprep/cli/parser.py b/fmriprep/cli/parser.py index 3b2e31ffd..c358d24ec 100644 --- a/fmriprep/cli/parser.py +++ b/fmriprep/cli/parser.py @@ -574,6 +574,12 @@ def _slice_time_ref(value, parser): dest="run_reconall", help="Disable FreeSurfer surface preprocessing.", ) + g_fs.add_argument( + "--fs-reuse-base", + action="store_true", + dest="fs_reuse_base", + help="Reuse freesurfer base template (from longitudinal preprocessing)", + ) g_carbon = parser.add_argument_group("Options for carbon usage tracking") g_carbon.add_argument( diff --git a/fmriprep/config.py b/fmriprep/config.py index f63211afa..c87a9267a 100644 --- a/fmriprep/config.py +++ b/fmriprep/config.py @@ -533,6 +533,8 @@ class workflow(_Config): """Run *fieldmap-less* susceptibility-derived distortions estimation.""" hires = None """Run FreeSurfer ``recon-all`` with the ``-hires`` flag.""" + fs_reuse_base = None + """Adjust pipeline to reuse base template of existing longitudinal freesurfer""" ignore = None """Ignore particular steps for *fMRIPrep*.""" longitudinal = False diff --git a/fmriprep/workflows/base.py b/fmriprep/workflows/base.py index 9495d76b0..22c6c9887 100644 --- a/fmriprep/workflows/base.py +++ b/fmriprep/workflows/base.py @@ -310,6 +310,7 @@ def init_single_subject_wf(subject_id: str): existing_derivatives=anat_derivatives, freesurfer=config.workflow.run_reconall, hires=config.workflow.hires, + fs_reuse_base=config.workflow.fs_reuse_base, longitudinal=config.workflow.longitudinal, omp_nthreads=config.nipype.omp_nthreads, output_dir=fmriprep_dir,