Skip to content

Commit 30861e7

Browse files
committed
ENH/DEP: Change flag for surface processing
- Add new flag `--surface-recon-method` to support various surface processing pipelines: - FreeSurfer's `recon-all` and `infant_recon_all`, as well as a new `mcribs` option. - Deprecate redundant `--force-reconall` flag.
1 parent cf5ca7d commit 30861e7

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

nibabies/cli/parser.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,12 @@ def _slice_time_ref(value, parser):
664664
action="store_true",
665665
help="Force traditional FreeSurfer surface reconstruction.",
666666
)
667+
g_baby.add_argument(
668+
"--surface-recon-method",
669+
choices=("infantfs", "freesurfer", "mcribs"),
670+
default="infantfs",
671+
help="Method to use for surface reconstruction",
672+
)
667673
return parser
668674

669675

@@ -674,6 +680,14 @@ def parse_args(args=None, namespace=None):
674680
parser = _build_parser()
675681
opts = parser.parse_args(args, namespace)
676682

683+
# Deprecations
684+
if opts.force_reconall:
685+
config.loggers.cli.warning(
686+
"--force-reconall is deprecated and will be removed in a future release."
687+
"To run traditional `recon-all`, use `--surface-recon-method freesurfer` instead."
688+
)
689+
opts.surface_recon_method = "freesurfer"
690+
677691
if opts.config_file:
678692
skip = {} if opts.reports_only else {"execution": ("run_uuid",)}
679693
config.load(opts.config_file, skip=skip)

nibabies/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,6 @@ class workflow(_Config):
543543
"""Remove the mean from fieldmaps."""
544544
force_syn = None
545545
"""Run *fieldmap-less* susceptibility-derived distortions estimation."""
546-
force_reconall = False
547-
"""Force traditional FreeSurfer surface reconstruction instead of infant version."""
548546
hires = None
549547
"""Run FreeSurfer ``recon-all`` with the ``-hires`` flag."""
550548
ignore = None
@@ -578,6 +576,8 @@ class workflow(_Config):
578576
spaces = None
579577
"""Keeps the :py:class:`~niworkflows.utils.spaces.SpatialReferences`
580578
instance keeping standard and nonstandard spaces."""
579+
surface_recon_method = "infantfs"
580+
"""Method to use for surface reconstruction."""
581581
topup_max_vols = 5
582582
"""Maximum number of volumes to use with TOPUP, per-series (EPI or BOLD)."""
583583
use_aroma = None

0 commit comments

Comments
 (0)