Skip to content

Commit 73a3e21

Browse files
committed
FIX: Add none option when selecting surface recon method, deprecated ambiguous options
1 parent 064aa3f commit 73a3e21

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

nibabies/cli/parser.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ def _build_parser():
2828
# parser attribute name: (replacement flag, version slated to be removed in)
2929
'bold2t1w_init': ('--bold2anat-init', '24.2.0'),
3030
'bold2t1w_dof': ('--bold2anat-dof', '24.2.0'),
31+
'force_reconall': ('--surface-recon-method freesurfer', '24.2.0'),
32+
'fs_no_reconall': ('--surface-recon-method none', '24.2.0'),
3133
}
3234

3335
class DeprecatedAction(Action):
@@ -619,9 +621,9 @@ def _slice_time_ref(value, parser):
619621
)
620622
g_surfs_xor.add_argument(
621623
'--fs-no-reconall',
622-
action='store_false',
624+
action=DeprecatedAction,
623625
dest='run_reconall',
624-
help='disable FreeSurfer surface preprocessing.',
626+
help='Deprecated - use `--surface-recon-method none` instead.',
625627
)
626628

627629
g_other = parser.add_argument_group('Other options')
@@ -750,14 +752,14 @@ def _slice_time_ref(value, parser):
750752
g_baby.add_argument(
751753
'--force-reconall',
752754
default=False,
753-
action='store_true',
754-
help='Force traditional FreeSurfer surface reconstruction.',
755+
action=DeprecatedAction,
756+
help='Deprecated - use `--surface-recon-method freesurfer` instead.',
755757
)
756758
g_baby.add_argument(
757759
'--surface-recon-method',
758-
choices=('infantfs', 'freesurfer', 'mcribs', 'auto'),
760+
choices=('auto', 'infantfs', 'freesurfer', 'mcribs', 'none'),
759761
default='auto',
760-
help='Method to use for surface reconstruction',
762+
help='Method to use for surface reconstruction.',
761763
)
762764
g_baby.add_argument(
763765
'--reference-anat',

nibabies/workflows/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,11 @@ def init_single_subject_wf(
351351
f'Requested to use {requested_anat} as anatomical reference but none available'
352352
)
353353
elif (reference_anat := requested_anat) is None: # Both available with no preference
354-
reference_anat = 'T2w' if any(
355-
(recon_method == 'none' and age <= AUTO_T2W_MAX_AGE, recon_method == 'mcribs')
356-
) else 'T1w'
354+
reference_anat = (
355+
'T2w'
356+
if any((recon_method == 'none' and age <= AUTO_T2W_MAX_AGE, recon_method == 'mcribs'))
357+
else 'T1w'
358+
)
357359

358360
anat = reference_anat.lower() # To be used for workflow connections
359361

0 commit comments

Comments
 (0)