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