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,990 @@
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
+ MRINFO_METADATA = Metadata(
9
+ id="640aec1bccae29356c89f4af6bea995bd8e6eee5.boutiques",
10
+ name="mrinfo",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ MrinfoPropertyParameters = typing.TypedDict('MrinfoPropertyParameters', {
17
+ "__STYX_TYPE__": typing.Literal["property"],
18
+ "key": str,
19
+ })
20
+
21
+
22
+ MrinfoFslgradParameters = typing.TypedDict('MrinfoFslgradParameters', {
23
+ "__STYX_TYPE__": typing.Literal["fslgrad"],
24
+ "bvecs": InputPathType,
25
+ "bvals": InputPathType,
26
+ })
27
+
28
+
29
+ MrinfoExportGradFslParameters = typing.TypedDict('MrinfoExportGradFslParameters', {
30
+ "__STYX_TYPE__": typing.Literal["export_grad_fsl"],
31
+ "bvecs_path": str,
32
+ "bvals_path": str,
33
+ })
34
+
35
+
36
+ MrinfoExportPeEddyParameters = typing.TypedDict('MrinfoExportPeEddyParameters', {
37
+ "__STYX_TYPE__": typing.Literal["export_pe_eddy"],
38
+ "config": str,
39
+ "indices": str,
40
+ })
41
+
42
+
43
+ MrinfoConfigParameters = typing.TypedDict('MrinfoConfigParameters', {
44
+ "__STYX_TYPE__": typing.Literal["config"],
45
+ "key": str,
46
+ "value": str,
47
+ })
48
+
49
+
50
+ MrinfoParameters = typing.TypedDict('MrinfoParameters', {
51
+ "__STYX_TYPE__": typing.Literal["mrinfo"],
52
+ "all": bool,
53
+ "name": bool,
54
+ "format": bool,
55
+ "ndim": bool,
56
+ "size": bool,
57
+ "spacing": bool,
58
+ "datatype": bool,
59
+ "strides": bool,
60
+ "offset": bool,
61
+ "multiplier": bool,
62
+ "transform": bool,
63
+ "property": typing.NotRequired[list[MrinfoPropertyParameters] | None],
64
+ "json_keyval": typing.NotRequired[str | None],
65
+ "json_all": typing.NotRequired[str | None],
66
+ "grad": typing.NotRequired[InputPathType | None],
67
+ "fslgrad": typing.NotRequired[MrinfoFslgradParameters | None],
68
+ "bvalue_scaling": typing.NotRequired[str | None],
69
+ "export_grad_mrtrix": typing.NotRequired[str | None],
70
+ "export_grad_fsl": typing.NotRequired[MrinfoExportGradFslParameters | None],
71
+ "dwgrad": bool,
72
+ "shell_bvalues": bool,
73
+ "shell_sizes": bool,
74
+ "shell_indices": bool,
75
+ "export_pe_table": typing.NotRequired[str | None],
76
+ "export_pe_eddy": typing.NotRequired[MrinfoExportPeEddyParameters | None],
77
+ "petable": bool,
78
+ "nodelete": bool,
79
+ "info": bool,
80
+ "quiet": bool,
81
+ "debug": bool,
82
+ "force": bool,
83
+ "nthreads": typing.NotRequired[int | None],
84
+ "config": typing.NotRequired[list[MrinfoConfigParameters] | None],
85
+ "help": bool,
86
+ "version": bool,
87
+ "image": list[InputPathType],
88
+ })
89
+
90
+
91
+ def dyn_cargs(
92
+ t: str,
93
+ ) -> typing.Any:
94
+ """
95
+ Get build cargs function by command type.
96
+
97
+ Args:
98
+ t: Command type.
99
+ Returns:
100
+ Build cargs function.
101
+ """
102
+ return {
103
+ "mrinfo": mrinfo_cargs,
104
+ "property": mrinfo_property_cargs,
105
+ "fslgrad": mrinfo_fslgrad_cargs,
106
+ "export_grad_fsl": mrinfo_export_grad_fsl_cargs,
107
+ "export_pe_eddy": mrinfo_export_pe_eddy_cargs,
108
+ "config": mrinfo_config_cargs,
109
+ }.get(t)
110
+
111
+
112
+ def dyn_outputs(
113
+ t: str,
114
+ ) -> typing.Any:
115
+ """
116
+ Get build outputs function by command type.
117
+
118
+ Args:
119
+ t: Command type.
120
+ Returns:
121
+ Build outputs function.
122
+ """
123
+ return {
124
+ "mrinfo": mrinfo_outputs,
125
+ "export_grad_fsl": mrinfo_export_grad_fsl_outputs,
126
+ "export_pe_eddy": mrinfo_export_pe_eddy_outputs,
127
+ }.get(t)
128
+
129
+
130
+ def mrinfo_property_params(
131
+ key: str,
132
+ ) -> MrinfoPropertyParameters:
133
+ """
134
+ Build parameters.
135
+
136
+ Args:
137
+ key: any text properties embedded in the image header under the\
138
+ specified key (use 'all' to list all keys found).
139
+ Returns:
140
+ Parameter dictionary
141
+ """
142
+ params = {
143
+ "__STYXTYPE__": "property",
144
+ "key": key,
145
+ }
146
+ return params
147
+
148
+
149
+ def mrinfo_property_cargs(
150
+ params: MrinfoPropertyParameters,
151
+ execution: Execution,
152
+ ) -> list[str]:
153
+ """
154
+ Build command-line arguments from parameters.
155
+
156
+ Args:
157
+ params: The parameters.
158
+ execution: The execution object for resolving input paths.
159
+ Returns:
160
+ Command-line arguments.
161
+ """
162
+ cargs = []
163
+ cargs.append("-property")
164
+ cargs.append(params.get("key"))
165
+ return cargs
166
+
167
+
168
+ def mrinfo_fslgrad_params(
169
+ bvecs: InputPathType,
170
+ bvals: InputPathType,
171
+ ) -> MrinfoFslgradParameters:
172
+ """
173
+ Build parameters.
174
+
175
+ Args:
176
+ bvecs: Provide the diffusion-weighted gradient scheme used in the\
177
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
178
+ scheme is present in the input image header, the data provided with\
179
+ this option will be instead used.
180
+ bvals: Provide the diffusion-weighted gradient scheme used in the\
181
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
182
+ scheme is present in the input image header, the data provided with\
183
+ this option will be instead used.
184
+ Returns:
185
+ Parameter dictionary
186
+ """
187
+ params = {
188
+ "__STYXTYPE__": "fslgrad",
189
+ "bvecs": bvecs,
190
+ "bvals": bvals,
191
+ }
192
+ return params
193
+
194
+
195
+ def mrinfo_fslgrad_cargs(
196
+ params: MrinfoFslgradParameters,
197
+ execution: Execution,
198
+ ) -> list[str]:
199
+ """
200
+ Build command-line arguments from parameters.
201
+
202
+ Args:
203
+ params: The parameters.
204
+ execution: The execution object for resolving input paths.
205
+ Returns:
206
+ Command-line arguments.
207
+ """
208
+ cargs = []
209
+ cargs.append("-fslgrad")
210
+ cargs.append(execution.input_file(params.get("bvecs")))
211
+ cargs.append(execution.input_file(params.get("bvals")))
212
+ return cargs
213
+
214
+
215
+ class MrinfoExportGradFslOutputs(typing.NamedTuple):
216
+ """
217
+ Output object returned when calling `MrinfoExportGradFslParameters | None(...)`.
218
+ """
219
+ root: OutputPathType
220
+ """Output root folder. This is the root folder for all outputs."""
221
+ bvecs_path: OutputPathType
222
+ """export the diffusion-weighted gradient table to files in FSL (bvecs /
223
+ bvals) format"""
224
+ bvals_path: OutputPathType
225
+ """export the diffusion-weighted gradient table to files in FSL (bvecs /
226
+ bvals) format"""
227
+
228
+
229
+ def mrinfo_export_grad_fsl_params(
230
+ bvecs_path: str,
231
+ bvals_path: str,
232
+ ) -> MrinfoExportGradFslParameters:
233
+ """
234
+ Build parameters.
235
+
236
+ Args:
237
+ bvecs_path: export the diffusion-weighted gradient table to files in\
238
+ FSL (bvecs / bvals) format.
239
+ bvals_path: export the diffusion-weighted gradient table to files in\
240
+ FSL (bvecs / bvals) format.
241
+ Returns:
242
+ Parameter dictionary
243
+ """
244
+ params = {
245
+ "__STYXTYPE__": "export_grad_fsl",
246
+ "bvecs_path": bvecs_path,
247
+ "bvals_path": bvals_path,
248
+ }
249
+ return params
250
+
251
+
252
+ def mrinfo_export_grad_fsl_cargs(
253
+ params: MrinfoExportGradFslParameters,
254
+ execution: Execution,
255
+ ) -> list[str]:
256
+ """
257
+ Build command-line arguments from parameters.
258
+
259
+ Args:
260
+ params: The parameters.
261
+ execution: The execution object for resolving input paths.
262
+ Returns:
263
+ Command-line arguments.
264
+ """
265
+ cargs = []
266
+ cargs.append("-export_grad_fsl")
267
+ cargs.append(params.get("bvecs_path"))
268
+ cargs.append(params.get("bvals_path"))
269
+ return cargs
270
+
271
+
272
+ def mrinfo_export_grad_fsl_outputs(
273
+ params: MrinfoExportGradFslParameters,
274
+ execution: Execution,
275
+ ) -> MrinfoExportGradFslOutputs:
276
+ """
277
+ Build outputs object containing output file paths and possibly stdout/stderr.
278
+
279
+ Args:
280
+ params: The parameters.
281
+ execution: The execution object for resolving input paths.
282
+ Returns:
283
+ Outputs object.
284
+ """
285
+ ret = MrinfoExportGradFslOutputs(
286
+ root=execution.output_file("."),
287
+ bvecs_path=execution.output_file(params.get("bvecs_path")),
288
+ bvals_path=execution.output_file(params.get("bvals_path")),
289
+ )
290
+ return ret
291
+
292
+
293
+ class MrinfoExportPeEddyOutputs(typing.NamedTuple):
294
+ """
295
+ Output object returned when calling `MrinfoExportPeEddyParameters | None(...)`.
296
+ """
297
+ root: OutputPathType
298
+ """Output root folder. This is the root folder for all outputs."""
299
+ config: OutputPathType
300
+ """export phase-encoding information to an EDDY-style config / index file
301
+ pair"""
302
+ indices: OutputPathType
303
+ """export phase-encoding information to an EDDY-style config / index file
304
+ pair"""
305
+
306
+
307
+ def mrinfo_export_pe_eddy_params(
308
+ config: str,
309
+ indices: str,
310
+ ) -> MrinfoExportPeEddyParameters:
311
+ """
312
+ Build parameters.
313
+
314
+ Args:
315
+ config: export phase-encoding information to an EDDY-style config /\
316
+ index file pair.
317
+ indices: export phase-encoding information to an EDDY-style config /\
318
+ index file pair.
319
+ Returns:
320
+ Parameter dictionary
321
+ """
322
+ params = {
323
+ "__STYXTYPE__": "export_pe_eddy",
324
+ "config": config,
325
+ "indices": indices,
326
+ }
327
+ return params
328
+
329
+
330
+ def mrinfo_export_pe_eddy_cargs(
331
+ params: MrinfoExportPeEddyParameters,
332
+ execution: Execution,
333
+ ) -> list[str]:
334
+ """
335
+ Build command-line arguments from parameters.
336
+
337
+ Args:
338
+ params: The parameters.
339
+ execution: The execution object for resolving input paths.
340
+ Returns:
341
+ Command-line arguments.
342
+ """
343
+ cargs = []
344
+ cargs.append("-export_pe_eddy")
345
+ cargs.append(params.get("config"))
346
+ cargs.append(params.get("indices"))
347
+ return cargs
348
+
349
+
350
+ def mrinfo_export_pe_eddy_outputs(
351
+ params: MrinfoExportPeEddyParameters,
352
+ execution: Execution,
353
+ ) -> MrinfoExportPeEddyOutputs:
354
+ """
355
+ Build outputs object containing output file paths and possibly stdout/stderr.
356
+
357
+ Args:
358
+ params: The parameters.
359
+ execution: The execution object for resolving input paths.
360
+ Returns:
361
+ Outputs object.
362
+ """
363
+ ret = MrinfoExportPeEddyOutputs(
364
+ root=execution.output_file("."),
365
+ config=execution.output_file(params.get("config")),
366
+ indices=execution.output_file(params.get("indices")),
367
+ )
368
+ return ret
369
+
370
+
371
+ def mrinfo_config_params(
372
+ key: str,
373
+ value: str,
374
+ ) -> MrinfoConfigParameters:
375
+ """
376
+ Build parameters.
377
+
378
+ Args:
379
+ key: temporarily set the value of an MRtrix config file entry.
380
+ value: temporarily set the value of an MRtrix config file entry.
381
+ Returns:
382
+ Parameter dictionary
383
+ """
384
+ params = {
385
+ "__STYXTYPE__": "config",
386
+ "key": key,
387
+ "value": value,
388
+ }
389
+ return params
390
+
391
+
392
+ def mrinfo_config_cargs(
393
+ params: MrinfoConfigParameters,
394
+ execution: Execution,
395
+ ) -> list[str]:
396
+ """
397
+ Build command-line arguments from parameters.
398
+
399
+ Args:
400
+ params: The parameters.
401
+ execution: The execution object for resolving input paths.
402
+ Returns:
403
+ Command-line arguments.
404
+ """
405
+ cargs = []
406
+ cargs.append("-config")
407
+ cargs.append(params.get("key"))
408
+ cargs.append(params.get("value"))
409
+ return cargs
410
+
411
+
412
+ class MrinfoOutputs(typing.NamedTuple):
413
+ """
414
+ Output object returned when calling `mrinfo(...)`.
415
+ """
416
+ root: OutputPathType
417
+ """Output root folder. This is the root folder for all outputs."""
418
+ json_keyval: OutputPathType | None
419
+ """export header key/value entries to a JSON file """
420
+ json_all: OutputPathType | None
421
+ """export all header contents to a JSON file """
422
+ export_grad_mrtrix: OutputPathType | None
423
+ """export the diffusion-weighted gradient table to file in MRtrix format """
424
+ export_pe_table: OutputPathType | None
425
+ """export phase-encoding table to file """
426
+ export_grad_fsl: MrinfoExportGradFslOutputs | None
427
+ """Outputs from `mrinfo_export_grad_fsl_outputs`."""
428
+ export_pe_eddy: MrinfoExportPeEddyOutputs | None
429
+ """Outputs from `mrinfo_export_pe_eddy_outputs`."""
430
+
431
+
432
+ def mrinfo_params(
433
+ image: list[InputPathType],
434
+ all_: bool = False,
435
+ name: bool = False,
436
+ format_: bool = False,
437
+ ndim: bool = False,
438
+ size: bool = False,
439
+ spacing: bool = False,
440
+ datatype: bool = False,
441
+ strides: bool = False,
442
+ offset: bool = False,
443
+ multiplier: bool = False,
444
+ transform: bool = False,
445
+ property_: list[MrinfoPropertyParameters] | None = None,
446
+ json_keyval: str | None = None,
447
+ json_all: str | None = None,
448
+ grad: InputPathType | None = None,
449
+ fslgrad: MrinfoFslgradParameters | None = None,
450
+ bvalue_scaling: str | None = None,
451
+ export_grad_mrtrix: str | None = None,
452
+ export_grad_fsl: MrinfoExportGradFslParameters | None = None,
453
+ dwgrad: bool = False,
454
+ shell_bvalues: bool = False,
455
+ shell_sizes: bool = False,
456
+ shell_indices: bool = False,
457
+ export_pe_table: str | None = None,
458
+ export_pe_eddy: MrinfoExportPeEddyParameters | None = None,
459
+ petable: bool = False,
460
+ nodelete: bool = False,
461
+ info: bool = False,
462
+ quiet: bool = False,
463
+ debug: bool = False,
464
+ force: bool = False,
465
+ nthreads: int | None = None,
466
+ config: list[MrinfoConfigParameters] | None = None,
467
+ help_: bool = False,
468
+ version: bool = False,
469
+ ) -> MrinfoParameters:
470
+ """
471
+ Build parameters.
472
+
473
+ Args:
474
+ image: the input image(s).
475
+ all_: print all properties, rather than the first and last 2 of each.
476
+ name: print the file system path of the image.
477
+ format_: image file format.
478
+ ndim: number of image dimensions.
479
+ size: image size along each axis.
480
+ spacing: voxel spacing along each image dimension.
481
+ datatype: data type used for image data storage.
482
+ strides: data strides i.e. order and direction of axes data layout.
483
+ offset: image intensity offset.
484
+ multiplier: image intensity multiplier.
485
+ transform: the transformation from image coordinates [mm] to scanner /\
486
+ real world coordinates [mm].
487
+ property_: any text properties embedded in the image header under the\
488
+ specified key (use 'all' to list all keys found).
489
+ json_keyval: export header key/value entries to a JSON file.
490
+ json_all: export all header contents to a JSON file.
491
+ grad: Provide the diffusion-weighted gradient scheme used in the\
492
+ acquisition in a text file. This should be supplied as a 4xN text file\
493
+ with each line is in the format [ X Y Z b ], where [ X Y Z ] describe\
494
+ the direction of the applied gradient, and b gives the b-value in units\
495
+ of s/mm^2. If a diffusion gradient scheme is present in the input image\
496
+ header, the data provided with this option will be instead used.
497
+ fslgrad: Provide the diffusion-weighted gradient scheme used in the\
498
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
499
+ scheme is present in the input image header, the data provided with\
500
+ this option will be instead used.
501
+ bvalue_scaling: enable or disable scaling of diffusion b-values by the\
502
+ square of the corresponding DW gradient norm (see Desciption). Valid\
503
+ choices are yes/no, true/false, 0/1 (default: automatic).
504
+ export_grad_mrtrix: export the diffusion-weighted gradient table to\
505
+ file in MRtrix format.
506
+ export_grad_fsl: export the diffusion-weighted gradient table to files\
507
+ in FSL (bvecs / bvals) format.
508
+ dwgrad: the diffusion-weighting gradient table, as interpreted by\
509
+ MRtrix3.
510
+ shell_bvalues: list the average b-value of each shell.
511
+ shell_sizes: list the number of volumes in each shell.
512
+ shell_indices: list the image volumes attributed to each b-value shell.
513
+ export_pe_table: export phase-encoding table to file.
514
+ export_pe_eddy: export phase-encoding information to an EDDY-style\
515
+ config / index file pair.
516
+ petable: print the phase encoding table.
517
+ nodelete: don't delete temporary images or images passed to mrinfo via\
518
+ Unix pipes.
519
+ info: display information messages.
520
+ quiet: do not display information messages or progress status;\
521
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
522
+ environment variable to a non-empty string.
523
+ debug: display debugging messages.
524
+ force: force overwrite of output files (caution: using the same file as\
525
+ input and output might cause unexpected behaviour).
526
+ nthreads: use this number of threads in multi-threaded applications\
527
+ (set to 0 to disable multi-threading).
528
+ config: temporarily set the value of an MRtrix config file entry.
529
+ help_: display this information page and exit.
530
+ version: display version information and exit.
531
+ Returns:
532
+ Parameter dictionary
533
+ """
534
+ params = {
535
+ "__STYXTYPE__": "mrinfo",
536
+ "all": all_,
537
+ "name": name,
538
+ "format": format_,
539
+ "ndim": ndim,
540
+ "size": size,
541
+ "spacing": spacing,
542
+ "datatype": datatype,
543
+ "strides": strides,
544
+ "offset": offset,
545
+ "multiplier": multiplier,
546
+ "transform": transform,
547
+ "dwgrad": dwgrad,
548
+ "shell_bvalues": shell_bvalues,
549
+ "shell_sizes": shell_sizes,
550
+ "shell_indices": shell_indices,
551
+ "petable": petable,
552
+ "nodelete": nodelete,
553
+ "info": info,
554
+ "quiet": quiet,
555
+ "debug": debug,
556
+ "force": force,
557
+ "help": help_,
558
+ "version": version,
559
+ "image": image,
560
+ }
561
+ if property_ is not None:
562
+ params["property"] = property_
563
+ if json_keyval is not None:
564
+ params["json_keyval"] = json_keyval
565
+ if json_all is not None:
566
+ params["json_all"] = json_all
567
+ if grad is not None:
568
+ params["grad"] = grad
569
+ if fslgrad is not None:
570
+ params["fslgrad"] = fslgrad
571
+ if bvalue_scaling is not None:
572
+ params["bvalue_scaling"] = bvalue_scaling
573
+ if export_grad_mrtrix is not None:
574
+ params["export_grad_mrtrix"] = export_grad_mrtrix
575
+ if export_grad_fsl is not None:
576
+ params["export_grad_fsl"] = export_grad_fsl
577
+ if export_pe_table is not None:
578
+ params["export_pe_table"] = export_pe_table
579
+ if export_pe_eddy is not None:
580
+ params["export_pe_eddy"] = export_pe_eddy
581
+ if nthreads is not None:
582
+ params["nthreads"] = nthreads
583
+ if config is not None:
584
+ params["config"] = config
585
+ return params
586
+
587
+
588
+ def mrinfo_cargs(
589
+ params: MrinfoParameters,
590
+ execution: Execution,
591
+ ) -> list[str]:
592
+ """
593
+ Build command-line arguments from parameters.
594
+
595
+ Args:
596
+ params: The parameters.
597
+ execution: The execution object for resolving input paths.
598
+ Returns:
599
+ Command-line arguments.
600
+ """
601
+ cargs = []
602
+ cargs.append("mrinfo")
603
+ if params.get("all"):
604
+ cargs.append("-all")
605
+ if params.get("name"):
606
+ cargs.append("-name")
607
+ if params.get("format"):
608
+ cargs.append("-format")
609
+ if params.get("ndim"):
610
+ cargs.append("-ndim")
611
+ if params.get("size"):
612
+ cargs.append("-size")
613
+ if params.get("spacing"):
614
+ cargs.append("-spacing")
615
+ if params.get("datatype"):
616
+ cargs.append("-datatype")
617
+ if params.get("strides"):
618
+ cargs.append("-strides")
619
+ if params.get("offset"):
620
+ cargs.append("-offset")
621
+ if params.get("multiplier"):
622
+ cargs.append("-multiplier")
623
+ if params.get("transform"):
624
+ cargs.append("-transform")
625
+ if params.get("property") is not None:
626
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("property")] for a in c])
627
+ if params.get("json_keyval") is not None:
628
+ cargs.extend([
629
+ "-json_keyval",
630
+ params.get("json_keyval")
631
+ ])
632
+ if params.get("json_all") is not None:
633
+ cargs.extend([
634
+ "-json_all",
635
+ params.get("json_all")
636
+ ])
637
+ if params.get("grad") is not None:
638
+ cargs.extend([
639
+ "-grad",
640
+ execution.input_file(params.get("grad"))
641
+ ])
642
+ if params.get("fslgrad") is not None:
643
+ cargs.extend(dyn_cargs(params.get("fslgrad")["__STYXTYPE__"])(params.get("fslgrad"), execution))
644
+ if params.get("bvalue_scaling") is not None:
645
+ cargs.extend([
646
+ "-bvalue_scaling",
647
+ params.get("bvalue_scaling")
648
+ ])
649
+ if params.get("export_grad_mrtrix") is not None:
650
+ cargs.extend([
651
+ "-export_grad_mrtrix",
652
+ params.get("export_grad_mrtrix")
653
+ ])
654
+ if params.get("export_grad_fsl") is not None:
655
+ cargs.extend(dyn_cargs(params.get("export_grad_fsl")["__STYXTYPE__"])(params.get("export_grad_fsl"), execution))
656
+ if params.get("dwgrad"):
657
+ cargs.append("-dwgrad")
658
+ if params.get("shell_bvalues"):
659
+ cargs.append("-shell_bvalues")
660
+ if params.get("shell_sizes"):
661
+ cargs.append("-shell_sizes")
662
+ if params.get("shell_indices"):
663
+ cargs.append("-shell_indices")
664
+ if params.get("export_pe_table") is not None:
665
+ cargs.extend([
666
+ "-export_pe_table",
667
+ params.get("export_pe_table")
668
+ ])
669
+ if params.get("export_pe_eddy") is not None:
670
+ cargs.extend(dyn_cargs(params.get("export_pe_eddy")["__STYXTYPE__"])(params.get("export_pe_eddy"), execution))
671
+ if params.get("petable"):
672
+ cargs.append("-petable")
673
+ if params.get("nodelete"):
674
+ cargs.append("-nodelete")
675
+ if params.get("info"):
676
+ cargs.append("-info")
677
+ if params.get("quiet"):
678
+ cargs.append("-quiet")
679
+ if params.get("debug"):
680
+ cargs.append("-debug")
681
+ if params.get("force"):
682
+ cargs.append("-force")
683
+ if params.get("nthreads") is not None:
684
+ cargs.extend([
685
+ "-nthreads",
686
+ str(params.get("nthreads"))
687
+ ])
688
+ if params.get("config") is not None:
689
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
690
+ if params.get("help"):
691
+ cargs.append("-help")
692
+ if params.get("version"):
693
+ cargs.append("-version")
694
+ cargs.extend([execution.input_file(f) for f in params.get("image")])
695
+ return cargs
696
+
697
+
698
+ def mrinfo_outputs(
699
+ params: MrinfoParameters,
700
+ execution: Execution,
701
+ ) -> MrinfoOutputs:
702
+ """
703
+ Build outputs object containing output file paths and possibly stdout/stderr.
704
+
705
+ Args:
706
+ params: The parameters.
707
+ execution: The execution object for resolving input paths.
708
+ Returns:
709
+ Outputs object.
710
+ """
711
+ ret = MrinfoOutputs(
712
+ root=execution.output_file("."),
713
+ json_keyval=execution.output_file(params.get("json_keyval")) if (params.get("json_keyval") is not None) else None,
714
+ json_all=execution.output_file(params.get("json_all")) if (params.get("json_all") is not None) else None,
715
+ export_grad_mrtrix=execution.output_file(params.get("export_grad_mrtrix")) if (params.get("export_grad_mrtrix") is not None) else None,
716
+ export_pe_table=execution.output_file(params.get("export_pe_table")) if (params.get("export_pe_table") is not None) else None,
717
+ export_grad_fsl=dyn_outputs(params.get("export_grad_fsl")["__STYXTYPE__"])(params.get("export_grad_fsl"), execution) if params.get("export_grad_fsl") else None,
718
+ export_pe_eddy=dyn_outputs(params.get("export_pe_eddy")["__STYXTYPE__"])(params.get("export_pe_eddy"), execution) if params.get("export_pe_eddy") else None,
719
+ )
720
+ return ret
721
+
722
+
723
+ def mrinfo_execute(
724
+ params: MrinfoParameters,
725
+ execution: Execution,
726
+ ) -> MrinfoOutputs:
727
+ """
728
+ Display image header information, or extract specific information from the
729
+ header.
730
+
731
+ By default, all information contained in each image header will be printed
732
+ to the console in a reader-friendly format.
733
+
734
+ Alternatively, command-line options may be used to extract specific details
735
+ from the header(s); these are printed to the console in a format more
736
+ appropriate for scripting purposes or piping to file. If multiple options
737
+ and/or images are provided, the requested header fields will be printed in
738
+ the order in which they appear in the help page, with all requested details
739
+ from each input image in sequence printed before the next image is
740
+ processed.
741
+
742
+ The command can also write the diffusion gradient table from a single input
743
+ image to file; either in the MRtrix or FSL format (bvecs/bvals file pair;
744
+ includes appropriate diffusion gradient vector reorientation)
745
+
746
+ The -dwgrad, -export_* and -shell_* options provide (information about) the
747
+ diffusion weighting gradient table after it has been processed by the
748
+ MRtrix3 back-end (vectors normalised, b-values scaled by the square of the
749
+ vector norm, depending on the -bvalue_scaling option). To see the raw
750
+ gradient table information as stored in the image header, i.e. without
751
+ MRtrix3 back-end processing, use "-property dw_scheme".
752
+
753
+ The -bvalue_scaling option controls an aspect of the import of diffusion
754
+ gradient tables. When the input diffusion-weighting direction vectors have
755
+ norms that differ substantially from unity, the b-values will be scaled by
756
+ the square of their corresponding vector norm (this is how multi-shell
757
+ acquisitions are frequently achieved on scanner platforms). However in some
758
+ rare instances, the b-values may be correct, despite the vectors not being
759
+ of unit norm (or conversely, the b-values may need to be rescaled even
760
+ though the vectors are close to unit norm). This option allows the user to
761
+ control this operation and override MRrtix3's automatic detection.
762
+
763
+ References:
764
+
765
+ .
766
+
767
+ Author: MRTrix3 Developers
768
+
769
+ URL: https://www.mrtrix.org/
770
+
771
+ Args:
772
+ params: The parameters.
773
+ execution: The execution object.
774
+ Returns:
775
+ NamedTuple of outputs (described in `MrinfoOutputs`).
776
+ """
777
+ params = execution.params(params)
778
+ cargs = mrinfo_cargs(params, execution)
779
+ ret = mrinfo_outputs(params, execution)
780
+ execution.run(cargs)
781
+ return ret
782
+
783
+
784
+ def mrinfo(
785
+ image: list[InputPathType],
786
+ all_: bool = False,
787
+ name: bool = False,
788
+ format_: bool = False,
789
+ ndim: bool = False,
790
+ size: bool = False,
791
+ spacing: bool = False,
792
+ datatype: bool = False,
793
+ strides: bool = False,
794
+ offset: bool = False,
795
+ multiplier: bool = False,
796
+ transform: bool = False,
797
+ property_: list[MrinfoPropertyParameters] | None = None,
798
+ json_keyval: str | None = None,
799
+ json_all: str | None = None,
800
+ grad: InputPathType | None = None,
801
+ fslgrad: MrinfoFslgradParameters | None = None,
802
+ bvalue_scaling: str | None = None,
803
+ export_grad_mrtrix: str | None = None,
804
+ export_grad_fsl: MrinfoExportGradFslParameters | None = None,
805
+ dwgrad: bool = False,
806
+ shell_bvalues: bool = False,
807
+ shell_sizes: bool = False,
808
+ shell_indices: bool = False,
809
+ export_pe_table: str | None = None,
810
+ export_pe_eddy: MrinfoExportPeEddyParameters | None = None,
811
+ petable: bool = False,
812
+ nodelete: bool = False,
813
+ info: bool = False,
814
+ quiet: bool = False,
815
+ debug: bool = False,
816
+ force: bool = False,
817
+ nthreads: int | None = None,
818
+ config: list[MrinfoConfigParameters] | None = None,
819
+ help_: bool = False,
820
+ version: bool = False,
821
+ runner: Runner | None = None,
822
+ ) -> MrinfoOutputs:
823
+ """
824
+ Display image header information, or extract specific information from the
825
+ header.
826
+
827
+ By default, all information contained in each image header will be printed
828
+ to the console in a reader-friendly format.
829
+
830
+ Alternatively, command-line options may be used to extract specific details
831
+ from the header(s); these are printed to the console in a format more
832
+ appropriate for scripting purposes or piping to file. If multiple options
833
+ and/or images are provided, the requested header fields will be printed in
834
+ the order in which they appear in the help page, with all requested details
835
+ from each input image in sequence printed before the next image is
836
+ processed.
837
+
838
+ The command can also write the diffusion gradient table from a single input
839
+ image to file; either in the MRtrix or FSL format (bvecs/bvals file pair;
840
+ includes appropriate diffusion gradient vector reorientation)
841
+
842
+ The -dwgrad, -export_* and -shell_* options provide (information about) the
843
+ diffusion weighting gradient table after it has been processed by the
844
+ MRtrix3 back-end (vectors normalised, b-values scaled by the square of the
845
+ vector norm, depending on the -bvalue_scaling option). To see the raw
846
+ gradient table information as stored in the image header, i.e. without
847
+ MRtrix3 back-end processing, use "-property dw_scheme".
848
+
849
+ The -bvalue_scaling option controls an aspect of the import of diffusion
850
+ gradient tables. When the input diffusion-weighting direction vectors have
851
+ norms that differ substantially from unity, the b-values will be scaled by
852
+ the square of their corresponding vector norm (this is how multi-shell
853
+ acquisitions are frequently achieved on scanner platforms). However in some
854
+ rare instances, the b-values may be correct, despite the vectors not being
855
+ of unit norm (or conversely, the b-values may need to be rescaled even
856
+ though the vectors are close to unit norm). This option allows the user to
857
+ control this operation and override MRrtix3's automatic detection.
858
+
859
+ References:
860
+
861
+ .
862
+
863
+ Author: MRTrix3 Developers
864
+
865
+ URL: https://www.mrtrix.org/
866
+
867
+ Args:
868
+ image: the input image(s).
869
+ all_: print all properties, rather than the first and last 2 of each.
870
+ name: print the file system path of the image.
871
+ format_: image file format.
872
+ ndim: number of image dimensions.
873
+ size: image size along each axis.
874
+ spacing: voxel spacing along each image dimension.
875
+ datatype: data type used for image data storage.
876
+ strides: data strides i.e. order and direction of axes data layout.
877
+ offset: image intensity offset.
878
+ multiplier: image intensity multiplier.
879
+ transform: the transformation from image coordinates [mm] to scanner /\
880
+ real world coordinates [mm].
881
+ property_: any text properties embedded in the image header under the\
882
+ specified key (use 'all' to list all keys found).
883
+ json_keyval: export header key/value entries to a JSON file.
884
+ json_all: export all header contents to a JSON file.
885
+ grad: Provide the diffusion-weighted gradient scheme used in the\
886
+ acquisition in a text file. This should be supplied as a 4xN text file\
887
+ with each line is in the format [ X Y Z b ], where [ X Y Z ] describe\
888
+ the direction of the applied gradient, and b gives the b-value in units\
889
+ of s/mm^2. If a diffusion gradient scheme is present in the input image\
890
+ header, the data provided with this option will be instead used.
891
+ fslgrad: Provide the diffusion-weighted gradient scheme used in the\
892
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
893
+ scheme is present in the input image header, the data provided with\
894
+ this option will be instead used.
895
+ bvalue_scaling: enable or disable scaling of diffusion b-values by the\
896
+ square of the corresponding DW gradient norm (see Desciption). Valid\
897
+ choices are yes/no, true/false, 0/1 (default: automatic).
898
+ export_grad_mrtrix: export the diffusion-weighted gradient table to\
899
+ file in MRtrix format.
900
+ export_grad_fsl: export the diffusion-weighted gradient table to files\
901
+ in FSL (bvecs / bvals) format.
902
+ dwgrad: the diffusion-weighting gradient table, as interpreted by\
903
+ MRtrix3.
904
+ shell_bvalues: list the average b-value of each shell.
905
+ shell_sizes: list the number of volumes in each shell.
906
+ shell_indices: list the image volumes attributed to each b-value shell.
907
+ export_pe_table: export phase-encoding table to file.
908
+ export_pe_eddy: export phase-encoding information to an EDDY-style\
909
+ config / index file pair.
910
+ petable: print the phase encoding table.
911
+ nodelete: don't delete temporary images or images passed to mrinfo via\
912
+ Unix pipes.
913
+ info: display information messages.
914
+ quiet: do not display information messages or progress status;\
915
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
916
+ environment variable to a non-empty string.
917
+ debug: display debugging messages.
918
+ force: force overwrite of output files (caution: using the same file as\
919
+ input and output might cause unexpected behaviour).
920
+ nthreads: use this number of threads in multi-threaded applications\
921
+ (set to 0 to disable multi-threading).
922
+ config: temporarily set the value of an MRtrix config file entry.
923
+ help_: display this information page and exit.
924
+ version: display version information and exit.
925
+ runner: Command runner.
926
+ Returns:
927
+ NamedTuple of outputs (described in `MrinfoOutputs`).
928
+ """
929
+ runner = runner or get_global_runner()
930
+ execution = runner.start_execution(MRINFO_METADATA)
931
+ params = mrinfo_params(
932
+ all_=all_,
933
+ name=name,
934
+ format_=format_,
935
+ ndim=ndim,
936
+ size=size,
937
+ spacing=spacing,
938
+ datatype=datatype,
939
+ strides=strides,
940
+ offset=offset,
941
+ multiplier=multiplier,
942
+ transform=transform,
943
+ property_=property_,
944
+ json_keyval=json_keyval,
945
+ json_all=json_all,
946
+ grad=grad,
947
+ fslgrad=fslgrad,
948
+ bvalue_scaling=bvalue_scaling,
949
+ export_grad_mrtrix=export_grad_mrtrix,
950
+ export_grad_fsl=export_grad_fsl,
951
+ dwgrad=dwgrad,
952
+ shell_bvalues=shell_bvalues,
953
+ shell_sizes=shell_sizes,
954
+ shell_indices=shell_indices,
955
+ export_pe_table=export_pe_table,
956
+ export_pe_eddy=export_pe_eddy,
957
+ petable=petable,
958
+ nodelete=nodelete,
959
+ info=info,
960
+ quiet=quiet,
961
+ debug=debug,
962
+ force=force,
963
+ nthreads=nthreads,
964
+ config=config,
965
+ help_=help_,
966
+ version=version,
967
+ image=image,
968
+ )
969
+ return mrinfo_execute(params, execution)
970
+
971
+
972
+ __all__ = [
973
+ "MRINFO_METADATA",
974
+ "MrinfoConfigParameters",
975
+ "MrinfoExportGradFslOutputs",
976
+ "MrinfoExportGradFslParameters",
977
+ "MrinfoExportPeEddyOutputs",
978
+ "MrinfoExportPeEddyParameters",
979
+ "MrinfoFslgradParameters",
980
+ "MrinfoOutputs",
981
+ "MrinfoParameters",
982
+ "MrinfoPropertyParameters",
983
+ "mrinfo",
984
+ "mrinfo_config_params",
985
+ "mrinfo_export_grad_fsl_params",
986
+ "mrinfo_export_pe_eddy_params",
987
+ "mrinfo_fslgrad_params",
988
+ "mrinfo_params",
989
+ "mrinfo_property_params",
990
+ ]