Skip to content

Commit

Permalink
change option name to --fs-no-resume
Browse files Browse the repository at this point in the history
  • Loading branch information
bpinsard committed Mar 14, 2024
1 parent c7d2e36 commit be0cefc
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,10 @@ jobs:
path: /tmp/ds005/derivatives
destination: fasttrack
- run:
name: Check fs-reuse-base using existing freesufer output
name: Check fs-no-resume using existing freesufer output
no_output_timeout: 5m
command: |
bash /tmp/src/smriprep/.circleci/ds005_run.sh --fs-reuse-base
bash /tmp/src/smriprep/.circleci/ds005_run.sh --fs-no-resume
- run:
name: Clean working directory
when: on_fail
Expand All @@ -558,10 +558,10 @@ jobs:
-exec sh -c 'rm -f {}; touch {}' \;
- store_artifacts:
path: /tmp/ds005/work
destination: fs_reuse_base
destination: fs_no_resume
- store_artifacts:
path: /tmp/ds005/derivatives
destination: fs_reuse_base
destination: fs_no_resume
ds054:
<<: *machine_defaults
environment:
Expand Down
10 changes: 6 additions & 4 deletions smriprep/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,12 @@ def get_parser():
'(default: OUTPUT_DIR/freesurfer)',
)
g_fs.add_argument(
'--fs-reuse-base',
'--fs-no-resume',
action='store_true',
dest='fs_reuse_base',
help='Reuse freesurfer base template (from longitudinal preprocessing)',
dest='fs_no_resume',
help="Import precomputed freesurfer without resuming "
"(longitudinal or fastsurfer data) "
"!expert option (you know what you're doing)!",
)
g_fs.add_argument(
'--cifti-output',
Expand Down Expand Up @@ -613,7 +615,7 @@ def build_workflow(opts, retval):
freesurfer=opts.run_reconall,
fs_subjects_dir=opts.fs_subjects_dir,
hires=opts.hires,
fs_reuse_base=opts.fs_reuse_base,
fs_no_resume=opts.fs_no_resume,
layout=layout,
longitudinal=opts.longitudinal,
low_mem=opts.low_mem,
Expand Down
10 changes: 5 additions & 5 deletions smriprep/workflows/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def init_anat_preproc_wf(
cifti_output: ty.Literal['91k', '170k', False] = False,
name: str = 'anat_preproc_wf',
skull_strip_fixed_seed: bool = False,
fs_reuse_base: bool = False,
fs_no_resume: bool = False,
):
"""
Stage the anatomical preprocessing steps of *sMRIPrep*.
Expand Down Expand Up @@ -184,7 +184,7 @@ def init_anat_preproc_wf(
Do not use a random seed for skull-stripping - will ensure
run-to-run replicability when used with --omp-nthreads 1
(default: ``False``).
fs_reuse_base : bool
fs_no_resume : bool
Adjust pipeline to reuse base template
of an existing longitudinal freesurfer output
(default: ``False``).
Expand Down Expand Up @@ -280,7 +280,7 @@ def init_anat_preproc_wf(
sloppy=sloppy,
omp_nthreads=omp_nthreads,
skull_strip_fixed_seed=skull_strip_fixed_seed,
fs_reuse_base=fs_reuse_base,
fs_no_resume=fs_no_resume,
)
template_iterator_wf = init_template_iterator_wf(spaces=spaces)
ds_std_volumes_wf = init_ds_anat_volumes_wf(
Expand Down Expand Up @@ -464,7 +464,7 @@ def init_anat_fit_wf(
sloppy: bool = False,
name='anat_fit_wf',
skull_strip_fixed_seed: bool = False,
fs_reuse_base: bool = False,
fs_no_resume: bool = False,
):
"""
Stage the anatomical preprocessing steps of *sMRIPrep*.
Expand Down Expand Up @@ -1047,7 +1047,7 @@ def init_anat_fit_wf(
name='surface_recon_wf',
omp_nthreads=omp_nthreads,
hires=hires,
fs_reuse_base=fs_reuse_base,
fs_no_resume=fs_no_resume,
precomputed=precomputed,
)
if t2w or flair:
Expand Down
14 changes: 7 additions & 7 deletions smriprep/workflows/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def init_smriprep_wf(
freesurfer,
fs_subjects_dir,
hires,
fs_reuse_base,
fs_no_resume,
layout,
longitudinal,
low_mem,
Expand Down Expand Up @@ -89,7 +89,7 @@ def init_smriprep_wf(
freesurfer=True,
fs_subjects_dir=None,
hires=True,
fs_reuse_base=False,
fs_no_resume=False,
layout=BIDSLayout('.'),
longitudinal=False,
low_mem=False,
Expand Down Expand Up @@ -180,7 +180,7 @@ def init_smriprep_wf(
freesurfer=freesurfer,
derivatives=derivatives,
hires=hires,
fs_reuse_base=fs_reuse_base,
fs_no_resume=fs_no_resume,
layout=layout,
longitudinal=longitudinal,
low_mem=low_mem,
Expand Down Expand Up @@ -217,7 +217,7 @@ def init_single_subject_wf(
derivatives,
freesurfer,
hires,
fs_reuse_base,
fs_no_resume,
layout,
longitudinal,
low_mem,
Expand Down Expand Up @@ -262,7 +262,7 @@ def init_single_subject_wf(
freesurfer=True,
derivatives=[],
hires=True,
fs_reuse_base=False,
fs_no_resume=False,
layout=BIDSLayout('.'),
longitudinal=False,
low_mem=False,
Expand Down Expand Up @@ -291,7 +291,7 @@ def init_single_subject_wf(
Enable FreeSurfer surface reconstruction (may increase runtime)
hires : :obj:`bool`
Enable sub-millimeter preprocessing in FreeSurfer
fs_reuse_base : bool
fs_no_resume : bool
Adjust pipeline to reuse base template
of an existing longitudinal freesurfer output
layout : BIDSLayout object
Expand Down Expand Up @@ -426,7 +426,7 @@ def init_single_subject_wf(
precomputed=deriv_cache,
freesurfer=freesurfer,
hires=hires,
fs_reuse_base=fs_reuse_base,
fs_no_resume=fs_no_resume,
longitudinal=longitudinal,
msm_sulc=msm_sulc,
name='anat_preproc_wf',
Expand Down
8 changes: 4 additions & 4 deletions smriprep/workflows/surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def init_surface_recon_wf(
*,
omp_nthreads: int,
hires: bool,
fs_reuse_base: bool,
fs_no_resume: bool,
precomputed: dict,
name='surface_recon_wf',
):
Expand Down Expand Up @@ -133,7 +133,7 @@ def init_surface_recon_wf(
wf = init_surface_recon_wf(
omp_nthreads=1,
hires=True,
fs_reuse_base=False,
fs_no_resume=False,
precomputed={})
Parameters
Expand All @@ -142,7 +142,7 @@ def init_surface_recon_wf(
Maximum number of threads an individual process may use
hires : bool
Enable sub-millimeter preprocessing in FreeSurfer
fs_reuse_base : bool
fs_no_resume : bool
Adjust pipeline to reuse base template
of an existing longitudinal freesurfer output
Expand Down Expand Up @@ -246,7 +246,7 @@ def init_surface_recon_wf(
name='sync',
)

if not fs_reuse_base:
if not fs_no_resume:
recon_config = pe.Node(FSDetectInputs(hires_enabled=hires), name='recon_config')

fov_check = pe.Node(niu.Function(function=_check_cw256), name='fov_check')
Expand Down

0 comments on commit be0cefc

Please sign in to comment.