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,850 @@
|
|
|
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
|
+
FIXELCONVERT_METADATA = Metadata(
|
|
9
|
+
id="e14b8ead7201552625ae27a34473502808101400.boutiques",
|
|
10
|
+
name="fixelconvert",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
_FixelconvertConfigParamsDictNoTag = typing.TypedDict('_FixelconvertConfigParamsDictNoTag', {
|
|
17
|
+
"key": str,
|
|
18
|
+
"value": str,
|
|
19
|
+
})
|
|
20
|
+
FixelconvertConfigParamsDictTagged = typing.TypedDict('FixelconvertConfigParamsDictTagged', {
|
|
21
|
+
"@type": typing.Literal["config"],
|
|
22
|
+
"key": str,
|
|
23
|
+
"value": str,
|
|
24
|
+
})
|
|
25
|
+
FixelconvertConfigParamsDict = _FixelconvertConfigParamsDictNoTag | FixelconvertConfigParamsDictTagged
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_FixelconvertVariousStringParamsDictNoTag = typing.TypedDict('_FixelconvertVariousStringParamsDictNoTag', {
|
|
29
|
+
"obj": str,
|
|
30
|
+
})
|
|
31
|
+
FixelconvertVariousStringParamsDictTagged = typing.TypedDict('FixelconvertVariousStringParamsDictTagged', {
|
|
32
|
+
"@type": typing.Literal["VariousString"],
|
|
33
|
+
"obj": str,
|
|
34
|
+
})
|
|
35
|
+
FixelconvertVariousStringParamsDict = _FixelconvertVariousStringParamsDictNoTag | FixelconvertVariousStringParamsDictTagged
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
_FixelconvertVariousFileParamsDictNoTag = typing.TypedDict('_FixelconvertVariousFileParamsDictNoTag', {
|
|
39
|
+
"obj": InputPathType,
|
|
40
|
+
})
|
|
41
|
+
FixelconvertVariousFileParamsDictTagged = typing.TypedDict('FixelconvertVariousFileParamsDictTagged', {
|
|
42
|
+
"@type": typing.Literal["VariousFile"],
|
|
43
|
+
"obj": InputPathType,
|
|
44
|
+
})
|
|
45
|
+
FixelconvertVariousFileParamsDict = _FixelconvertVariousFileParamsDictNoTag | FixelconvertVariousFileParamsDictTagged
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
_FixelconvertVariousString1ParamsDictNoTag = typing.TypedDict('_FixelconvertVariousString1ParamsDictNoTag', {
|
|
49
|
+
"obj": str,
|
|
50
|
+
})
|
|
51
|
+
FixelconvertVariousString1ParamsDictTagged = typing.TypedDict('FixelconvertVariousString1ParamsDictTagged', {
|
|
52
|
+
"@type": typing.Literal["VariousString_1"],
|
|
53
|
+
"obj": str,
|
|
54
|
+
})
|
|
55
|
+
FixelconvertVariousString1ParamsDict = _FixelconvertVariousString1ParamsDictNoTag | FixelconvertVariousString1ParamsDictTagged
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
_FixelconvertVariousFile1ParamsDictNoTag = typing.TypedDict('_FixelconvertVariousFile1ParamsDictNoTag', {
|
|
59
|
+
"obj": InputPathType,
|
|
60
|
+
})
|
|
61
|
+
FixelconvertVariousFile1ParamsDictTagged = typing.TypedDict('FixelconvertVariousFile1ParamsDictTagged', {
|
|
62
|
+
"@type": typing.Literal["VariousFile_1"],
|
|
63
|
+
"obj": InputPathType,
|
|
64
|
+
})
|
|
65
|
+
FixelconvertVariousFile1ParamsDict = _FixelconvertVariousFile1ParamsDictNoTag | FixelconvertVariousFile1ParamsDictTagged
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
_FixelconvertParamsDictNoTag = typing.TypedDict('_FixelconvertParamsDictNoTag', {
|
|
69
|
+
"name": typing.NotRequired[str | None],
|
|
70
|
+
"nii": bool,
|
|
71
|
+
"out_size": bool,
|
|
72
|
+
"template": typing.NotRequired[InputPathType | None],
|
|
73
|
+
"value": typing.NotRequired[InputPathType | None],
|
|
74
|
+
"in_size": typing.NotRequired[InputPathType | None],
|
|
75
|
+
"info": bool,
|
|
76
|
+
"quiet": bool,
|
|
77
|
+
"debug": bool,
|
|
78
|
+
"force": bool,
|
|
79
|
+
"nthreads": typing.NotRequired[int | None],
|
|
80
|
+
"config": typing.NotRequired[list[FixelconvertConfigParamsDict] | None],
|
|
81
|
+
"help": bool,
|
|
82
|
+
"version": bool,
|
|
83
|
+
"fixel_in": typing.Union[FixelconvertVariousStringParamsDictTagged, FixelconvertVariousFileParamsDictTagged],
|
|
84
|
+
"fixel_out": typing.Union[FixelconvertVariousString1ParamsDictTagged, FixelconvertVariousFile1ParamsDictTagged],
|
|
85
|
+
})
|
|
86
|
+
FixelconvertParamsDictTagged = typing.TypedDict('FixelconvertParamsDictTagged', {
|
|
87
|
+
"@type": typing.Literal["mrtrix/fixelconvert"],
|
|
88
|
+
"name": typing.NotRequired[str | None],
|
|
89
|
+
"nii": bool,
|
|
90
|
+
"out_size": bool,
|
|
91
|
+
"template": typing.NotRequired[InputPathType | None],
|
|
92
|
+
"value": typing.NotRequired[InputPathType | None],
|
|
93
|
+
"in_size": typing.NotRequired[InputPathType | None],
|
|
94
|
+
"info": bool,
|
|
95
|
+
"quiet": bool,
|
|
96
|
+
"debug": bool,
|
|
97
|
+
"force": bool,
|
|
98
|
+
"nthreads": typing.NotRequired[int | None],
|
|
99
|
+
"config": typing.NotRequired[list[FixelconvertConfigParamsDict] | None],
|
|
100
|
+
"help": bool,
|
|
101
|
+
"version": bool,
|
|
102
|
+
"fixel_in": typing.Union[FixelconvertVariousStringParamsDictTagged, FixelconvertVariousFileParamsDictTagged],
|
|
103
|
+
"fixel_out": typing.Union[FixelconvertVariousString1ParamsDictTagged, FixelconvertVariousFile1ParamsDictTagged],
|
|
104
|
+
})
|
|
105
|
+
FixelconvertParamsDict = _FixelconvertParamsDictNoTag | FixelconvertParamsDictTagged
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def fixelconvert_fixel_in_cargs_dyn_fn(
|
|
109
|
+
t: str,
|
|
110
|
+
) -> typing.Any:
|
|
111
|
+
"""
|
|
112
|
+
Get build cargs function by command type.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
t: Command type.
|
|
116
|
+
Returns:
|
|
117
|
+
Build cargs function.
|
|
118
|
+
"""
|
|
119
|
+
return {
|
|
120
|
+
"VariousString": fixelconvert_various_string_cargs,
|
|
121
|
+
"VariousFile": fixelconvert_various_file_cargs,
|
|
122
|
+
}.get(t)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def fixelconvert_fixel_in_validate_dyn_fn(
|
|
126
|
+
t: str,
|
|
127
|
+
) -> typing.Any:
|
|
128
|
+
"""
|
|
129
|
+
Get validate params function by command type.
|
|
130
|
+
|
|
131
|
+
Args:
|
|
132
|
+
t: Command type.
|
|
133
|
+
Returns:
|
|
134
|
+
Validate params function.
|
|
135
|
+
"""
|
|
136
|
+
return {
|
|
137
|
+
"VariousString": fixelconvert_various_string_validate,
|
|
138
|
+
"VariousFile": fixelconvert_various_file_validate,
|
|
139
|
+
}.get(t)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def fixelconvert_fixel_out_cargs_dyn_fn(
|
|
143
|
+
t: str,
|
|
144
|
+
) -> typing.Any:
|
|
145
|
+
"""
|
|
146
|
+
Get build cargs function by command type.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
t: Command type.
|
|
150
|
+
Returns:
|
|
151
|
+
Build cargs function.
|
|
152
|
+
"""
|
|
153
|
+
return {
|
|
154
|
+
"VariousString_1": fixelconvert_various_string_1_cargs,
|
|
155
|
+
"VariousFile_1": fixelconvert_various_file_1_cargs,
|
|
156
|
+
}.get(t)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def fixelconvert_fixel_out_validate_dyn_fn(
|
|
160
|
+
t: str,
|
|
161
|
+
) -> typing.Any:
|
|
162
|
+
"""
|
|
163
|
+
Get validate params function by command type.
|
|
164
|
+
|
|
165
|
+
Args:
|
|
166
|
+
t: Command type.
|
|
167
|
+
Returns:
|
|
168
|
+
Validate params function.
|
|
169
|
+
"""
|
|
170
|
+
return {
|
|
171
|
+
"VariousString_1": fixelconvert_various_string_1_validate,
|
|
172
|
+
"VariousFile_1": fixelconvert_various_file_1_validate,
|
|
173
|
+
}.get(t)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def fixelconvert_config(
|
|
177
|
+
key: str,
|
|
178
|
+
value: str,
|
|
179
|
+
) -> FixelconvertConfigParamsDictTagged:
|
|
180
|
+
"""
|
|
181
|
+
Build parameters.
|
|
182
|
+
|
|
183
|
+
Args:
|
|
184
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
185
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
186
|
+
Returns:
|
|
187
|
+
Parameter dictionary
|
|
188
|
+
"""
|
|
189
|
+
params = {
|
|
190
|
+
"@type": "config",
|
|
191
|
+
"key": key,
|
|
192
|
+
"value": value,
|
|
193
|
+
}
|
|
194
|
+
return params
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def fixelconvert_config_validate(
|
|
198
|
+
params: typing.Any,
|
|
199
|
+
) -> None:
|
|
200
|
+
"""
|
|
201
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
202
|
+
`FixelconvertConfigParamsDict` object.
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
params: The parameters object to validate.
|
|
206
|
+
"""
|
|
207
|
+
if params is None or not isinstance(params, dict):
|
|
208
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
209
|
+
if params.get("key", None) is None:
|
|
210
|
+
raise StyxValidationError("`key` must not be None")
|
|
211
|
+
if not isinstance(params["key"], str):
|
|
212
|
+
raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
|
|
213
|
+
if params.get("value", None) is None:
|
|
214
|
+
raise StyxValidationError("`value` must not be None")
|
|
215
|
+
if not isinstance(params["value"], str):
|
|
216
|
+
raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
def fixelconvert_config_cargs(
|
|
220
|
+
params: FixelconvertConfigParamsDict,
|
|
221
|
+
execution: Execution,
|
|
222
|
+
) -> list[str]:
|
|
223
|
+
"""
|
|
224
|
+
Build command-line arguments from parameters.
|
|
225
|
+
|
|
226
|
+
Args:
|
|
227
|
+
params: The parameters.
|
|
228
|
+
execution: The execution object for resolving input paths.
|
|
229
|
+
Returns:
|
|
230
|
+
Command-line arguments.
|
|
231
|
+
"""
|
|
232
|
+
cargs = []
|
|
233
|
+
cargs.append("-config")
|
|
234
|
+
cargs.append(params.get("key", None))
|
|
235
|
+
cargs.append(params.get("value", None))
|
|
236
|
+
return cargs
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def fixelconvert_various_string(
|
|
240
|
+
obj: str,
|
|
241
|
+
) -> FixelconvertVariousStringParamsDictTagged:
|
|
242
|
+
"""
|
|
243
|
+
Build parameters.
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
obj: String object.
|
|
247
|
+
Returns:
|
|
248
|
+
Parameter dictionary
|
|
249
|
+
"""
|
|
250
|
+
params = {
|
|
251
|
+
"@type": "VariousString",
|
|
252
|
+
"obj": obj,
|
|
253
|
+
}
|
|
254
|
+
return params
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def fixelconvert_various_string_validate(
|
|
258
|
+
params: typing.Any,
|
|
259
|
+
) -> None:
|
|
260
|
+
"""
|
|
261
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
262
|
+
`FixelconvertVariousStringParamsDict` object.
|
|
263
|
+
|
|
264
|
+
Args:
|
|
265
|
+
params: The parameters object to validate.
|
|
266
|
+
"""
|
|
267
|
+
if params is None or not isinstance(params, dict):
|
|
268
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
269
|
+
if params.get("obj", None) is None:
|
|
270
|
+
raise StyxValidationError("`obj` must not be None")
|
|
271
|
+
if not isinstance(params["obj"], str):
|
|
272
|
+
raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `str`')
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
def fixelconvert_various_string_cargs(
|
|
276
|
+
params: FixelconvertVariousStringParamsDict,
|
|
277
|
+
execution: Execution,
|
|
278
|
+
) -> list[str]:
|
|
279
|
+
"""
|
|
280
|
+
Build command-line arguments from parameters.
|
|
281
|
+
|
|
282
|
+
Args:
|
|
283
|
+
params: The parameters.
|
|
284
|
+
execution: The execution object for resolving input paths.
|
|
285
|
+
Returns:
|
|
286
|
+
Command-line arguments.
|
|
287
|
+
"""
|
|
288
|
+
cargs = []
|
|
289
|
+
cargs.append(params.get("obj", None))
|
|
290
|
+
return cargs
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
def fixelconvert_various_file(
|
|
294
|
+
obj: InputPathType,
|
|
295
|
+
) -> FixelconvertVariousFileParamsDictTagged:
|
|
296
|
+
"""
|
|
297
|
+
Build parameters.
|
|
298
|
+
|
|
299
|
+
Args:
|
|
300
|
+
obj: File object.
|
|
301
|
+
Returns:
|
|
302
|
+
Parameter dictionary
|
|
303
|
+
"""
|
|
304
|
+
params = {
|
|
305
|
+
"@type": "VariousFile",
|
|
306
|
+
"obj": obj,
|
|
307
|
+
}
|
|
308
|
+
return params
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
def fixelconvert_various_file_validate(
|
|
312
|
+
params: typing.Any,
|
|
313
|
+
) -> None:
|
|
314
|
+
"""
|
|
315
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
316
|
+
`FixelconvertVariousFileParamsDict` object.
|
|
317
|
+
|
|
318
|
+
Args:
|
|
319
|
+
params: The parameters object to validate.
|
|
320
|
+
"""
|
|
321
|
+
if params is None or not isinstance(params, dict):
|
|
322
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
323
|
+
if params.get("obj", None) is None:
|
|
324
|
+
raise StyxValidationError("`obj` must not be None")
|
|
325
|
+
if not isinstance(params["obj"], (pathlib.Path, str)):
|
|
326
|
+
raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `InputPathType`')
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def fixelconvert_various_file_cargs(
|
|
330
|
+
params: FixelconvertVariousFileParamsDict,
|
|
331
|
+
execution: Execution,
|
|
332
|
+
) -> list[str]:
|
|
333
|
+
"""
|
|
334
|
+
Build command-line arguments from parameters.
|
|
335
|
+
|
|
336
|
+
Args:
|
|
337
|
+
params: The parameters.
|
|
338
|
+
execution: The execution object for resolving input paths.
|
|
339
|
+
Returns:
|
|
340
|
+
Command-line arguments.
|
|
341
|
+
"""
|
|
342
|
+
cargs = []
|
|
343
|
+
cargs.append(execution.input_file(params.get("obj", None)))
|
|
344
|
+
return cargs
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
def fixelconvert_various_string_1(
|
|
348
|
+
obj: str,
|
|
349
|
+
) -> FixelconvertVariousString1ParamsDictTagged:
|
|
350
|
+
"""
|
|
351
|
+
Build parameters.
|
|
352
|
+
|
|
353
|
+
Args:
|
|
354
|
+
obj: String object.
|
|
355
|
+
Returns:
|
|
356
|
+
Parameter dictionary
|
|
357
|
+
"""
|
|
358
|
+
params = {
|
|
359
|
+
"@type": "VariousString_1",
|
|
360
|
+
"obj": obj,
|
|
361
|
+
}
|
|
362
|
+
return params
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
def fixelconvert_various_string_1_validate(
|
|
366
|
+
params: typing.Any,
|
|
367
|
+
) -> None:
|
|
368
|
+
"""
|
|
369
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
370
|
+
`FixelconvertVariousString1ParamsDict` object.
|
|
371
|
+
|
|
372
|
+
Args:
|
|
373
|
+
params: The parameters object to validate.
|
|
374
|
+
"""
|
|
375
|
+
if params is None or not isinstance(params, dict):
|
|
376
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
377
|
+
if params.get("obj", None) is None:
|
|
378
|
+
raise StyxValidationError("`obj` must not be None")
|
|
379
|
+
if not isinstance(params["obj"], str):
|
|
380
|
+
raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `str`')
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
def fixelconvert_various_string_1_cargs(
|
|
384
|
+
params: FixelconvertVariousString1ParamsDict,
|
|
385
|
+
execution: Execution,
|
|
386
|
+
) -> list[str]:
|
|
387
|
+
"""
|
|
388
|
+
Build command-line arguments from parameters.
|
|
389
|
+
|
|
390
|
+
Args:
|
|
391
|
+
params: The parameters.
|
|
392
|
+
execution: The execution object for resolving input paths.
|
|
393
|
+
Returns:
|
|
394
|
+
Command-line arguments.
|
|
395
|
+
"""
|
|
396
|
+
cargs = []
|
|
397
|
+
cargs.append(params.get("obj", None))
|
|
398
|
+
return cargs
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
def fixelconvert_various_file_1(
|
|
402
|
+
obj: InputPathType,
|
|
403
|
+
) -> FixelconvertVariousFile1ParamsDictTagged:
|
|
404
|
+
"""
|
|
405
|
+
Build parameters.
|
|
406
|
+
|
|
407
|
+
Args:
|
|
408
|
+
obj: File object.
|
|
409
|
+
Returns:
|
|
410
|
+
Parameter dictionary
|
|
411
|
+
"""
|
|
412
|
+
params = {
|
|
413
|
+
"@type": "VariousFile_1",
|
|
414
|
+
"obj": obj,
|
|
415
|
+
}
|
|
416
|
+
return params
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
def fixelconvert_various_file_1_validate(
|
|
420
|
+
params: typing.Any,
|
|
421
|
+
) -> None:
|
|
422
|
+
"""
|
|
423
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
424
|
+
`FixelconvertVariousFile1ParamsDict` object.
|
|
425
|
+
|
|
426
|
+
Args:
|
|
427
|
+
params: The parameters object to validate.
|
|
428
|
+
"""
|
|
429
|
+
if params is None or not isinstance(params, dict):
|
|
430
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
431
|
+
if params.get("obj", None) is None:
|
|
432
|
+
raise StyxValidationError("`obj` must not be None")
|
|
433
|
+
if not isinstance(params["obj"], (pathlib.Path, str)):
|
|
434
|
+
raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `InputPathType`')
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
def fixelconvert_various_file_1_cargs(
|
|
438
|
+
params: FixelconvertVariousFile1ParamsDict,
|
|
439
|
+
execution: Execution,
|
|
440
|
+
) -> list[str]:
|
|
441
|
+
"""
|
|
442
|
+
Build command-line arguments from parameters.
|
|
443
|
+
|
|
444
|
+
Args:
|
|
445
|
+
params: The parameters.
|
|
446
|
+
execution: The execution object for resolving input paths.
|
|
447
|
+
Returns:
|
|
448
|
+
Command-line arguments.
|
|
449
|
+
"""
|
|
450
|
+
cargs = []
|
|
451
|
+
cargs.append(execution.input_file(params.get("obj", None)))
|
|
452
|
+
return cargs
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
class FixelconvertOutputs(typing.NamedTuple):
|
|
456
|
+
"""
|
|
457
|
+
Output object returned when calling `FixelconvertParamsDict(...)`.
|
|
458
|
+
"""
|
|
459
|
+
root: OutputPathType
|
|
460
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
def fixelconvert_params(
|
|
464
|
+
fixel_in: typing.Union[FixelconvertVariousStringParamsDictTagged, FixelconvertVariousFileParamsDictTagged],
|
|
465
|
+
fixel_out: typing.Union[FixelconvertVariousString1ParamsDictTagged, FixelconvertVariousFile1ParamsDictTagged],
|
|
466
|
+
name: str | None = None,
|
|
467
|
+
nii: bool = False,
|
|
468
|
+
out_size: bool = False,
|
|
469
|
+
template: InputPathType | None = None,
|
|
470
|
+
value: InputPathType | None = None,
|
|
471
|
+
in_size: InputPathType | None = None,
|
|
472
|
+
info: bool = False,
|
|
473
|
+
quiet: bool = False,
|
|
474
|
+
debug: bool = False,
|
|
475
|
+
force: bool = False,
|
|
476
|
+
nthreads: int | None = None,
|
|
477
|
+
config: list[FixelconvertConfigParamsDict] | None = None,
|
|
478
|
+
help_: bool = False,
|
|
479
|
+
version: bool = False,
|
|
480
|
+
) -> FixelconvertParamsDictTagged:
|
|
481
|
+
"""
|
|
482
|
+
Build parameters.
|
|
483
|
+
|
|
484
|
+
Args:
|
|
485
|
+
fixel_in: the input fixel file / directory.
|
|
486
|
+
fixel_out: the output fixel file / directory.
|
|
487
|
+
name: assign a different name to the value field output (Default:\
|
|
488
|
+
value). Do not include the file extension.
|
|
489
|
+
nii: output the index, directions and data file in NIfTI format instead\
|
|
490
|
+
of .mif.
|
|
491
|
+
out_size: also output the 'size' field from the old format.
|
|
492
|
+
template: specify an existing fixel directory (in the new format) to\
|
|
493
|
+
which the new output should conform.
|
|
494
|
+
value: nominate the data file to import to the 'value' field in the old\
|
|
495
|
+
format.
|
|
496
|
+
in_size: import data for the 'size' field in the old format.
|
|
497
|
+
info: display information messages.
|
|
498
|
+
quiet: do not display information messages or progress status;\
|
|
499
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
500
|
+
environment variable to a non-empty string.
|
|
501
|
+
debug: display debugging messages.
|
|
502
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
503
|
+
input and output might cause unexpected behaviour).
|
|
504
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
505
|
+
(set to 0 to disable multi-threading).
|
|
506
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
507
|
+
help_: display this information page and exit.
|
|
508
|
+
version: display version information and exit.
|
|
509
|
+
Returns:
|
|
510
|
+
Parameter dictionary
|
|
511
|
+
"""
|
|
512
|
+
params = {
|
|
513
|
+
"@type": "mrtrix/fixelconvert",
|
|
514
|
+
"nii": nii,
|
|
515
|
+
"out_size": out_size,
|
|
516
|
+
"info": info,
|
|
517
|
+
"quiet": quiet,
|
|
518
|
+
"debug": debug,
|
|
519
|
+
"force": force,
|
|
520
|
+
"help": help_,
|
|
521
|
+
"version": version,
|
|
522
|
+
"fixel_in": fixel_in,
|
|
523
|
+
"fixel_out": fixel_out,
|
|
524
|
+
}
|
|
525
|
+
if name is not None:
|
|
526
|
+
params["name"] = name
|
|
527
|
+
if template is not None:
|
|
528
|
+
params["template"] = template
|
|
529
|
+
if value is not None:
|
|
530
|
+
params["value"] = value
|
|
531
|
+
if in_size is not None:
|
|
532
|
+
params["in_size"] = in_size
|
|
533
|
+
if nthreads is not None:
|
|
534
|
+
params["nthreads"] = nthreads
|
|
535
|
+
if config is not None:
|
|
536
|
+
params["config"] = config
|
|
537
|
+
return params
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
def fixelconvert_validate(
|
|
541
|
+
params: typing.Any,
|
|
542
|
+
) -> None:
|
|
543
|
+
"""
|
|
544
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
545
|
+
`FixelconvertParamsDict` object.
|
|
546
|
+
|
|
547
|
+
Args:
|
|
548
|
+
params: The parameters object to validate.
|
|
549
|
+
"""
|
|
550
|
+
if params is None or not isinstance(params, dict):
|
|
551
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
552
|
+
if params.get("name", None) is not None:
|
|
553
|
+
if not isinstance(params["name"], str):
|
|
554
|
+
raise StyxValidationError(f'`name` has the wrong type: Received `{type(params.get("name", None))}` expected `str | None`')
|
|
555
|
+
if params.get("nii", False) is None:
|
|
556
|
+
raise StyxValidationError("`nii` must not be None")
|
|
557
|
+
if not isinstance(params["nii"], bool):
|
|
558
|
+
raise StyxValidationError(f'`nii` has the wrong type: Received `{type(params.get("nii", False))}` expected `bool`')
|
|
559
|
+
if params.get("out_size", False) is None:
|
|
560
|
+
raise StyxValidationError("`out_size` must not be None")
|
|
561
|
+
if not isinstance(params["out_size"], bool):
|
|
562
|
+
raise StyxValidationError(f'`out_size` has the wrong type: Received `{type(params.get("out_size", False))}` expected `bool`')
|
|
563
|
+
if params.get("template", None) is not None:
|
|
564
|
+
if not isinstance(params["template"], (pathlib.Path, str)):
|
|
565
|
+
raise StyxValidationError(f'`template` has the wrong type: Received `{type(params.get("template", None))}` expected `InputPathType | None`')
|
|
566
|
+
if params.get("value", None) is not None:
|
|
567
|
+
if not isinstance(params["value"], (pathlib.Path, str)):
|
|
568
|
+
raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `InputPathType | None`')
|
|
569
|
+
if params.get("in_size", None) is not None:
|
|
570
|
+
if not isinstance(params["in_size"], (pathlib.Path, str)):
|
|
571
|
+
raise StyxValidationError(f'`in_size` has the wrong type: Received `{type(params.get("in_size", None))}` expected `InputPathType | None`')
|
|
572
|
+
if params.get("info", False) is None:
|
|
573
|
+
raise StyxValidationError("`info` must not be None")
|
|
574
|
+
if not isinstance(params["info"], bool):
|
|
575
|
+
raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
|
|
576
|
+
if params.get("quiet", False) is None:
|
|
577
|
+
raise StyxValidationError("`quiet` must not be None")
|
|
578
|
+
if not isinstance(params["quiet"], bool):
|
|
579
|
+
raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
|
|
580
|
+
if params.get("debug", False) is None:
|
|
581
|
+
raise StyxValidationError("`debug` must not be None")
|
|
582
|
+
if not isinstance(params["debug"], bool):
|
|
583
|
+
raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
|
|
584
|
+
if params.get("force", False) is None:
|
|
585
|
+
raise StyxValidationError("`force` must not be None")
|
|
586
|
+
if not isinstance(params["force"], bool):
|
|
587
|
+
raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
|
|
588
|
+
if params.get("nthreads", None) is not None:
|
|
589
|
+
if not isinstance(params["nthreads"], int):
|
|
590
|
+
raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
|
|
591
|
+
if params.get("config", None) is not None:
|
|
592
|
+
if not isinstance(params["config"], list):
|
|
593
|
+
raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[FixelconvertConfigParamsDict] | None`')
|
|
594
|
+
for e in params["config"]:
|
|
595
|
+
fixelconvert_config_validate(e)
|
|
596
|
+
if params.get("help", False) is None:
|
|
597
|
+
raise StyxValidationError("`help` must not be None")
|
|
598
|
+
if not isinstance(params["help"], bool):
|
|
599
|
+
raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
|
|
600
|
+
if params.get("version", False) is None:
|
|
601
|
+
raise StyxValidationError("`version` must not be None")
|
|
602
|
+
if not isinstance(params["version"], bool):
|
|
603
|
+
raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
|
|
604
|
+
if params.get("fixel_in", None) is None:
|
|
605
|
+
raise StyxValidationError("`fixel_in` must not be None")
|
|
606
|
+
if not isinstance(params["fixel_in"], dict):
|
|
607
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params["fixel_in"])}\'')
|
|
608
|
+
if "@type" not in params["fixel_in"]:
|
|
609
|
+
raise StyxValidationError("Params object is missing `@type`")
|
|
610
|
+
if params["fixel_in"]["@type"] not in ["VariousString", "VariousFile"]:
|
|
611
|
+
raise StyxValidationError("Parameter `fixel_in`s `@type` must be one of [\"VariousString\", \"VariousFile\"]")
|
|
612
|
+
fixelconvert_fixel_in_validate_dyn_fn(params["fixel_in"]["@type"])(params["fixel_in"])
|
|
613
|
+
if params.get("fixel_out", None) is None:
|
|
614
|
+
raise StyxValidationError("`fixel_out` must not be None")
|
|
615
|
+
if not isinstance(params["fixel_out"], dict):
|
|
616
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params["fixel_out"])}\'')
|
|
617
|
+
if "@type" not in params["fixel_out"]:
|
|
618
|
+
raise StyxValidationError("Params object is missing `@type`")
|
|
619
|
+
if params["fixel_out"]["@type"] not in ["VariousString_1", "VariousFile_1"]:
|
|
620
|
+
raise StyxValidationError("Parameter `fixel_out`s `@type` must be one of [\"VariousString_1\", \"VariousFile_1\"]")
|
|
621
|
+
fixelconvert_fixel_out_validate_dyn_fn(params["fixel_out"]["@type"])(params["fixel_out"])
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
def fixelconvert_cargs(
|
|
625
|
+
params: FixelconvertParamsDict,
|
|
626
|
+
execution: Execution,
|
|
627
|
+
) -> list[str]:
|
|
628
|
+
"""
|
|
629
|
+
Build command-line arguments from parameters.
|
|
630
|
+
|
|
631
|
+
Args:
|
|
632
|
+
params: The parameters.
|
|
633
|
+
execution: The execution object for resolving input paths.
|
|
634
|
+
Returns:
|
|
635
|
+
Command-line arguments.
|
|
636
|
+
"""
|
|
637
|
+
cargs = []
|
|
638
|
+
cargs.append("fixelconvert")
|
|
639
|
+
if params.get("name", None) is not None:
|
|
640
|
+
cargs.extend([
|
|
641
|
+
"-name",
|
|
642
|
+
params.get("name", None)
|
|
643
|
+
])
|
|
644
|
+
if params.get("nii", False):
|
|
645
|
+
cargs.append("-nii")
|
|
646
|
+
if params.get("out_size", False):
|
|
647
|
+
cargs.append("-out_size")
|
|
648
|
+
if params.get("template", None) is not None:
|
|
649
|
+
cargs.extend([
|
|
650
|
+
"-template",
|
|
651
|
+
execution.input_file(params.get("template", None))
|
|
652
|
+
])
|
|
653
|
+
if params.get("value", None) is not None:
|
|
654
|
+
cargs.extend([
|
|
655
|
+
"-value",
|
|
656
|
+
execution.input_file(params.get("value", None))
|
|
657
|
+
])
|
|
658
|
+
if params.get("in_size", None) is not None:
|
|
659
|
+
cargs.extend([
|
|
660
|
+
"-in_size",
|
|
661
|
+
execution.input_file(params.get("in_size", None))
|
|
662
|
+
])
|
|
663
|
+
if params.get("info", False):
|
|
664
|
+
cargs.append("-info")
|
|
665
|
+
if params.get("quiet", False):
|
|
666
|
+
cargs.append("-quiet")
|
|
667
|
+
if params.get("debug", False):
|
|
668
|
+
cargs.append("-debug")
|
|
669
|
+
if params.get("force", False):
|
|
670
|
+
cargs.append("-force")
|
|
671
|
+
if params.get("nthreads", None) is not None:
|
|
672
|
+
cargs.extend([
|
|
673
|
+
"-nthreads",
|
|
674
|
+
str(params.get("nthreads", None))
|
|
675
|
+
])
|
|
676
|
+
if params.get("config", None) is not None:
|
|
677
|
+
cargs.extend([a for c in [fixelconvert_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
678
|
+
if params.get("help", False):
|
|
679
|
+
cargs.append("-help")
|
|
680
|
+
if params.get("version", False):
|
|
681
|
+
cargs.append("-version")
|
|
682
|
+
cargs.extend(fixelconvert_fixel_in_cargs_dyn_fn(params.get("fixel_in", None)["@type"])(params.get("fixel_in", None), execution))
|
|
683
|
+
cargs.extend(fixelconvert_fixel_out_cargs_dyn_fn(params.get("fixel_out", None)["@type"])(params.get("fixel_out", None), execution))
|
|
684
|
+
return cargs
|
|
685
|
+
|
|
686
|
+
|
|
687
|
+
def fixelconvert_outputs(
|
|
688
|
+
params: FixelconvertParamsDict,
|
|
689
|
+
execution: Execution,
|
|
690
|
+
) -> FixelconvertOutputs:
|
|
691
|
+
"""
|
|
692
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
693
|
+
|
|
694
|
+
Args:
|
|
695
|
+
params: The parameters.
|
|
696
|
+
execution: The execution object for resolving input paths.
|
|
697
|
+
Returns:
|
|
698
|
+
Outputs object.
|
|
699
|
+
"""
|
|
700
|
+
ret = FixelconvertOutputs(
|
|
701
|
+
root=execution.output_file("."),
|
|
702
|
+
)
|
|
703
|
+
return ret
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
def fixelconvert_execute(
|
|
707
|
+
params: FixelconvertParamsDict,
|
|
708
|
+
runner: Runner | None = None,
|
|
709
|
+
) -> FixelconvertOutputs:
|
|
710
|
+
"""
|
|
711
|
+
fixelconvert
|
|
712
|
+
|
|
713
|
+
Convert between the old format fixel image (.msf / .msh) and the new fixel
|
|
714
|
+
directory format.
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
References:
|
|
719
|
+
|
|
720
|
+
.
|
|
721
|
+
|
|
722
|
+
Author: MRTrix3 Developers
|
|
723
|
+
|
|
724
|
+
URL: https://www.mrtrix.org/
|
|
725
|
+
|
|
726
|
+
Args:
|
|
727
|
+
params: The parameters.
|
|
728
|
+
runner: Command runner.
|
|
729
|
+
Returns:
|
|
730
|
+
NamedTuple of outputs (described in `FixelconvertOutputs`).
|
|
731
|
+
"""
|
|
732
|
+
fixelconvert_validate(params)
|
|
733
|
+
runner = runner or get_global_runner()
|
|
734
|
+
execution = runner.start_execution(FIXELCONVERT_METADATA)
|
|
735
|
+
params = execution.params(params)
|
|
736
|
+
cargs = fixelconvert_cargs(params, execution)
|
|
737
|
+
ret = fixelconvert_outputs(params, execution)
|
|
738
|
+
execution.run(cargs)
|
|
739
|
+
return ret
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
def fixelconvert(
|
|
743
|
+
fixel_in: typing.Union[FixelconvertVariousStringParamsDictTagged, FixelconvertVariousFileParamsDictTagged],
|
|
744
|
+
fixel_out: typing.Union[FixelconvertVariousString1ParamsDictTagged, FixelconvertVariousFile1ParamsDictTagged],
|
|
745
|
+
name: str | None = None,
|
|
746
|
+
nii: bool = False,
|
|
747
|
+
out_size: bool = False,
|
|
748
|
+
template: InputPathType | None = None,
|
|
749
|
+
value: InputPathType | None = None,
|
|
750
|
+
in_size: InputPathType | None = None,
|
|
751
|
+
info: bool = False,
|
|
752
|
+
quiet: bool = False,
|
|
753
|
+
debug: bool = False,
|
|
754
|
+
force: bool = False,
|
|
755
|
+
nthreads: int | None = None,
|
|
756
|
+
config: list[FixelconvertConfigParamsDict] | None = None,
|
|
757
|
+
help_: bool = False,
|
|
758
|
+
version: bool = False,
|
|
759
|
+
runner: Runner | None = None,
|
|
760
|
+
) -> FixelconvertOutputs:
|
|
761
|
+
"""
|
|
762
|
+
fixelconvert
|
|
763
|
+
|
|
764
|
+
Convert between the old format fixel image (.msf / .msh) and the new fixel
|
|
765
|
+
directory format.
|
|
766
|
+
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
References:
|
|
770
|
+
|
|
771
|
+
.
|
|
772
|
+
|
|
773
|
+
Author: MRTrix3 Developers
|
|
774
|
+
|
|
775
|
+
URL: https://www.mrtrix.org/
|
|
776
|
+
|
|
777
|
+
Args:
|
|
778
|
+
fixel_in: the input fixel file / directory.
|
|
779
|
+
fixel_out: the output fixel file / directory.
|
|
780
|
+
name: assign a different name to the value field output (Default:\
|
|
781
|
+
value). Do not include the file extension.
|
|
782
|
+
nii: output the index, directions and data file in NIfTI format instead\
|
|
783
|
+
of .mif.
|
|
784
|
+
out_size: also output the 'size' field from the old format.
|
|
785
|
+
template: specify an existing fixel directory (in the new format) to\
|
|
786
|
+
which the new output should conform.
|
|
787
|
+
value: nominate the data file to import to the 'value' field in the old\
|
|
788
|
+
format.
|
|
789
|
+
in_size: import data for the 'size' field in the old format.
|
|
790
|
+
info: display information messages.
|
|
791
|
+
quiet: do not display information messages or progress status;\
|
|
792
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
793
|
+
environment variable to a non-empty string.
|
|
794
|
+
debug: display debugging messages.
|
|
795
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
796
|
+
input and output might cause unexpected behaviour).
|
|
797
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
798
|
+
(set to 0 to disable multi-threading).
|
|
799
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
800
|
+
help_: display this information page and exit.
|
|
801
|
+
version: display version information and exit.
|
|
802
|
+
runner: Command runner.
|
|
803
|
+
Returns:
|
|
804
|
+
NamedTuple of outputs (described in `FixelconvertOutputs`).
|
|
805
|
+
"""
|
|
806
|
+
params = fixelconvert_params(
|
|
807
|
+
name=name,
|
|
808
|
+
nii=nii,
|
|
809
|
+
out_size=out_size,
|
|
810
|
+
template=template,
|
|
811
|
+
value=value,
|
|
812
|
+
in_size=in_size,
|
|
813
|
+
info=info,
|
|
814
|
+
quiet=quiet,
|
|
815
|
+
debug=debug,
|
|
816
|
+
force=force,
|
|
817
|
+
nthreads=nthreads,
|
|
818
|
+
config=config,
|
|
819
|
+
help_=help_,
|
|
820
|
+
version=version,
|
|
821
|
+
fixel_in=fixel_in,
|
|
822
|
+
fixel_out=fixel_out,
|
|
823
|
+
)
|
|
824
|
+
return fixelconvert_execute(params, runner)
|
|
825
|
+
|
|
826
|
+
|
|
827
|
+
__all__ = [
|
|
828
|
+
"FIXELCONVERT_METADATA",
|
|
829
|
+
"FixelconvertConfigParamsDict",
|
|
830
|
+
"FixelconvertConfigParamsDictTagged",
|
|
831
|
+
"FixelconvertOutputs",
|
|
832
|
+
"FixelconvertParamsDict",
|
|
833
|
+
"FixelconvertParamsDictTagged",
|
|
834
|
+
"FixelconvertVariousFile1ParamsDict",
|
|
835
|
+
"FixelconvertVariousFile1ParamsDictTagged",
|
|
836
|
+
"FixelconvertVariousFileParamsDict",
|
|
837
|
+
"FixelconvertVariousFileParamsDictTagged",
|
|
838
|
+
"FixelconvertVariousString1ParamsDict",
|
|
839
|
+
"FixelconvertVariousString1ParamsDictTagged",
|
|
840
|
+
"FixelconvertVariousStringParamsDict",
|
|
841
|
+
"FixelconvertVariousStringParamsDictTagged",
|
|
842
|
+
"fixelconvert",
|
|
843
|
+
"fixelconvert_config",
|
|
844
|
+
"fixelconvert_execute",
|
|
845
|
+
"fixelconvert_params",
|
|
846
|
+
"fixelconvert_various_file",
|
|
847
|
+
"fixelconvert_various_file_1",
|
|
848
|
+
"fixelconvert_various_string",
|
|
849
|
+
"fixelconvert_various_string_1",
|
|
850
|
+
]
|