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,613 @@
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
+ FIXEL2PEAKS_METADATA = Metadata(
9
+ id="0d92be2b2e1ceff15fcfee87e64154e86fddb5a8.boutiques",
10
+ name="fixel2peaks",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _Fixel2peaksConfigParamsDictNoTag = typing.TypedDict('_Fixel2peaksConfigParamsDictNoTag', {
17
+ "key": str,
18
+ "value": str,
19
+ })
20
+ Fixel2peaksConfigParamsDictTagged = typing.TypedDict('Fixel2peaksConfigParamsDictTagged', {
21
+ "@type": typing.Literal["config"],
22
+ "key": str,
23
+ "value": str,
24
+ })
25
+ Fixel2peaksConfigParamsDict = _Fixel2peaksConfigParamsDictNoTag | Fixel2peaksConfigParamsDictTagged
26
+
27
+
28
+ _Fixel2peaksVariousStringParamsDictNoTag = typing.TypedDict('_Fixel2peaksVariousStringParamsDictNoTag', {
29
+ "obj": str,
30
+ })
31
+ Fixel2peaksVariousStringParamsDictTagged = typing.TypedDict('Fixel2peaksVariousStringParamsDictTagged', {
32
+ "@type": typing.Literal["VariousString"],
33
+ "obj": str,
34
+ })
35
+ Fixel2peaksVariousStringParamsDict = _Fixel2peaksVariousStringParamsDictNoTag | Fixel2peaksVariousStringParamsDictTagged
36
+
37
+
38
+ _Fixel2peaksVariousFileParamsDictNoTag = typing.TypedDict('_Fixel2peaksVariousFileParamsDictNoTag', {
39
+ "obj": InputPathType,
40
+ })
41
+ Fixel2peaksVariousFileParamsDictTagged = typing.TypedDict('Fixel2peaksVariousFileParamsDictTagged', {
42
+ "@type": typing.Literal["VariousFile"],
43
+ "obj": InputPathType,
44
+ })
45
+ Fixel2peaksVariousFileParamsDict = _Fixel2peaksVariousFileParamsDictNoTag | Fixel2peaksVariousFileParamsDictTagged
46
+
47
+
48
+ _Fixel2peaksParamsDictNoTag = typing.TypedDict('_Fixel2peaksParamsDictNoTag', {
49
+ "number": typing.NotRequired[int | None],
50
+ "nan": bool,
51
+ "info": bool,
52
+ "quiet": bool,
53
+ "debug": bool,
54
+ "force": bool,
55
+ "nthreads": typing.NotRequired[int | None],
56
+ "config": typing.NotRequired[list[Fixel2peaksConfigParamsDict] | None],
57
+ "help": bool,
58
+ "version": bool,
59
+ "in": typing.Union[Fixel2peaksVariousStringParamsDictTagged, Fixel2peaksVariousFileParamsDictTagged],
60
+ "out": str,
61
+ })
62
+ Fixel2peaksParamsDictTagged = typing.TypedDict('Fixel2peaksParamsDictTagged', {
63
+ "@type": typing.Literal["mrtrix/fixel2peaks"],
64
+ "number": typing.NotRequired[int | None],
65
+ "nan": bool,
66
+ "info": bool,
67
+ "quiet": bool,
68
+ "debug": bool,
69
+ "force": bool,
70
+ "nthreads": typing.NotRequired[int | None],
71
+ "config": typing.NotRequired[list[Fixel2peaksConfigParamsDict] | None],
72
+ "help": bool,
73
+ "version": bool,
74
+ "in": typing.Union[Fixel2peaksVariousStringParamsDictTagged, Fixel2peaksVariousFileParamsDictTagged],
75
+ "out": str,
76
+ })
77
+ Fixel2peaksParamsDict = _Fixel2peaksParamsDictNoTag | Fixel2peaksParamsDictTagged
78
+
79
+
80
+ def fixel2peaks_in_cargs_dyn_fn(
81
+ t: str,
82
+ ) -> typing.Any:
83
+ """
84
+ Get build cargs function by command type.
85
+
86
+ Args:
87
+ t: Command type.
88
+ Returns:
89
+ Build cargs function.
90
+ """
91
+ return {
92
+ "VariousString": fixel2peaks_various_string_cargs,
93
+ "VariousFile": fixel2peaks_various_file_cargs,
94
+ }.get(t)
95
+
96
+
97
+ def fixel2peaks_in_validate_dyn_fn(
98
+ t: str,
99
+ ) -> typing.Any:
100
+ """
101
+ Get validate params function by command type.
102
+
103
+ Args:
104
+ t: Command type.
105
+ Returns:
106
+ Validate params function.
107
+ """
108
+ return {
109
+ "VariousString": fixel2peaks_various_string_validate,
110
+ "VariousFile": fixel2peaks_various_file_validate,
111
+ }.get(t)
112
+
113
+
114
+ def fixel2peaks_config(
115
+ key: str,
116
+ value: str,
117
+ ) -> Fixel2peaksConfigParamsDictTagged:
118
+ """
119
+ Build parameters.
120
+
121
+ Args:
122
+ key: temporarily set the value of an MRtrix config file entry.
123
+ value: temporarily set the value of an MRtrix config file entry.
124
+ Returns:
125
+ Parameter dictionary
126
+ """
127
+ params = {
128
+ "@type": "config",
129
+ "key": key,
130
+ "value": value,
131
+ }
132
+ return params
133
+
134
+
135
+ def fixel2peaks_config_validate(
136
+ params: typing.Any,
137
+ ) -> None:
138
+ """
139
+ Validate parameters. Throws an error if `params` is not a valid
140
+ `Fixel2peaksConfigParamsDict` object.
141
+
142
+ Args:
143
+ params: The parameters object to validate.
144
+ """
145
+ if params is None or not isinstance(params, dict):
146
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
147
+ if params.get("key", None) is None:
148
+ raise StyxValidationError("`key` must not be None")
149
+ if not isinstance(params["key"], str):
150
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
151
+ if params.get("value", None) is None:
152
+ raise StyxValidationError("`value` must not be None")
153
+ if not isinstance(params["value"], str):
154
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
155
+
156
+
157
+ def fixel2peaks_config_cargs(
158
+ params: Fixel2peaksConfigParamsDict,
159
+ execution: Execution,
160
+ ) -> list[str]:
161
+ """
162
+ Build command-line arguments from parameters.
163
+
164
+ Args:
165
+ params: The parameters.
166
+ execution: The execution object for resolving input paths.
167
+ Returns:
168
+ Command-line arguments.
169
+ """
170
+ cargs = []
171
+ cargs.append("-config")
172
+ cargs.append(params.get("key", None))
173
+ cargs.append(params.get("value", None))
174
+ return cargs
175
+
176
+
177
+ def fixel2peaks_various_string(
178
+ obj: str,
179
+ ) -> Fixel2peaksVariousStringParamsDictTagged:
180
+ """
181
+ Build parameters.
182
+
183
+ Args:
184
+ obj: String object.
185
+ Returns:
186
+ Parameter dictionary
187
+ """
188
+ params = {
189
+ "@type": "VariousString",
190
+ "obj": obj,
191
+ }
192
+ return params
193
+
194
+
195
+ def fixel2peaks_various_string_validate(
196
+ params: typing.Any,
197
+ ) -> None:
198
+ """
199
+ Validate parameters. Throws an error if `params` is not a valid
200
+ `Fixel2peaksVariousStringParamsDict` object.
201
+
202
+ Args:
203
+ params: The parameters object to validate.
204
+ """
205
+ if params is None or not isinstance(params, dict):
206
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
207
+ if params.get("obj", None) is None:
208
+ raise StyxValidationError("`obj` must not be None")
209
+ if not isinstance(params["obj"], str):
210
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `str`')
211
+
212
+
213
+ def fixel2peaks_various_string_cargs(
214
+ params: Fixel2peaksVariousStringParamsDict,
215
+ execution: Execution,
216
+ ) -> list[str]:
217
+ """
218
+ Build command-line arguments from parameters.
219
+
220
+ Args:
221
+ params: The parameters.
222
+ execution: The execution object for resolving input paths.
223
+ Returns:
224
+ Command-line arguments.
225
+ """
226
+ cargs = []
227
+ cargs.append(params.get("obj", None))
228
+ return cargs
229
+
230
+
231
+ def fixel2peaks_various_file(
232
+ obj: InputPathType,
233
+ ) -> Fixel2peaksVariousFileParamsDictTagged:
234
+ """
235
+ Build parameters.
236
+
237
+ Args:
238
+ obj: File object.
239
+ Returns:
240
+ Parameter dictionary
241
+ """
242
+ params = {
243
+ "@type": "VariousFile",
244
+ "obj": obj,
245
+ }
246
+ return params
247
+
248
+
249
+ def fixel2peaks_various_file_validate(
250
+ params: typing.Any,
251
+ ) -> None:
252
+ """
253
+ Validate parameters. Throws an error if `params` is not a valid
254
+ `Fixel2peaksVariousFileParamsDict` object.
255
+
256
+ Args:
257
+ params: The parameters object to validate.
258
+ """
259
+ if params is None or not isinstance(params, dict):
260
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
261
+ if params.get("obj", None) is None:
262
+ raise StyxValidationError("`obj` must not be None")
263
+ if not isinstance(params["obj"], (pathlib.Path, str)):
264
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `InputPathType`')
265
+
266
+
267
+ def fixel2peaks_various_file_cargs(
268
+ params: Fixel2peaksVariousFileParamsDict,
269
+ execution: Execution,
270
+ ) -> list[str]:
271
+ """
272
+ Build command-line arguments from parameters.
273
+
274
+ Args:
275
+ params: The parameters.
276
+ execution: The execution object for resolving input paths.
277
+ Returns:
278
+ Command-line arguments.
279
+ """
280
+ cargs = []
281
+ cargs.append(execution.input_file(params.get("obj", None)))
282
+ return cargs
283
+
284
+
285
+ class Fixel2peaksOutputs(typing.NamedTuple):
286
+ """
287
+ Output object returned when calling `Fixel2peaksParamsDict(...)`.
288
+ """
289
+ root: OutputPathType
290
+ """Output root folder. This is the root folder for all outputs."""
291
+ out: OutputPathType
292
+ """the output peaks image"""
293
+
294
+
295
+ def fixel2peaks_params(
296
+ in_: typing.Union[Fixel2peaksVariousStringParamsDictTagged, Fixel2peaksVariousFileParamsDictTagged],
297
+ out: str,
298
+ number: int | None = None,
299
+ nan: bool = False,
300
+ info: bool = False,
301
+ quiet: bool = False,
302
+ debug: bool = False,
303
+ force: bool = False,
304
+ nthreads: int | None = None,
305
+ config: list[Fixel2peaksConfigParamsDict] | None = None,
306
+ help_: bool = False,
307
+ version: bool = False,
308
+ ) -> Fixel2peaksParamsDictTagged:
309
+ """
310
+ Build parameters.
311
+
312
+ Args:
313
+ in_: the input fixel information.
314
+ out: the output peaks image.
315
+ number: maximum number of fixels in each voxel (default: based on input\
316
+ data).
317
+ nan: fill excess peak data with NaNs rather than zeroes.
318
+ info: display information messages.
319
+ quiet: do not display information messages or progress status;\
320
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
321
+ environment variable to a non-empty string.
322
+ debug: display debugging messages.
323
+ force: force overwrite of output files (caution: using the same file as\
324
+ input and output might cause unexpected behaviour).
325
+ nthreads: use this number of threads in multi-threaded applications\
326
+ (set to 0 to disable multi-threading).
327
+ config: temporarily set the value of an MRtrix config file entry.
328
+ help_: display this information page and exit.
329
+ version: display version information and exit.
330
+ Returns:
331
+ Parameter dictionary
332
+ """
333
+ params = {
334
+ "@type": "mrtrix/fixel2peaks",
335
+ "nan": nan,
336
+ "info": info,
337
+ "quiet": quiet,
338
+ "debug": debug,
339
+ "force": force,
340
+ "help": help_,
341
+ "version": version,
342
+ "in": in_,
343
+ "out": out,
344
+ }
345
+ if number is not None:
346
+ params["number"] = number
347
+ if nthreads is not None:
348
+ params["nthreads"] = nthreads
349
+ if config is not None:
350
+ params["config"] = config
351
+ return params
352
+
353
+
354
+ def fixel2peaks_validate(
355
+ params: typing.Any,
356
+ ) -> None:
357
+ """
358
+ Validate parameters. Throws an error if `params` is not a valid
359
+ `Fixel2peaksParamsDict` object.
360
+
361
+ Args:
362
+ params: The parameters object to validate.
363
+ """
364
+ if params is None or not isinstance(params, dict):
365
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
366
+ if params.get("number", None) is not None:
367
+ if not isinstance(params["number"], int):
368
+ raise StyxValidationError(f'`number` has the wrong type: Received `{type(params.get("number", None))}` expected `int | None`')
369
+ if params.get("nan", False) is None:
370
+ raise StyxValidationError("`nan` must not be None")
371
+ if not isinstance(params["nan"], bool):
372
+ raise StyxValidationError(f'`nan` has the wrong type: Received `{type(params.get("nan", False))}` expected `bool`')
373
+ if params.get("info", False) is None:
374
+ raise StyxValidationError("`info` must not be None")
375
+ if not isinstance(params["info"], bool):
376
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
377
+ if params.get("quiet", False) is None:
378
+ raise StyxValidationError("`quiet` must not be None")
379
+ if not isinstance(params["quiet"], bool):
380
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
381
+ if params.get("debug", False) is None:
382
+ raise StyxValidationError("`debug` must not be None")
383
+ if not isinstance(params["debug"], bool):
384
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
385
+ if params.get("force", False) is None:
386
+ raise StyxValidationError("`force` must not be None")
387
+ if not isinstance(params["force"], bool):
388
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
389
+ if params.get("nthreads", None) is not None:
390
+ if not isinstance(params["nthreads"], int):
391
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
392
+ if params.get("config", None) is not None:
393
+ if not isinstance(params["config"], list):
394
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[Fixel2peaksConfigParamsDict] | None`')
395
+ for e in params["config"]:
396
+ fixel2peaks_config_validate(e)
397
+ if params.get("help", False) is None:
398
+ raise StyxValidationError("`help` must not be None")
399
+ if not isinstance(params["help"], bool):
400
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
401
+ if params.get("version", False) is None:
402
+ raise StyxValidationError("`version` must not be None")
403
+ if not isinstance(params["version"], bool):
404
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
405
+ if params.get("in", None) is None:
406
+ raise StyxValidationError("`in` must not be None")
407
+ if not isinstance(params["in"], dict):
408
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params["in"])}\'')
409
+ if "@type" not in params["in"]:
410
+ raise StyxValidationError("Params object is missing `@type`")
411
+ if params["in"]["@type"] not in ["VariousString", "VariousFile"]:
412
+ raise StyxValidationError("Parameter `in`s `@type` must be one of [\"VariousString\", \"VariousFile\"]")
413
+ fixel2peaks_in_validate_dyn_fn(params["in"]["@type"])(params["in"])
414
+ if params.get("out", None) is None:
415
+ raise StyxValidationError("`out` must not be None")
416
+ if not isinstance(params["out"], str):
417
+ raise StyxValidationError(f'`out` has the wrong type: Received `{type(params.get("out", None))}` expected `str`')
418
+
419
+
420
+ def fixel2peaks_cargs(
421
+ params: Fixel2peaksParamsDict,
422
+ execution: Execution,
423
+ ) -> list[str]:
424
+ """
425
+ Build command-line arguments from parameters.
426
+
427
+ Args:
428
+ params: The parameters.
429
+ execution: The execution object for resolving input paths.
430
+ Returns:
431
+ Command-line arguments.
432
+ """
433
+ cargs = []
434
+ cargs.append("fixel2peaks")
435
+ if params.get("number", None) is not None:
436
+ cargs.extend([
437
+ "-number",
438
+ str(params.get("number", None))
439
+ ])
440
+ if params.get("nan", False):
441
+ cargs.append("-nan")
442
+ if params.get("info", False):
443
+ cargs.append("-info")
444
+ if params.get("quiet", False):
445
+ cargs.append("-quiet")
446
+ if params.get("debug", False):
447
+ cargs.append("-debug")
448
+ if params.get("force", False):
449
+ cargs.append("-force")
450
+ if params.get("nthreads", None) is not None:
451
+ cargs.extend([
452
+ "-nthreads",
453
+ str(params.get("nthreads", None))
454
+ ])
455
+ if params.get("config", None) is not None:
456
+ cargs.extend([a for c in [fixel2peaks_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
457
+ if params.get("help", False):
458
+ cargs.append("-help")
459
+ if params.get("version", False):
460
+ cargs.append("-version")
461
+ cargs.extend(fixel2peaks_in_cargs_dyn_fn(params.get("in", None)["@type"])(params.get("in", None), execution))
462
+ cargs.append(params.get("out", None))
463
+ return cargs
464
+
465
+
466
+ def fixel2peaks_outputs(
467
+ params: Fixel2peaksParamsDict,
468
+ execution: Execution,
469
+ ) -> Fixel2peaksOutputs:
470
+ """
471
+ Build outputs object containing output file paths and possibly stdout/stderr.
472
+
473
+ Args:
474
+ params: The parameters.
475
+ execution: The execution object for resolving input paths.
476
+ Returns:
477
+ Outputs object.
478
+ """
479
+ ret = Fixel2peaksOutputs(
480
+ root=execution.output_file("."),
481
+ out=execution.output_file(params.get("out", None)),
482
+ )
483
+ return ret
484
+
485
+
486
+ def fixel2peaks_execute(
487
+ params: Fixel2peaksParamsDict,
488
+ runner: Runner | None = None,
489
+ ) -> Fixel2peaksOutputs:
490
+ """
491
+ fixel2peaks
492
+
493
+ Convert data in the fixel directory format into a 4D image of 3-vectors.
494
+
495
+ If a fixel data file is provided as input, then the 3-vectors in the output
496
+ image will be scaled based on the data in that file. If the input is instead
497
+ the fixel directory, or the index or directions file, then all output
498
+ 3-vectors will possess unit norm.
499
+
500
+ References:
501
+
502
+ .
503
+
504
+ Author: MRTrix3 Developers
505
+
506
+ URL: https://www.mrtrix.org/
507
+
508
+ Args:
509
+ params: The parameters.
510
+ runner: Command runner.
511
+ Returns:
512
+ NamedTuple of outputs (described in `Fixel2peaksOutputs`).
513
+ """
514
+ fixel2peaks_validate(params)
515
+ runner = runner or get_global_runner()
516
+ execution = runner.start_execution(FIXEL2PEAKS_METADATA)
517
+ params = execution.params(params)
518
+ cargs = fixel2peaks_cargs(params, execution)
519
+ ret = fixel2peaks_outputs(params, execution)
520
+ execution.run(cargs)
521
+ return ret
522
+
523
+
524
+ def fixel2peaks(
525
+ in_: typing.Union[Fixel2peaksVariousStringParamsDictTagged, Fixel2peaksVariousFileParamsDictTagged],
526
+ out: str,
527
+ number: int | None = None,
528
+ nan: bool = False,
529
+ info: bool = False,
530
+ quiet: bool = False,
531
+ debug: bool = False,
532
+ force: bool = False,
533
+ nthreads: int | None = None,
534
+ config: list[Fixel2peaksConfigParamsDict] | None = None,
535
+ help_: bool = False,
536
+ version: bool = False,
537
+ runner: Runner | None = None,
538
+ ) -> Fixel2peaksOutputs:
539
+ """
540
+ fixel2peaks
541
+
542
+ Convert data in the fixel directory format into a 4D image of 3-vectors.
543
+
544
+ If a fixel data file is provided as input, then the 3-vectors in the output
545
+ image will be scaled based on the data in that file. If the input is instead
546
+ the fixel directory, or the index or directions file, then all output
547
+ 3-vectors will possess unit norm.
548
+
549
+ References:
550
+
551
+ .
552
+
553
+ Author: MRTrix3 Developers
554
+
555
+ URL: https://www.mrtrix.org/
556
+
557
+ Args:
558
+ in_: the input fixel information.
559
+ out: the output peaks image.
560
+ number: maximum number of fixels in each voxel (default: based on input\
561
+ data).
562
+ nan: fill excess peak data with NaNs rather than zeroes.
563
+ info: display information messages.
564
+ quiet: do not display information messages or progress status;\
565
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
566
+ environment variable to a non-empty string.
567
+ debug: display debugging messages.
568
+ force: force overwrite of output files (caution: using the same file as\
569
+ input and output might cause unexpected behaviour).
570
+ nthreads: use this number of threads in multi-threaded applications\
571
+ (set to 0 to disable multi-threading).
572
+ config: temporarily set the value of an MRtrix config file entry.
573
+ help_: display this information page and exit.
574
+ version: display version information and exit.
575
+ runner: Command runner.
576
+ Returns:
577
+ NamedTuple of outputs (described in `Fixel2peaksOutputs`).
578
+ """
579
+ params = fixel2peaks_params(
580
+ number=number,
581
+ nan=nan,
582
+ info=info,
583
+ quiet=quiet,
584
+ debug=debug,
585
+ force=force,
586
+ nthreads=nthreads,
587
+ config=config,
588
+ help_=help_,
589
+ version=version,
590
+ in_=in_,
591
+ out=out,
592
+ )
593
+ return fixel2peaks_execute(params, runner)
594
+
595
+
596
+ __all__ = [
597
+ "FIXEL2PEAKS_METADATA",
598
+ "Fixel2peaksConfigParamsDict",
599
+ "Fixel2peaksConfigParamsDictTagged",
600
+ "Fixel2peaksOutputs",
601
+ "Fixel2peaksParamsDict",
602
+ "Fixel2peaksParamsDictTagged",
603
+ "Fixel2peaksVariousFileParamsDict",
604
+ "Fixel2peaksVariousFileParamsDictTagged",
605
+ "Fixel2peaksVariousStringParamsDict",
606
+ "Fixel2peaksVariousStringParamsDictTagged",
607
+ "fixel2peaks",
608
+ "fixel2peaks_config",
609
+ "fixel2peaks_execute",
610
+ "fixel2peaks_params",
611
+ "fixel2peaks_various_file",
612
+ "fixel2peaks_various_string",
613
+ ]