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,534 @@
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
+ MRSTATS_METADATA = Metadata(
9
+ id="28fb063299fa07970bfa62d606e13e87fd3bc94e.boutiques",
10
+ name="mrstats",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _MrstatsOutputParamsDictNoTag = typing.TypedDict('_MrstatsOutputParamsDictNoTag', {
17
+ "field": str,
18
+ })
19
+ MrstatsOutputParamsDictTagged = typing.TypedDict('MrstatsOutputParamsDictTagged', {
20
+ "@type": typing.Literal["output"],
21
+ "field": str,
22
+ })
23
+ MrstatsOutputParamsDict = _MrstatsOutputParamsDictNoTag | MrstatsOutputParamsDictTagged
24
+
25
+
26
+ _MrstatsConfigParamsDictNoTag = typing.TypedDict('_MrstatsConfigParamsDictNoTag', {
27
+ "key": str,
28
+ "value": str,
29
+ })
30
+ MrstatsConfigParamsDictTagged = typing.TypedDict('MrstatsConfigParamsDictTagged', {
31
+ "@type": typing.Literal["config"],
32
+ "key": str,
33
+ "value": str,
34
+ })
35
+ MrstatsConfigParamsDict = _MrstatsConfigParamsDictNoTag | MrstatsConfigParamsDictTagged
36
+
37
+
38
+ _MrstatsParamsDictNoTag = typing.TypedDict('_MrstatsParamsDictNoTag', {
39
+ "output": typing.NotRequired[list[MrstatsOutputParamsDict] | None],
40
+ "mask": typing.NotRequired[InputPathType | None],
41
+ "ignorezero": bool,
42
+ "allvolumes": bool,
43
+ "info": bool,
44
+ "quiet": bool,
45
+ "debug": bool,
46
+ "force": bool,
47
+ "nthreads": typing.NotRequired[int | None],
48
+ "config": typing.NotRequired[list[MrstatsConfigParamsDict] | None],
49
+ "help": bool,
50
+ "version": bool,
51
+ "image": InputPathType,
52
+ })
53
+ MrstatsParamsDictTagged = typing.TypedDict('MrstatsParamsDictTagged', {
54
+ "@type": typing.Literal["mrtrix/mrstats"],
55
+ "output": typing.NotRequired[list[MrstatsOutputParamsDict] | None],
56
+ "mask": typing.NotRequired[InputPathType | None],
57
+ "ignorezero": bool,
58
+ "allvolumes": bool,
59
+ "info": bool,
60
+ "quiet": bool,
61
+ "debug": bool,
62
+ "force": bool,
63
+ "nthreads": typing.NotRequired[int | None],
64
+ "config": typing.NotRequired[list[MrstatsConfigParamsDict] | None],
65
+ "help": bool,
66
+ "version": bool,
67
+ "image": InputPathType,
68
+ })
69
+ MrstatsParamsDict = _MrstatsParamsDictNoTag | MrstatsParamsDictTagged
70
+
71
+
72
+ def mrstats_output(
73
+ field: str,
74
+ ) -> MrstatsOutputParamsDictTagged:
75
+ """
76
+ Build parameters.
77
+
78
+ Args:
79
+ field: output only the field specified. Multiple such options can be\
80
+ supplied if required. Choices are: mean, median, std, std_rv, min, max,\
81
+ count. Useful for use in scripts. Both std options refer to the\
82
+ unbiased (sample) standard deviation. For complex data, min, max and\
83
+ std are calculated separately for real and imaginary parts, std_rv is\
84
+ based on the real valued variance (equals sqrt of sum of variances of\
85
+ imaginary and real parts).
86
+ Returns:
87
+ Parameter dictionary
88
+ """
89
+ params = {
90
+ "@type": "output",
91
+ "field": field,
92
+ }
93
+ return params
94
+
95
+
96
+ def mrstats_output_validate(
97
+ params: typing.Any,
98
+ ) -> None:
99
+ """
100
+ Validate parameters. Throws an error if `params` is not a valid
101
+ `MrstatsOutputParamsDict` object.
102
+
103
+ Args:
104
+ params: The parameters object to validate.
105
+ """
106
+ if params is None or not isinstance(params, dict):
107
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
108
+ if params.get("field", None) is None:
109
+ raise StyxValidationError("`field` must not be None")
110
+ if not isinstance(params["field"], str):
111
+ raise StyxValidationError(f'`field` has the wrong type: Received `{type(params.get("field", None))}` expected `str`')
112
+
113
+
114
+ def mrstats_output_cargs(
115
+ params: MrstatsOutputParamsDict,
116
+ execution: Execution,
117
+ ) -> list[str]:
118
+ """
119
+ Build command-line arguments from parameters.
120
+
121
+ Args:
122
+ params: The parameters.
123
+ execution: The execution object for resolving input paths.
124
+ Returns:
125
+ Command-line arguments.
126
+ """
127
+ cargs = []
128
+ cargs.append("-output")
129
+ cargs.append(params.get("field", None))
130
+ return cargs
131
+
132
+
133
+ def mrstats_config(
134
+ key: str,
135
+ value: str,
136
+ ) -> MrstatsConfigParamsDictTagged:
137
+ """
138
+ Build parameters.
139
+
140
+ Args:
141
+ key: temporarily set the value of an MRtrix config file entry.
142
+ value: temporarily set the value of an MRtrix config file entry.
143
+ Returns:
144
+ Parameter dictionary
145
+ """
146
+ params = {
147
+ "@type": "config",
148
+ "key": key,
149
+ "value": value,
150
+ }
151
+ return params
152
+
153
+
154
+ def mrstats_config_validate(
155
+ params: typing.Any,
156
+ ) -> None:
157
+ """
158
+ Validate parameters. Throws an error if `params` is not a valid
159
+ `MrstatsConfigParamsDict` object.
160
+
161
+ Args:
162
+ params: The parameters object to validate.
163
+ """
164
+ if params is None or not isinstance(params, dict):
165
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
166
+ if params.get("key", None) is None:
167
+ raise StyxValidationError("`key` must not be None")
168
+ if not isinstance(params["key"], str):
169
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
170
+ if params.get("value", None) is None:
171
+ raise StyxValidationError("`value` must not be None")
172
+ if not isinstance(params["value"], str):
173
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
174
+
175
+
176
+ def mrstats_config_cargs(
177
+ params: MrstatsConfigParamsDict,
178
+ execution: Execution,
179
+ ) -> list[str]:
180
+ """
181
+ Build command-line arguments from parameters.
182
+
183
+ Args:
184
+ params: The parameters.
185
+ execution: The execution object for resolving input paths.
186
+ Returns:
187
+ Command-line arguments.
188
+ """
189
+ cargs = []
190
+ cargs.append("-config")
191
+ cargs.append(params.get("key", None))
192
+ cargs.append(params.get("value", None))
193
+ return cargs
194
+
195
+
196
+ class MrstatsOutputs(typing.NamedTuple):
197
+ """
198
+ Output object returned when calling `MrstatsParamsDict(...)`.
199
+ """
200
+ root: OutputPathType
201
+ """Output root folder. This is the root folder for all outputs."""
202
+
203
+
204
+ def mrstats_params(
205
+ image: InputPathType,
206
+ output: list[MrstatsOutputParamsDict] | None = None,
207
+ mask: InputPathType | None = None,
208
+ ignorezero: bool = False,
209
+ allvolumes: bool = False,
210
+ info: bool = False,
211
+ quiet: bool = False,
212
+ debug: bool = False,
213
+ force: bool = False,
214
+ nthreads: int | None = None,
215
+ config: list[MrstatsConfigParamsDict] | None = None,
216
+ help_: bool = False,
217
+ version: bool = False,
218
+ ) -> MrstatsParamsDictTagged:
219
+ """
220
+ Build parameters.
221
+
222
+ Args:
223
+ image: the input image from which statistics will be computed.
224
+ output: output only the field specified. Multiple such options can be\
225
+ supplied if required. Choices are: mean, median, std, std_rv, min, max,\
226
+ count. Useful for use in scripts. Both std options refer to the\
227
+ unbiased (sample) standard deviation. For complex data, min, max and\
228
+ std are calculated separately for real and imaginary parts, std_rv is\
229
+ based on the real valued variance (equals sqrt of sum of variances of\
230
+ imaginary and real parts).
231
+ mask: only perform computation within the specified binary mask image.
232
+ ignorezero: ignore zero values during statistics calculation.
233
+ allvolumes: generate statistics across all image volumes, rather than\
234
+ one set of statistics per image volume.
235
+ info: display information messages.
236
+ quiet: do not display information messages or progress status;\
237
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
238
+ environment variable to a non-empty string.
239
+ debug: display debugging messages.
240
+ force: force overwrite of output files (caution: using the same file as\
241
+ input and output might cause unexpected behaviour).
242
+ nthreads: use this number of threads in multi-threaded applications\
243
+ (set to 0 to disable multi-threading).
244
+ config: temporarily set the value of an MRtrix config file entry.
245
+ help_: display this information page and exit.
246
+ version: display version information and exit.
247
+ Returns:
248
+ Parameter dictionary
249
+ """
250
+ params = {
251
+ "@type": "mrtrix/mrstats",
252
+ "ignorezero": ignorezero,
253
+ "allvolumes": allvolumes,
254
+ "info": info,
255
+ "quiet": quiet,
256
+ "debug": debug,
257
+ "force": force,
258
+ "help": help_,
259
+ "version": version,
260
+ "image": image,
261
+ }
262
+ if output is not None:
263
+ params["output"] = output
264
+ if mask is not None:
265
+ params["mask"] = mask
266
+ if nthreads is not None:
267
+ params["nthreads"] = nthreads
268
+ if config is not None:
269
+ params["config"] = config
270
+ return params
271
+
272
+
273
+ def mrstats_validate(
274
+ params: typing.Any,
275
+ ) -> None:
276
+ """
277
+ Validate parameters. Throws an error if `params` is not a valid
278
+ `MrstatsParamsDict` object.
279
+
280
+ Args:
281
+ params: The parameters object to validate.
282
+ """
283
+ if params is None or not isinstance(params, dict):
284
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
285
+ if params.get("output", None) is not None:
286
+ if not isinstance(params["output"], list):
287
+ raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `list[MrstatsOutputParamsDict] | None`')
288
+ for e in params["output"]:
289
+ mrstats_output_validate(e)
290
+ if params.get("mask", None) is not None:
291
+ if not isinstance(params["mask"], (pathlib.Path, str)):
292
+ raise StyxValidationError(f'`mask` has the wrong type: Received `{type(params.get("mask", None))}` expected `InputPathType | None`')
293
+ if params.get("ignorezero", False) is None:
294
+ raise StyxValidationError("`ignorezero` must not be None")
295
+ if not isinstance(params["ignorezero"], bool):
296
+ raise StyxValidationError(f'`ignorezero` has the wrong type: Received `{type(params.get("ignorezero", False))}` expected `bool`')
297
+ if params.get("allvolumes", False) is None:
298
+ raise StyxValidationError("`allvolumes` must not be None")
299
+ if not isinstance(params["allvolumes"], bool):
300
+ raise StyxValidationError(f'`allvolumes` has the wrong type: Received `{type(params.get("allvolumes", False))}` expected `bool`')
301
+ if params.get("info", False) is None:
302
+ raise StyxValidationError("`info` must not be None")
303
+ if not isinstance(params["info"], bool):
304
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
305
+ if params.get("quiet", False) is None:
306
+ raise StyxValidationError("`quiet` must not be None")
307
+ if not isinstance(params["quiet"], bool):
308
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
309
+ if params.get("debug", False) is None:
310
+ raise StyxValidationError("`debug` must not be None")
311
+ if not isinstance(params["debug"], bool):
312
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
313
+ if params.get("force", False) is None:
314
+ raise StyxValidationError("`force` must not be None")
315
+ if not isinstance(params["force"], bool):
316
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
317
+ if params.get("nthreads", None) is not None:
318
+ if not isinstance(params["nthreads"], int):
319
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
320
+ if params.get("config", None) is not None:
321
+ if not isinstance(params["config"], list):
322
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[MrstatsConfigParamsDict] | None`')
323
+ for e in params["config"]:
324
+ mrstats_config_validate(e)
325
+ if params.get("help", False) is None:
326
+ raise StyxValidationError("`help` must not be None")
327
+ if not isinstance(params["help"], bool):
328
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
329
+ if params.get("version", False) is None:
330
+ raise StyxValidationError("`version` must not be None")
331
+ if not isinstance(params["version"], bool):
332
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
333
+ if params.get("image", None) is None:
334
+ raise StyxValidationError("`image` must not be None")
335
+ if not isinstance(params["image"], (pathlib.Path, str)):
336
+ raise StyxValidationError(f'`image` has the wrong type: Received `{type(params.get("image", None))}` expected `InputPathType`')
337
+
338
+
339
+ def mrstats_cargs(
340
+ params: MrstatsParamsDict,
341
+ execution: Execution,
342
+ ) -> list[str]:
343
+ """
344
+ Build command-line arguments from parameters.
345
+
346
+ Args:
347
+ params: The parameters.
348
+ execution: The execution object for resolving input paths.
349
+ Returns:
350
+ Command-line arguments.
351
+ """
352
+ cargs = []
353
+ cargs.append("mrstats")
354
+ if params.get("output", None) is not None:
355
+ cargs.extend([a for c in [mrstats_output_cargs(s, execution) for s in params.get("output", None)] for a in c])
356
+ if params.get("mask", None) is not None:
357
+ cargs.extend([
358
+ "-mask",
359
+ execution.input_file(params.get("mask", None))
360
+ ])
361
+ if params.get("ignorezero", False):
362
+ cargs.append("-ignorezero")
363
+ if params.get("allvolumes", False):
364
+ cargs.append("-allvolumes")
365
+ if params.get("info", False):
366
+ cargs.append("-info")
367
+ if params.get("quiet", False):
368
+ cargs.append("-quiet")
369
+ if params.get("debug", False):
370
+ cargs.append("-debug")
371
+ if params.get("force", False):
372
+ cargs.append("-force")
373
+ if params.get("nthreads", None) is not None:
374
+ cargs.extend([
375
+ "-nthreads",
376
+ str(params.get("nthreads", None))
377
+ ])
378
+ if params.get("config", None) is not None:
379
+ cargs.extend([a for c in [mrstats_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
380
+ if params.get("help", False):
381
+ cargs.append("-help")
382
+ if params.get("version", False):
383
+ cargs.append("-version")
384
+ cargs.append(execution.input_file(params.get("image", None)))
385
+ return cargs
386
+
387
+
388
+ def mrstats_outputs(
389
+ params: MrstatsParamsDict,
390
+ execution: Execution,
391
+ ) -> MrstatsOutputs:
392
+ """
393
+ Build outputs object containing output file paths and possibly stdout/stderr.
394
+
395
+ Args:
396
+ params: The parameters.
397
+ execution: The execution object for resolving input paths.
398
+ Returns:
399
+ Outputs object.
400
+ """
401
+ ret = MrstatsOutputs(
402
+ root=execution.output_file("."),
403
+ )
404
+ return ret
405
+
406
+
407
+ def mrstats_execute(
408
+ params: MrstatsParamsDict,
409
+ runner: Runner | None = None,
410
+ ) -> MrstatsOutputs:
411
+ """
412
+ mrstats
413
+
414
+ Compute images statistics.
415
+
416
+
417
+
418
+ References:
419
+
420
+ .
421
+
422
+ Author: MRTrix3 Developers
423
+
424
+ URL: https://www.mrtrix.org/
425
+
426
+ Args:
427
+ params: The parameters.
428
+ runner: Command runner.
429
+ Returns:
430
+ NamedTuple of outputs (described in `MrstatsOutputs`).
431
+ """
432
+ mrstats_validate(params)
433
+ runner = runner or get_global_runner()
434
+ execution = runner.start_execution(MRSTATS_METADATA)
435
+ params = execution.params(params)
436
+ cargs = mrstats_cargs(params, execution)
437
+ ret = mrstats_outputs(params, execution)
438
+ execution.run(cargs)
439
+ return ret
440
+
441
+
442
+ def mrstats(
443
+ image: InputPathType,
444
+ output: list[MrstatsOutputParamsDict] | None = None,
445
+ mask: InputPathType | None = None,
446
+ ignorezero: bool = False,
447
+ allvolumes: bool = False,
448
+ info: bool = False,
449
+ quiet: bool = False,
450
+ debug: bool = False,
451
+ force: bool = False,
452
+ nthreads: int | None = None,
453
+ config: list[MrstatsConfigParamsDict] | None = None,
454
+ help_: bool = False,
455
+ version: bool = False,
456
+ runner: Runner | None = None,
457
+ ) -> MrstatsOutputs:
458
+ """
459
+ mrstats
460
+
461
+ Compute images statistics.
462
+
463
+
464
+
465
+ References:
466
+
467
+ .
468
+
469
+ Author: MRTrix3 Developers
470
+
471
+ URL: https://www.mrtrix.org/
472
+
473
+ Args:
474
+ image: the input image from which statistics will be computed.
475
+ output: output only the field specified. Multiple such options can be\
476
+ supplied if required. Choices are: mean, median, std, std_rv, min, max,\
477
+ count. Useful for use in scripts. Both std options refer to the\
478
+ unbiased (sample) standard deviation. For complex data, min, max and\
479
+ std are calculated separately for real and imaginary parts, std_rv is\
480
+ based on the real valued variance (equals sqrt of sum of variances of\
481
+ imaginary and real parts).
482
+ mask: only perform computation within the specified binary mask image.
483
+ ignorezero: ignore zero values during statistics calculation.
484
+ allvolumes: generate statistics across all image volumes, rather than\
485
+ one set of statistics per image volume.
486
+ info: display information messages.
487
+ quiet: do not display information messages or progress status;\
488
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
489
+ environment variable to a non-empty string.
490
+ debug: display debugging messages.
491
+ force: force overwrite of output files (caution: using the same file as\
492
+ input and output might cause unexpected behaviour).
493
+ nthreads: use this number of threads in multi-threaded applications\
494
+ (set to 0 to disable multi-threading).
495
+ config: temporarily set the value of an MRtrix config file entry.
496
+ help_: display this information page and exit.
497
+ version: display version information and exit.
498
+ runner: Command runner.
499
+ Returns:
500
+ NamedTuple of outputs (described in `MrstatsOutputs`).
501
+ """
502
+ params = mrstats_params(
503
+ output=output,
504
+ mask=mask,
505
+ ignorezero=ignorezero,
506
+ allvolumes=allvolumes,
507
+ info=info,
508
+ quiet=quiet,
509
+ debug=debug,
510
+ force=force,
511
+ nthreads=nthreads,
512
+ config=config,
513
+ help_=help_,
514
+ version=version,
515
+ image=image,
516
+ )
517
+ return mrstats_execute(params, runner)
518
+
519
+
520
+ __all__ = [
521
+ "MRSTATS_METADATA",
522
+ "MrstatsConfigParamsDict",
523
+ "MrstatsConfigParamsDictTagged",
524
+ "MrstatsOutputParamsDict",
525
+ "MrstatsOutputParamsDictTagged",
526
+ "MrstatsOutputs",
527
+ "MrstatsParamsDict",
528
+ "MrstatsParamsDictTagged",
529
+ "mrstats",
530
+ "mrstats_config",
531
+ "mrstats_execute",
532
+ "mrstats_output",
533
+ "mrstats_params",
534
+ ]