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,423 @@
|
|
|
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
|
+
MRDUMP_METADATA = Metadata(
|
|
9
|
+
id="606c9d0900d68319d10a0372597796b0e18d5074.boutiques",
|
|
10
|
+
name="mrdump",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
_MrdumpConfigParamsDictNoTag = typing.TypedDict('_MrdumpConfigParamsDictNoTag', {
|
|
17
|
+
"key": str,
|
|
18
|
+
"value": str,
|
|
19
|
+
})
|
|
20
|
+
MrdumpConfigParamsDictTagged = typing.TypedDict('MrdumpConfigParamsDictTagged', {
|
|
21
|
+
"@type": typing.Literal["config"],
|
|
22
|
+
"key": str,
|
|
23
|
+
"value": str,
|
|
24
|
+
})
|
|
25
|
+
MrdumpConfigParamsDict = _MrdumpConfigParamsDictNoTag | MrdumpConfigParamsDictTagged
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_MrdumpParamsDictNoTag = typing.TypedDict('_MrdumpParamsDictNoTag', {
|
|
29
|
+
"mask": typing.NotRequired[InputPathType | None],
|
|
30
|
+
"info": bool,
|
|
31
|
+
"quiet": bool,
|
|
32
|
+
"debug": bool,
|
|
33
|
+
"force": bool,
|
|
34
|
+
"nthreads": typing.NotRequired[int | None],
|
|
35
|
+
"config": typing.NotRequired[list[MrdumpConfigParamsDict] | None],
|
|
36
|
+
"help": bool,
|
|
37
|
+
"version": bool,
|
|
38
|
+
"input": InputPathType,
|
|
39
|
+
"output": typing.NotRequired[str | None],
|
|
40
|
+
})
|
|
41
|
+
MrdumpParamsDictTagged = typing.TypedDict('MrdumpParamsDictTagged', {
|
|
42
|
+
"@type": typing.Literal["mrtrix/mrdump"],
|
|
43
|
+
"mask": typing.NotRequired[InputPathType | None],
|
|
44
|
+
"info": bool,
|
|
45
|
+
"quiet": bool,
|
|
46
|
+
"debug": bool,
|
|
47
|
+
"force": bool,
|
|
48
|
+
"nthreads": typing.NotRequired[int | None],
|
|
49
|
+
"config": typing.NotRequired[list[MrdumpConfigParamsDict] | None],
|
|
50
|
+
"help": bool,
|
|
51
|
+
"version": bool,
|
|
52
|
+
"input": InputPathType,
|
|
53
|
+
"output": typing.NotRequired[str | None],
|
|
54
|
+
})
|
|
55
|
+
MrdumpParamsDict = _MrdumpParamsDictNoTag | MrdumpParamsDictTagged
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def mrdump_config(
|
|
59
|
+
key: str,
|
|
60
|
+
value: str,
|
|
61
|
+
) -> MrdumpConfigParamsDictTagged:
|
|
62
|
+
"""
|
|
63
|
+
Build parameters.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
67
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
68
|
+
Returns:
|
|
69
|
+
Parameter dictionary
|
|
70
|
+
"""
|
|
71
|
+
params = {
|
|
72
|
+
"@type": "config",
|
|
73
|
+
"key": key,
|
|
74
|
+
"value": value,
|
|
75
|
+
}
|
|
76
|
+
return params
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def mrdump_config_validate(
|
|
80
|
+
params: typing.Any,
|
|
81
|
+
) -> None:
|
|
82
|
+
"""
|
|
83
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
84
|
+
`MrdumpConfigParamsDict` object.
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
params: The parameters object to validate.
|
|
88
|
+
"""
|
|
89
|
+
if params is None or not isinstance(params, dict):
|
|
90
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
91
|
+
if params.get("key", None) is None:
|
|
92
|
+
raise StyxValidationError("`key` must not be None")
|
|
93
|
+
if not isinstance(params["key"], str):
|
|
94
|
+
raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
|
|
95
|
+
if params.get("value", None) is None:
|
|
96
|
+
raise StyxValidationError("`value` must not be None")
|
|
97
|
+
if not isinstance(params["value"], str):
|
|
98
|
+
raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def mrdump_config_cargs(
|
|
102
|
+
params: MrdumpConfigParamsDict,
|
|
103
|
+
execution: Execution,
|
|
104
|
+
) -> list[str]:
|
|
105
|
+
"""
|
|
106
|
+
Build command-line arguments from parameters.
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
params: The parameters.
|
|
110
|
+
execution: The execution object for resolving input paths.
|
|
111
|
+
Returns:
|
|
112
|
+
Command-line arguments.
|
|
113
|
+
"""
|
|
114
|
+
cargs = []
|
|
115
|
+
cargs.append("-config")
|
|
116
|
+
cargs.append(params.get("key", None))
|
|
117
|
+
cargs.append(params.get("value", None))
|
|
118
|
+
return cargs
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class MrdumpOutputs(typing.NamedTuple):
|
|
122
|
+
"""
|
|
123
|
+
Output object returned when calling `MrdumpParamsDict(...)`.
|
|
124
|
+
"""
|
|
125
|
+
root: OutputPathType
|
|
126
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
127
|
+
output: OutputPathType | None
|
|
128
|
+
"""the (optional) output text file."""
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def mrdump_params(
|
|
132
|
+
input_: InputPathType,
|
|
133
|
+
mask: InputPathType | None = None,
|
|
134
|
+
info: bool = False,
|
|
135
|
+
quiet: bool = False,
|
|
136
|
+
debug: bool = False,
|
|
137
|
+
force: bool = False,
|
|
138
|
+
nthreads: int | None = None,
|
|
139
|
+
config: list[MrdumpConfigParamsDict] | None = None,
|
|
140
|
+
help_: bool = False,
|
|
141
|
+
version: bool = False,
|
|
142
|
+
output: str | None = None,
|
|
143
|
+
) -> MrdumpParamsDictTagged:
|
|
144
|
+
"""
|
|
145
|
+
Build parameters.
|
|
146
|
+
|
|
147
|
+
Args:
|
|
148
|
+
input_: the input image.
|
|
149
|
+
mask: only write the image values within voxels specified by a mask\
|
|
150
|
+
image.
|
|
151
|
+
info: display information messages.
|
|
152
|
+
quiet: do not display information messages or progress status;\
|
|
153
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
154
|
+
environment variable to a non-empty string.
|
|
155
|
+
debug: display debugging messages.
|
|
156
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
157
|
+
input and output might cause unexpected behaviour).
|
|
158
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
159
|
+
(set to 0 to disable multi-threading).
|
|
160
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
161
|
+
help_: display this information page and exit.
|
|
162
|
+
version: display version information and exit.
|
|
163
|
+
output: the (optional) output text file.
|
|
164
|
+
Returns:
|
|
165
|
+
Parameter dictionary
|
|
166
|
+
"""
|
|
167
|
+
params = {
|
|
168
|
+
"@type": "mrtrix/mrdump",
|
|
169
|
+
"info": info,
|
|
170
|
+
"quiet": quiet,
|
|
171
|
+
"debug": debug,
|
|
172
|
+
"force": force,
|
|
173
|
+
"help": help_,
|
|
174
|
+
"version": version,
|
|
175
|
+
"input": input_,
|
|
176
|
+
}
|
|
177
|
+
if mask is not None:
|
|
178
|
+
params["mask"] = mask
|
|
179
|
+
if nthreads is not None:
|
|
180
|
+
params["nthreads"] = nthreads
|
|
181
|
+
if config is not None:
|
|
182
|
+
params["config"] = config
|
|
183
|
+
if output is not None:
|
|
184
|
+
params["output"] = output
|
|
185
|
+
return params
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def mrdump_validate(
|
|
189
|
+
params: typing.Any,
|
|
190
|
+
) -> None:
|
|
191
|
+
"""
|
|
192
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
193
|
+
`MrdumpParamsDict` object.
|
|
194
|
+
|
|
195
|
+
Args:
|
|
196
|
+
params: The parameters object to validate.
|
|
197
|
+
"""
|
|
198
|
+
if params is None or not isinstance(params, dict):
|
|
199
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
200
|
+
if params.get("mask", None) is not None:
|
|
201
|
+
if not isinstance(params["mask"], (pathlib.Path, str)):
|
|
202
|
+
raise StyxValidationError(f'`mask` has the wrong type: Received `{type(params.get("mask", None))}` expected `InputPathType | None`')
|
|
203
|
+
if params.get("info", False) is None:
|
|
204
|
+
raise StyxValidationError("`info` must not be None")
|
|
205
|
+
if not isinstance(params["info"], bool):
|
|
206
|
+
raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
|
|
207
|
+
if params.get("quiet", False) is None:
|
|
208
|
+
raise StyxValidationError("`quiet` must not be None")
|
|
209
|
+
if not isinstance(params["quiet"], bool):
|
|
210
|
+
raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
|
|
211
|
+
if params.get("debug", False) is None:
|
|
212
|
+
raise StyxValidationError("`debug` must not be None")
|
|
213
|
+
if not isinstance(params["debug"], bool):
|
|
214
|
+
raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
|
|
215
|
+
if params.get("force", False) is None:
|
|
216
|
+
raise StyxValidationError("`force` must not be None")
|
|
217
|
+
if not isinstance(params["force"], bool):
|
|
218
|
+
raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
|
|
219
|
+
if params.get("nthreads", None) is not None:
|
|
220
|
+
if not isinstance(params["nthreads"], int):
|
|
221
|
+
raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
|
|
222
|
+
if params.get("config", None) is not None:
|
|
223
|
+
if not isinstance(params["config"], list):
|
|
224
|
+
raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[MrdumpConfigParamsDict] | None`')
|
|
225
|
+
for e in params["config"]:
|
|
226
|
+
mrdump_config_validate(e)
|
|
227
|
+
if params.get("help", False) is None:
|
|
228
|
+
raise StyxValidationError("`help` must not be None")
|
|
229
|
+
if not isinstance(params["help"], bool):
|
|
230
|
+
raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
|
|
231
|
+
if params.get("version", False) is None:
|
|
232
|
+
raise StyxValidationError("`version` must not be None")
|
|
233
|
+
if not isinstance(params["version"], bool):
|
|
234
|
+
raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
|
|
235
|
+
if params.get("input", None) is None:
|
|
236
|
+
raise StyxValidationError("`input` must not be None")
|
|
237
|
+
if not isinstance(params["input"], (pathlib.Path, str)):
|
|
238
|
+
raise StyxValidationError(f'`input` has the wrong type: Received `{type(params.get("input", None))}` expected `InputPathType`')
|
|
239
|
+
if params.get("output", None) is not None:
|
|
240
|
+
if not isinstance(params["output"], str):
|
|
241
|
+
raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `str | None`')
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
def mrdump_cargs(
|
|
245
|
+
params: MrdumpParamsDict,
|
|
246
|
+
execution: Execution,
|
|
247
|
+
) -> list[str]:
|
|
248
|
+
"""
|
|
249
|
+
Build command-line arguments from parameters.
|
|
250
|
+
|
|
251
|
+
Args:
|
|
252
|
+
params: The parameters.
|
|
253
|
+
execution: The execution object for resolving input paths.
|
|
254
|
+
Returns:
|
|
255
|
+
Command-line arguments.
|
|
256
|
+
"""
|
|
257
|
+
cargs = []
|
|
258
|
+
cargs.append("mrdump")
|
|
259
|
+
if params.get("mask", None) is not None:
|
|
260
|
+
cargs.extend([
|
|
261
|
+
"-mask",
|
|
262
|
+
execution.input_file(params.get("mask", None))
|
|
263
|
+
])
|
|
264
|
+
if params.get("info", False):
|
|
265
|
+
cargs.append("-info")
|
|
266
|
+
if params.get("quiet", False):
|
|
267
|
+
cargs.append("-quiet")
|
|
268
|
+
if params.get("debug", False):
|
|
269
|
+
cargs.append("-debug")
|
|
270
|
+
if params.get("force", False):
|
|
271
|
+
cargs.append("-force")
|
|
272
|
+
if params.get("nthreads", None) is not None:
|
|
273
|
+
cargs.extend([
|
|
274
|
+
"-nthreads",
|
|
275
|
+
str(params.get("nthreads", None))
|
|
276
|
+
])
|
|
277
|
+
if params.get("config", None) is not None:
|
|
278
|
+
cargs.extend([a for c in [mrdump_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
279
|
+
if params.get("help", False):
|
|
280
|
+
cargs.append("-help")
|
|
281
|
+
if params.get("version", False):
|
|
282
|
+
cargs.append("-version")
|
|
283
|
+
cargs.append(execution.input_file(params.get("input", None)))
|
|
284
|
+
if params.get("output", None) is not None:
|
|
285
|
+
cargs.append(params.get("output", None))
|
|
286
|
+
return cargs
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
def mrdump_outputs(
|
|
290
|
+
params: MrdumpParamsDict,
|
|
291
|
+
execution: Execution,
|
|
292
|
+
) -> MrdumpOutputs:
|
|
293
|
+
"""
|
|
294
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
295
|
+
|
|
296
|
+
Args:
|
|
297
|
+
params: The parameters.
|
|
298
|
+
execution: The execution object for resolving input paths.
|
|
299
|
+
Returns:
|
|
300
|
+
Outputs object.
|
|
301
|
+
"""
|
|
302
|
+
ret = MrdumpOutputs(
|
|
303
|
+
root=execution.output_file("."),
|
|
304
|
+
output=execution.output_file(params.get("output", None)) if (params.get("output") is not None) else None,
|
|
305
|
+
)
|
|
306
|
+
return ret
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def mrdump_execute(
|
|
310
|
+
params: MrdumpParamsDict,
|
|
311
|
+
runner: Runner | None = None,
|
|
312
|
+
) -> MrdumpOutputs:
|
|
313
|
+
"""
|
|
314
|
+
mrdump
|
|
315
|
+
|
|
316
|
+
Print out the values within an image.
|
|
317
|
+
|
|
318
|
+
If no destination file is specified, the voxel locations will be printed to
|
|
319
|
+
stdout.
|
|
320
|
+
|
|
321
|
+
References:
|
|
322
|
+
|
|
323
|
+
.
|
|
324
|
+
|
|
325
|
+
Author: MRTrix3 Developers
|
|
326
|
+
|
|
327
|
+
URL: https://www.mrtrix.org/
|
|
328
|
+
|
|
329
|
+
Args:
|
|
330
|
+
params: The parameters.
|
|
331
|
+
runner: Command runner.
|
|
332
|
+
Returns:
|
|
333
|
+
NamedTuple of outputs (described in `MrdumpOutputs`).
|
|
334
|
+
"""
|
|
335
|
+
mrdump_validate(params)
|
|
336
|
+
runner = runner or get_global_runner()
|
|
337
|
+
execution = runner.start_execution(MRDUMP_METADATA)
|
|
338
|
+
params = execution.params(params)
|
|
339
|
+
cargs = mrdump_cargs(params, execution)
|
|
340
|
+
ret = mrdump_outputs(params, execution)
|
|
341
|
+
execution.run(cargs)
|
|
342
|
+
return ret
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
def mrdump(
|
|
346
|
+
input_: InputPathType,
|
|
347
|
+
mask: InputPathType | None = None,
|
|
348
|
+
info: bool = False,
|
|
349
|
+
quiet: bool = False,
|
|
350
|
+
debug: bool = False,
|
|
351
|
+
force: bool = False,
|
|
352
|
+
nthreads: int | None = None,
|
|
353
|
+
config: list[MrdumpConfigParamsDict] | None = None,
|
|
354
|
+
help_: bool = False,
|
|
355
|
+
version: bool = False,
|
|
356
|
+
output: str | None = None,
|
|
357
|
+
runner: Runner | None = None,
|
|
358
|
+
) -> MrdumpOutputs:
|
|
359
|
+
"""
|
|
360
|
+
mrdump
|
|
361
|
+
|
|
362
|
+
Print out the values within an image.
|
|
363
|
+
|
|
364
|
+
If no destination file is specified, the voxel locations will be printed to
|
|
365
|
+
stdout.
|
|
366
|
+
|
|
367
|
+
References:
|
|
368
|
+
|
|
369
|
+
.
|
|
370
|
+
|
|
371
|
+
Author: MRTrix3 Developers
|
|
372
|
+
|
|
373
|
+
URL: https://www.mrtrix.org/
|
|
374
|
+
|
|
375
|
+
Args:
|
|
376
|
+
input_: the input image.
|
|
377
|
+
mask: only write the image values within voxels specified by a mask\
|
|
378
|
+
image.
|
|
379
|
+
info: display information messages.
|
|
380
|
+
quiet: do not display information messages or progress status;\
|
|
381
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
382
|
+
environment variable to a non-empty string.
|
|
383
|
+
debug: display debugging messages.
|
|
384
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
385
|
+
input and output might cause unexpected behaviour).
|
|
386
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
387
|
+
(set to 0 to disable multi-threading).
|
|
388
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
389
|
+
help_: display this information page and exit.
|
|
390
|
+
version: display version information and exit.
|
|
391
|
+
output: the (optional) output text file.
|
|
392
|
+
runner: Command runner.
|
|
393
|
+
Returns:
|
|
394
|
+
NamedTuple of outputs (described in `MrdumpOutputs`).
|
|
395
|
+
"""
|
|
396
|
+
params = mrdump_params(
|
|
397
|
+
mask=mask,
|
|
398
|
+
info=info,
|
|
399
|
+
quiet=quiet,
|
|
400
|
+
debug=debug,
|
|
401
|
+
force=force,
|
|
402
|
+
nthreads=nthreads,
|
|
403
|
+
config=config,
|
|
404
|
+
help_=help_,
|
|
405
|
+
version=version,
|
|
406
|
+
input_=input_,
|
|
407
|
+
output=output,
|
|
408
|
+
)
|
|
409
|
+
return mrdump_execute(params, runner)
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
__all__ = [
|
|
413
|
+
"MRDUMP_METADATA",
|
|
414
|
+
"MrdumpConfigParamsDict",
|
|
415
|
+
"MrdumpConfigParamsDictTagged",
|
|
416
|
+
"MrdumpOutputs",
|
|
417
|
+
"MrdumpParamsDict",
|
|
418
|
+
"MrdumpParamsDictTagged",
|
|
419
|
+
"mrdump",
|
|
420
|
+
"mrdump_config",
|
|
421
|
+
"mrdump_execute",
|
|
422
|
+
"mrdump_params",
|
|
423
|
+
]
|