@@ -32,12 +32,10 @@ def check_deps(workflow):
32
32
33
33
34
34
def get_parser ():
35
- """Build parser object"""
36
- from smriprep .cli .utils import ParseTemplates , output_space as _output_space
37
- from templateflow .api import templates
35
+ """Build parser object."""
36
+ from niworkflows .utils .spaces import Reference , SpatialReferences , OutputReferencesAction
38
37
from packaging .version import Version
39
38
from ..__about__ import __version__
40
- from ..config import NONSTANDARD_REFERENCES
41
39
from .version import check_latest , is_flagged
42
40
43
41
verstr = 'dmriprep v{}' .format (__version__ )
@@ -104,26 +102,24 @@ def get_parser():
104
102
'--longitudinal' , action = 'store_true' ,
105
103
help = 'treat dataset as longitudinal - may increase runtime' )
106
104
g_conf .add_argument (
107
- '--output-spaces' , nargs = '+ ' , action = ParseTemplates ,
105
+ '--output-spaces' , nargs = '* ' , action = OutputReferencesAction , default = SpatialReferences () ,
108
106
help = """\
109
107
Standard and non-standard spaces to resample anatomical and functional images to. \
110
108
Standard spaces may be specified by the form \
111
- ``<TEMPLATE>[:res-<resolution>][:cohort-<label>][...]``, where ``<TEMPLATE>`` is \
112
- a keyword (valid keywords: %s) or path pointing to a user-supplied template, and \
113
- may be followed by optional, colon-separated parameters. \
114
- Non-standard spaces (valid keywords: %s) imply specific orientations and sampling \
115
- grids. \
109
+ ``<SPACE>[:cohort-<label>][:res-<resolution>][...]``, where ``<SPACE>`` is \
110
+ a keyword designating a spatial reference, and may be followed by optional, \
111
+ colon-separated parameters. \
112
+ Non-standard spaces imply specific orientations and sampling grids. \
116
113
Important to note, the ``res-*`` modifier does not define the resolution used for \
117
- the spatial normalization.
118
- For further details, please check out \
119
- https://dmriprep.readthedocs.io/en/%s/spaces.html""" % (
120
- ', ' .join ('"%s"' % s for s in templates ()), ', ' .join (NONSTANDARD_REFERENCES ),
121
- currentv .base_version if is_release else 'latest' ))
114
+ the spatial normalization. To generate no DWI outputs, use this option without specifying \
115
+ any spatial references. For further details, please check out \
116
+ https://www.nipreps.org/dmriprep/en/%s/spaces.html""" % (currentv .base_version
117
+ if is_release else 'latest' ))
122
118
123
119
# ANTs options
124
120
g_ants = parser .add_argument_group ('Specific options for ANTs registrations' )
125
121
g_ants .add_argument (
126
- '--skull-strip-template' , action = 'store' , default = 'OASIS30ANTs' , type = _output_space ,
122
+ '--skull-strip-template' , default = 'OASIS30ANTs' , type = Reference . from_string ,
127
123
help = 'select a template for skull-stripping with antsBrainExtraction' )
128
124
g_ants .add_argument ('--skull-strip-fixed-seed' , action = 'store_true' ,
129
125
help = 'do not use a random seed for skull-stripping - will ensure '
0 commit comments