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,825 @@
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
+ DWIEXTRACT_METADATA = Metadata(
9
+ id="5b00b542225211d60f5d1b333fb8c27f5a4730f1.boutiques",
10
+ name="dwiextract",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ DwiextractFslgradParameters = typing.TypedDict('DwiextractFslgradParameters', {
17
+ "__STYX_TYPE__": typing.Literal["fslgrad"],
18
+ "bvecs": InputPathType,
19
+ "bvals": InputPathType,
20
+ })
21
+
22
+
23
+ DwiextractExportGradFslParameters = typing.TypedDict('DwiextractExportGradFslParameters', {
24
+ "__STYX_TYPE__": typing.Literal["export_grad_fsl"],
25
+ "bvecs_path": str,
26
+ "bvals_path": str,
27
+ })
28
+
29
+
30
+ DwiextractImportPeEddyParameters = typing.TypedDict('DwiextractImportPeEddyParameters', {
31
+ "__STYX_TYPE__": typing.Literal["import_pe_eddy"],
32
+ "config": InputPathType,
33
+ "indices": InputPathType,
34
+ })
35
+
36
+
37
+ DwiextractVariousStringParameters = typing.TypedDict('DwiextractVariousStringParameters', {
38
+ "__STYX_TYPE__": typing.Literal["VariousString"],
39
+ "obj": str,
40
+ })
41
+
42
+
43
+ DwiextractVariousFileParameters = typing.TypedDict('DwiextractVariousFileParameters', {
44
+ "__STYX_TYPE__": typing.Literal["VariousFile"],
45
+ "obj": InputPathType,
46
+ })
47
+
48
+
49
+ DwiextractConfigParameters = typing.TypedDict('DwiextractConfigParameters', {
50
+ "__STYX_TYPE__": typing.Literal["config"],
51
+ "key": str,
52
+ "value": str,
53
+ })
54
+
55
+
56
+ DwiextractParameters = typing.TypedDict('DwiextractParameters', {
57
+ "__STYX_TYPE__": typing.Literal["dwiextract"],
58
+ "bzero": bool,
59
+ "no_bzero": bool,
60
+ "singleshell": bool,
61
+ "grad": typing.NotRequired[InputPathType | None],
62
+ "fslgrad": typing.NotRequired[DwiextractFslgradParameters | None],
63
+ "shells": typing.NotRequired[list[float] | None],
64
+ "export_grad_mrtrix": typing.NotRequired[str | None],
65
+ "export_grad_fsl": typing.NotRequired[DwiextractExportGradFslParameters | None],
66
+ "import_pe_table": typing.NotRequired[InputPathType | None],
67
+ "import_pe_eddy": typing.NotRequired[DwiextractImportPeEddyParameters | None],
68
+ "pe": typing.NotRequired[list[float] | None],
69
+ "strides": typing.NotRequired[typing.Union[DwiextractVariousStringParameters, DwiextractVariousFileParameters] | None],
70
+ "info": bool,
71
+ "quiet": bool,
72
+ "debug": bool,
73
+ "force": bool,
74
+ "nthreads": typing.NotRequired[int | None],
75
+ "config": typing.NotRequired[list[DwiextractConfigParameters] | None],
76
+ "help": bool,
77
+ "version": bool,
78
+ "input": InputPathType,
79
+ "output": str,
80
+ })
81
+
82
+
83
+ def dyn_cargs(
84
+ t: str,
85
+ ) -> typing.Any:
86
+ """
87
+ Get build cargs function by command type.
88
+
89
+ Args:
90
+ t: Command type.
91
+ Returns:
92
+ Build cargs function.
93
+ """
94
+ return {
95
+ "dwiextract": dwiextract_cargs,
96
+ "fslgrad": dwiextract_fslgrad_cargs,
97
+ "export_grad_fsl": dwiextract_export_grad_fsl_cargs,
98
+ "import_pe_eddy": dwiextract_import_pe_eddy_cargs,
99
+ "VariousString": dwiextract_various_string_cargs,
100
+ "VariousFile": dwiextract_various_file_cargs,
101
+ "config": dwiextract_config_cargs,
102
+ }.get(t)
103
+
104
+
105
+ def dyn_outputs(
106
+ t: str,
107
+ ) -> typing.Any:
108
+ """
109
+ Get build outputs function by command type.
110
+
111
+ Args:
112
+ t: Command type.
113
+ Returns:
114
+ Build outputs function.
115
+ """
116
+ return {
117
+ "dwiextract": dwiextract_outputs,
118
+ "export_grad_fsl": dwiextract_export_grad_fsl_outputs,
119
+ }.get(t)
120
+
121
+
122
+ def dwiextract_fslgrad_params(
123
+ bvecs: InputPathType,
124
+ bvals: InputPathType,
125
+ ) -> DwiextractFslgradParameters:
126
+ """
127
+ Build parameters.
128
+
129
+ Args:
130
+ bvecs: Provide the diffusion-weighted gradient scheme used in the\
131
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
132
+ scheme is present in the input image header, the data provided with\
133
+ this option will be instead used.
134
+ bvals: Provide the diffusion-weighted gradient scheme used in the\
135
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
136
+ scheme is present in the input image header, the data provided with\
137
+ this option will be instead used.
138
+ Returns:
139
+ Parameter dictionary
140
+ """
141
+ params = {
142
+ "__STYXTYPE__": "fslgrad",
143
+ "bvecs": bvecs,
144
+ "bvals": bvals,
145
+ }
146
+ return params
147
+
148
+
149
+ def dwiextract_fslgrad_cargs(
150
+ params: DwiextractFslgradParameters,
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("-fslgrad")
164
+ cargs.append(execution.input_file(params.get("bvecs")))
165
+ cargs.append(execution.input_file(params.get("bvals")))
166
+ return cargs
167
+
168
+
169
+ class DwiextractExportGradFslOutputs(typing.NamedTuple):
170
+ """
171
+ Output object returned when calling `DwiextractExportGradFslParameters | None(...)`.
172
+ """
173
+ root: OutputPathType
174
+ """Output root folder. This is the root folder for all outputs."""
175
+ bvecs_path: OutputPathType
176
+ """export the diffusion-weighted gradient table to files in FSL (bvecs /
177
+ bvals) format"""
178
+ bvals_path: OutputPathType
179
+ """export the diffusion-weighted gradient table to files in FSL (bvecs /
180
+ bvals) format"""
181
+
182
+
183
+ def dwiextract_export_grad_fsl_params(
184
+ bvecs_path: str,
185
+ bvals_path: str,
186
+ ) -> DwiextractExportGradFslParameters:
187
+ """
188
+ Build parameters.
189
+
190
+ Args:
191
+ bvecs_path: export the diffusion-weighted gradient table to files in\
192
+ FSL (bvecs / bvals) format.
193
+ bvals_path: export the diffusion-weighted gradient table to files in\
194
+ FSL (bvecs / bvals) format.
195
+ Returns:
196
+ Parameter dictionary
197
+ """
198
+ params = {
199
+ "__STYXTYPE__": "export_grad_fsl",
200
+ "bvecs_path": bvecs_path,
201
+ "bvals_path": bvals_path,
202
+ }
203
+ return params
204
+
205
+
206
+ def dwiextract_export_grad_fsl_cargs(
207
+ params: DwiextractExportGradFslParameters,
208
+ execution: Execution,
209
+ ) -> list[str]:
210
+ """
211
+ Build command-line arguments from parameters.
212
+
213
+ Args:
214
+ params: The parameters.
215
+ execution: The execution object for resolving input paths.
216
+ Returns:
217
+ Command-line arguments.
218
+ """
219
+ cargs = []
220
+ cargs.append("-export_grad_fsl")
221
+ cargs.append(params.get("bvecs_path"))
222
+ cargs.append(params.get("bvals_path"))
223
+ return cargs
224
+
225
+
226
+ def dwiextract_export_grad_fsl_outputs(
227
+ params: DwiextractExportGradFslParameters,
228
+ execution: Execution,
229
+ ) -> DwiextractExportGradFslOutputs:
230
+ """
231
+ Build outputs object containing output file paths and possibly stdout/stderr.
232
+
233
+ Args:
234
+ params: The parameters.
235
+ execution: The execution object for resolving input paths.
236
+ Returns:
237
+ Outputs object.
238
+ """
239
+ ret = DwiextractExportGradFslOutputs(
240
+ root=execution.output_file("."),
241
+ bvecs_path=execution.output_file(params.get("bvecs_path")),
242
+ bvals_path=execution.output_file(params.get("bvals_path")),
243
+ )
244
+ return ret
245
+
246
+
247
+ def dwiextract_import_pe_eddy_params(
248
+ config: InputPathType,
249
+ indices: InputPathType,
250
+ ) -> DwiextractImportPeEddyParameters:
251
+ """
252
+ Build parameters.
253
+
254
+ Args:
255
+ config: import phase-encoding information from an EDDY-style config /\
256
+ index file pair.
257
+ indices: import phase-encoding information from an EDDY-style config /\
258
+ index file pair.
259
+ Returns:
260
+ Parameter dictionary
261
+ """
262
+ params = {
263
+ "__STYXTYPE__": "import_pe_eddy",
264
+ "config": config,
265
+ "indices": indices,
266
+ }
267
+ return params
268
+
269
+
270
+ def dwiextract_import_pe_eddy_cargs(
271
+ params: DwiextractImportPeEddyParameters,
272
+ execution: Execution,
273
+ ) -> list[str]:
274
+ """
275
+ Build command-line arguments from parameters.
276
+
277
+ Args:
278
+ params: The parameters.
279
+ execution: The execution object for resolving input paths.
280
+ Returns:
281
+ Command-line arguments.
282
+ """
283
+ cargs = []
284
+ cargs.append("-import_pe_eddy")
285
+ cargs.append(execution.input_file(params.get("config")))
286
+ cargs.append(execution.input_file(params.get("indices")))
287
+ return cargs
288
+
289
+
290
+ def dwiextract_various_string_params(
291
+ obj: str,
292
+ ) -> DwiextractVariousStringParameters:
293
+ """
294
+ Build parameters.
295
+
296
+ Args:
297
+ obj: String object.
298
+ Returns:
299
+ Parameter dictionary
300
+ """
301
+ params = {
302
+ "__STYXTYPE__": "VariousString",
303
+ "obj": obj,
304
+ }
305
+ return params
306
+
307
+
308
+ def dwiextract_various_string_cargs(
309
+ params: DwiextractVariousStringParameters,
310
+ execution: Execution,
311
+ ) -> list[str]:
312
+ """
313
+ Build command-line arguments from parameters.
314
+
315
+ Args:
316
+ params: The parameters.
317
+ execution: The execution object for resolving input paths.
318
+ Returns:
319
+ Command-line arguments.
320
+ """
321
+ cargs = []
322
+ cargs.append(params.get("obj"))
323
+ return cargs
324
+
325
+
326
+ def dwiextract_various_file_params(
327
+ obj: InputPathType,
328
+ ) -> DwiextractVariousFileParameters:
329
+ """
330
+ Build parameters.
331
+
332
+ Args:
333
+ obj: File object.
334
+ Returns:
335
+ Parameter dictionary
336
+ """
337
+ params = {
338
+ "__STYXTYPE__": "VariousFile",
339
+ "obj": obj,
340
+ }
341
+ return params
342
+
343
+
344
+ def dwiextract_various_file_cargs(
345
+ params: DwiextractVariousFileParameters,
346
+ execution: Execution,
347
+ ) -> list[str]:
348
+ """
349
+ Build command-line arguments from parameters.
350
+
351
+ Args:
352
+ params: The parameters.
353
+ execution: The execution object for resolving input paths.
354
+ Returns:
355
+ Command-line arguments.
356
+ """
357
+ cargs = []
358
+ cargs.append(execution.input_file(params.get("obj")))
359
+ return cargs
360
+
361
+
362
+ def dwiextract_config_params(
363
+ key: str,
364
+ value: str,
365
+ ) -> DwiextractConfigParameters:
366
+ """
367
+ Build parameters.
368
+
369
+ Args:
370
+ key: temporarily set the value of an MRtrix config file entry.
371
+ value: temporarily set the value of an MRtrix config file entry.
372
+ Returns:
373
+ Parameter dictionary
374
+ """
375
+ params = {
376
+ "__STYXTYPE__": "config",
377
+ "key": key,
378
+ "value": value,
379
+ }
380
+ return params
381
+
382
+
383
+ def dwiextract_config_cargs(
384
+ params: DwiextractConfigParameters,
385
+ execution: Execution,
386
+ ) -> list[str]:
387
+ """
388
+ Build command-line arguments from parameters.
389
+
390
+ Args:
391
+ params: The parameters.
392
+ execution: The execution object for resolving input paths.
393
+ Returns:
394
+ Command-line arguments.
395
+ """
396
+ cargs = []
397
+ cargs.append("-config")
398
+ cargs.append(params.get("key"))
399
+ cargs.append(params.get("value"))
400
+ return cargs
401
+
402
+
403
+ class DwiextractOutputs(typing.NamedTuple):
404
+ """
405
+ Output object returned when calling `dwiextract(...)`.
406
+ """
407
+ root: OutputPathType
408
+ """Output root folder. This is the root folder for all outputs."""
409
+ output: OutputPathType
410
+ """the output image (diffusion-weighted volumes by default)."""
411
+ export_grad_mrtrix: OutputPathType | None
412
+ """export the diffusion-weighted gradient table to file in MRtrix format """
413
+ export_grad_fsl: DwiextractExportGradFslOutputs | None
414
+ """Outputs from `dwiextract_export_grad_fsl_outputs`."""
415
+
416
+
417
+ def dwiextract_params(
418
+ input_: InputPathType,
419
+ output: str,
420
+ bzero: bool = False,
421
+ no_bzero: bool = False,
422
+ singleshell: bool = False,
423
+ grad: InputPathType | None = None,
424
+ fslgrad: DwiextractFslgradParameters | None = None,
425
+ shells: list[float] | None = None,
426
+ export_grad_mrtrix: str | None = None,
427
+ export_grad_fsl: DwiextractExportGradFslParameters | None = None,
428
+ import_pe_table: InputPathType | None = None,
429
+ import_pe_eddy: DwiextractImportPeEddyParameters | None = None,
430
+ pe: list[float] | None = None,
431
+ strides: typing.Union[DwiextractVariousStringParameters, DwiextractVariousFileParameters] | None = None,
432
+ info: bool = False,
433
+ quiet: bool = False,
434
+ debug: bool = False,
435
+ force: bool = False,
436
+ nthreads: int | None = None,
437
+ config: list[DwiextractConfigParameters] | None = None,
438
+ help_: bool = False,
439
+ version: bool = False,
440
+ ) -> DwiextractParameters:
441
+ """
442
+ Build parameters.
443
+
444
+ Args:
445
+ input_: the input DW image.
446
+ output: the output image (diffusion-weighted volumes by default).
447
+ bzero: Output b=0 volumes (instead of the diffusion weighted volumes,\
448
+ if -singleshell is not specified).
449
+ no_bzero: Output only non b=0 volumes (default, if -singleshell is not\
450
+ specified).
451
+ singleshell: Force a single-shell (single non b=0 shell) output. This\
452
+ will include b=0 volumes, if present. Use with -bzero to enforce\
453
+ presence of b=0 volumes (error if not present) or with -no_bzero to\
454
+ exclude them.
455
+ grad: Provide the diffusion-weighted gradient scheme used in the\
456
+ acquisition in a text file. This should be supplied as a 4xN text file\
457
+ with each line is in the format [ X Y Z b ], where [ X Y Z ] describe\
458
+ the direction of the applied gradient, and b gives the b-value in units\
459
+ of s/mm^2. If a diffusion gradient scheme is present in the input image\
460
+ header, the data provided with this option will be instead used.
461
+ fslgrad: Provide the diffusion-weighted gradient scheme used in the\
462
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
463
+ scheme is present in the input image header, the data provided with\
464
+ this option will be instead used.
465
+ shells: specify one or more b-values to use during processing, as a\
466
+ comma-separated list of the desired approximate b-values (b-values are\
467
+ clustered to allow for small deviations). Note that some commands are\
468
+ incompatible with multiple b-values, and will report an error if more\
469
+ than one b-value is provided.\
470
+ WARNING: note that, even though the b=0 volumes are never referred\
471
+ to as shells in the literature, they still have to be explicitly\
472
+ included in the list of b-values as provided to the -shell option!\
473
+ Several algorithms which include the b=0 volumes in their\
474
+ computations may otherwise return an undesired result.
475
+ export_grad_mrtrix: export the diffusion-weighted gradient table to\
476
+ file in MRtrix format.
477
+ export_grad_fsl: export the diffusion-weighted gradient table to files\
478
+ in FSL (bvecs / bvals) format.
479
+ import_pe_table: import a phase-encoding table from file.
480
+ import_pe_eddy: import phase-encoding information from an EDDY-style\
481
+ config / index file pair.
482
+ pe: select volumes with a particular phase encoding; this can be three\
483
+ comma-separated values (for i,j,k components of vector direction) or\
484
+ four (direction & total readout time).
485
+ strides: specify the strides of the output data in memory; either as a\
486
+ comma-separated list of (signed) integers, or as a template image from\
487
+ which the strides shall be extracted and used. The actual strides\
488
+ produced will depend on whether the output image format can support it.
489
+ info: display information messages.
490
+ quiet: do not display information messages or progress status;\
491
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
492
+ environment variable to a non-empty string.
493
+ debug: display debugging messages.
494
+ force: force overwrite of output files (caution: using the same file as\
495
+ input and output might cause unexpected behaviour).
496
+ nthreads: use this number of threads in multi-threaded applications\
497
+ (set to 0 to disable multi-threading).
498
+ config: temporarily set the value of an MRtrix config file entry.
499
+ help_: display this information page and exit.
500
+ version: display version information and exit.
501
+ Returns:
502
+ Parameter dictionary
503
+ """
504
+ params = {
505
+ "__STYXTYPE__": "dwiextract",
506
+ "bzero": bzero,
507
+ "no_bzero": no_bzero,
508
+ "singleshell": singleshell,
509
+ "info": info,
510
+ "quiet": quiet,
511
+ "debug": debug,
512
+ "force": force,
513
+ "help": help_,
514
+ "version": version,
515
+ "input": input_,
516
+ "output": output,
517
+ }
518
+ if grad is not None:
519
+ params["grad"] = grad
520
+ if fslgrad is not None:
521
+ params["fslgrad"] = fslgrad
522
+ if shells is not None:
523
+ params["shells"] = shells
524
+ if export_grad_mrtrix is not None:
525
+ params["export_grad_mrtrix"] = export_grad_mrtrix
526
+ if export_grad_fsl is not None:
527
+ params["export_grad_fsl"] = export_grad_fsl
528
+ if import_pe_table is not None:
529
+ params["import_pe_table"] = import_pe_table
530
+ if import_pe_eddy is not None:
531
+ params["import_pe_eddy"] = import_pe_eddy
532
+ if pe is not None:
533
+ params["pe"] = pe
534
+ if strides is not None:
535
+ params["strides"] = strides
536
+ if nthreads is not None:
537
+ params["nthreads"] = nthreads
538
+ if config is not None:
539
+ params["config"] = config
540
+ return params
541
+
542
+
543
+ def dwiextract_cargs(
544
+ params: DwiextractParameters,
545
+ execution: Execution,
546
+ ) -> list[str]:
547
+ """
548
+ Build command-line arguments from parameters.
549
+
550
+ Args:
551
+ params: The parameters.
552
+ execution: The execution object for resolving input paths.
553
+ Returns:
554
+ Command-line arguments.
555
+ """
556
+ cargs = []
557
+ cargs.append("dwiextract")
558
+ if params.get("bzero"):
559
+ cargs.append("-bzero")
560
+ if params.get("no_bzero"):
561
+ cargs.append("-no_bzero")
562
+ if params.get("singleshell"):
563
+ cargs.append("-singleshell")
564
+ if params.get("grad") is not None:
565
+ cargs.extend([
566
+ "-grad",
567
+ execution.input_file(params.get("grad"))
568
+ ])
569
+ if params.get("fslgrad") is not None:
570
+ cargs.extend(dyn_cargs(params.get("fslgrad")["__STYXTYPE__"])(params.get("fslgrad"), execution))
571
+ if params.get("shells") is not None:
572
+ cargs.extend([
573
+ "-shells",
574
+ ",".join(map(str, params.get("shells")))
575
+ ])
576
+ if params.get("export_grad_mrtrix") is not None:
577
+ cargs.extend([
578
+ "-export_grad_mrtrix",
579
+ params.get("export_grad_mrtrix")
580
+ ])
581
+ if params.get("export_grad_fsl") is not None:
582
+ cargs.extend(dyn_cargs(params.get("export_grad_fsl")["__STYXTYPE__"])(params.get("export_grad_fsl"), execution))
583
+ if params.get("import_pe_table") is not None:
584
+ cargs.extend([
585
+ "-import_pe_table",
586
+ execution.input_file(params.get("import_pe_table"))
587
+ ])
588
+ if params.get("import_pe_eddy") is not None:
589
+ cargs.extend(dyn_cargs(params.get("import_pe_eddy")["__STYXTYPE__"])(params.get("import_pe_eddy"), execution))
590
+ if params.get("pe") is not None:
591
+ cargs.extend([
592
+ "-pe",
593
+ ",".join(map(str, params.get("pe")))
594
+ ])
595
+ if params.get("strides") is not None:
596
+ cargs.extend([
597
+ "-strides",
598
+ *dyn_cargs(params.get("strides")["__STYXTYPE__"])(params.get("strides"), execution)
599
+ ])
600
+ if params.get("info"):
601
+ cargs.append("-info")
602
+ if params.get("quiet"):
603
+ cargs.append("-quiet")
604
+ if params.get("debug"):
605
+ cargs.append("-debug")
606
+ if params.get("force"):
607
+ cargs.append("-force")
608
+ if params.get("nthreads") is not None:
609
+ cargs.extend([
610
+ "-nthreads",
611
+ str(params.get("nthreads"))
612
+ ])
613
+ if params.get("config") is not None:
614
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
615
+ if params.get("help"):
616
+ cargs.append("-help")
617
+ if params.get("version"):
618
+ cargs.append("-version")
619
+ cargs.append(execution.input_file(params.get("input")))
620
+ cargs.append(params.get("output"))
621
+ return cargs
622
+
623
+
624
+ def dwiextract_outputs(
625
+ params: DwiextractParameters,
626
+ execution: Execution,
627
+ ) -> DwiextractOutputs:
628
+ """
629
+ Build outputs object containing output file paths and possibly stdout/stderr.
630
+
631
+ Args:
632
+ params: The parameters.
633
+ execution: The execution object for resolving input paths.
634
+ Returns:
635
+ Outputs object.
636
+ """
637
+ ret = DwiextractOutputs(
638
+ root=execution.output_file("."),
639
+ output=execution.output_file(params.get("output")),
640
+ export_grad_mrtrix=execution.output_file(params.get("export_grad_mrtrix")) if (params.get("export_grad_mrtrix") is not None) else None,
641
+ 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,
642
+ )
643
+ return ret
644
+
645
+
646
+ def dwiextract_execute(
647
+ params: DwiextractParameters,
648
+ execution: Execution,
649
+ ) -> DwiextractOutputs:
650
+ """
651
+ Extract diffusion-weighted volumes, b=0 volumes, or certain shells from a DWI
652
+ dataset.
653
+
654
+
655
+
656
+ References:
657
+
658
+ .
659
+
660
+ Author: MRTrix3 Developers
661
+
662
+ URL: https://www.mrtrix.org/
663
+
664
+ Args:
665
+ params: The parameters.
666
+ execution: The execution object.
667
+ Returns:
668
+ NamedTuple of outputs (described in `DwiextractOutputs`).
669
+ """
670
+ params = execution.params(params)
671
+ cargs = dwiextract_cargs(params, execution)
672
+ ret = dwiextract_outputs(params, execution)
673
+ execution.run(cargs)
674
+ return ret
675
+
676
+
677
+ def dwiextract(
678
+ input_: InputPathType,
679
+ output: str,
680
+ bzero: bool = False,
681
+ no_bzero: bool = False,
682
+ singleshell: bool = False,
683
+ grad: InputPathType | None = None,
684
+ fslgrad: DwiextractFslgradParameters | None = None,
685
+ shells: list[float] | None = None,
686
+ export_grad_mrtrix: str | None = None,
687
+ export_grad_fsl: DwiextractExportGradFslParameters | None = None,
688
+ import_pe_table: InputPathType | None = None,
689
+ import_pe_eddy: DwiextractImportPeEddyParameters | None = None,
690
+ pe: list[float] | None = None,
691
+ strides: typing.Union[DwiextractVariousStringParameters, DwiextractVariousFileParameters] | None = None,
692
+ info: bool = False,
693
+ quiet: bool = False,
694
+ debug: bool = False,
695
+ force: bool = False,
696
+ nthreads: int | None = None,
697
+ config: list[DwiextractConfigParameters] | None = None,
698
+ help_: bool = False,
699
+ version: bool = False,
700
+ runner: Runner | None = None,
701
+ ) -> DwiextractOutputs:
702
+ """
703
+ Extract diffusion-weighted volumes, b=0 volumes, or certain shells from a DWI
704
+ dataset.
705
+
706
+
707
+
708
+ References:
709
+
710
+ .
711
+
712
+ Author: MRTrix3 Developers
713
+
714
+ URL: https://www.mrtrix.org/
715
+
716
+ Args:
717
+ input_: the input DW image.
718
+ output: the output image (diffusion-weighted volumes by default).
719
+ bzero: Output b=0 volumes (instead of the diffusion weighted volumes,\
720
+ if -singleshell is not specified).
721
+ no_bzero: Output only non b=0 volumes (default, if -singleshell is not\
722
+ specified).
723
+ singleshell: Force a single-shell (single non b=0 shell) output. This\
724
+ will include b=0 volumes, if present. Use with -bzero to enforce\
725
+ presence of b=0 volumes (error if not present) or with -no_bzero to\
726
+ exclude them.
727
+ grad: Provide the diffusion-weighted gradient scheme used in the\
728
+ acquisition in a text file. This should be supplied as a 4xN text file\
729
+ with each line is in the format [ X Y Z b ], where [ X Y Z ] describe\
730
+ the direction of the applied gradient, and b gives the b-value in units\
731
+ of s/mm^2. If a diffusion gradient scheme is present in the input image\
732
+ header, the data provided with this option will be instead used.
733
+ fslgrad: Provide the diffusion-weighted gradient scheme used in the\
734
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
735
+ scheme is present in the input image header, the data provided with\
736
+ this option will be instead used.
737
+ shells: specify one or more b-values to use during processing, as a\
738
+ comma-separated list of the desired approximate b-values (b-values are\
739
+ clustered to allow for small deviations). Note that some commands are\
740
+ incompatible with multiple b-values, and will report an error if more\
741
+ than one b-value is provided.\
742
+ WARNING: note that, even though the b=0 volumes are never referred\
743
+ to as shells in the literature, they still have to be explicitly\
744
+ included in the list of b-values as provided to the -shell option!\
745
+ Several algorithms which include the b=0 volumes in their\
746
+ computations may otherwise return an undesired result.
747
+ export_grad_mrtrix: export the diffusion-weighted gradient table to\
748
+ file in MRtrix format.
749
+ export_grad_fsl: export the diffusion-weighted gradient table to files\
750
+ in FSL (bvecs / bvals) format.
751
+ import_pe_table: import a phase-encoding table from file.
752
+ import_pe_eddy: import phase-encoding information from an EDDY-style\
753
+ config / index file pair.
754
+ pe: select volumes with a particular phase encoding; this can be three\
755
+ comma-separated values (for i,j,k components of vector direction) or\
756
+ four (direction & total readout time).
757
+ strides: specify the strides of the output data in memory; either as a\
758
+ comma-separated list of (signed) integers, or as a template image from\
759
+ which the strides shall be extracted and used. The actual strides\
760
+ produced will depend on whether the output image format can support it.
761
+ info: display information messages.
762
+ quiet: do not display information messages or progress status;\
763
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
764
+ environment variable to a non-empty string.
765
+ debug: display debugging messages.
766
+ force: force overwrite of output files (caution: using the same file as\
767
+ input and output might cause unexpected behaviour).
768
+ nthreads: use this number of threads in multi-threaded applications\
769
+ (set to 0 to disable multi-threading).
770
+ config: temporarily set the value of an MRtrix config file entry.
771
+ help_: display this information page and exit.
772
+ version: display version information and exit.
773
+ runner: Command runner.
774
+ Returns:
775
+ NamedTuple of outputs (described in `DwiextractOutputs`).
776
+ """
777
+ runner = runner or get_global_runner()
778
+ execution = runner.start_execution(DWIEXTRACT_METADATA)
779
+ params = dwiextract_params(
780
+ bzero=bzero,
781
+ no_bzero=no_bzero,
782
+ singleshell=singleshell,
783
+ grad=grad,
784
+ fslgrad=fslgrad,
785
+ shells=shells,
786
+ export_grad_mrtrix=export_grad_mrtrix,
787
+ export_grad_fsl=export_grad_fsl,
788
+ import_pe_table=import_pe_table,
789
+ import_pe_eddy=import_pe_eddy,
790
+ pe=pe,
791
+ strides=strides,
792
+ info=info,
793
+ quiet=quiet,
794
+ debug=debug,
795
+ force=force,
796
+ nthreads=nthreads,
797
+ config=config,
798
+ help_=help_,
799
+ version=version,
800
+ input_=input_,
801
+ output=output,
802
+ )
803
+ return dwiextract_execute(params, execution)
804
+
805
+
806
+ __all__ = [
807
+ "DWIEXTRACT_METADATA",
808
+ "DwiextractConfigParameters",
809
+ "DwiextractExportGradFslOutputs",
810
+ "DwiextractExportGradFslParameters",
811
+ "DwiextractFslgradParameters",
812
+ "DwiextractImportPeEddyParameters",
813
+ "DwiextractOutputs",
814
+ "DwiextractParameters",
815
+ "DwiextractVariousFileParameters",
816
+ "DwiextractVariousStringParameters",
817
+ "dwiextract",
818
+ "dwiextract_config_params",
819
+ "dwiextract_export_grad_fsl_params",
820
+ "dwiextract_fslgrad_params",
821
+ "dwiextract_import_pe_eddy_params",
822
+ "dwiextract_params",
823
+ "dwiextract_various_file_params",
824
+ "dwiextract_various_string_params",
825
+ ]