niwrap-mrtrix 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- niwrap_mrtrix/mrtrix/__init__.py +263 -0
- niwrap_mrtrix/mrtrix/afdconnectivity.py +527 -0
- niwrap_mrtrix/mrtrix/amp2response.py +560 -0
- niwrap_mrtrix/mrtrix/amp2sh.py +870 -0
- niwrap_mrtrix/mrtrix/connectome2tck.py +583 -0
- niwrap_mrtrix/mrtrix/connectomeedit.py +413 -0
- niwrap_mrtrix/mrtrix/connectomestats.py +956 -0
- niwrap_mrtrix/mrtrix/dcmedit.py +552 -0
- niwrap_mrtrix/mrtrix/dcminfo.py +529 -0
- niwrap_mrtrix/mrtrix/dirflip.py +440 -0
- niwrap_mrtrix/mrtrix/dirgen.py +514 -0
- niwrap_mrtrix/mrtrix/dirmerge.py +446 -0
- niwrap_mrtrix/mrtrix/dirorder.py +421 -0
- niwrap_mrtrix/mrtrix/dirsplit.py +436 -0
- niwrap_mrtrix/mrtrix/dirstat.py +640 -0
- niwrap_mrtrix/mrtrix/dwi2adc.py +531 -0
- niwrap_mrtrix/mrtrix/dwi2fod.py +1156 -0
- niwrap_mrtrix/mrtrix/dwi2mask.py +570 -0
- niwrap_mrtrix/mrtrix/dwi2response.py +1774 -0
- niwrap_mrtrix/mrtrix/dwi2tensor.py +715 -0
- niwrap_mrtrix/mrtrix/dwibiascorrect.py +673 -0
- niwrap_mrtrix/mrtrix/dwidenoise.py +570 -0
- niwrap_mrtrix/mrtrix/dwiextract.py +1111 -0
- niwrap_mrtrix/mrtrix/dwigradcheck.py +665 -0
- niwrap_mrtrix/mrtrix/fixel2peaks.py +613 -0
- niwrap_mrtrix/mrtrix/fixel2sh.py +430 -0
- niwrap_mrtrix/mrtrix/fixel2tsf.py +435 -0
- niwrap_mrtrix/mrtrix/fixel2voxel.py +523 -0
- niwrap_mrtrix/mrtrix/fixelcfestats.py +1179 -0
- niwrap_mrtrix/mrtrix/fixelconnectivity.py +477 -0
- niwrap_mrtrix/mrtrix/fixelconvert.py +850 -0
- niwrap_mrtrix/mrtrix/fixelcorrespondence.py +455 -0
- niwrap_mrtrix/mrtrix/fixelcrop.py +422 -0
- niwrap_mrtrix/mrtrix/fixelfilter.py +882 -0
- niwrap_mrtrix/mrtrix/fixelreorient.py +435 -0
- niwrap_mrtrix/mrtrix/fod2dec.py +571 -0
- niwrap_mrtrix/mrtrix/fod2fixel.py +646 -0
- niwrap_mrtrix/mrtrix/label2colour.py +426 -0
- niwrap_mrtrix/mrtrix/label2mesh.py +417 -0
- niwrap_mrtrix/mrtrix/labelconvert.py +460 -0
- niwrap_mrtrix/mrtrix/labelstats.py +418 -0
- niwrap_mrtrix/mrtrix/maskdump.py +404 -0
- niwrap_mrtrix/mrtrix/maskfilter.py +730 -0
- niwrap_mrtrix/mrtrix/mesh2voxel.py +422 -0
- niwrap_mrtrix/mrtrix/meshconvert.py +514 -0
- niwrap_mrtrix/mrtrix/meshfilter.py +452 -0
- niwrap_mrtrix/mrtrix/mraverageheader.py +485 -0
- niwrap_mrtrix/mrtrix/mrcalc.py +4302 -0
- niwrap_mrtrix/mrtrix/mrcat.py +467 -0
- niwrap_mrtrix/mrtrix/mrcentroid.py +418 -0
- niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +446 -0
- niwrap_mrtrix/mrtrix/mrclusterstats.py +930 -0
- niwrap_mrtrix/mrtrix/mrcolour.py +490 -0
- niwrap_mrtrix/mrtrix/mrconvert.py +1967 -0
- niwrap_mrtrix/mrtrix/mrdegibbs.py +535 -0
- niwrap_mrtrix/mrtrix/mrdump.py +423 -0
- niwrap_mrtrix/mrtrix/mredit.py +737 -0
- niwrap_mrtrix/mrtrix/mrfilter.py +971 -0
- niwrap_mrtrix/mrtrix/mrgrid.py +1079 -0
- niwrap_mrtrix/mrtrix/mrhistmatch.py +494 -0
- niwrap_mrtrix/mrtrix/mrhistogram.py +484 -0
- niwrap_mrtrix/mrtrix/mrinfo.py +1282 -0
- niwrap_mrtrix/mrtrix/mrmath.py +503 -0
- niwrap_mrtrix/mrtrix/mrmetric.py +525 -0
- niwrap_mrtrix/mrtrix/mrregister.py +2098 -0
- niwrap_mrtrix/mrtrix/mrstats.py +534 -0
- niwrap_mrtrix/mrtrix/mrthreshold.py +666 -0
- niwrap_mrtrix/mrtrix/mrtransform.py +1372 -0
- niwrap_mrtrix/mrtrix/mtnormalise.py +725 -0
- niwrap_mrtrix/mrtrix/peaks2amp.py +403 -0
- niwrap_mrtrix/mrtrix/peaks2fixel.py +422 -0
- niwrap_mrtrix/mrtrix/responsemean.py +385 -0
- niwrap_mrtrix/mrtrix/sh2amp.py +844 -0
- niwrap_mrtrix/mrtrix/sh2peaks.py +632 -0
- niwrap_mrtrix/mrtrix/sh2power.py +427 -0
- niwrap_mrtrix/mrtrix/sh2response.py +481 -0
- niwrap_mrtrix/mrtrix/shbasis.py +445 -0
- niwrap_mrtrix/mrtrix/shconv.py +661 -0
- niwrap_mrtrix/mrtrix/tck2connectome.py +727 -0
- niwrap_mrtrix/mrtrix/tck2fixel.py +447 -0
- niwrap_mrtrix/mrtrix/tckconvert.py +775 -0
- niwrap_mrtrix/mrtrix/tckdfc.py +684 -0
- niwrap_mrtrix/mrtrix/tckedit.py +1478 -0
- niwrap_mrtrix/mrtrix/tckgen.py +2733 -0
- niwrap_mrtrix/mrtrix/tckglobal.py +944 -0
- niwrap_mrtrix/mrtrix/tckinfo.py +402 -0
- niwrap_mrtrix/mrtrix/tckmap.py +1004 -0
- niwrap_mrtrix/mrtrix/tckresample.py +760 -0
- niwrap_mrtrix/mrtrix/tcksample.py +497 -0
- niwrap_mrtrix/mrtrix/tcksift.py +739 -0
- niwrap_mrtrix/mrtrix/tcksift2.py +902 -0
- niwrap_mrtrix/mrtrix/tckstats.py +550 -0
- niwrap_mrtrix/mrtrix/tcktransform.py +414 -0
- niwrap_mrtrix/mrtrix/tensor2metric.py +659 -0
- niwrap_mrtrix/mrtrix/transformcalc.py +421 -0
- niwrap_mrtrix/mrtrix/transformcompose.py +625 -0
- niwrap_mrtrix/mrtrix/transformconvert.py +423 -0
- niwrap_mrtrix/mrtrix/tsfdivide.py +414 -0
- niwrap_mrtrix/mrtrix/tsfinfo.py +421 -0
- niwrap_mrtrix/mrtrix/tsfmult.py +401 -0
- niwrap_mrtrix/mrtrix/tsfsmooth.py +420 -0
- niwrap_mrtrix/mrtrix/tsfthreshold.py +428 -0
- niwrap_mrtrix/mrtrix/tsfvalidate.py +398 -0
- niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +432 -0
- niwrap_mrtrix/mrtrix/v_5tt2vis.py +505 -0
- niwrap_mrtrix/mrtrix/v_5ttcheck.py +409 -0
- niwrap_mrtrix/mrtrix/v_5ttedit.py +513 -0
- niwrap_mrtrix/mrtrix/v_5ttgen.py +1107 -0
- niwrap_mrtrix/mrtrix/vectorstats.py +736 -0
- niwrap_mrtrix/mrtrix/voxel2fixel.py +430 -0
- niwrap_mrtrix/mrtrix/voxel2mesh.py +454 -0
- niwrap_mrtrix/mrtrix/warp2metric.py +556 -0
- niwrap_mrtrix/mrtrix/warpconvert.py +498 -0
- niwrap_mrtrix/mrtrix/warpcorrect.py +448 -0
- niwrap_mrtrix/mrtrix/warpinit.py +425 -0
- niwrap_mrtrix/mrtrix/warpinvert.py +448 -0
- niwrap_mrtrix-0.8.0.dist-info/METADATA +8 -0
- niwrap_mrtrix-0.8.0.dist-info/RECORD +119 -0
- niwrap_mrtrix-0.8.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
# This file was auto generated by Styx.
|
|
2
|
+
# Do not edit this file directly.
|
|
3
|
+
|
|
4
|
+
import typing
|
|
5
|
+
import pathlib
|
|
6
|
+
from styxdefs import *
|
|
7
|
+
|
|
8
|
+
MRAVERAGEHEADER_METADATA = Metadata(
|
|
9
|
+
id="157f0794eeda94318eeaa422b5298c388c67f70c.boutiques",
|
|
10
|
+
name="mraverageheader",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
_MraverageheaderConfigParamsDictNoTag = typing.TypedDict('_MraverageheaderConfigParamsDictNoTag', {
|
|
17
|
+
"key": str,
|
|
18
|
+
"value": str,
|
|
19
|
+
})
|
|
20
|
+
MraverageheaderConfigParamsDictTagged = typing.TypedDict('MraverageheaderConfigParamsDictTagged', {
|
|
21
|
+
"@type": typing.Literal["config"],
|
|
22
|
+
"key": str,
|
|
23
|
+
"value": str,
|
|
24
|
+
})
|
|
25
|
+
MraverageheaderConfigParamsDict = _MraverageheaderConfigParamsDictNoTag | MraverageheaderConfigParamsDictTagged
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_MraverageheaderParamsDictNoTag = typing.TypedDict('_MraverageheaderParamsDictNoTag', {
|
|
29
|
+
"padding": typing.NotRequired[float | None],
|
|
30
|
+
"resolution": typing.NotRequired[str | None],
|
|
31
|
+
"fill": bool,
|
|
32
|
+
"datatype": typing.NotRequired[str | None],
|
|
33
|
+
"info": bool,
|
|
34
|
+
"quiet": bool,
|
|
35
|
+
"debug": bool,
|
|
36
|
+
"force": bool,
|
|
37
|
+
"nthreads": typing.NotRequired[int | None],
|
|
38
|
+
"config": typing.NotRequired[list[MraverageheaderConfigParamsDict] | None],
|
|
39
|
+
"help": bool,
|
|
40
|
+
"version": bool,
|
|
41
|
+
"input": list[InputPathType],
|
|
42
|
+
"output": str,
|
|
43
|
+
})
|
|
44
|
+
MraverageheaderParamsDictTagged = typing.TypedDict('MraverageheaderParamsDictTagged', {
|
|
45
|
+
"@type": typing.Literal["mrtrix/mraverageheader"],
|
|
46
|
+
"padding": typing.NotRequired[float | None],
|
|
47
|
+
"resolution": typing.NotRequired[str | None],
|
|
48
|
+
"fill": bool,
|
|
49
|
+
"datatype": typing.NotRequired[str | None],
|
|
50
|
+
"info": bool,
|
|
51
|
+
"quiet": bool,
|
|
52
|
+
"debug": bool,
|
|
53
|
+
"force": bool,
|
|
54
|
+
"nthreads": typing.NotRequired[int | None],
|
|
55
|
+
"config": typing.NotRequired[list[MraverageheaderConfigParamsDict] | None],
|
|
56
|
+
"help": bool,
|
|
57
|
+
"version": bool,
|
|
58
|
+
"input": list[InputPathType],
|
|
59
|
+
"output": str,
|
|
60
|
+
})
|
|
61
|
+
MraverageheaderParamsDict = _MraverageheaderParamsDictNoTag | MraverageheaderParamsDictTagged
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def mraverageheader_config(
|
|
65
|
+
key: str,
|
|
66
|
+
value: str,
|
|
67
|
+
) -> MraverageheaderConfigParamsDictTagged:
|
|
68
|
+
"""
|
|
69
|
+
Build parameters.
|
|
70
|
+
|
|
71
|
+
Args:
|
|
72
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
73
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
74
|
+
Returns:
|
|
75
|
+
Parameter dictionary
|
|
76
|
+
"""
|
|
77
|
+
params = {
|
|
78
|
+
"@type": "config",
|
|
79
|
+
"key": key,
|
|
80
|
+
"value": value,
|
|
81
|
+
}
|
|
82
|
+
return params
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def mraverageheader_config_validate(
|
|
86
|
+
params: typing.Any,
|
|
87
|
+
) -> None:
|
|
88
|
+
"""
|
|
89
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
90
|
+
`MraverageheaderConfigParamsDict` object.
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
params: The parameters object to validate.
|
|
94
|
+
"""
|
|
95
|
+
if params is None or not isinstance(params, dict):
|
|
96
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
97
|
+
if params.get("key", None) is None:
|
|
98
|
+
raise StyxValidationError("`key` must not be None")
|
|
99
|
+
if not isinstance(params["key"], str):
|
|
100
|
+
raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
|
|
101
|
+
if params.get("value", None) is None:
|
|
102
|
+
raise StyxValidationError("`value` must not be None")
|
|
103
|
+
if not isinstance(params["value"], str):
|
|
104
|
+
raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def mraverageheader_config_cargs(
|
|
108
|
+
params: MraverageheaderConfigParamsDict,
|
|
109
|
+
execution: Execution,
|
|
110
|
+
) -> list[str]:
|
|
111
|
+
"""
|
|
112
|
+
Build command-line arguments from parameters.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
params: The parameters.
|
|
116
|
+
execution: The execution object for resolving input paths.
|
|
117
|
+
Returns:
|
|
118
|
+
Command-line arguments.
|
|
119
|
+
"""
|
|
120
|
+
cargs = []
|
|
121
|
+
cargs.append("-config")
|
|
122
|
+
cargs.append(params.get("key", None))
|
|
123
|
+
cargs.append(params.get("value", None))
|
|
124
|
+
return cargs
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class MraverageheaderOutputs(typing.NamedTuple):
|
|
128
|
+
"""
|
|
129
|
+
Output object returned when calling `MraverageheaderParamsDict(...)`.
|
|
130
|
+
"""
|
|
131
|
+
root: OutputPathType
|
|
132
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
133
|
+
output: OutputPathType
|
|
134
|
+
"""the output image"""
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def mraverageheader_params(
|
|
138
|
+
input_: list[InputPathType],
|
|
139
|
+
output: str,
|
|
140
|
+
padding: float | None = None,
|
|
141
|
+
resolution: str | None = None,
|
|
142
|
+
fill: bool = False,
|
|
143
|
+
datatype: str | None = None,
|
|
144
|
+
info: bool = False,
|
|
145
|
+
quiet: bool = False,
|
|
146
|
+
debug: bool = False,
|
|
147
|
+
force: bool = False,
|
|
148
|
+
nthreads: int | None = None,
|
|
149
|
+
config: list[MraverageheaderConfigParamsDict] | None = None,
|
|
150
|
+
help_: bool = False,
|
|
151
|
+
version: bool = False,
|
|
152
|
+
) -> MraverageheaderParamsDictTagged:
|
|
153
|
+
"""
|
|
154
|
+
Build parameters.
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
input_: the input image(s).
|
|
158
|
+
output: the output image.
|
|
159
|
+
padding: boundary box padding in voxels. Default: 0.
|
|
160
|
+
resolution: subsampling of template compared to smallest voxel size in\
|
|
161
|
+
any input image. Valid options are 'mean': unbiased but loss of\
|
|
162
|
+
resolution for individual images possible, and 'max': smallest voxel\
|
|
163
|
+
size of any input image defines the resolution. Default: mean.
|
|
164
|
+
fill: set the intensity in the first volume of the average space to 1.
|
|
165
|
+
datatype: specify output image data type. Valid choices are: float32,\
|
|
166
|
+
float32le, float32be, float64, float64le, float64be, int64, uint64,\
|
|
167
|
+
int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
|
|
168
|
+
int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
|
|
169
|
+
cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
|
|
170
|
+
int8, uint8, bit.
|
|
171
|
+
info: display information messages.
|
|
172
|
+
quiet: do not display information messages or progress status;\
|
|
173
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
174
|
+
environment variable to a non-empty string.
|
|
175
|
+
debug: display debugging messages.
|
|
176
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
177
|
+
input and output might cause unexpected behaviour).
|
|
178
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
179
|
+
(set to 0 to disable multi-threading).
|
|
180
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
181
|
+
help_: display this information page and exit.
|
|
182
|
+
version: display version information and exit.
|
|
183
|
+
Returns:
|
|
184
|
+
Parameter dictionary
|
|
185
|
+
"""
|
|
186
|
+
params = {
|
|
187
|
+
"@type": "mrtrix/mraverageheader",
|
|
188
|
+
"fill": fill,
|
|
189
|
+
"info": info,
|
|
190
|
+
"quiet": quiet,
|
|
191
|
+
"debug": debug,
|
|
192
|
+
"force": force,
|
|
193
|
+
"help": help_,
|
|
194
|
+
"version": version,
|
|
195
|
+
"input": input_,
|
|
196
|
+
"output": output,
|
|
197
|
+
}
|
|
198
|
+
if padding is not None:
|
|
199
|
+
params["padding"] = padding
|
|
200
|
+
if resolution is not None:
|
|
201
|
+
params["resolution"] = resolution
|
|
202
|
+
if datatype is not None:
|
|
203
|
+
params["datatype"] = datatype
|
|
204
|
+
if nthreads is not None:
|
|
205
|
+
params["nthreads"] = nthreads
|
|
206
|
+
if config is not None:
|
|
207
|
+
params["config"] = config
|
|
208
|
+
return params
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def mraverageheader_validate(
|
|
212
|
+
params: typing.Any,
|
|
213
|
+
) -> None:
|
|
214
|
+
"""
|
|
215
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
216
|
+
`MraverageheaderParamsDict` object.
|
|
217
|
+
|
|
218
|
+
Args:
|
|
219
|
+
params: The parameters object to validate.
|
|
220
|
+
"""
|
|
221
|
+
if params is None or not isinstance(params, dict):
|
|
222
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
223
|
+
if params.get("padding", None) is not None:
|
|
224
|
+
if not isinstance(params["padding"], (float, int)):
|
|
225
|
+
raise StyxValidationError(f'`padding` has the wrong type: Received `{type(params.get("padding", None))}` expected `float | None`')
|
|
226
|
+
if params.get("resolution", None) is not None:
|
|
227
|
+
if not isinstance(params["resolution"], str):
|
|
228
|
+
raise StyxValidationError(f'`resolution` has the wrong type: Received `{type(params.get("resolution", None))}` expected `str | None`')
|
|
229
|
+
if params.get("fill", False) is None:
|
|
230
|
+
raise StyxValidationError("`fill` must not be None")
|
|
231
|
+
if not isinstance(params["fill"], bool):
|
|
232
|
+
raise StyxValidationError(f'`fill` has the wrong type: Received `{type(params.get("fill", False))}` expected `bool`')
|
|
233
|
+
if params.get("datatype", None) is not None:
|
|
234
|
+
if not isinstance(params["datatype"], str):
|
|
235
|
+
raise StyxValidationError(f'`datatype` has the wrong type: Received `{type(params.get("datatype", None))}` expected `str | None`')
|
|
236
|
+
if params.get("info", False) is None:
|
|
237
|
+
raise StyxValidationError("`info` must not be None")
|
|
238
|
+
if not isinstance(params["info"], bool):
|
|
239
|
+
raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
|
|
240
|
+
if params.get("quiet", False) is None:
|
|
241
|
+
raise StyxValidationError("`quiet` must not be None")
|
|
242
|
+
if not isinstance(params["quiet"], bool):
|
|
243
|
+
raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
|
|
244
|
+
if params.get("debug", False) is None:
|
|
245
|
+
raise StyxValidationError("`debug` must not be None")
|
|
246
|
+
if not isinstance(params["debug"], bool):
|
|
247
|
+
raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
|
|
248
|
+
if params.get("force", False) is None:
|
|
249
|
+
raise StyxValidationError("`force` must not be None")
|
|
250
|
+
if not isinstance(params["force"], bool):
|
|
251
|
+
raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
|
|
252
|
+
if params.get("nthreads", None) is not None:
|
|
253
|
+
if not isinstance(params["nthreads"], int):
|
|
254
|
+
raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
|
|
255
|
+
if params.get("config", None) is not None:
|
|
256
|
+
if not isinstance(params["config"], list):
|
|
257
|
+
raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[MraverageheaderConfigParamsDict] | None`')
|
|
258
|
+
for e in params["config"]:
|
|
259
|
+
mraverageheader_config_validate(e)
|
|
260
|
+
if params.get("help", False) is None:
|
|
261
|
+
raise StyxValidationError("`help` must not be None")
|
|
262
|
+
if not isinstance(params["help"], bool):
|
|
263
|
+
raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
|
|
264
|
+
if params.get("version", False) is None:
|
|
265
|
+
raise StyxValidationError("`version` must not be None")
|
|
266
|
+
if not isinstance(params["version"], bool):
|
|
267
|
+
raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
|
|
268
|
+
if params.get("input", None) is None:
|
|
269
|
+
raise StyxValidationError("`input` must not be None")
|
|
270
|
+
if not isinstance(params["input"], list):
|
|
271
|
+
raise StyxValidationError(f'`input` has the wrong type: Received `{type(params.get("input", None))}` expected `list[InputPathType]`')
|
|
272
|
+
for e in params["input"]:
|
|
273
|
+
if not isinstance(e, (pathlib.Path, str)):
|
|
274
|
+
raise StyxValidationError(f'`input` has the wrong type: Received `{type(params.get("input", None))}` expected `list[InputPathType]`')
|
|
275
|
+
if params.get("output", None) is None:
|
|
276
|
+
raise StyxValidationError("`output` must not be None")
|
|
277
|
+
if not isinstance(params["output"], str):
|
|
278
|
+
raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `str`')
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
def mraverageheader_cargs(
|
|
282
|
+
params: MraverageheaderParamsDict,
|
|
283
|
+
execution: Execution,
|
|
284
|
+
) -> list[str]:
|
|
285
|
+
"""
|
|
286
|
+
Build command-line arguments from parameters.
|
|
287
|
+
|
|
288
|
+
Args:
|
|
289
|
+
params: The parameters.
|
|
290
|
+
execution: The execution object for resolving input paths.
|
|
291
|
+
Returns:
|
|
292
|
+
Command-line arguments.
|
|
293
|
+
"""
|
|
294
|
+
cargs = []
|
|
295
|
+
cargs.append("mraverageheader")
|
|
296
|
+
if params.get("padding", None) is not None:
|
|
297
|
+
cargs.extend([
|
|
298
|
+
"-padding",
|
|
299
|
+
str(params.get("padding", None))
|
|
300
|
+
])
|
|
301
|
+
if params.get("resolution", None) is not None:
|
|
302
|
+
cargs.extend([
|
|
303
|
+
"-resolution",
|
|
304
|
+
params.get("resolution", None)
|
|
305
|
+
])
|
|
306
|
+
if params.get("fill", False):
|
|
307
|
+
cargs.append("-fill")
|
|
308
|
+
if params.get("datatype", None) is not None:
|
|
309
|
+
cargs.extend([
|
|
310
|
+
"-datatype",
|
|
311
|
+
params.get("datatype", None)
|
|
312
|
+
])
|
|
313
|
+
if params.get("info", False):
|
|
314
|
+
cargs.append("-info")
|
|
315
|
+
if params.get("quiet", False):
|
|
316
|
+
cargs.append("-quiet")
|
|
317
|
+
if params.get("debug", False):
|
|
318
|
+
cargs.append("-debug")
|
|
319
|
+
if params.get("force", False):
|
|
320
|
+
cargs.append("-force")
|
|
321
|
+
if params.get("nthreads", None) is not None:
|
|
322
|
+
cargs.extend([
|
|
323
|
+
"-nthreads",
|
|
324
|
+
str(params.get("nthreads", None))
|
|
325
|
+
])
|
|
326
|
+
if params.get("config", None) is not None:
|
|
327
|
+
cargs.extend([a for c in [mraverageheader_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
328
|
+
if params.get("help", False):
|
|
329
|
+
cargs.append("-help")
|
|
330
|
+
if params.get("version", False):
|
|
331
|
+
cargs.append("-version")
|
|
332
|
+
cargs.extend([execution.input_file(f) for f in params.get("input", None)])
|
|
333
|
+
cargs.append(params.get("output", None))
|
|
334
|
+
return cargs
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
def mraverageheader_outputs(
|
|
338
|
+
params: MraverageheaderParamsDict,
|
|
339
|
+
execution: Execution,
|
|
340
|
+
) -> MraverageheaderOutputs:
|
|
341
|
+
"""
|
|
342
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
343
|
+
|
|
344
|
+
Args:
|
|
345
|
+
params: The parameters.
|
|
346
|
+
execution: The execution object for resolving input paths.
|
|
347
|
+
Returns:
|
|
348
|
+
Outputs object.
|
|
349
|
+
"""
|
|
350
|
+
ret = MraverageheaderOutputs(
|
|
351
|
+
root=execution.output_file("."),
|
|
352
|
+
output=execution.output_file(params.get("output", None)),
|
|
353
|
+
)
|
|
354
|
+
return ret
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def mraverageheader_execute(
|
|
358
|
+
params: MraverageheaderParamsDict,
|
|
359
|
+
runner: Runner | None = None,
|
|
360
|
+
) -> MraverageheaderOutputs:
|
|
361
|
+
"""
|
|
362
|
+
mraverageheader
|
|
363
|
+
|
|
364
|
+
Calculate the average (unbiased) coordinate space of all input images.
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
References:
|
|
369
|
+
|
|
370
|
+
.
|
|
371
|
+
|
|
372
|
+
Author: MRTrix3 Developers
|
|
373
|
+
|
|
374
|
+
URL: https://www.mrtrix.org/
|
|
375
|
+
|
|
376
|
+
Args:
|
|
377
|
+
params: The parameters.
|
|
378
|
+
runner: Command runner.
|
|
379
|
+
Returns:
|
|
380
|
+
NamedTuple of outputs (described in `MraverageheaderOutputs`).
|
|
381
|
+
"""
|
|
382
|
+
mraverageheader_validate(params)
|
|
383
|
+
runner = runner or get_global_runner()
|
|
384
|
+
execution = runner.start_execution(MRAVERAGEHEADER_METADATA)
|
|
385
|
+
params = execution.params(params)
|
|
386
|
+
cargs = mraverageheader_cargs(params, execution)
|
|
387
|
+
ret = mraverageheader_outputs(params, execution)
|
|
388
|
+
execution.run(cargs)
|
|
389
|
+
return ret
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
def mraverageheader(
|
|
393
|
+
input_: list[InputPathType],
|
|
394
|
+
output: str,
|
|
395
|
+
padding: float | None = None,
|
|
396
|
+
resolution: str | None = None,
|
|
397
|
+
fill: bool = False,
|
|
398
|
+
datatype: str | None = None,
|
|
399
|
+
info: bool = False,
|
|
400
|
+
quiet: bool = False,
|
|
401
|
+
debug: bool = False,
|
|
402
|
+
force: bool = False,
|
|
403
|
+
nthreads: int | None = None,
|
|
404
|
+
config: list[MraverageheaderConfigParamsDict] | None = None,
|
|
405
|
+
help_: bool = False,
|
|
406
|
+
version: bool = False,
|
|
407
|
+
runner: Runner | None = None,
|
|
408
|
+
) -> MraverageheaderOutputs:
|
|
409
|
+
"""
|
|
410
|
+
mraverageheader
|
|
411
|
+
|
|
412
|
+
Calculate the average (unbiased) coordinate space of all input images.
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
References:
|
|
417
|
+
|
|
418
|
+
.
|
|
419
|
+
|
|
420
|
+
Author: MRTrix3 Developers
|
|
421
|
+
|
|
422
|
+
URL: https://www.mrtrix.org/
|
|
423
|
+
|
|
424
|
+
Args:
|
|
425
|
+
input_: the input image(s).
|
|
426
|
+
output: the output image.
|
|
427
|
+
padding: boundary box padding in voxels. Default: 0.
|
|
428
|
+
resolution: subsampling of template compared to smallest voxel size in\
|
|
429
|
+
any input image. Valid options are 'mean': unbiased but loss of\
|
|
430
|
+
resolution for individual images possible, and 'max': smallest voxel\
|
|
431
|
+
size of any input image defines the resolution. Default: mean.
|
|
432
|
+
fill: set the intensity in the first volume of the average space to 1.
|
|
433
|
+
datatype: specify output image data type. Valid choices are: float32,\
|
|
434
|
+
float32le, float32be, float64, float64le, float64be, int64, uint64,\
|
|
435
|
+
int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
|
|
436
|
+
int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
|
|
437
|
+
cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
|
|
438
|
+
int8, uint8, bit.
|
|
439
|
+
info: display information messages.
|
|
440
|
+
quiet: do not display information messages or progress status;\
|
|
441
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
442
|
+
environment variable to a non-empty string.
|
|
443
|
+
debug: display debugging messages.
|
|
444
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
445
|
+
input and output might cause unexpected behaviour).
|
|
446
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
447
|
+
(set to 0 to disable multi-threading).
|
|
448
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
449
|
+
help_: display this information page and exit.
|
|
450
|
+
version: display version information and exit.
|
|
451
|
+
runner: Command runner.
|
|
452
|
+
Returns:
|
|
453
|
+
NamedTuple of outputs (described in `MraverageheaderOutputs`).
|
|
454
|
+
"""
|
|
455
|
+
params = mraverageheader_params(
|
|
456
|
+
padding=padding,
|
|
457
|
+
resolution=resolution,
|
|
458
|
+
fill=fill,
|
|
459
|
+
datatype=datatype,
|
|
460
|
+
info=info,
|
|
461
|
+
quiet=quiet,
|
|
462
|
+
debug=debug,
|
|
463
|
+
force=force,
|
|
464
|
+
nthreads=nthreads,
|
|
465
|
+
config=config,
|
|
466
|
+
help_=help_,
|
|
467
|
+
version=version,
|
|
468
|
+
input_=input_,
|
|
469
|
+
output=output,
|
|
470
|
+
)
|
|
471
|
+
return mraverageheader_execute(params, runner)
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
__all__ = [
|
|
475
|
+
"MRAVERAGEHEADER_METADATA",
|
|
476
|
+
"MraverageheaderConfigParamsDict",
|
|
477
|
+
"MraverageheaderConfigParamsDictTagged",
|
|
478
|
+
"MraverageheaderOutputs",
|
|
479
|
+
"MraverageheaderParamsDict",
|
|
480
|
+
"MraverageheaderParamsDictTagged",
|
|
481
|
+
"mraverageheader",
|
|
482
|
+
"mraverageheader_config",
|
|
483
|
+
"mraverageheader_execute",
|
|
484
|
+
"mraverageheader_params",
|
|
485
|
+
]
|