niwrap-mrtrix 0.5.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.

Potentially problematic release.


This version of niwrap-mrtrix might be problematic. Click here for more details.

Files changed (119) hide show
  1. niwrap_mrtrix/mrtrix/__init__.py +130 -0
  2. niwrap_mrtrix/mrtrix/afdconnectivity.py +445 -0
  3. niwrap_mrtrix/mrtrix/amp2response.py +453 -0
  4. niwrap_mrtrix/mrtrix/amp2sh.py +656 -0
  5. niwrap_mrtrix/mrtrix/connectome2tck.py +470 -0
  6. niwrap_mrtrix/mrtrix/connectomeedit.py +338 -0
  7. niwrap_mrtrix/mrtrix/connectomestats.py +767 -0
  8. niwrap_mrtrix/mrtrix/dcmedit.py +440 -0
  9. niwrap_mrtrix/mrtrix/dcminfo.py +416 -0
  10. niwrap_mrtrix/mrtrix/dirflip.py +362 -0
  11. niwrap_mrtrix/mrtrix/dirgen.py +423 -0
  12. niwrap_mrtrix/mrtrix/dirmerge.py +365 -0
  13. niwrap_mrtrix/mrtrix/dirorder.py +347 -0
  14. niwrap_mrtrix/mrtrix/dirsplit.py +358 -0
  15. niwrap_mrtrix/mrtrix/dirstat.py +530 -0
  16. niwrap_mrtrix/mrtrix/dwi2adc.py +428 -0
  17. niwrap_mrtrix/mrtrix/dwi2fod.py +879 -0
  18. niwrap_mrtrix/mrtrix/dwi2mask.py +463 -0
  19. niwrap_mrtrix/mrtrix/dwi2response.py +1295 -0
  20. niwrap_mrtrix/mrtrix/dwi2tensor.py +587 -0
  21. niwrap_mrtrix/mrtrix/dwibiascorrect.py +467 -0
  22. niwrap_mrtrix/mrtrix/dwidenoise.py +478 -0
  23. niwrap_mrtrix/mrtrix/dwiextract.py +825 -0
  24. niwrap_mrtrix/mrtrix/dwigradcheck.py +534 -0
  25. niwrap_mrtrix/mrtrix/fixel2peaks.py +452 -0
  26. niwrap_mrtrix/mrtrix/fixel2sh.py +357 -0
  27. niwrap_mrtrix/mrtrix/fixel2tsf.py +357 -0
  28. niwrap_mrtrix/mrtrix/fixel2voxel.py +437 -0
  29. niwrap_mrtrix/mrtrix/fixelcfestats.py +893 -0
  30. niwrap_mrtrix/mrtrix/fixelconnectivity.py +391 -0
  31. niwrap_mrtrix/mrtrix/fixelconvert.py +588 -0
  32. niwrap_mrtrix/mrtrix/fixelcorrespondence.py +371 -0
  33. niwrap_mrtrix/mrtrix/fixelcrop.py +348 -0
  34. niwrap_mrtrix/mrtrix/fixelfilter.py +616 -0
  35. niwrap_mrtrix/mrtrix/fixelreorient.py +361 -0
  36. niwrap_mrtrix/mrtrix/fod2dec.py +469 -0
  37. niwrap_mrtrix/mrtrix/fod2fixel.py +530 -0
  38. niwrap_mrtrix/mrtrix/label2colour.py +351 -0
  39. niwrap_mrtrix/mrtrix/label2mesh.py +343 -0
  40. niwrap_mrtrix/mrtrix/labelconvert.py +377 -0
  41. niwrap_mrtrix/mrtrix/labelstats.py +344 -0
  42. niwrap_mrtrix/mrtrix/maskdump.py +336 -0
  43. niwrap_mrtrix/mrtrix/maskfilter.py +537 -0
  44. niwrap_mrtrix/mrtrix/mesh2voxel.py +348 -0
  45. niwrap_mrtrix/mrtrix/meshconvert.py +410 -0
  46. niwrap_mrtrix/mrtrix/meshfilter.py +370 -0
  47. niwrap_mrtrix/mrtrix/mraverageheader.py +396 -0
  48. niwrap_mrtrix/mrtrix/mrcalc.py +3047 -0
  49. niwrap_mrtrix/mrtrix/mrcat.py +382 -0
  50. niwrap_mrtrix/mrtrix/mrcentroid.py +344 -0
  51. niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +363 -0
  52. niwrap_mrtrix/mrtrix/mrclusterstats.py +736 -0
  53. niwrap_mrtrix/mrtrix/mrcolour.py +401 -0
  54. niwrap_mrtrix/mrtrix/mrconvert.py +1423 -0
  55. niwrap_mrtrix/mrtrix/mrdegibbs.py +443 -0
  56. niwrap_mrtrix/mrtrix/mrdump.py +351 -0
  57. niwrap_mrtrix/mrtrix/mredit.py +546 -0
  58. niwrap_mrtrix/mrtrix/mrfilter.py +716 -0
  59. niwrap_mrtrix/mrtrix/mrgrid.py +819 -0
  60. niwrap_mrtrix/mrtrix/mrhistmatch.py +403 -0
  61. niwrap_mrtrix/mrtrix/mrhistogram.py +393 -0
  62. niwrap_mrtrix/mrtrix/mrinfo.py +990 -0
  63. niwrap_mrtrix/mrtrix/mrmath.py +413 -0
  64. niwrap_mrtrix/mrtrix/mrmetric.py +425 -0
  65. niwrap_mrtrix/mrtrix/mrregister.py +1676 -0
  66. niwrap_mrtrix/mrtrix/mrstats.py +427 -0
  67. niwrap_mrtrix/mrtrix/mrthreshold.py +549 -0
  68. niwrap_mrtrix/mrtrix/mrtransform.py +1061 -0
  69. niwrap_mrtrix/mrtrix/mtnormalise.py +596 -0
  70. niwrap_mrtrix/mrtrix/peaks2amp.py +334 -0
  71. niwrap_mrtrix/mrtrix/peaks2fixel.py +349 -0
  72. niwrap_mrtrix/mrtrix/responsemean.py +316 -0
  73. niwrap_mrtrix/mrtrix/sh2amp.py +640 -0
  74. niwrap_mrtrix/mrtrix/sh2peaks.py +505 -0
  75. niwrap_mrtrix/mrtrix/sh2power.py +353 -0
  76. niwrap_mrtrix/mrtrix/sh2response.py +394 -0
  77. niwrap_mrtrix/mrtrix/shbasis.py +373 -0
  78. niwrap_mrtrix/mrtrix/shconv.py +498 -0
  79. niwrap_mrtrix/mrtrix/tck2connectome.py +580 -0
  80. niwrap_mrtrix/mrtrix/tck2fixel.py +363 -0
  81. niwrap_mrtrix/mrtrix/tckconvert.py +580 -0
  82. niwrap_mrtrix/mrtrix/tckdfc.py +551 -0
  83. niwrap_mrtrix/mrtrix/tckedit.py +1003 -0
  84. niwrap_mrtrix/mrtrix/tckgen.py +1983 -0
  85. niwrap_mrtrix/mrtrix/tckglobal.py +758 -0
  86. niwrap_mrtrix/mrtrix/tckinfo.py +329 -0
  87. niwrap_mrtrix/mrtrix/tckmap.py +772 -0
  88. niwrap_mrtrix/mrtrix/tckresample.py +580 -0
  89. niwrap_mrtrix/mrtrix/tcksample.py +404 -0
  90. niwrap_mrtrix/mrtrix/tcksift.py +592 -0
  91. niwrap_mrtrix/mrtrix/tcksift2.py +730 -0
  92. niwrap_mrtrix/mrtrix/tckstats.py +441 -0
  93. niwrap_mrtrix/mrtrix/tcktransform.py +340 -0
  94. niwrap_mrtrix/mrtrix/tensor2metric.py +544 -0
  95. niwrap_mrtrix/mrtrix/transformcalc.py +344 -0
  96. niwrap_mrtrix/mrtrix/transformcompose.py +465 -0
  97. niwrap_mrtrix/mrtrix/transformconvert.py +346 -0
  98. niwrap_mrtrix/mrtrix/tsfdivide.py +340 -0
  99. niwrap_mrtrix/mrtrix/tsfinfo.py +344 -0
  100. niwrap_mrtrix/mrtrix/tsfmult.py +340 -0
  101. niwrap_mrtrix/mrtrix/tsfsmooth.py +347 -0
  102. niwrap_mrtrix/mrtrix/tsfthreshold.py +349 -0
  103. niwrap_mrtrix/mrtrix/tsfvalidate.py +328 -0
  104. niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +359 -0
  105. niwrap_mrtrix/mrtrix/v_5tt2vis.py +412 -0
  106. niwrap_mrtrix/mrtrix/v_5ttcheck.py +337 -0
  107. niwrap_mrtrix/mrtrix/v_5ttedit.py +420 -0
  108. niwrap_mrtrix/mrtrix/v_5ttgen.py +816 -0
  109. niwrap_mrtrix/mrtrix/vectorstats.py +585 -0
  110. niwrap_mrtrix/mrtrix/voxel2fixel.py +350 -0
  111. niwrap_mrtrix/mrtrix/voxel2mesh.py +376 -0
  112. niwrap_mrtrix/mrtrix/warp2metric.py +449 -0
  113. niwrap_mrtrix/mrtrix/warpconvert.py +411 -0
  114. niwrap_mrtrix/mrtrix/warpcorrect.py +368 -0
  115. niwrap_mrtrix/mrtrix/warpinit.py +356 -0
  116. niwrap_mrtrix/mrtrix/warpinvert.py +370 -0
  117. niwrap_mrtrix-0.5.0.dist-info/METADATA +8 -0
  118. niwrap_mrtrix-0.5.0.dist-info/RECORD +119 -0
  119. niwrap_mrtrix-0.5.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,1003 @@
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
+ TCKEDIT_METADATA = Metadata(
9
+ id="e2f6cba90c1172611cb544017f9c4f8e312c397d.boutiques",
10
+ name="tckedit",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ TckeditVariousStringParameters = typing.TypedDict('TckeditVariousStringParameters', {
17
+ "__STYX_TYPE__": typing.Literal["VariousString"],
18
+ "obj": str,
19
+ })
20
+
21
+
22
+ TckeditVariousFileParameters = typing.TypedDict('TckeditVariousFileParameters', {
23
+ "__STYX_TYPE__": typing.Literal["VariousFile"],
24
+ "obj": InputPathType,
25
+ })
26
+
27
+
28
+ TckeditIncludeParameters = typing.TypedDict('TckeditIncludeParameters', {
29
+ "__STYX_TYPE__": typing.Literal["include"],
30
+ "spec": typing.Union[TckeditVariousStringParameters, TckeditVariousFileParameters],
31
+ })
32
+
33
+
34
+ TckeditIncludeOrderedParameters = typing.TypedDict('TckeditIncludeOrderedParameters', {
35
+ "__STYX_TYPE__": typing.Literal["include_ordered"],
36
+ "image": str,
37
+ })
38
+
39
+
40
+ TckeditVariousString1Parameters = typing.TypedDict('TckeditVariousString1Parameters', {
41
+ "__STYX_TYPE__": typing.Literal["VariousString_1"],
42
+ "obj": str,
43
+ })
44
+
45
+
46
+ TckeditVariousFile1Parameters = typing.TypedDict('TckeditVariousFile1Parameters', {
47
+ "__STYX_TYPE__": typing.Literal["VariousFile_1"],
48
+ "obj": InputPathType,
49
+ })
50
+
51
+
52
+ TckeditExcludeParameters = typing.TypedDict('TckeditExcludeParameters', {
53
+ "__STYX_TYPE__": typing.Literal["exclude"],
54
+ "spec": typing.Union[TckeditVariousString1Parameters, TckeditVariousFile1Parameters],
55
+ })
56
+
57
+
58
+ TckeditVariousString2Parameters = typing.TypedDict('TckeditVariousString2Parameters', {
59
+ "__STYX_TYPE__": typing.Literal["VariousString_2"],
60
+ "obj": str,
61
+ })
62
+
63
+
64
+ TckeditVariousFile2Parameters = typing.TypedDict('TckeditVariousFile2Parameters', {
65
+ "__STYX_TYPE__": typing.Literal["VariousFile_2"],
66
+ "obj": InputPathType,
67
+ })
68
+
69
+
70
+ TckeditMaskParameters = typing.TypedDict('TckeditMaskParameters', {
71
+ "__STYX_TYPE__": typing.Literal["mask"],
72
+ "spec": typing.Union[TckeditVariousString2Parameters, TckeditVariousFile2Parameters],
73
+ })
74
+
75
+
76
+ TckeditConfigParameters = typing.TypedDict('TckeditConfigParameters', {
77
+ "__STYX_TYPE__": typing.Literal["config"],
78
+ "key": str,
79
+ "value": str,
80
+ })
81
+
82
+
83
+ TckeditParameters = typing.TypedDict('TckeditParameters', {
84
+ "__STYX_TYPE__": typing.Literal["tckedit"],
85
+ "include": typing.NotRequired[list[TckeditIncludeParameters] | None],
86
+ "include_ordered": typing.NotRequired[list[TckeditIncludeOrderedParameters] | None],
87
+ "exclude": typing.NotRequired[list[TckeditExcludeParameters] | None],
88
+ "mask": typing.NotRequired[list[TckeditMaskParameters] | None],
89
+ "maxlength": typing.NotRequired[float | None],
90
+ "minlength": typing.NotRequired[float | None],
91
+ "number": typing.NotRequired[int | None],
92
+ "skip": typing.NotRequired[int | None],
93
+ "maxweight": typing.NotRequired[float | None],
94
+ "minweight": typing.NotRequired[float | None],
95
+ "inverse": bool,
96
+ "ends_only": bool,
97
+ "tck_weights_in": typing.NotRequired[InputPathType | None],
98
+ "tck_weights_out": typing.NotRequired[str | None],
99
+ "info": bool,
100
+ "quiet": bool,
101
+ "debug": bool,
102
+ "force": bool,
103
+ "nthreads": typing.NotRequired[int | None],
104
+ "config": typing.NotRequired[list[TckeditConfigParameters] | None],
105
+ "help": bool,
106
+ "version": bool,
107
+ "tracks_in": list[InputPathType],
108
+ "tracks_out": str,
109
+ })
110
+
111
+
112
+ def dyn_cargs(
113
+ t: str,
114
+ ) -> typing.Any:
115
+ """
116
+ Get build cargs function by command type.
117
+
118
+ Args:
119
+ t: Command type.
120
+ Returns:
121
+ Build cargs function.
122
+ """
123
+ return {
124
+ "tckedit": tckedit_cargs,
125
+ "include": tckedit_include_cargs,
126
+ "VariousString": tckedit_various_string_cargs,
127
+ "VariousFile": tckedit_various_file_cargs,
128
+ "include_ordered": tckedit_include_ordered_cargs,
129
+ "exclude": tckedit_exclude_cargs,
130
+ "VariousString_1": tckedit_various_string_1_cargs,
131
+ "VariousFile_1": tckedit_various_file_1_cargs,
132
+ "mask": tckedit_mask_cargs,
133
+ "VariousString_2": tckedit_various_string_2_cargs,
134
+ "VariousFile_2": tckedit_various_file_2_cargs,
135
+ "config": tckedit_config_cargs,
136
+ }.get(t)
137
+
138
+
139
+ def dyn_outputs(
140
+ t: str,
141
+ ) -> typing.Any:
142
+ """
143
+ Get build outputs function by command type.
144
+
145
+ Args:
146
+ t: Command type.
147
+ Returns:
148
+ Build outputs function.
149
+ """
150
+ return {
151
+ "tckedit": tckedit_outputs,
152
+ }.get(t)
153
+
154
+
155
+ def tckedit_various_string_params(
156
+ obj: str,
157
+ ) -> TckeditVariousStringParameters:
158
+ """
159
+ Build parameters.
160
+
161
+ Args:
162
+ obj: String object.
163
+ Returns:
164
+ Parameter dictionary
165
+ """
166
+ params = {
167
+ "__STYXTYPE__": "VariousString",
168
+ "obj": obj,
169
+ }
170
+ return params
171
+
172
+
173
+ def tckedit_various_string_cargs(
174
+ params: TckeditVariousStringParameters,
175
+ execution: Execution,
176
+ ) -> list[str]:
177
+ """
178
+ Build command-line arguments from parameters.
179
+
180
+ Args:
181
+ params: The parameters.
182
+ execution: The execution object for resolving input paths.
183
+ Returns:
184
+ Command-line arguments.
185
+ """
186
+ cargs = []
187
+ cargs.append(params.get("obj"))
188
+ return cargs
189
+
190
+
191
+ def tckedit_various_file_params(
192
+ obj: InputPathType,
193
+ ) -> TckeditVariousFileParameters:
194
+ """
195
+ Build parameters.
196
+
197
+ Args:
198
+ obj: File object.
199
+ Returns:
200
+ Parameter dictionary
201
+ """
202
+ params = {
203
+ "__STYXTYPE__": "VariousFile",
204
+ "obj": obj,
205
+ }
206
+ return params
207
+
208
+
209
+ def tckedit_various_file_cargs(
210
+ params: TckeditVariousFileParameters,
211
+ execution: Execution,
212
+ ) -> list[str]:
213
+ """
214
+ Build command-line arguments from parameters.
215
+
216
+ Args:
217
+ params: The parameters.
218
+ execution: The execution object for resolving input paths.
219
+ Returns:
220
+ Command-line arguments.
221
+ """
222
+ cargs = []
223
+ cargs.append(execution.input_file(params.get("obj")))
224
+ return cargs
225
+
226
+
227
+ def tckedit_include_params(
228
+ spec: typing.Union[TckeditVariousStringParameters, TckeditVariousFileParameters],
229
+ ) -> TckeditIncludeParameters:
230
+ """
231
+ Build parameters.
232
+
233
+ Args:
234
+ spec: specify an inclusion region of interest, as either a binary mask\
235
+ image, or as a sphere using 4 comma-separared values (x,y,z,radius).\
236
+ Streamlines must traverse ALL inclusion regions to be accepted.
237
+ Returns:
238
+ Parameter dictionary
239
+ """
240
+ params = {
241
+ "__STYXTYPE__": "include",
242
+ "spec": spec,
243
+ }
244
+ return params
245
+
246
+
247
+ def tckedit_include_cargs(
248
+ params: TckeditIncludeParameters,
249
+ execution: Execution,
250
+ ) -> list[str]:
251
+ """
252
+ Build command-line arguments from parameters.
253
+
254
+ Args:
255
+ params: The parameters.
256
+ execution: The execution object for resolving input paths.
257
+ Returns:
258
+ Command-line arguments.
259
+ """
260
+ cargs = []
261
+ cargs.append("-include")
262
+ cargs.extend(dyn_cargs(params.get("spec")["__STYXTYPE__"])(params.get("spec"), execution))
263
+ return cargs
264
+
265
+
266
+ def tckedit_include_ordered_params(
267
+ image: str,
268
+ ) -> TckeditIncludeOrderedParameters:
269
+ """
270
+ Build parameters.
271
+
272
+ Args:
273
+ image: specify an inclusion region of interest, as either a binary mask\
274
+ image, or as a sphere using 4 comma-separared values (x,y,z,radius).\
275
+ Streamlines must traverse ALL inclusion_ordered regions in the order\
276
+ they are specified in order to be accepted.
277
+ Returns:
278
+ Parameter dictionary
279
+ """
280
+ params = {
281
+ "__STYXTYPE__": "include_ordered",
282
+ "image": image,
283
+ }
284
+ return params
285
+
286
+
287
+ def tckedit_include_ordered_cargs(
288
+ params: TckeditIncludeOrderedParameters,
289
+ execution: Execution,
290
+ ) -> list[str]:
291
+ """
292
+ Build command-line arguments from parameters.
293
+
294
+ Args:
295
+ params: The parameters.
296
+ execution: The execution object for resolving input paths.
297
+ Returns:
298
+ Command-line arguments.
299
+ """
300
+ cargs = []
301
+ cargs.append("-include_ordered")
302
+ cargs.append(params.get("image"))
303
+ return cargs
304
+
305
+
306
+ def tckedit_various_string_1_params(
307
+ obj: str,
308
+ ) -> TckeditVariousString1Parameters:
309
+ """
310
+ Build parameters.
311
+
312
+ Args:
313
+ obj: String object.
314
+ Returns:
315
+ Parameter dictionary
316
+ """
317
+ params = {
318
+ "__STYXTYPE__": "VariousString_1",
319
+ "obj": obj,
320
+ }
321
+ return params
322
+
323
+
324
+ def tckedit_various_string_1_cargs(
325
+ params: TckeditVariousString1Parameters,
326
+ execution: Execution,
327
+ ) -> list[str]:
328
+ """
329
+ Build command-line arguments from parameters.
330
+
331
+ Args:
332
+ params: The parameters.
333
+ execution: The execution object for resolving input paths.
334
+ Returns:
335
+ Command-line arguments.
336
+ """
337
+ cargs = []
338
+ cargs.append(params.get("obj"))
339
+ return cargs
340
+
341
+
342
+ def tckedit_various_file_1_params(
343
+ obj: InputPathType,
344
+ ) -> TckeditVariousFile1Parameters:
345
+ """
346
+ Build parameters.
347
+
348
+ Args:
349
+ obj: File object.
350
+ Returns:
351
+ Parameter dictionary
352
+ """
353
+ params = {
354
+ "__STYXTYPE__": "VariousFile_1",
355
+ "obj": obj,
356
+ }
357
+ return params
358
+
359
+
360
+ def tckedit_various_file_1_cargs(
361
+ params: TckeditVariousFile1Parameters,
362
+ execution: Execution,
363
+ ) -> list[str]:
364
+ """
365
+ Build command-line arguments from parameters.
366
+
367
+ Args:
368
+ params: The parameters.
369
+ execution: The execution object for resolving input paths.
370
+ Returns:
371
+ Command-line arguments.
372
+ """
373
+ cargs = []
374
+ cargs.append(execution.input_file(params.get("obj")))
375
+ return cargs
376
+
377
+
378
+ def tckedit_exclude_params(
379
+ spec: typing.Union[TckeditVariousString1Parameters, TckeditVariousFile1Parameters],
380
+ ) -> TckeditExcludeParameters:
381
+ """
382
+ Build parameters.
383
+
384
+ Args:
385
+ spec: specify an exclusion region of interest, as either a binary mask\
386
+ image, or as a sphere using 4 comma-separared values (x,y,z,radius).\
387
+ Streamlines that enter ANY exclude region will be discarded.
388
+ Returns:
389
+ Parameter dictionary
390
+ """
391
+ params = {
392
+ "__STYXTYPE__": "exclude",
393
+ "spec": spec,
394
+ }
395
+ return params
396
+
397
+
398
+ def tckedit_exclude_cargs(
399
+ params: TckeditExcludeParameters,
400
+ execution: Execution,
401
+ ) -> list[str]:
402
+ """
403
+ Build command-line arguments from parameters.
404
+
405
+ Args:
406
+ params: The parameters.
407
+ execution: The execution object for resolving input paths.
408
+ Returns:
409
+ Command-line arguments.
410
+ """
411
+ cargs = []
412
+ cargs.append("-exclude")
413
+ cargs.extend(dyn_cargs(params.get("spec")["__STYXTYPE__"])(params.get("spec"), execution))
414
+ return cargs
415
+
416
+
417
+ def tckedit_various_string_2_params(
418
+ obj: str,
419
+ ) -> TckeditVariousString2Parameters:
420
+ """
421
+ Build parameters.
422
+
423
+ Args:
424
+ obj: String object.
425
+ Returns:
426
+ Parameter dictionary
427
+ """
428
+ params = {
429
+ "__STYXTYPE__": "VariousString_2",
430
+ "obj": obj,
431
+ }
432
+ return params
433
+
434
+
435
+ def tckedit_various_string_2_cargs(
436
+ params: TckeditVariousString2Parameters,
437
+ execution: Execution,
438
+ ) -> list[str]:
439
+ """
440
+ Build command-line arguments from parameters.
441
+
442
+ Args:
443
+ params: The parameters.
444
+ execution: The execution object for resolving input paths.
445
+ Returns:
446
+ Command-line arguments.
447
+ """
448
+ cargs = []
449
+ cargs.append(params.get("obj"))
450
+ return cargs
451
+
452
+
453
+ def tckedit_various_file_2_params(
454
+ obj: InputPathType,
455
+ ) -> TckeditVariousFile2Parameters:
456
+ """
457
+ Build parameters.
458
+
459
+ Args:
460
+ obj: File object.
461
+ Returns:
462
+ Parameter dictionary
463
+ """
464
+ params = {
465
+ "__STYXTYPE__": "VariousFile_2",
466
+ "obj": obj,
467
+ }
468
+ return params
469
+
470
+
471
+ def tckedit_various_file_2_cargs(
472
+ params: TckeditVariousFile2Parameters,
473
+ execution: Execution,
474
+ ) -> list[str]:
475
+ """
476
+ Build command-line arguments from parameters.
477
+
478
+ Args:
479
+ params: The parameters.
480
+ execution: The execution object for resolving input paths.
481
+ Returns:
482
+ Command-line arguments.
483
+ """
484
+ cargs = []
485
+ cargs.append(execution.input_file(params.get("obj")))
486
+ return cargs
487
+
488
+
489
+ def tckedit_mask_params(
490
+ spec: typing.Union[TckeditVariousString2Parameters, TckeditVariousFile2Parameters],
491
+ ) -> TckeditMaskParameters:
492
+ """
493
+ Build parameters.
494
+
495
+ Args:
496
+ spec: specify a masking region of interest, as either a binary mask\
497
+ image, or as a sphere using 4 comma-separared values (x,y,z,radius). If\
498
+ defined, streamlines exiting the mask will be truncated.
499
+ Returns:
500
+ Parameter dictionary
501
+ """
502
+ params = {
503
+ "__STYXTYPE__": "mask",
504
+ "spec": spec,
505
+ }
506
+ return params
507
+
508
+
509
+ def tckedit_mask_cargs(
510
+ params: TckeditMaskParameters,
511
+ execution: Execution,
512
+ ) -> list[str]:
513
+ """
514
+ Build command-line arguments from parameters.
515
+
516
+ Args:
517
+ params: The parameters.
518
+ execution: The execution object for resolving input paths.
519
+ Returns:
520
+ Command-line arguments.
521
+ """
522
+ cargs = []
523
+ cargs.append("-mask")
524
+ cargs.extend(dyn_cargs(params.get("spec")["__STYXTYPE__"])(params.get("spec"), execution))
525
+ return cargs
526
+
527
+
528
+ def tckedit_config_params(
529
+ key: str,
530
+ value: str,
531
+ ) -> TckeditConfigParameters:
532
+ """
533
+ Build parameters.
534
+
535
+ Args:
536
+ key: temporarily set the value of an MRtrix config file entry.
537
+ value: temporarily set the value of an MRtrix config file entry.
538
+ Returns:
539
+ Parameter dictionary
540
+ """
541
+ params = {
542
+ "__STYXTYPE__": "config",
543
+ "key": key,
544
+ "value": value,
545
+ }
546
+ return params
547
+
548
+
549
+ def tckedit_config_cargs(
550
+ params: TckeditConfigParameters,
551
+ execution: Execution,
552
+ ) -> list[str]:
553
+ """
554
+ Build command-line arguments from parameters.
555
+
556
+ Args:
557
+ params: The parameters.
558
+ execution: The execution object for resolving input paths.
559
+ Returns:
560
+ Command-line arguments.
561
+ """
562
+ cargs = []
563
+ cargs.append("-config")
564
+ cargs.append(params.get("key"))
565
+ cargs.append(params.get("value"))
566
+ return cargs
567
+
568
+
569
+ class TckeditOutputs(typing.NamedTuple):
570
+ """
571
+ Output object returned when calling `tckedit(...)`.
572
+ """
573
+ root: OutputPathType
574
+ """Output root folder. This is the root folder for all outputs."""
575
+ tracks_out: OutputPathType
576
+ """the output track file"""
577
+ tck_weights_out: OutputPathType | None
578
+ """specify the path for an output text scalar file containing streamline
579
+ weights """
580
+
581
+
582
+ def tckedit_params(
583
+ tracks_in: list[InputPathType],
584
+ tracks_out: str,
585
+ include: list[TckeditIncludeParameters] | None = None,
586
+ include_ordered: list[TckeditIncludeOrderedParameters] | None = None,
587
+ exclude: list[TckeditExcludeParameters] | None = None,
588
+ mask: list[TckeditMaskParameters] | None = None,
589
+ maxlength: float | None = None,
590
+ minlength: float | None = None,
591
+ number: int | None = None,
592
+ skip: int | None = None,
593
+ maxweight: float | None = None,
594
+ minweight: float | None = None,
595
+ inverse: bool = False,
596
+ ends_only: bool = False,
597
+ tck_weights_in: InputPathType | None = None,
598
+ tck_weights_out: str | None = None,
599
+ info: bool = False,
600
+ quiet: bool = False,
601
+ debug: bool = False,
602
+ force: bool = False,
603
+ nthreads: int | None = None,
604
+ config: list[TckeditConfigParameters] | None = None,
605
+ help_: bool = False,
606
+ version: bool = False,
607
+ ) -> TckeditParameters:
608
+ """
609
+ Build parameters.
610
+
611
+ Args:
612
+ tracks_in: the input track file(s).
613
+ tracks_out: the output track file.
614
+ include: specify an inclusion region of interest, as either a binary\
615
+ mask image, or as a sphere using 4 comma-separared values\
616
+ (x,y,z,radius). Streamlines must traverse ALL inclusion regions to be\
617
+ accepted.
618
+ include_ordered: specify an inclusion region of interest, as either a\
619
+ binary mask image, or as a sphere using 4 comma-separared values\
620
+ (x,y,z,radius). Streamlines must traverse ALL inclusion_ordered regions\
621
+ in the order they are specified in order to be accepted.
622
+ exclude: specify an exclusion region of interest, as either a binary\
623
+ mask image, or as a sphere using 4 comma-separared values\
624
+ (x,y,z,radius). Streamlines that enter ANY exclude region will be\
625
+ discarded.
626
+ mask: specify a masking region of interest, as either a binary mask\
627
+ image, or as a sphere using 4 comma-separared values (x,y,z,radius). If\
628
+ defined, streamlines exiting the mask will be truncated.
629
+ maxlength: set the maximum length of any streamline in mm.
630
+ minlength: set the minimum length of any streamline in mm.
631
+ number: set the desired number of selected streamlines to be propagated\
632
+ to the output file.
633
+ skip: omit this number of selected streamlines before commencing\
634
+ writing to the output file.
635
+ maxweight: set the maximum weight of any streamline.
636
+ minweight: set the minimum weight of any streamline.
637
+ inverse: output the inverse selection of streamlines based on the\
638
+ criteria provided; i.e. only those streamlines that fail at least one\
639
+ selection criterion, and/or vertices that are outside masks if\
640
+ provided, will be written to file.
641
+ ends_only: only test the ends of each streamline against the provided\
642
+ include/exclude ROIs.
643
+ tck_weights_in: specify a text scalar file containing the streamline\
644
+ weights.
645
+ tck_weights_out: specify the path for an output text scalar file\
646
+ containing streamline weights.
647
+ info: display information messages.
648
+ quiet: do not display information messages or progress status;\
649
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
650
+ environment variable to a non-empty string.
651
+ debug: display debugging messages.
652
+ force: force overwrite of output files (caution: using the same file as\
653
+ input and output might cause unexpected behaviour).
654
+ nthreads: use this number of threads in multi-threaded applications\
655
+ (set to 0 to disable multi-threading).
656
+ config: temporarily set the value of an MRtrix config file entry.
657
+ help_: display this information page and exit.
658
+ version: display version information and exit.
659
+ Returns:
660
+ Parameter dictionary
661
+ """
662
+ params = {
663
+ "__STYXTYPE__": "tckedit",
664
+ "inverse": inverse,
665
+ "ends_only": ends_only,
666
+ "info": info,
667
+ "quiet": quiet,
668
+ "debug": debug,
669
+ "force": force,
670
+ "help": help_,
671
+ "version": version,
672
+ "tracks_in": tracks_in,
673
+ "tracks_out": tracks_out,
674
+ }
675
+ if include is not None:
676
+ params["include"] = include
677
+ if include_ordered is not None:
678
+ params["include_ordered"] = include_ordered
679
+ if exclude is not None:
680
+ params["exclude"] = exclude
681
+ if mask is not None:
682
+ params["mask"] = mask
683
+ if maxlength is not None:
684
+ params["maxlength"] = maxlength
685
+ if minlength is not None:
686
+ params["minlength"] = minlength
687
+ if number is not None:
688
+ params["number"] = number
689
+ if skip is not None:
690
+ params["skip"] = skip
691
+ if maxweight is not None:
692
+ params["maxweight"] = maxweight
693
+ if minweight is not None:
694
+ params["minweight"] = minweight
695
+ if tck_weights_in is not None:
696
+ params["tck_weights_in"] = tck_weights_in
697
+ if tck_weights_out is not None:
698
+ params["tck_weights_out"] = tck_weights_out
699
+ if nthreads is not None:
700
+ params["nthreads"] = nthreads
701
+ if config is not None:
702
+ params["config"] = config
703
+ return params
704
+
705
+
706
+ def tckedit_cargs(
707
+ params: TckeditParameters,
708
+ execution: Execution,
709
+ ) -> list[str]:
710
+ """
711
+ Build command-line arguments from parameters.
712
+
713
+ Args:
714
+ params: The parameters.
715
+ execution: The execution object for resolving input paths.
716
+ Returns:
717
+ Command-line arguments.
718
+ """
719
+ cargs = []
720
+ cargs.append("tckedit")
721
+ if params.get("include") is not None:
722
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("include")] for a in c])
723
+ if params.get("include_ordered") is not None:
724
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("include_ordered")] for a in c])
725
+ if params.get("exclude") is not None:
726
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("exclude")] for a in c])
727
+ if params.get("mask") is not None:
728
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("mask")] for a in c])
729
+ if params.get("maxlength") is not None:
730
+ cargs.extend([
731
+ "-maxlength",
732
+ str(params.get("maxlength"))
733
+ ])
734
+ if params.get("minlength") is not None:
735
+ cargs.extend([
736
+ "-minlength",
737
+ str(params.get("minlength"))
738
+ ])
739
+ if params.get("number") is not None:
740
+ cargs.extend([
741
+ "-number",
742
+ str(params.get("number"))
743
+ ])
744
+ if params.get("skip") is not None:
745
+ cargs.extend([
746
+ "-skip",
747
+ str(params.get("skip"))
748
+ ])
749
+ if params.get("maxweight") is not None:
750
+ cargs.extend([
751
+ "-maxweight",
752
+ str(params.get("maxweight"))
753
+ ])
754
+ if params.get("minweight") is not None:
755
+ cargs.extend([
756
+ "-minweight",
757
+ str(params.get("minweight"))
758
+ ])
759
+ if params.get("inverse"):
760
+ cargs.append("-inverse")
761
+ if params.get("ends_only"):
762
+ cargs.append("-ends_only")
763
+ if params.get("tck_weights_in") is not None:
764
+ cargs.extend([
765
+ "-tck_weights_in",
766
+ execution.input_file(params.get("tck_weights_in"))
767
+ ])
768
+ if params.get("tck_weights_out") is not None:
769
+ cargs.extend([
770
+ "-tck_weights_out",
771
+ params.get("tck_weights_out")
772
+ ])
773
+ if params.get("info"):
774
+ cargs.append("-info")
775
+ if params.get("quiet"):
776
+ cargs.append("-quiet")
777
+ if params.get("debug"):
778
+ cargs.append("-debug")
779
+ if params.get("force"):
780
+ cargs.append("-force")
781
+ if params.get("nthreads") is not None:
782
+ cargs.extend([
783
+ "-nthreads",
784
+ str(params.get("nthreads"))
785
+ ])
786
+ if params.get("config") is not None:
787
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
788
+ if params.get("help"):
789
+ cargs.append("-help")
790
+ if params.get("version"):
791
+ cargs.append("-version")
792
+ cargs.extend([execution.input_file(f) for f in params.get("tracks_in")])
793
+ cargs.append(params.get("tracks_out"))
794
+ return cargs
795
+
796
+
797
+ def tckedit_outputs(
798
+ params: TckeditParameters,
799
+ execution: Execution,
800
+ ) -> TckeditOutputs:
801
+ """
802
+ Build outputs object containing output file paths and possibly stdout/stderr.
803
+
804
+ Args:
805
+ params: The parameters.
806
+ execution: The execution object for resolving input paths.
807
+ Returns:
808
+ Outputs object.
809
+ """
810
+ ret = TckeditOutputs(
811
+ root=execution.output_file("."),
812
+ tracks_out=execution.output_file(params.get("tracks_out")),
813
+ tck_weights_out=execution.output_file(params.get("tck_weights_out")) if (params.get("tck_weights_out") is not None) else None,
814
+ )
815
+ return ret
816
+
817
+
818
+ def tckedit_execute(
819
+ params: TckeditParameters,
820
+ execution: Execution,
821
+ ) -> TckeditOutputs:
822
+ """
823
+ Perform various editing operations on track files.
824
+
825
+ This command can be used to perform various types of manipulations on track
826
+ data. A range of such manipulations are demonstrated in the examples
827
+ provided below.
828
+
829
+ References:
830
+
831
+ .
832
+
833
+ Author: MRTrix3 Developers
834
+
835
+ URL: https://www.mrtrix.org/
836
+
837
+ Args:
838
+ params: The parameters.
839
+ execution: The execution object.
840
+ Returns:
841
+ NamedTuple of outputs (described in `TckeditOutputs`).
842
+ """
843
+ params = execution.params(params)
844
+ cargs = tckedit_cargs(params, execution)
845
+ ret = tckedit_outputs(params, execution)
846
+ execution.run(cargs)
847
+ return ret
848
+
849
+
850
+ def tckedit(
851
+ tracks_in: list[InputPathType],
852
+ tracks_out: str,
853
+ include: list[TckeditIncludeParameters] | None = None,
854
+ include_ordered: list[TckeditIncludeOrderedParameters] | None = None,
855
+ exclude: list[TckeditExcludeParameters] | None = None,
856
+ mask: list[TckeditMaskParameters] | None = None,
857
+ maxlength: float | None = None,
858
+ minlength: float | None = None,
859
+ number: int | None = None,
860
+ skip: int | None = None,
861
+ maxweight: float | None = None,
862
+ minweight: float | None = None,
863
+ inverse: bool = False,
864
+ ends_only: bool = False,
865
+ tck_weights_in: InputPathType | None = None,
866
+ tck_weights_out: str | None = None,
867
+ info: bool = False,
868
+ quiet: bool = False,
869
+ debug: bool = False,
870
+ force: bool = False,
871
+ nthreads: int | None = None,
872
+ config: list[TckeditConfigParameters] | None = None,
873
+ help_: bool = False,
874
+ version: bool = False,
875
+ runner: Runner | None = None,
876
+ ) -> TckeditOutputs:
877
+ """
878
+ Perform various editing operations on track files.
879
+
880
+ This command can be used to perform various types of manipulations on track
881
+ data. A range of such manipulations are demonstrated in the examples
882
+ provided below.
883
+
884
+ References:
885
+
886
+ .
887
+
888
+ Author: MRTrix3 Developers
889
+
890
+ URL: https://www.mrtrix.org/
891
+
892
+ Args:
893
+ tracks_in: the input track file(s).
894
+ tracks_out: the output track file.
895
+ include: specify an inclusion region of interest, as either a binary\
896
+ mask image, or as a sphere using 4 comma-separared values\
897
+ (x,y,z,radius). Streamlines must traverse ALL inclusion regions to be\
898
+ accepted.
899
+ include_ordered: specify an inclusion region of interest, as either a\
900
+ binary mask image, or as a sphere using 4 comma-separared values\
901
+ (x,y,z,radius). Streamlines must traverse ALL inclusion_ordered regions\
902
+ in the order they are specified in order to be accepted.
903
+ exclude: specify an exclusion region of interest, as either a binary\
904
+ mask image, or as a sphere using 4 comma-separared values\
905
+ (x,y,z,radius). Streamlines that enter ANY exclude region will be\
906
+ discarded.
907
+ mask: specify a masking region of interest, as either a binary mask\
908
+ image, or as a sphere using 4 comma-separared values (x,y,z,radius). If\
909
+ defined, streamlines exiting the mask will be truncated.
910
+ maxlength: set the maximum length of any streamline in mm.
911
+ minlength: set the minimum length of any streamline in mm.
912
+ number: set the desired number of selected streamlines to be propagated\
913
+ to the output file.
914
+ skip: omit this number of selected streamlines before commencing\
915
+ writing to the output file.
916
+ maxweight: set the maximum weight of any streamline.
917
+ minweight: set the minimum weight of any streamline.
918
+ inverse: output the inverse selection of streamlines based on the\
919
+ criteria provided; i.e. only those streamlines that fail at least one\
920
+ selection criterion, and/or vertices that are outside masks if\
921
+ provided, will be written to file.
922
+ ends_only: only test the ends of each streamline against the provided\
923
+ include/exclude ROIs.
924
+ tck_weights_in: specify a text scalar file containing the streamline\
925
+ weights.
926
+ tck_weights_out: specify the path for an output text scalar file\
927
+ containing streamline weights.
928
+ info: display information messages.
929
+ quiet: do not display information messages or progress status;\
930
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
931
+ environment variable to a non-empty string.
932
+ debug: display debugging messages.
933
+ force: force overwrite of output files (caution: using the same file as\
934
+ input and output might cause unexpected behaviour).
935
+ nthreads: use this number of threads in multi-threaded applications\
936
+ (set to 0 to disable multi-threading).
937
+ config: temporarily set the value of an MRtrix config file entry.
938
+ help_: display this information page and exit.
939
+ version: display version information and exit.
940
+ runner: Command runner.
941
+ Returns:
942
+ NamedTuple of outputs (described in `TckeditOutputs`).
943
+ """
944
+ runner = runner or get_global_runner()
945
+ execution = runner.start_execution(TCKEDIT_METADATA)
946
+ params = tckedit_params(
947
+ include=include,
948
+ include_ordered=include_ordered,
949
+ exclude=exclude,
950
+ mask=mask,
951
+ maxlength=maxlength,
952
+ minlength=minlength,
953
+ number=number,
954
+ skip=skip,
955
+ maxweight=maxweight,
956
+ minweight=minweight,
957
+ inverse=inverse,
958
+ ends_only=ends_only,
959
+ tck_weights_in=tck_weights_in,
960
+ tck_weights_out=tck_weights_out,
961
+ info=info,
962
+ quiet=quiet,
963
+ debug=debug,
964
+ force=force,
965
+ nthreads=nthreads,
966
+ config=config,
967
+ help_=help_,
968
+ version=version,
969
+ tracks_in=tracks_in,
970
+ tracks_out=tracks_out,
971
+ )
972
+ return tckedit_execute(params, execution)
973
+
974
+
975
+ __all__ = [
976
+ "TCKEDIT_METADATA",
977
+ "TckeditConfigParameters",
978
+ "TckeditExcludeParameters",
979
+ "TckeditIncludeOrderedParameters",
980
+ "TckeditIncludeParameters",
981
+ "TckeditMaskParameters",
982
+ "TckeditOutputs",
983
+ "TckeditParameters",
984
+ "TckeditVariousFile1Parameters",
985
+ "TckeditVariousFile2Parameters",
986
+ "TckeditVariousFileParameters",
987
+ "TckeditVariousString1Parameters",
988
+ "TckeditVariousString2Parameters",
989
+ "TckeditVariousStringParameters",
990
+ "tckedit",
991
+ "tckedit_config_params",
992
+ "tckedit_exclude_params",
993
+ "tckedit_include_ordered_params",
994
+ "tckedit_include_params",
995
+ "tckedit_mask_params",
996
+ "tckedit_params",
997
+ "tckedit_various_file_1_params",
998
+ "tckedit_various_file_2_params",
999
+ "tckedit_various_file_params",
1000
+ "tckedit_various_string_1_params",
1001
+ "tckedit_various_string_2_params",
1002
+ "tckedit_various_string_params",
1003
+ ]