23
23
"""Parser."""
24
24
25
25
import sys
26
+ from pathlib import Path
26
27
27
28
from .. import config
28
29
@@ -32,9 +33,13 @@ def _build_parser(**kwargs):
32
33
33
34
``kwargs`` are passed to ``argparse.ArgumentParser`` (mainly useful for debugging).
34
35
"""
35
- from argparse import Action , ArgumentDefaultsHelpFormatter , ArgumentParser
36
+ from argparse import (
37
+ Action ,
38
+ ArgumentDefaultsHelpFormatter ,
39
+ ArgumentParser ,
40
+ BooleanOptionalAction ,
41
+ )
36
42
from functools import partial
37
- from pathlib import Path
38
43
39
44
from niworkflows .utils .spaces import OutputReferencesAction , Reference
40
45
from packaging .version import Version
@@ -521,10 +526,12 @@ def _fallback_trt(value, parser):
521
526
'(default is 91k, which equates to 2mm resolution)' ,
522
527
)
523
528
g_outputs .add_argument (
524
- '--no-msm' ,
525
- action = 'store_false' ,
529
+ '--msm' ,
530
+ action = BooleanOptionalAction ,
531
+ default = True ,
526
532
dest = 'run_msmsulc' ,
527
- help = 'Disable Multimodal Surface Matching surface registration.' ,
533
+ help = 'Enable or disable Multimodal Surface Matching surface registration. '
534
+ 'To disable, use `--no-msm`.' ,
528
535
)
529
536
530
537
g_confounds = parser .add_argument_group ('Options relating to confounds' )
@@ -634,10 +641,12 @@ def _fallback_trt(value, parser):
634
641
'(default: OUTPUT_DIR/freesurfer)' ,
635
642
)
636
643
g_fs .add_argument (
637
- '--no-submm-recon' ,
638
- action = 'store_false' ,
644
+ '--submm-recon' ,
645
+ action = BooleanOptionalAction ,
646
+ default = True ,
639
647
dest = 'hires' ,
640
- help = 'Disable sub-millimeter (hires) reconstruction' ,
648
+ help = 'Enable or disable sub-millimeter (hi-res) reconstruction. '
649
+ 'To disable, use `--no-submm-recon`.' ,
641
650
)
642
651
g_fs .add_argument (
643
652
'--fs-no-reconall' ,
0 commit comments