Skip to content

Commit 08285d2

Browse files
committed
ENH: Make --multi-step-reg a boolean action, enable by default
1 parent 279dabc commit 08285d2

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

nibabies/cli/parser.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515

1616
def _build_parser():
1717
"""Build parser object."""
18-
from argparse import Action, ArgumentDefaultsHelpFormatter, ArgumentParser
18+
from argparse import (
19+
Action,
20+
ArgumentDefaultsHelpFormatter,
21+
ArgumentParser,
22+
BooleanOptionalAction,
23+
)
1924
from functools import partial
2025
from pathlib import Path
2126

@@ -759,7 +764,8 @@ def _str_none(val):
759764
)
760765
g_baby.add_argument(
761766
'--multi-step-reg',
762-
action='store_true',
767+
action=BooleanOptionalAction,
768+
default=True,
763769
help='For certain adult templates (MNI152NLin6Asym), perform two step '
764770
'registrations (native -> MNIInfant -> template) and concatenate into a single xfm',
765771
)

nibabies/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ class workflow(_Config):
578578
"""Run FreeSurfer ``recon-all`` with the ``-logitudinal`` flag."""
579579
medial_surface_nan = None
580580
"""Fill medial surface with :abbr:`NaNs (not-a-number)` when sampling."""
581-
multi_step_reg = False
581+
multi_step_reg = True
582582
"""Perform multiple registrations (native -> MNIInfant -> template) and concatenate into a
583583
single transform"""
584584
norm_csf = False

nibabies/workflows/tests/test_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def _make_params(
138138
ignore: list[str] = None,
139139
bids_filters: dict = None,
140140
norm_csf: bool = False,
141-
multi_step_reg: bool = False,
141+
multi_step_reg: bool = True,
142142
):
143143
if ignore is None:
144144
ignore = []
@@ -219,6 +219,7 @@ def _make_params(
219219
_make_params(bids_filters={'sbref': {'suffix': 'sbref'}}),
220220
_make_params(norm_csf=True),
221221
_make_params(multi_step_reg=True),
222+
_make_params(multi_step_reg=False),
222223
],
223224
)
224225
def test_init_nibabies_wf(

0 commit comments

Comments
 (0)