Skip to content

Commit

Permalink
Add FastSurfer argument to
Browse files Browse the repository at this point in the history
Adds FastSurfer argument to support FastSurfer as a surface processing option (nipreps#278)
  • Loading branch information
pcamach2 authored Apr 24, 2022
1 parent f90738a commit 42e6456
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions smriprep/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@ def get_parser():
dest="hires",
help="disable sub-millimeter (hires) reconstruction",
)

g_surfs_xor.add_argument(
"--fastsurfer-recon",
action="store_true",
dest="run_fastsurfer",
help="enable FastSurfer surface preprocessing.",
)

g_surfs_xor = g_surfs.add_mutually_exclusive_group()

g_surfs_xor.add_argument(
Expand Down Expand Up @@ -394,6 +402,17 @@ def _warn_redirect(message, category, filename, lineno, file=None, line=None):
from templateflow import api
from niworkflows.utils.misc import _copy_any

dseg_tsv = str(api.get("fsaverage", suffix="dseg", extension=[".tsv"]))
_copy_any(
dseg_tsv, str(Path(output_dir) / "smriprep" / "desc-aseg_dseg.tsv")
)
_copy_any(
dseg_tsv, str(Path(output_dir) / "smriprep" / "desc-aparcaseg_dseg.tsv")
)
elif opts.run_fastsurfer:
from templateflow import api
from niworkflows.utils.misc import _copy_any

dseg_tsv = str(api.get("fsaverage", suffix="dseg", extension=[".tsv"]))
_copy_any(
dseg_tsv, str(Path(output_dir) / "smriprep" / "desc-aseg_dseg.tsv")
Expand Down Expand Up @@ -584,6 +603,7 @@ def build_workflow(opts, retval):
freesurfer=opts.run_reconall,
fs_subjects_dir=opts.fs_subjects_dir,
hires=opts.hires,
fastsurfer=opts.run_fastsurfer,
layout=layout,
longitudinal=opts.longitudinal,
low_mem=opts.low_mem,
Expand Down

0 comments on commit 42e6456

Please sign in to comment.