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,523 @@
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
+ FIXEL2VOXEL_METADATA = Metadata(
9
+ id="0e517d0eb23dea1741bca5bac37fc1918bda4919.boutiques",
10
+ name="fixel2voxel",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _Fixel2voxelConfigParamsDictNoTag = typing.TypedDict('_Fixel2voxelConfigParamsDictNoTag', {
17
+ "key": str,
18
+ "value": str,
19
+ })
20
+ Fixel2voxelConfigParamsDictTagged = typing.TypedDict('Fixel2voxelConfigParamsDictTagged', {
21
+ "@type": typing.Literal["config"],
22
+ "key": str,
23
+ "value": str,
24
+ })
25
+ Fixel2voxelConfigParamsDict = _Fixel2voxelConfigParamsDictNoTag | Fixel2voxelConfigParamsDictTagged
26
+
27
+
28
+ _Fixel2voxelParamsDictNoTag = typing.TypedDict('_Fixel2voxelParamsDictNoTag', {
29
+ "number": typing.NotRequired[int | None],
30
+ "fill": typing.NotRequired[float | None],
31
+ "weighted": typing.NotRequired[InputPathType | None],
32
+ "info": bool,
33
+ "quiet": bool,
34
+ "debug": bool,
35
+ "force": bool,
36
+ "nthreads": typing.NotRequired[int | None],
37
+ "config": typing.NotRequired[list[Fixel2voxelConfigParamsDict] | None],
38
+ "help": bool,
39
+ "version": bool,
40
+ "fixel_in": InputPathType,
41
+ "operation": str,
42
+ "image_out": str,
43
+ })
44
+ Fixel2voxelParamsDictTagged = typing.TypedDict('Fixel2voxelParamsDictTagged', {
45
+ "@type": typing.Literal["mrtrix/fixel2voxel"],
46
+ "number": typing.NotRequired[int | None],
47
+ "fill": typing.NotRequired[float | None],
48
+ "weighted": typing.NotRequired[InputPathType | None],
49
+ "info": bool,
50
+ "quiet": bool,
51
+ "debug": bool,
52
+ "force": bool,
53
+ "nthreads": typing.NotRequired[int | None],
54
+ "config": typing.NotRequired[list[Fixel2voxelConfigParamsDict] | None],
55
+ "help": bool,
56
+ "version": bool,
57
+ "fixel_in": InputPathType,
58
+ "operation": str,
59
+ "image_out": str,
60
+ })
61
+ Fixel2voxelParamsDict = _Fixel2voxelParamsDictNoTag | Fixel2voxelParamsDictTagged
62
+
63
+
64
+ def fixel2voxel_config(
65
+ key: str,
66
+ value: str,
67
+ ) -> Fixel2voxelConfigParamsDictTagged:
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 fixel2voxel_config_validate(
86
+ params: typing.Any,
87
+ ) -> None:
88
+ """
89
+ Validate parameters. Throws an error if `params` is not a valid
90
+ `Fixel2voxelConfigParamsDict` 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 fixel2voxel_config_cargs(
108
+ params: Fixel2voxelConfigParamsDict,
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 Fixel2voxelOutputs(typing.NamedTuple):
128
+ """
129
+ Output object returned when calling `Fixel2voxelParamsDict(...)`.
130
+ """
131
+ root: OutputPathType
132
+ """Output root folder. This is the root folder for all outputs."""
133
+ image_out: OutputPathType
134
+ """the output scalar image."""
135
+
136
+
137
+ def fixel2voxel_params(
138
+ fixel_in: InputPathType,
139
+ operation: str,
140
+ image_out: str,
141
+ number: int | None = None,
142
+ fill: float | None = None,
143
+ weighted: InputPathType | 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[Fixel2voxelConfigParamsDict] | None = None,
150
+ help_: bool = False,
151
+ version: bool = False,
152
+ ) -> Fixel2voxelParamsDictTagged:
153
+ """
154
+ Build parameters.
155
+
156
+ Args:
157
+ fixel_in: the input fixel data file.
158
+ operation: the operation to apply, one of: mean, sum, product, min,\
159
+ max, absmax, magmax, count, complexity, sf, dec_unit, dec_scaled, none.
160
+ image_out: the output scalar image.
161
+ number: use only the largest N fixels in calculation of the voxel-wise\
162
+ statistic; in the case of operation "none", output only the largest N\
163
+ fixels in each voxel.
164
+ fill: for "none" operation, specify the value to fill when number of\
165
+ fixels is fewer than the maximum (default: 0.0).
166
+ weighted: weight the contribution of each fixel to the per-voxel result\
167
+ according to its volume.
168
+ info: display information messages.
169
+ quiet: do not display information messages or progress status;\
170
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
171
+ environment variable to a non-empty string.
172
+ debug: display debugging messages.
173
+ force: force overwrite of output files (caution: using the same file as\
174
+ input and output might cause unexpected behaviour).
175
+ nthreads: use this number of threads in multi-threaded applications\
176
+ (set to 0 to disable multi-threading).
177
+ config: temporarily set the value of an MRtrix config file entry.
178
+ help_: display this information page and exit.
179
+ version: display version information and exit.
180
+ Returns:
181
+ Parameter dictionary
182
+ """
183
+ params = {
184
+ "@type": "mrtrix/fixel2voxel",
185
+ "info": info,
186
+ "quiet": quiet,
187
+ "debug": debug,
188
+ "force": force,
189
+ "help": help_,
190
+ "version": version,
191
+ "fixel_in": fixel_in,
192
+ "operation": operation,
193
+ "image_out": image_out,
194
+ }
195
+ if number is not None:
196
+ params["number"] = number
197
+ if fill is not None:
198
+ params["fill"] = fill
199
+ if weighted is not None:
200
+ params["weighted"] = weighted
201
+ if nthreads is not None:
202
+ params["nthreads"] = nthreads
203
+ if config is not None:
204
+ params["config"] = config
205
+ return params
206
+
207
+
208
+ def fixel2voxel_validate(
209
+ params: typing.Any,
210
+ ) -> None:
211
+ """
212
+ Validate parameters. Throws an error if `params` is not a valid
213
+ `Fixel2voxelParamsDict` object.
214
+
215
+ Args:
216
+ params: The parameters object to validate.
217
+ """
218
+ if params is None or not isinstance(params, dict):
219
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
220
+ if params.get("number", None) is not None:
221
+ if not isinstance(params["number"], int):
222
+ raise StyxValidationError(f'`number` has the wrong type: Received `{type(params.get("number", None))}` expected `int | None`')
223
+ if params.get("fill", None) is not None:
224
+ if not isinstance(params["fill"], (float, int)):
225
+ raise StyxValidationError(f'`fill` has the wrong type: Received `{type(params.get("fill", None))}` expected `float | None`')
226
+ if params.get("weighted", None) is not None:
227
+ if not isinstance(params["weighted"], (pathlib.Path, str)):
228
+ raise StyxValidationError(f'`weighted` has the wrong type: Received `{type(params.get("weighted", None))}` expected `InputPathType | None`')
229
+ if params.get("info", False) is None:
230
+ raise StyxValidationError("`info` must not be None")
231
+ if not isinstance(params["info"], bool):
232
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
233
+ if params.get("quiet", False) is None:
234
+ raise StyxValidationError("`quiet` must not be None")
235
+ if not isinstance(params["quiet"], bool):
236
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
237
+ if params.get("debug", False) is None:
238
+ raise StyxValidationError("`debug` must not be None")
239
+ if not isinstance(params["debug"], bool):
240
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
241
+ if params.get("force", False) is None:
242
+ raise StyxValidationError("`force` must not be None")
243
+ if not isinstance(params["force"], bool):
244
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
245
+ if params.get("nthreads", None) is not None:
246
+ if not isinstance(params["nthreads"], int):
247
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
248
+ if params.get("config", None) is not None:
249
+ if not isinstance(params["config"], list):
250
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[Fixel2voxelConfigParamsDict] | None`')
251
+ for e in params["config"]:
252
+ fixel2voxel_config_validate(e)
253
+ if params.get("help", False) is None:
254
+ raise StyxValidationError("`help` must not be None")
255
+ if not isinstance(params["help"], bool):
256
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
257
+ if params.get("version", False) is None:
258
+ raise StyxValidationError("`version` must not be None")
259
+ if not isinstance(params["version"], bool):
260
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
261
+ if params.get("fixel_in", None) is None:
262
+ raise StyxValidationError("`fixel_in` must not be None")
263
+ if not isinstance(params["fixel_in"], (pathlib.Path, str)):
264
+ raise StyxValidationError(f'`fixel_in` has the wrong type: Received `{type(params.get("fixel_in", None))}` expected `InputPathType`')
265
+ if params.get("operation", None) is None:
266
+ raise StyxValidationError("`operation` must not be None")
267
+ if not isinstance(params["operation"], str):
268
+ raise StyxValidationError(f'`operation` has the wrong type: Received `{type(params.get("operation", None))}` expected `str`')
269
+ if params.get("image_out", None) is None:
270
+ raise StyxValidationError("`image_out` must not be None")
271
+ if not isinstance(params["image_out"], str):
272
+ raise StyxValidationError(f'`image_out` has the wrong type: Received `{type(params.get("image_out", None))}` expected `str`')
273
+
274
+
275
+ def fixel2voxel_cargs(
276
+ params: Fixel2voxelParamsDict,
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("fixel2voxel")
290
+ if params.get("number", None) is not None:
291
+ cargs.extend([
292
+ "-number",
293
+ str(params.get("number", None))
294
+ ])
295
+ if params.get("fill", None) is not None:
296
+ cargs.extend([
297
+ "-fill",
298
+ str(params.get("fill", None))
299
+ ])
300
+ if params.get("weighted", None) is not None:
301
+ cargs.extend([
302
+ "-weighted",
303
+ execution.input_file(params.get("weighted", None))
304
+ ])
305
+ if params.get("info", False):
306
+ cargs.append("-info")
307
+ if params.get("quiet", False):
308
+ cargs.append("-quiet")
309
+ if params.get("debug", False):
310
+ cargs.append("-debug")
311
+ if params.get("force", False):
312
+ cargs.append("-force")
313
+ if params.get("nthreads", None) is not None:
314
+ cargs.extend([
315
+ "-nthreads",
316
+ str(params.get("nthreads", None))
317
+ ])
318
+ if params.get("config", None) is not None:
319
+ cargs.extend([a for c in [fixel2voxel_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
320
+ if params.get("help", False):
321
+ cargs.append("-help")
322
+ if params.get("version", False):
323
+ cargs.append("-version")
324
+ cargs.append(execution.input_file(params.get("fixel_in", None)))
325
+ cargs.append(params.get("operation", None))
326
+ cargs.append(params.get("image_out", None))
327
+ return cargs
328
+
329
+
330
+ def fixel2voxel_outputs(
331
+ params: Fixel2voxelParamsDict,
332
+ execution: Execution,
333
+ ) -> Fixel2voxelOutputs:
334
+ """
335
+ Build outputs object containing output file paths and possibly stdout/stderr.
336
+
337
+ Args:
338
+ params: The parameters.
339
+ execution: The execution object for resolving input paths.
340
+ Returns:
341
+ Outputs object.
342
+ """
343
+ ret = Fixel2voxelOutputs(
344
+ root=execution.output_file("."),
345
+ image_out=execution.output_file(params.get("image_out", None)),
346
+ )
347
+ return ret
348
+
349
+
350
+ def fixel2voxel_execute(
351
+ params: Fixel2voxelParamsDict,
352
+ runner: Runner | None = None,
353
+ ) -> Fixel2voxelOutputs:
354
+ """
355
+ fixel2voxel
356
+
357
+ Convert a fixel-based sparse-data image into some form of scalar image.
358
+
359
+ Fixel data can be reduced to voxel data in a number of ways:
360
+
361
+ - Some statistic computed across all fixel values within a voxel: mean, sum,
362
+ product, min, max, absmax, magmax
363
+
364
+ - The number of fixels in each voxel: count
365
+
366
+ - Some measure of crossing-fibre organisation: complexity, sf
367
+ ('single-fibre')
368
+
369
+ - A 4D directionally-encoded colour image: dec_unit, dec_scaled
370
+
371
+ - A 4D image containing all fixel data values in each voxel unmodified: none
372
+
373
+ The -weighted option deals with the case where there is some per-fixel
374
+ metric of interest that you wish to collapse into a single scalar measure
375
+ per voxel, but each fixel possesses a different volume, and you wish for
376
+ those fixels with greater volume to have a greater influence on the
377
+ calculation than fixels with lesser volume. For instance, when estimating a
378
+ voxel-based measure of mean axon diameter from per-fixel mean axon
379
+ diameters, a fixel's mean axon diameter should be weigthed by its relative
380
+ volume within the voxel in the calculation of that voxel mean.
381
+
382
+ References:
383
+
384
+ * Reference for 'complexity' operation:
385
+ Riffert, T. W.; Schreiber, J.; Anwander, A. & Knosche, T. R. Beyond
386
+ Fractional Anisotropy: Extraction of bundle-specific structural metrics from
387
+ crossing fibre models. NeuroImage, 2014, 100, 176-191.
388
+
389
+ Author: MRTrix3 Developers
390
+
391
+ URL: https://www.mrtrix.org/
392
+
393
+ Args:
394
+ params: The parameters.
395
+ runner: Command runner.
396
+ Returns:
397
+ NamedTuple of outputs (described in `Fixel2voxelOutputs`).
398
+ """
399
+ fixel2voxel_validate(params)
400
+ runner = runner or get_global_runner()
401
+ execution = runner.start_execution(FIXEL2VOXEL_METADATA)
402
+ params = execution.params(params)
403
+ cargs = fixel2voxel_cargs(params, execution)
404
+ ret = fixel2voxel_outputs(params, execution)
405
+ execution.run(cargs)
406
+ return ret
407
+
408
+
409
+ def fixel2voxel(
410
+ fixel_in: InputPathType,
411
+ operation: str,
412
+ image_out: str,
413
+ number: int | None = None,
414
+ fill: float | None = None,
415
+ weighted: InputPathType | None = None,
416
+ info: bool = False,
417
+ quiet: bool = False,
418
+ debug: bool = False,
419
+ force: bool = False,
420
+ nthreads: int | None = None,
421
+ config: list[Fixel2voxelConfigParamsDict] | None = None,
422
+ help_: bool = False,
423
+ version: bool = False,
424
+ runner: Runner | None = None,
425
+ ) -> Fixel2voxelOutputs:
426
+ """
427
+ fixel2voxel
428
+
429
+ Convert a fixel-based sparse-data image into some form of scalar image.
430
+
431
+ Fixel data can be reduced to voxel data in a number of ways:
432
+
433
+ - Some statistic computed across all fixel values within a voxel: mean, sum,
434
+ product, min, max, absmax, magmax
435
+
436
+ - The number of fixels in each voxel: count
437
+
438
+ - Some measure of crossing-fibre organisation: complexity, sf
439
+ ('single-fibre')
440
+
441
+ - A 4D directionally-encoded colour image: dec_unit, dec_scaled
442
+
443
+ - A 4D image containing all fixel data values in each voxel unmodified: none
444
+
445
+ The -weighted option deals with the case where there is some per-fixel
446
+ metric of interest that you wish to collapse into a single scalar measure
447
+ per voxel, but each fixel possesses a different volume, and you wish for
448
+ those fixels with greater volume to have a greater influence on the
449
+ calculation than fixels with lesser volume. For instance, when estimating a
450
+ voxel-based measure of mean axon diameter from per-fixel mean axon
451
+ diameters, a fixel's mean axon diameter should be weigthed by its relative
452
+ volume within the voxel in the calculation of that voxel mean.
453
+
454
+ References:
455
+
456
+ * Reference for 'complexity' operation:
457
+ Riffert, T. W.; Schreiber, J.; Anwander, A. & Knosche, T. R. Beyond
458
+ Fractional Anisotropy: Extraction of bundle-specific structural metrics from
459
+ crossing fibre models. NeuroImage, 2014, 100, 176-191.
460
+
461
+ Author: MRTrix3 Developers
462
+
463
+ URL: https://www.mrtrix.org/
464
+
465
+ Args:
466
+ fixel_in: the input fixel data file.
467
+ operation: the operation to apply, one of: mean, sum, product, min,\
468
+ max, absmax, magmax, count, complexity, sf, dec_unit, dec_scaled, none.
469
+ image_out: the output scalar image.
470
+ number: use only the largest N fixels in calculation of the voxel-wise\
471
+ statistic; in the case of operation "none", output only the largest N\
472
+ fixels in each voxel.
473
+ fill: for "none" operation, specify the value to fill when number of\
474
+ fixels is fewer than the maximum (default: 0.0).
475
+ weighted: weight the contribution of each fixel to the per-voxel result\
476
+ according to its volume.
477
+ info: display information messages.
478
+ quiet: do not display information messages or progress status;\
479
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
480
+ environment variable to a non-empty string.
481
+ debug: display debugging messages.
482
+ force: force overwrite of output files (caution: using the same file as\
483
+ input and output might cause unexpected behaviour).
484
+ nthreads: use this number of threads in multi-threaded applications\
485
+ (set to 0 to disable multi-threading).
486
+ config: temporarily set the value of an MRtrix config file entry.
487
+ help_: display this information page and exit.
488
+ version: display version information and exit.
489
+ runner: Command runner.
490
+ Returns:
491
+ NamedTuple of outputs (described in `Fixel2voxelOutputs`).
492
+ """
493
+ params = fixel2voxel_params(
494
+ number=number,
495
+ fill=fill,
496
+ weighted=weighted,
497
+ info=info,
498
+ quiet=quiet,
499
+ debug=debug,
500
+ force=force,
501
+ nthreads=nthreads,
502
+ config=config,
503
+ help_=help_,
504
+ version=version,
505
+ fixel_in=fixel_in,
506
+ operation=operation,
507
+ image_out=image_out,
508
+ )
509
+ return fixel2voxel_execute(params, runner)
510
+
511
+
512
+ __all__ = [
513
+ "FIXEL2VOXEL_METADATA",
514
+ "Fixel2voxelConfigParamsDict",
515
+ "Fixel2voxelConfigParamsDictTagged",
516
+ "Fixel2voxelOutputs",
517
+ "Fixel2voxelParamsDict",
518
+ "Fixel2voxelParamsDictTagged",
519
+ "fixel2voxel",
520
+ "fixel2voxel_config",
521
+ "fixel2voxel_execute",
522
+ "fixel2voxel_params",
523
+ ]