niwrap-mrtrix 0.8.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. niwrap_mrtrix/mrtrix/__init__.py +263 -0
  2. niwrap_mrtrix/mrtrix/afdconnectivity.py +527 -0
  3. niwrap_mrtrix/mrtrix/amp2response.py +560 -0
  4. niwrap_mrtrix/mrtrix/amp2sh.py +870 -0
  5. niwrap_mrtrix/mrtrix/connectome2tck.py +583 -0
  6. niwrap_mrtrix/mrtrix/connectomeedit.py +413 -0
  7. niwrap_mrtrix/mrtrix/connectomestats.py +956 -0
  8. niwrap_mrtrix/mrtrix/dcmedit.py +552 -0
  9. niwrap_mrtrix/mrtrix/dcminfo.py +529 -0
  10. niwrap_mrtrix/mrtrix/dirflip.py +440 -0
  11. niwrap_mrtrix/mrtrix/dirgen.py +514 -0
  12. niwrap_mrtrix/mrtrix/dirmerge.py +446 -0
  13. niwrap_mrtrix/mrtrix/dirorder.py +421 -0
  14. niwrap_mrtrix/mrtrix/dirsplit.py +436 -0
  15. niwrap_mrtrix/mrtrix/dirstat.py +640 -0
  16. niwrap_mrtrix/mrtrix/dwi2adc.py +531 -0
  17. niwrap_mrtrix/mrtrix/dwi2fod.py +1156 -0
  18. niwrap_mrtrix/mrtrix/dwi2mask.py +570 -0
  19. niwrap_mrtrix/mrtrix/dwi2response.py +1774 -0
  20. niwrap_mrtrix/mrtrix/dwi2tensor.py +715 -0
  21. niwrap_mrtrix/mrtrix/dwibiascorrect.py +673 -0
  22. niwrap_mrtrix/mrtrix/dwidenoise.py +570 -0
  23. niwrap_mrtrix/mrtrix/dwiextract.py +1111 -0
  24. niwrap_mrtrix/mrtrix/dwigradcheck.py +665 -0
  25. niwrap_mrtrix/mrtrix/fixel2peaks.py +613 -0
  26. niwrap_mrtrix/mrtrix/fixel2sh.py +430 -0
  27. niwrap_mrtrix/mrtrix/fixel2tsf.py +435 -0
  28. niwrap_mrtrix/mrtrix/fixel2voxel.py +523 -0
  29. niwrap_mrtrix/mrtrix/fixelcfestats.py +1179 -0
  30. niwrap_mrtrix/mrtrix/fixelconnectivity.py +477 -0
  31. niwrap_mrtrix/mrtrix/fixelconvert.py +850 -0
  32. niwrap_mrtrix/mrtrix/fixelcorrespondence.py +455 -0
  33. niwrap_mrtrix/mrtrix/fixelcrop.py +422 -0
  34. niwrap_mrtrix/mrtrix/fixelfilter.py +882 -0
  35. niwrap_mrtrix/mrtrix/fixelreorient.py +435 -0
  36. niwrap_mrtrix/mrtrix/fod2dec.py +571 -0
  37. niwrap_mrtrix/mrtrix/fod2fixel.py +646 -0
  38. niwrap_mrtrix/mrtrix/label2colour.py +426 -0
  39. niwrap_mrtrix/mrtrix/label2mesh.py +417 -0
  40. niwrap_mrtrix/mrtrix/labelconvert.py +460 -0
  41. niwrap_mrtrix/mrtrix/labelstats.py +418 -0
  42. niwrap_mrtrix/mrtrix/maskdump.py +404 -0
  43. niwrap_mrtrix/mrtrix/maskfilter.py +730 -0
  44. niwrap_mrtrix/mrtrix/mesh2voxel.py +422 -0
  45. niwrap_mrtrix/mrtrix/meshconvert.py +514 -0
  46. niwrap_mrtrix/mrtrix/meshfilter.py +452 -0
  47. niwrap_mrtrix/mrtrix/mraverageheader.py +485 -0
  48. niwrap_mrtrix/mrtrix/mrcalc.py +4302 -0
  49. niwrap_mrtrix/mrtrix/mrcat.py +467 -0
  50. niwrap_mrtrix/mrtrix/mrcentroid.py +418 -0
  51. niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +446 -0
  52. niwrap_mrtrix/mrtrix/mrclusterstats.py +930 -0
  53. niwrap_mrtrix/mrtrix/mrcolour.py +490 -0
  54. niwrap_mrtrix/mrtrix/mrconvert.py +1967 -0
  55. niwrap_mrtrix/mrtrix/mrdegibbs.py +535 -0
  56. niwrap_mrtrix/mrtrix/mrdump.py +423 -0
  57. niwrap_mrtrix/mrtrix/mredit.py +737 -0
  58. niwrap_mrtrix/mrtrix/mrfilter.py +971 -0
  59. niwrap_mrtrix/mrtrix/mrgrid.py +1079 -0
  60. niwrap_mrtrix/mrtrix/mrhistmatch.py +494 -0
  61. niwrap_mrtrix/mrtrix/mrhistogram.py +484 -0
  62. niwrap_mrtrix/mrtrix/mrinfo.py +1282 -0
  63. niwrap_mrtrix/mrtrix/mrmath.py +503 -0
  64. niwrap_mrtrix/mrtrix/mrmetric.py +525 -0
  65. niwrap_mrtrix/mrtrix/mrregister.py +2098 -0
  66. niwrap_mrtrix/mrtrix/mrstats.py +534 -0
  67. niwrap_mrtrix/mrtrix/mrthreshold.py +666 -0
  68. niwrap_mrtrix/mrtrix/mrtransform.py +1372 -0
  69. niwrap_mrtrix/mrtrix/mtnormalise.py +725 -0
  70. niwrap_mrtrix/mrtrix/peaks2amp.py +403 -0
  71. niwrap_mrtrix/mrtrix/peaks2fixel.py +422 -0
  72. niwrap_mrtrix/mrtrix/responsemean.py +385 -0
  73. niwrap_mrtrix/mrtrix/sh2amp.py +844 -0
  74. niwrap_mrtrix/mrtrix/sh2peaks.py +632 -0
  75. niwrap_mrtrix/mrtrix/sh2power.py +427 -0
  76. niwrap_mrtrix/mrtrix/sh2response.py +481 -0
  77. niwrap_mrtrix/mrtrix/shbasis.py +445 -0
  78. niwrap_mrtrix/mrtrix/shconv.py +661 -0
  79. niwrap_mrtrix/mrtrix/tck2connectome.py +727 -0
  80. niwrap_mrtrix/mrtrix/tck2fixel.py +447 -0
  81. niwrap_mrtrix/mrtrix/tckconvert.py +775 -0
  82. niwrap_mrtrix/mrtrix/tckdfc.py +684 -0
  83. niwrap_mrtrix/mrtrix/tckedit.py +1478 -0
  84. niwrap_mrtrix/mrtrix/tckgen.py +2733 -0
  85. niwrap_mrtrix/mrtrix/tckglobal.py +944 -0
  86. niwrap_mrtrix/mrtrix/tckinfo.py +402 -0
  87. niwrap_mrtrix/mrtrix/tckmap.py +1004 -0
  88. niwrap_mrtrix/mrtrix/tckresample.py +760 -0
  89. niwrap_mrtrix/mrtrix/tcksample.py +497 -0
  90. niwrap_mrtrix/mrtrix/tcksift.py +739 -0
  91. niwrap_mrtrix/mrtrix/tcksift2.py +902 -0
  92. niwrap_mrtrix/mrtrix/tckstats.py +550 -0
  93. niwrap_mrtrix/mrtrix/tcktransform.py +414 -0
  94. niwrap_mrtrix/mrtrix/tensor2metric.py +659 -0
  95. niwrap_mrtrix/mrtrix/transformcalc.py +421 -0
  96. niwrap_mrtrix/mrtrix/transformcompose.py +625 -0
  97. niwrap_mrtrix/mrtrix/transformconvert.py +423 -0
  98. niwrap_mrtrix/mrtrix/tsfdivide.py +414 -0
  99. niwrap_mrtrix/mrtrix/tsfinfo.py +421 -0
  100. niwrap_mrtrix/mrtrix/tsfmult.py +401 -0
  101. niwrap_mrtrix/mrtrix/tsfsmooth.py +420 -0
  102. niwrap_mrtrix/mrtrix/tsfthreshold.py +428 -0
  103. niwrap_mrtrix/mrtrix/tsfvalidate.py +398 -0
  104. niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +432 -0
  105. niwrap_mrtrix/mrtrix/v_5tt2vis.py +505 -0
  106. niwrap_mrtrix/mrtrix/v_5ttcheck.py +409 -0
  107. niwrap_mrtrix/mrtrix/v_5ttedit.py +513 -0
  108. niwrap_mrtrix/mrtrix/v_5ttgen.py +1107 -0
  109. niwrap_mrtrix/mrtrix/vectorstats.py +736 -0
  110. niwrap_mrtrix/mrtrix/voxel2fixel.py +430 -0
  111. niwrap_mrtrix/mrtrix/voxel2mesh.py +454 -0
  112. niwrap_mrtrix/mrtrix/warp2metric.py +556 -0
  113. niwrap_mrtrix/mrtrix/warpconvert.py +498 -0
  114. niwrap_mrtrix/mrtrix/warpcorrect.py +448 -0
  115. niwrap_mrtrix/mrtrix/warpinit.py +425 -0
  116. niwrap_mrtrix/mrtrix/warpinvert.py +448 -0
  117. niwrap_mrtrix-0.8.0.dist-info/METADATA +8 -0
  118. niwrap_mrtrix-0.8.0.dist-info/RECORD +119 -0
  119. niwrap_mrtrix-0.8.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,1967 @@
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
+ MRCONVERT_METADATA = Metadata(
9
+ id="bef3db00bf7c217fcb538ce0cdc9238e54062140.boutiques",
10
+ name="mrconvert",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _MrconvertCoordParamsDictNoTag = typing.TypedDict('_MrconvertCoordParamsDictNoTag', {
17
+ "axis": int,
18
+ "selection": list[int],
19
+ })
20
+ MrconvertCoordParamsDictTagged = typing.TypedDict('MrconvertCoordParamsDictTagged', {
21
+ "@type": typing.Literal["coord"],
22
+ "axis": int,
23
+ "selection": list[int],
24
+ })
25
+ MrconvertCoordParamsDict = _MrconvertCoordParamsDictNoTag | MrconvertCoordParamsDictTagged
26
+
27
+
28
+ _MrconvertClearPropertyParamsDictNoTag = typing.TypedDict('_MrconvertClearPropertyParamsDictNoTag', {
29
+ "key": str,
30
+ })
31
+ MrconvertClearPropertyParamsDictTagged = typing.TypedDict('MrconvertClearPropertyParamsDictTagged', {
32
+ "@type": typing.Literal["clear_property"],
33
+ "key": str,
34
+ })
35
+ MrconvertClearPropertyParamsDict = _MrconvertClearPropertyParamsDictNoTag | MrconvertClearPropertyParamsDictTagged
36
+
37
+
38
+ _MrconvertSetPropertyParamsDictNoTag = typing.TypedDict('_MrconvertSetPropertyParamsDictNoTag', {
39
+ "key": str,
40
+ "value": str,
41
+ })
42
+ MrconvertSetPropertyParamsDictTagged = typing.TypedDict('MrconvertSetPropertyParamsDictTagged', {
43
+ "@type": typing.Literal["set_property"],
44
+ "key": str,
45
+ "value": str,
46
+ })
47
+ MrconvertSetPropertyParamsDict = _MrconvertSetPropertyParamsDictNoTag | MrconvertSetPropertyParamsDictTagged
48
+
49
+
50
+ _MrconvertAppendPropertyParamsDictNoTag = typing.TypedDict('_MrconvertAppendPropertyParamsDictNoTag', {
51
+ "key": str,
52
+ "value": str,
53
+ })
54
+ MrconvertAppendPropertyParamsDictTagged = typing.TypedDict('MrconvertAppendPropertyParamsDictTagged', {
55
+ "@type": typing.Literal["append_property"],
56
+ "key": str,
57
+ "value": str,
58
+ })
59
+ MrconvertAppendPropertyParamsDict = _MrconvertAppendPropertyParamsDictNoTag | MrconvertAppendPropertyParamsDictTagged
60
+
61
+
62
+ _MrconvertVariousStringParamsDictNoTag = typing.TypedDict('_MrconvertVariousStringParamsDictNoTag', {
63
+ "obj": str,
64
+ })
65
+ MrconvertVariousStringParamsDictTagged = typing.TypedDict('MrconvertVariousStringParamsDictTagged', {
66
+ "@type": typing.Literal["VariousString"],
67
+ "obj": str,
68
+ })
69
+ MrconvertVariousStringParamsDict = _MrconvertVariousStringParamsDictNoTag | MrconvertVariousStringParamsDictTagged
70
+
71
+
72
+ _MrconvertVariousFileParamsDictNoTag = typing.TypedDict('_MrconvertVariousFileParamsDictNoTag', {
73
+ "obj": InputPathType,
74
+ })
75
+ MrconvertVariousFileParamsDictTagged = typing.TypedDict('MrconvertVariousFileParamsDictTagged', {
76
+ "@type": typing.Literal["VariousFile"],
77
+ "obj": InputPathType,
78
+ })
79
+ MrconvertVariousFileParamsDict = _MrconvertVariousFileParamsDictNoTag | MrconvertVariousFileParamsDictTagged
80
+
81
+
82
+ _MrconvertVariousString1ParamsDictNoTag = typing.TypedDict('_MrconvertVariousString1ParamsDictNoTag', {
83
+ "obj": str,
84
+ })
85
+ MrconvertVariousString1ParamsDictTagged = typing.TypedDict('MrconvertVariousString1ParamsDictTagged', {
86
+ "@type": typing.Literal["VariousString_1"],
87
+ "obj": str,
88
+ })
89
+ MrconvertVariousString1ParamsDict = _MrconvertVariousString1ParamsDictNoTag | MrconvertVariousString1ParamsDictTagged
90
+
91
+
92
+ _MrconvertVariousFile1ParamsDictNoTag = typing.TypedDict('_MrconvertVariousFile1ParamsDictNoTag', {
93
+ "obj": InputPathType,
94
+ })
95
+ MrconvertVariousFile1ParamsDictTagged = typing.TypedDict('MrconvertVariousFile1ParamsDictTagged', {
96
+ "@type": typing.Literal["VariousFile_1"],
97
+ "obj": InputPathType,
98
+ })
99
+ MrconvertVariousFile1ParamsDict = _MrconvertVariousFile1ParamsDictNoTag | MrconvertVariousFile1ParamsDictTagged
100
+
101
+
102
+ _MrconvertFslgradParamsDictNoTag = typing.TypedDict('_MrconvertFslgradParamsDictNoTag', {
103
+ "bvecs": InputPathType,
104
+ "bvals": InputPathType,
105
+ })
106
+ MrconvertFslgradParamsDictTagged = typing.TypedDict('MrconvertFslgradParamsDictTagged', {
107
+ "@type": typing.Literal["fslgrad"],
108
+ "bvecs": InputPathType,
109
+ "bvals": InputPathType,
110
+ })
111
+ MrconvertFslgradParamsDict = _MrconvertFslgradParamsDictNoTag | MrconvertFslgradParamsDictTagged
112
+
113
+
114
+ _MrconvertExportGradFslParamsDictNoTag = typing.TypedDict('_MrconvertExportGradFslParamsDictNoTag', {
115
+ "bvecs_path": str,
116
+ "bvals_path": str,
117
+ })
118
+ MrconvertExportGradFslParamsDictTagged = typing.TypedDict('MrconvertExportGradFslParamsDictTagged', {
119
+ "@type": typing.Literal["export_grad_fsl"],
120
+ "bvecs_path": str,
121
+ "bvals_path": str,
122
+ })
123
+ MrconvertExportGradFslParamsDict = _MrconvertExportGradFslParamsDictNoTag | MrconvertExportGradFslParamsDictTagged
124
+
125
+
126
+ _MrconvertImportPeEddyParamsDictNoTag = typing.TypedDict('_MrconvertImportPeEddyParamsDictNoTag', {
127
+ "config": InputPathType,
128
+ "indices": InputPathType,
129
+ })
130
+ MrconvertImportPeEddyParamsDictTagged = typing.TypedDict('MrconvertImportPeEddyParamsDictTagged', {
131
+ "@type": typing.Literal["import_pe_eddy"],
132
+ "config": InputPathType,
133
+ "indices": InputPathType,
134
+ })
135
+ MrconvertImportPeEddyParamsDict = _MrconvertImportPeEddyParamsDictNoTag | MrconvertImportPeEddyParamsDictTagged
136
+
137
+
138
+ _MrconvertExportPeEddyParamsDictNoTag = typing.TypedDict('_MrconvertExportPeEddyParamsDictNoTag', {
139
+ "config": str,
140
+ "indices": str,
141
+ })
142
+ MrconvertExportPeEddyParamsDictTagged = typing.TypedDict('MrconvertExportPeEddyParamsDictTagged', {
143
+ "@type": typing.Literal["export_pe_eddy"],
144
+ "config": str,
145
+ "indices": str,
146
+ })
147
+ MrconvertExportPeEddyParamsDict = _MrconvertExportPeEddyParamsDictNoTag | MrconvertExportPeEddyParamsDictTagged
148
+
149
+
150
+ _MrconvertConfigParamsDictNoTag = typing.TypedDict('_MrconvertConfigParamsDictNoTag', {
151
+ "key": str,
152
+ "value": str,
153
+ })
154
+ MrconvertConfigParamsDictTagged = typing.TypedDict('MrconvertConfigParamsDictTagged', {
155
+ "@type": typing.Literal["config"],
156
+ "key": str,
157
+ "value": str,
158
+ })
159
+ MrconvertConfigParamsDict = _MrconvertConfigParamsDictNoTag | MrconvertConfigParamsDictTagged
160
+
161
+
162
+ _MrconvertParamsDictNoTag = typing.TypedDict('_MrconvertParamsDictNoTag', {
163
+ "coord": typing.NotRequired[list[MrconvertCoordParamsDict] | None],
164
+ "vox": typing.NotRequired[list[float] | None],
165
+ "axes": typing.NotRequired[list[int] | None],
166
+ "scaling": typing.NotRequired[list[float] | None],
167
+ "json_import": typing.NotRequired[InputPathType | None],
168
+ "json_export": typing.NotRequired[str | None],
169
+ "clear_property": typing.NotRequired[list[MrconvertClearPropertyParamsDict] | None],
170
+ "set_property": typing.NotRequired[list[MrconvertSetPropertyParamsDict] | None],
171
+ "append_property": typing.NotRequired[list[MrconvertAppendPropertyParamsDict] | None],
172
+ "copy_properties": typing.NotRequired[typing.Union[MrconvertVariousStringParamsDictTagged, MrconvertVariousFileParamsDictTagged] | None],
173
+ "strides": typing.NotRequired[typing.Union[MrconvertVariousString1ParamsDictTagged, MrconvertVariousFile1ParamsDictTagged] | None],
174
+ "datatype": typing.NotRequired[str | None],
175
+ "grad": typing.NotRequired[InputPathType | None],
176
+ "fslgrad": typing.NotRequired[MrconvertFslgradParamsDict | None],
177
+ "bvalue_scaling": typing.NotRequired[str | None],
178
+ "export_grad_mrtrix": typing.NotRequired[str | None],
179
+ "export_grad_fsl": typing.NotRequired[MrconvertExportGradFslParamsDict | None],
180
+ "import_pe_table": typing.NotRequired[InputPathType | None],
181
+ "import_pe_eddy": typing.NotRequired[MrconvertImportPeEddyParamsDict | None],
182
+ "export_pe_table": typing.NotRequired[str | None],
183
+ "export_pe_eddy": typing.NotRequired[MrconvertExportPeEddyParamsDict | None],
184
+ "info": bool,
185
+ "quiet": bool,
186
+ "debug": bool,
187
+ "force": bool,
188
+ "nthreads": typing.NotRequired[int | None],
189
+ "config": typing.NotRequired[list[MrconvertConfigParamsDict] | None],
190
+ "help": bool,
191
+ "version": bool,
192
+ "input": InputPathType,
193
+ "output": str,
194
+ })
195
+ MrconvertParamsDictTagged = typing.TypedDict('MrconvertParamsDictTagged', {
196
+ "@type": typing.Literal["mrtrix/mrconvert"],
197
+ "coord": typing.NotRequired[list[MrconvertCoordParamsDict] | None],
198
+ "vox": typing.NotRequired[list[float] | None],
199
+ "axes": typing.NotRequired[list[int] | None],
200
+ "scaling": typing.NotRequired[list[float] | None],
201
+ "json_import": typing.NotRequired[InputPathType | None],
202
+ "json_export": typing.NotRequired[str | None],
203
+ "clear_property": typing.NotRequired[list[MrconvertClearPropertyParamsDict] | None],
204
+ "set_property": typing.NotRequired[list[MrconvertSetPropertyParamsDict] | None],
205
+ "append_property": typing.NotRequired[list[MrconvertAppendPropertyParamsDict] | None],
206
+ "copy_properties": typing.NotRequired[typing.Union[MrconvertVariousStringParamsDictTagged, MrconvertVariousFileParamsDictTagged] | None],
207
+ "strides": typing.NotRequired[typing.Union[MrconvertVariousString1ParamsDictTagged, MrconvertVariousFile1ParamsDictTagged] | None],
208
+ "datatype": typing.NotRequired[str | None],
209
+ "grad": typing.NotRequired[InputPathType | None],
210
+ "fslgrad": typing.NotRequired[MrconvertFslgradParamsDict | None],
211
+ "bvalue_scaling": typing.NotRequired[str | None],
212
+ "export_grad_mrtrix": typing.NotRequired[str | None],
213
+ "export_grad_fsl": typing.NotRequired[MrconvertExportGradFslParamsDict | None],
214
+ "import_pe_table": typing.NotRequired[InputPathType | None],
215
+ "import_pe_eddy": typing.NotRequired[MrconvertImportPeEddyParamsDict | None],
216
+ "export_pe_table": typing.NotRequired[str | None],
217
+ "export_pe_eddy": typing.NotRequired[MrconvertExportPeEddyParamsDict | None],
218
+ "info": bool,
219
+ "quiet": bool,
220
+ "debug": bool,
221
+ "force": bool,
222
+ "nthreads": typing.NotRequired[int | None],
223
+ "config": typing.NotRequired[list[MrconvertConfigParamsDict] | None],
224
+ "help": bool,
225
+ "version": bool,
226
+ "input": InputPathType,
227
+ "output": str,
228
+ })
229
+ MrconvertParamsDict = _MrconvertParamsDictNoTag | MrconvertParamsDictTagged
230
+
231
+
232
+ def mrconvert_copy_properties_cargs_dyn_fn(
233
+ t: str,
234
+ ) -> typing.Any:
235
+ """
236
+ Get build cargs function by command type.
237
+
238
+ Args:
239
+ t: Command type.
240
+ Returns:
241
+ Build cargs function.
242
+ """
243
+ return {
244
+ "VariousString": mrconvert_various_string_cargs,
245
+ "VariousFile": mrconvert_various_file_cargs,
246
+ }.get(t)
247
+
248
+
249
+ def mrconvert_copy_properties_validate_dyn_fn(
250
+ t: str,
251
+ ) -> typing.Any:
252
+ """
253
+ Get validate params function by command type.
254
+
255
+ Args:
256
+ t: Command type.
257
+ Returns:
258
+ Validate params function.
259
+ """
260
+ return {
261
+ "VariousString": mrconvert_various_string_validate,
262
+ "VariousFile": mrconvert_various_file_validate,
263
+ }.get(t)
264
+
265
+
266
+ def mrconvert_strides_cargs_dyn_fn(
267
+ t: str,
268
+ ) -> typing.Any:
269
+ """
270
+ Get build cargs function by command type.
271
+
272
+ Args:
273
+ t: Command type.
274
+ Returns:
275
+ Build cargs function.
276
+ """
277
+ return {
278
+ "VariousString_1": mrconvert_various_string_1_cargs,
279
+ "VariousFile_1": mrconvert_various_file_1_cargs,
280
+ }.get(t)
281
+
282
+
283
+ def mrconvert_strides_validate_dyn_fn(
284
+ t: str,
285
+ ) -> typing.Any:
286
+ """
287
+ Get validate params function by command type.
288
+
289
+ Args:
290
+ t: Command type.
291
+ Returns:
292
+ Validate params function.
293
+ """
294
+ return {
295
+ "VariousString_1": mrconvert_various_string_1_validate,
296
+ "VariousFile_1": mrconvert_various_file_1_validate,
297
+ }.get(t)
298
+
299
+
300
+ def mrconvert_coord(
301
+ axis: int,
302
+ selection: list[int],
303
+ ) -> MrconvertCoordParamsDictTagged:
304
+ """
305
+ Build parameters.
306
+
307
+ Args:
308
+ axis: retain data from the input image only at the coordinates\
309
+ specified in the selection along the specified axis. The selection\
310
+ argument expects a number sequence, which can also include the 'end'\
311
+ keyword.
312
+ selection: retain data from the input image only at the coordinates\
313
+ specified in the selection along the specified axis. The selection\
314
+ argument expects a number sequence, which can also include the 'end'\
315
+ keyword.
316
+ Returns:
317
+ Parameter dictionary
318
+ """
319
+ params = {
320
+ "@type": "coord",
321
+ "axis": axis,
322
+ "selection": selection,
323
+ }
324
+ return params
325
+
326
+
327
+ def mrconvert_coord_validate(
328
+ params: typing.Any,
329
+ ) -> None:
330
+ """
331
+ Validate parameters. Throws an error if `params` is not a valid
332
+ `MrconvertCoordParamsDict` object.
333
+
334
+ Args:
335
+ params: The parameters object to validate.
336
+ """
337
+ if params is None or not isinstance(params, dict):
338
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
339
+ if params.get("axis", None) is None:
340
+ raise StyxValidationError("`axis` must not be None")
341
+ if not isinstance(params["axis"], int):
342
+ raise StyxValidationError(f'`axis` has the wrong type: Received `{type(params.get("axis", None))}` expected `int`')
343
+ if params.get("selection", None) is None:
344
+ raise StyxValidationError("`selection` must not be None")
345
+ if not isinstance(params["selection"], list):
346
+ raise StyxValidationError(f'`selection` has the wrong type: Received `{type(params.get("selection", None))}` expected `list[int]`')
347
+ for e in params["selection"]:
348
+ if not isinstance(e, int):
349
+ raise StyxValidationError(f'`selection` has the wrong type: Received `{type(params.get("selection", None))}` expected `list[int]`')
350
+
351
+
352
+ def mrconvert_coord_cargs(
353
+ params: MrconvertCoordParamsDict,
354
+ execution: Execution,
355
+ ) -> list[str]:
356
+ """
357
+ Build command-line arguments from parameters.
358
+
359
+ Args:
360
+ params: The parameters.
361
+ execution: The execution object for resolving input paths.
362
+ Returns:
363
+ Command-line arguments.
364
+ """
365
+ cargs = []
366
+ cargs.append("-coord")
367
+ cargs.append(str(params.get("axis", None)))
368
+ cargs.extend(map(str, params.get("selection", None)))
369
+ return cargs
370
+
371
+
372
+ def mrconvert_clear_property(
373
+ key: str,
374
+ ) -> MrconvertClearPropertyParamsDictTagged:
375
+ """
376
+ Build parameters.
377
+
378
+ Args:
379
+ key: remove the specified key from the image header altogether.
380
+ Returns:
381
+ Parameter dictionary
382
+ """
383
+ params = {
384
+ "@type": "clear_property",
385
+ "key": key,
386
+ }
387
+ return params
388
+
389
+
390
+ def mrconvert_clear_property_validate(
391
+ params: typing.Any,
392
+ ) -> None:
393
+ """
394
+ Validate parameters. Throws an error if `params` is not a valid
395
+ `MrconvertClearPropertyParamsDict` object.
396
+
397
+ Args:
398
+ params: The parameters object to validate.
399
+ """
400
+ if params is None or not isinstance(params, dict):
401
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
402
+ if params.get("key", None) is None:
403
+ raise StyxValidationError("`key` must not be None")
404
+ if not isinstance(params["key"], str):
405
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
406
+
407
+
408
+ def mrconvert_clear_property_cargs(
409
+ params: MrconvertClearPropertyParamsDict,
410
+ execution: Execution,
411
+ ) -> list[str]:
412
+ """
413
+ Build command-line arguments from parameters.
414
+
415
+ Args:
416
+ params: The parameters.
417
+ execution: The execution object for resolving input paths.
418
+ Returns:
419
+ Command-line arguments.
420
+ """
421
+ cargs = []
422
+ cargs.append("-clear_property")
423
+ cargs.append(params.get("key", None))
424
+ return cargs
425
+
426
+
427
+ def mrconvert_set_property(
428
+ key: str,
429
+ value: str,
430
+ ) -> MrconvertSetPropertyParamsDictTagged:
431
+ """
432
+ Build parameters.
433
+
434
+ Args:
435
+ key: set the value of the specified key in the image header.
436
+ value: set the value of the specified key in the image header.
437
+ Returns:
438
+ Parameter dictionary
439
+ """
440
+ params = {
441
+ "@type": "set_property",
442
+ "key": key,
443
+ "value": value,
444
+ }
445
+ return params
446
+
447
+
448
+ def mrconvert_set_property_validate(
449
+ params: typing.Any,
450
+ ) -> None:
451
+ """
452
+ Validate parameters. Throws an error if `params` is not a valid
453
+ `MrconvertSetPropertyParamsDict` object.
454
+
455
+ Args:
456
+ params: The parameters object to validate.
457
+ """
458
+ if params is None or not isinstance(params, dict):
459
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
460
+ if params.get("key", None) is None:
461
+ raise StyxValidationError("`key` must not be None")
462
+ if not isinstance(params["key"], str):
463
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
464
+ if params.get("value", None) is None:
465
+ raise StyxValidationError("`value` must not be None")
466
+ if not isinstance(params["value"], str):
467
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
468
+
469
+
470
+ def mrconvert_set_property_cargs(
471
+ params: MrconvertSetPropertyParamsDict,
472
+ execution: Execution,
473
+ ) -> list[str]:
474
+ """
475
+ Build command-line arguments from parameters.
476
+
477
+ Args:
478
+ params: The parameters.
479
+ execution: The execution object for resolving input paths.
480
+ Returns:
481
+ Command-line arguments.
482
+ """
483
+ cargs = []
484
+ cargs.append("-set_property")
485
+ cargs.append(params.get("key", None))
486
+ cargs.append(params.get("value", None))
487
+ return cargs
488
+
489
+
490
+ def mrconvert_append_property(
491
+ key: str,
492
+ value: str,
493
+ ) -> MrconvertAppendPropertyParamsDictTagged:
494
+ """
495
+ Build parameters.
496
+
497
+ Args:
498
+ key: append the given value to the specified key in the image header\
499
+ (this adds the value specified as a new line in the header value).
500
+ value: append the given value to the specified key in the image header\
501
+ (this adds the value specified as a new line in the header value).
502
+ Returns:
503
+ Parameter dictionary
504
+ """
505
+ params = {
506
+ "@type": "append_property",
507
+ "key": key,
508
+ "value": value,
509
+ }
510
+ return params
511
+
512
+
513
+ def mrconvert_append_property_validate(
514
+ params: typing.Any,
515
+ ) -> None:
516
+ """
517
+ Validate parameters. Throws an error if `params` is not a valid
518
+ `MrconvertAppendPropertyParamsDict` object.
519
+
520
+ Args:
521
+ params: The parameters object to validate.
522
+ """
523
+ if params is None or not isinstance(params, dict):
524
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
525
+ if params.get("key", None) is None:
526
+ raise StyxValidationError("`key` must not be None")
527
+ if not isinstance(params["key"], str):
528
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
529
+ if params.get("value", None) is None:
530
+ raise StyxValidationError("`value` must not be None")
531
+ if not isinstance(params["value"], str):
532
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
533
+
534
+
535
+ def mrconvert_append_property_cargs(
536
+ params: MrconvertAppendPropertyParamsDict,
537
+ execution: Execution,
538
+ ) -> list[str]:
539
+ """
540
+ Build command-line arguments from parameters.
541
+
542
+ Args:
543
+ params: The parameters.
544
+ execution: The execution object for resolving input paths.
545
+ Returns:
546
+ Command-line arguments.
547
+ """
548
+ cargs = []
549
+ cargs.append("-append_property")
550
+ cargs.append(params.get("key", None))
551
+ cargs.append(params.get("value", None))
552
+ return cargs
553
+
554
+
555
+ def mrconvert_various_string(
556
+ obj: str,
557
+ ) -> MrconvertVariousStringParamsDictTagged:
558
+ """
559
+ Build parameters.
560
+
561
+ Args:
562
+ obj: String object.
563
+ Returns:
564
+ Parameter dictionary
565
+ """
566
+ params = {
567
+ "@type": "VariousString",
568
+ "obj": obj,
569
+ }
570
+ return params
571
+
572
+
573
+ def mrconvert_various_string_validate(
574
+ params: typing.Any,
575
+ ) -> None:
576
+ """
577
+ Validate parameters. Throws an error if `params` is not a valid
578
+ `MrconvertVariousStringParamsDict` object.
579
+
580
+ Args:
581
+ params: The parameters object to validate.
582
+ """
583
+ if params is None or not isinstance(params, dict):
584
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
585
+ if params.get("obj", None) is None:
586
+ raise StyxValidationError("`obj` must not be None")
587
+ if not isinstance(params["obj"], str):
588
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `str`')
589
+
590
+
591
+ def mrconvert_various_string_cargs(
592
+ params: MrconvertVariousStringParamsDict,
593
+ execution: Execution,
594
+ ) -> list[str]:
595
+ """
596
+ Build command-line arguments from parameters.
597
+
598
+ Args:
599
+ params: The parameters.
600
+ execution: The execution object for resolving input paths.
601
+ Returns:
602
+ Command-line arguments.
603
+ """
604
+ cargs = []
605
+ cargs.append(params.get("obj", None))
606
+ return cargs
607
+
608
+
609
+ def mrconvert_various_file(
610
+ obj: InputPathType,
611
+ ) -> MrconvertVariousFileParamsDictTagged:
612
+ """
613
+ Build parameters.
614
+
615
+ Args:
616
+ obj: File object.
617
+ Returns:
618
+ Parameter dictionary
619
+ """
620
+ params = {
621
+ "@type": "VariousFile",
622
+ "obj": obj,
623
+ }
624
+ return params
625
+
626
+
627
+ def mrconvert_various_file_validate(
628
+ params: typing.Any,
629
+ ) -> None:
630
+ """
631
+ Validate parameters. Throws an error if `params` is not a valid
632
+ `MrconvertVariousFileParamsDict` object.
633
+
634
+ Args:
635
+ params: The parameters object to validate.
636
+ """
637
+ if params is None or not isinstance(params, dict):
638
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
639
+ if params.get("obj", None) is None:
640
+ raise StyxValidationError("`obj` must not be None")
641
+ if not isinstance(params["obj"], (pathlib.Path, str)):
642
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `InputPathType`')
643
+
644
+
645
+ def mrconvert_various_file_cargs(
646
+ params: MrconvertVariousFileParamsDict,
647
+ execution: Execution,
648
+ ) -> list[str]:
649
+ """
650
+ Build command-line arguments from parameters.
651
+
652
+ Args:
653
+ params: The parameters.
654
+ execution: The execution object for resolving input paths.
655
+ Returns:
656
+ Command-line arguments.
657
+ """
658
+ cargs = []
659
+ cargs.append(execution.input_file(params.get("obj", None)))
660
+ return cargs
661
+
662
+
663
+ def mrconvert_various_string_1(
664
+ obj: str,
665
+ ) -> MrconvertVariousString1ParamsDictTagged:
666
+ """
667
+ Build parameters.
668
+
669
+ Args:
670
+ obj: String object.
671
+ Returns:
672
+ Parameter dictionary
673
+ """
674
+ params = {
675
+ "@type": "VariousString_1",
676
+ "obj": obj,
677
+ }
678
+ return params
679
+
680
+
681
+ def mrconvert_various_string_1_validate(
682
+ params: typing.Any,
683
+ ) -> None:
684
+ """
685
+ Validate parameters. Throws an error if `params` is not a valid
686
+ `MrconvertVariousString1ParamsDict` object.
687
+
688
+ Args:
689
+ params: The parameters object to validate.
690
+ """
691
+ if params is None or not isinstance(params, dict):
692
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
693
+ if params.get("obj", None) is None:
694
+ raise StyxValidationError("`obj` must not be None")
695
+ if not isinstance(params["obj"], str):
696
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `str`')
697
+
698
+
699
+ def mrconvert_various_string_1_cargs(
700
+ params: MrconvertVariousString1ParamsDict,
701
+ execution: Execution,
702
+ ) -> list[str]:
703
+ """
704
+ Build command-line arguments from parameters.
705
+
706
+ Args:
707
+ params: The parameters.
708
+ execution: The execution object for resolving input paths.
709
+ Returns:
710
+ Command-line arguments.
711
+ """
712
+ cargs = []
713
+ cargs.append(params.get("obj", None))
714
+ return cargs
715
+
716
+
717
+ def mrconvert_various_file_1(
718
+ obj: InputPathType,
719
+ ) -> MrconvertVariousFile1ParamsDictTagged:
720
+ """
721
+ Build parameters.
722
+
723
+ Args:
724
+ obj: File object.
725
+ Returns:
726
+ Parameter dictionary
727
+ """
728
+ params = {
729
+ "@type": "VariousFile_1",
730
+ "obj": obj,
731
+ }
732
+ return params
733
+
734
+
735
+ def mrconvert_various_file_1_validate(
736
+ params: typing.Any,
737
+ ) -> None:
738
+ """
739
+ Validate parameters. Throws an error if `params` is not a valid
740
+ `MrconvertVariousFile1ParamsDict` object.
741
+
742
+ Args:
743
+ params: The parameters object to validate.
744
+ """
745
+ if params is None or not isinstance(params, dict):
746
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
747
+ if params.get("obj", None) is None:
748
+ raise StyxValidationError("`obj` must not be None")
749
+ if not isinstance(params["obj"], (pathlib.Path, str)):
750
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `InputPathType`')
751
+
752
+
753
+ def mrconvert_various_file_1_cargs(
754
+ params: MrconvertVariousFile1ParamsDict,
755
+ execution: Execution,
756
+ ) -> list[str]:
757
+ """
758
+ Build command-line arguments from parameters.
759
+
760
+ Args:
761
+ params: The parameters.
762
+ execution: The execution object for resolving input paths.
763
+ Returns:
764
+ Command-line arguments.
765
+ """
766
+ cargs = []
767
+ cargs.append(execution.input_file(params.get("obj", None)))
768
+ return cargs
769
+
770
+
771
+ def mrconvert_fslgrad(
772
+ bvecs: InputPathType,
773
+ bvals: InputPathType,
774
+ ) -> MrconvertFslgradParamsDictTagged:
775
+ """
776
+ Build parameters.
777
+
778
+ Args:
779
+ bvecs: Provide the diffusion-weighted gradient scheme used in the\
780
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
781
+ scheme is present in the input image header, the data provided with\
782
+ this option will be instead used.
783
+ bvals: Provide the diffusion-weighted gradient scheme used in the\
784
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
785
+ scheme is present in the input image header, the data provided with\
786
+ this option will be instead used.
787
+ Returns:
788
+ Parameter dictionary
789
+ """
790
+ params = {
791
+ "@type": "fslgrad",
792
+ "bvecs": bvecs,
793
+ "bvals": bvals,
794
+ }
795
+ return params
796
+
797
+
798
+ def mrconvert_fslgrad_validate(
799
+ params: typing.Any,
800
+ ) -> None:
801
+ """
802
+ Validate parameters. Throws an error if `params` is not a valid
803
+ `MrconvertFslgradParamsDict` object.
804
+
805
+ Args:
806
+ params: The parameters object to validate.
807
+ """
808
+ if params is None or not isinstance(params, dict):
809
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
810
+ if params.get("bvecs", None) is None:
811
+ raise StyxValidationError("`bvecs` must not be None")
812
+ if not isinstance(params["bvecs"], (pathlib.Path, str)):
813
+ raise StyxValidationError(f'`bvecs` has the wrong type: Received `{type(params.get("bvecs", None))}` expected `InputPathType`')
814
+ if params.get("bvals", None) is None:
815
+ raise StyxValidationError("`bvals` must not be None")
816
+ if not isinstance(params["bvals"], (pathlib.Path, str)):
817
+ raise StyxValidationError(f'`bvals` has the wrong type: Received `{type(params.get("bvals", None))}` expected `InputPathType`')
818
+
819
+
820
+ def mrconvert_fslgrad_cargs(
821
+ params: MrconvertFslgradParamsDict,
822
+ execution: Execution,
823
+ ) -> list[str]:
824
+ """
825
+ Build command-line arguments from parameters.
826
+
827
+ Args:
828
+ params: The parameters.
829
+ execution: The execution object for resolving input paths.
830
+ Returns:
831
+ Command-line arguments.
832
+ """
833
+ cargs = []
834
+ cargs.append("-fslgrad")
835
+ cargs.append(execution.input_file(params.get("bvecs", None)))
836
+ cargs.append(execution.input_file(params.get("bvals", None)))
837
+ return cargs
838
+
839
+
840
+ class MrconvertExportGradFslOutputs(typing.NamedTuple):
841
+ """
842
+ Output object returned when calling `MrconvertExportGradFslParamsDict | None(...)`.
843
+ """
844
+ root: OutputPathType
845
+ """Output root folder. This is the root folder for all outputs."""
846
+ bvecs_path: OutputPathType
847
+ """export the diffusion-weighted gradient table to files in FSL (bvecs /
848
+ bvals) format"""
849
+ bvals_path: OutputPathType
850
+ """export the diffusion-weighted gradient table to files in FSL (bvecs /
851
+ bvals) format"""
852
+
853
+
854
+ def mrconvert_export_grad_fsl(
855
+ bvecs_path: str,
856
+ bvals_path: str,
857
+ ) -> MrconvertExportGradFslParamsDictTagged:
858
+ """
859
+ Build parameters.
860
+
861
+ Args:
862
+ bvecs_path: export the diffusion-weighted gradient table to files in\
863
+ FSL (bvecs / bvals) format.
864
+ bvals_path: export the diffusion-weighted gradient table to files in\
865
+ FSL (bvecs / bvals) format.
866
+ Returns:
867
+ Parameter dictionary
868
+ """
869
+ params = {
870
+ "@type": "export_grad_fsl",
871
+ "bvecs_path": bvecs_path,
872
+ "bvals_path": bvals_path,
873
+ }
874
+ return params
875
+
876
+
877
+ def mrconvert_export_grad_fsl_validate(
878
+ params: typing.Any,
879
+ ) -> None:
880
+ """
881
+ Validate parameters. Throws an error if `params` is not a valid
882
+ `MrconvertExportGradFslParamsDict` object.
883
+
884
+ Args:
885
+ params: The parameters object to validate.
886
+ """
887
+ if params is None or not isinstance(params, dict):
888
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
889
+ if params.get("bvecs_path", None) is None:
890
+ raise StyxValidationError("`bvecs_path` must not be None")
891
+ if not isinstance(params["bvecs_path"], str):
892
+ raise StyxValidationError(f'`bvecs_path` has the wrong type: Received `{type(params.get("bvecs_path", None))}` expected `str`')
893
+ if params.get("bvals_path", None) is None:
894
+ raise StyxValidationError("`bvals_path` must not be None")
895
+ if not isinstance(params["bvals_path"], str):
896
+ raise StyxValidationError(f'`bvals_path` has the wrong type: Received `{type(params.get("bvals_path", None))}` expected `str`')
897
+
898
+
899
+ def mrconvert_export_grad_fsl_cargs(
900
+ params: MrconvertExportGradFslParamsDict,
901
+ execution: Execution,
902
+ ) -> list[str]:
903
+ """
904
+ Build command-line arguments from parameters.
905
+
906
+ Args:
907
+ params: The parameters.
908
+ execution: The execution object for resolving input paths.
909
+ Returns:
910
+ Command-line arguments.
911
+ """
912
+ cargs = []
913
+ cargs.append("-export_grad_fsl")
914
+ cargs.append(params.get("bvecs_path", None))
915
+ cargs.append(params.get("bvals_path", None))
916
+ return cargs
917
+
918
+
919
+ def mrconvert_export_grad_fsl_outputs(
920
+ params: MrconvertExportGradFslParamsDict,
921
+ execution: Execution,
922
+ ) -> MrconvertExportGradFslOutputs:
923
+ """
924
+ Build outputs object containing output file paths and possibly stdout/stderr.
925
+
926
+ Args:
927
+ params: The parameters.
928
+ execution: The execution object for resolving input paths.
929
+ Returns:
930
+ Outputs object.
931
+ """
932
+ ret = MrconvertExportGradFslOutputs(
933
+ root=execution.output_file("."),
934
+ bvecs_path=execution.output_file(params.get("bvecs_path", None)),
935
+ bvals_path=execution.output_file(params.get("bvals_path", None)),
936
+ )
937
+ return ret
938
+
939
+
940
+ def mrconvert_import_pe_eddy(
941
+ config: InputPathType,
942
+ indices: InputPathType,
943
+ ) -> MrconvertImportPeEddyParamsDictTagged:
944
+ """
945
+ Build parameters.
946
+
947
+ Args:
948
+ config: import phase-encoding information from an EDDY-style config /\
949
+ index file pair.
950
+ indices: import phase-encoding information from an EDDY-style config /\
951
+ index file pair.
952
+ Returns:
953
+ Parameter dictionary
954
+ """
955
+ params = {
956
+ "@type": "import_pe_eddy",
957
+ "config": config,
958
+ "indices": indices,
959
+ }
960
+ return params
961
+
962
+
963
+ def mrconvert_import_pe_eddy_validate(
964
+ params: typing.Any,
965
+ ) -> None:
966
+ """
967
+ Validate parameters. Throws an error if `params` is not a valid
968
+ `MrconvertImportPeEddyParamsDict` object.
969
+
970
+ Args:
971
+ params: The parameters object to validate.
972
+ """
973
+ if params is None or not isinstance(params, dict):
974
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
975
+ if params.get("config", None) is None:
976
+ raise StyxValidationError("`config` must not be None")
977
+ if not isinstance(params["config"], (pathlib.Path, str)):
978
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `InputPathType`')
979
+ if params.get("indices", None) is None:
980
+ raise StyxValidationError("`indices` must not be None")
981
+ if not isinstance(params["indices"], (pathlib.Path, str)):
982
+ raise StyxValidationError(f'`indices` has the wrong type: Received `{type(params.get("indices", None))}` expected `InputPathType`')
983
+
984
+
985
+ def mrconvert_import_pe_eddy_cargs(
986
+ params: MrconvertImportPeEddyParamsDict,
987
+ execution: Execution,
988
+ ) -> list[str]:
989
+ """
990
+ Build command-line arguments from parameters.
991
+
992
+ Args:
993
+ params: The parameters.
994
+ execution: The execution object for resolving input paths.
995
+ Returns:
996
+ Command-line arguments.
997
+ """
998
+ cargs = []
999
+ cargs.append("-import_pe_eddy")
1000
+ cargs.append(execution.input_file(params.get("config", None)))
1001
+ cargs.append(execution.input_file(params.get("indices", None)))
1002
+ return cargs
1003
+
1004
+
1005
+ class MrconvertExportPeEddyOutputs(typing.NamedTuple):
1006
+ """
1007
+ Output object returned when calling `MrconvertExportPeEddyParamsDict | None(...)`.
1008
+ """
1009
+ root: OutputPathType
1010
+ """Output root folder. This is the root folder for all outputs."""
1011
+ config: OutputPathType
1012
+ """export phase-encoding information to an EDDY-style config / index file
1013
+ pair"""
1014
+ indices: OutputPathType
1015
+ """export phase-encoding information to an EDDY-style config / index file
1016
+ pair"""
1017
+
1018
+
1019
+ def mrconvert_export_pe_eddy(
1020
+ config: str,
1021
+ indices: str,
1022
+ ) -> MrconvertExportPeEddyParamsDictTagged:
1023
+ """
1024
+ Build parameters.
1025
+
1026
+ Args:
1027
+ config: export phase-encoding information to an EDDY-style config /\
1028
+ index file pair.
1029
+ indices: export phase-encoding information to an EDDY-style config /\
1030
+ index file pair.
1031
+ Returns:
1032
+ Parameter dictionary
1033
+ """
1034
+ params = {
1035
+ "@type": "export_pe_eddy",
1036
+ "config": config,
1037
+ "indices": indices,
1038
+ }
1039
+ return params
1040
+
1041
+
1042
+ def mrconvert_export_pe_eddy_validate(
1043
+ params: typing.Any,
1044
+ ) -> None:
1045
+ """
1046
+ Validate parameters. Throws an error if `params` is not a valid
1047
+ `MrconvertExportPeEddyParamsDict` object.
1048
+
1049
+ Args:
1050
+ params: The parameters object to validate.
1051
+ """
1052
+ if params is None or not isinstance(params, dict):
1053
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1054
+ if params.get("config", None) is None:
1055
+ raise StyxValidationError("`config` must not be None")
1056
+ if not isinstance(params["config"], str):
1057
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `str`')
1058
+ if params.get("indices", None) is None:
1059
+ raise StyxValidationError("`indices` must not be None")
1060
+ if not isinstance(params["indices"], str):
1061
+ raise StyxValidationError(f'`indices` has the wrong type: Received `{type(params.get("indices", None))}` expected `str`')
1062
+
1063
+
1064
+ def mrconvert_export_pe_eddy_cargs(
1065
+ params: MrconvertExportPeEddyParamsDict,
1066
+ execution: Execution,
1067
+ ) -> list[str]:
1068
+ """
1069
+ Build command-line arguments from parameters.
1070
+
1071
+ Args:
1072
+ params: The parameters.
1073
+ execution: The execution object for resolving input paths.
1074
+ Returns:
1075
+ Command-line arguments.
1076
+ """
1077
+ cargs = []
1078
+ cargs.append("-export_pe_eddy")
1079
+ cargs.append(params.get("config", None))
1080
+ cargs.append(params.get("indices", None))
1081
+ return cargs
1082
+
1083
+
1084
+ def mrconvert_export_pe_eddy_outputs(
1085
+ params: MrconvertExportPeEddyParamsDict,
1086
+ execution: Execution,
1087
+ ) -> MrconvertExportPeEddyOutputs:
1088
+ """
1089
+ Build outputs object containing output file paths and possibly stdout/stderr.
1090
+
1091
+ Args:
1092
+ params: The parameters.
1093
+ execution: The execution object for resolving input paths.
1094
+ Returns:
1095
+ Outputs object.
1096
+ """
1097
+ ret = MrconvertExportPeEddyOutputs(
1098
+ root=execution.output_file("."),
1099
+ config=execution.output_file(params.get("config", None)),
1100
+ indices=execution.output_file(params.get("indices", None)),
1101
+ )
1102
+ return ret
1103
+
1104
+
1105
+ def mrconvert_config(
1106
+ key: str,
1107
+ value: str,
1108
+ ) -> MrconvertConfigParamsDictTagged:
1109
+ """
1110
+ Build parameters.
1111
+
1112
+ Args:
1113
+ key: temporarily set the value of an MRtrix config file entry.
1114
+ value: temporarily set the value of an MRtrix config file entry.
1115
+ Returns:
1116
+ Parameter dictionary
1117
+ """
1118
+ params = {
1119
+ "@type": "config",
1120
+ "key": key,
1121
+ "value": value,
1122
+ }
1123
+ return params
1124
+
1125
+
1126
+ def mrconvert_config_validate(
1127
+ params: typing.Any,
1128
+ ) -> None:
1129
+ """
1130
+ Validate parameters. Throws an error if `params` is not a valid
1131
+ `MrconvertConfigParamsDict` object.
1132
+
1133
+ Args:
1134
+ params: The parameters object to validate.
1135
+ """
1136
+ if params is None or not isinstance(params, dict):
1137
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1138
+ if params.get("key", None) is None:
1139
+ raise StyxValidationError("`key` must not be None")
1140
+ if not isinstance(params["key"], str):
1141
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
1142
+ if params.get("value", None) is None:
1143
+ raise StyxValidationError("`value` must not be None")
1144
+ if not isinstance(params["value"], str):
1145
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
1146
+
1147
+
1148
+ def mrconvert_config_cargs(
1149
+ params: MrconvertConfigParamsDict,
1150
+ execution: Execution,
1151
+ ) -> list[str]:
1152
+ """
1153
+ Build command-line arguments from parameters.
1154
+
1155
+ Args:
1156
+ params: The parameters.
1157
+ execution: The execution object for resolving input paths.
1158
+ Returns:
1159
+ Command-line arguments.
1160
+ """
1161
+ cargs = []
1162
+ cargs.append("-config")
1163
+ cargs.append(params.get("key", None))
1164
+ cargs.append(params.get("value", None))
1165
+ return cargs
1166
+
1167
+
1168
+ class MrconvertOutputs(typing.NamedTuple):
1169
+ """
1170
+ Output object returned when calling `MrconvertParamsDict(...)`.
1171
+ """
1172
+ root: OutputPathType
1173
+ """Output root folder. This is the root folder for all outputs."""
1174
+ output: OutputPathType
1175
+ """the output image."""
1176
+ json_export: OutputPathType | None
1177
+ """export data from an image header key-value pairs into a JSON file """
1178
+ export_grad_mrtrix: OutputPathType | None
1179
+ """export the diffusion-weighted gradient table to file in MRtrix format """
1180
+ export_pe_table: OutputPathType | None
1181
+ """export phase-encoding table to file """
1182
+ export_grad_fsl: MrconvertExportGradFslOutputs | None
1183
+ """Outputs from `mrconvert_export_grad_fsl_outputs`."""
1184
+ export_pe_eddy: MrconvertExportPeEddyOutputs | None
1185
+ """Outputs from `mrconvert_export_pe_eddy_outputs`."""
1186
+
1187
+
1188
+ def mrconvert_params(
1189
+ input_: InputPathType,
1190
+ output: str,
1191
+ coord: list[MrconvertCoordParamsDict] | None = None,
1192
+ vox: list[float] | None = None,
1193
+ axes: list[int] | None = None,
1194
+ scaling: list[float] | None = None,
1195
+ json_import: InputPathType | None = None,
1196
+ json_export: str | None = None,
1197
+ clear_property: list[MrconvertClearPropertyParamsDict] | None = None,
1198
+ set_property: list[MrconvertSetPropertyParamsDict] | None = None,
1199
+ append_property: list[MrconvertAppendPropertyParamsDict] | None = None,
1200
+ copy_properties: typing.Union[MrconvertVariousStringParamsDictTagged, MrconvertVariousFileParamsDictTagged] | None = None,
1201
+ strides: typing.Union[MrconvertVariousString1ParamsDictTagged, MrconvertVariousFile1ParamsDictTagged] | None = None,
1202
+ datatype: str | None = None,
1203
+ grad: InputPathType | None = None,
1204
+ fslgrad: MrconvertFslgradParamsDict | None = None,
1205
+ bvalue_scaling: str | None = None,
1206
+ export_grad_mrtrix: str | None = None,
1207
+ export_grad_fsl: MrconvertExportGradFslParamsDict | None = None,
1208
+ import_pe_table: InputPathType | None = None,
1209
+ import_pe_eddy: MrconvertImportPeEddyParamsDict | None = None,
1210
+ export_pe_table: str | None = None,
1211
+ export_pe_eddy: MrconvertExportPeEddyParamsDict | None = None,
1212
+ info: bool = False,
1213
+ quiet: bool = False,
1214
+ debug: bool = False,
1215
+ force: bool = False,
1216
+ nthreads: int | None = None,
1217
+ config: list[MrconvertConfigParamsDict] | None = None,
1218
+ help_: bool = False,
1219
+ version: bool = False,
1220
+ ) -> MrconvertParamsDictTagged:
1221
+ """
1222
+ Build parameters.
1223
+
1224
+ Args:
1225
+ input_: the input image.
1226
+ output: the output image.
1227
+ coord: retain data from the input image only at the coordinates\
1228
+ specified in the selection along the specified axis. The selection\
1229
+ argument expects a number sequence, which can also include the 'end'\
1230
+ keyword.
1231
+ vox: change the voxel dimensions reported in the output image header.
1232
+ axes: specify the axes from the input image that will be used to form\
1233
+ the output image.
1234
+ scaling: specify the data scaling parameters used to rescale the\
1235
+ intensity values.
1236
+ json_import: import data from a JSON file into header key-value pairs.
1237
+ json_export: export data from an image header key-value pairs into a\
1238
+ JSON file.
1239
+ clear_property: remove the specified key from the image header\
1240
+ altogether.
1241
+ set_property: set the value of the specified key in the image header.
1242
+ append_property: append the given value to the specified key in the\
1243
+ image header (this adds the value specified as a new line in the header\
1244
+ value).
1245
+ copy_properties: clear all generic properties and replace with the\
1246
+ properties from the image / file specified.
1247
+ strides: specify the strides of the output data in memory; either as a\
1248
+ comma-separated list of (signed) integers, or as a template image from\
1249
+ which the strides shall be extracted and used. The actual strides\
1250
+ produced will depend on whether the output image format can support it.
1251
+ datatype: specify output image data type. Valid choices are: float32,\
1252
+ float32le, float32be, float64, float64le, float64be, int64, uint64,\
1253
+ int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
1254
+ int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
1255
+ cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
1256
+ int8, uint8, bit.
1257
+ grad: Provide the diffusion-weighted gradient scheme used in the\
1258
+ acquisition in a text file. This should be supplied as a 4xN text file\
1259
+ with each line is in the format [ X Y Z b ], where [ X Y Z ] describe\
1260
+ the direction of the applied gradient, and b gives the b-value in units\
1261
+ of s/mm^2. If a diffusion gradient scheme is present in the input image\
1262
+ header, the data provided with this option will be instead used.
1263
+ fslgrad: Provide the diffusion-weighted gradient scheme used in the\
1264
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
1265
+ scheme is present in the input image header, the data provided with\
1266
+ this option will be instead used.
1267
+ bvalue_scaling: enable or disable scaling of diffusion b-values by the\
1268
+ square of the corresponding DW gradient norm (see Desciption). Valid\
1269
+ choices are yes/no, true/false, 0/1 (default: automatic).
1270
+ export_grad_mrtrix: export the diffusion-weighted gradient table to\
1271
+ file in MRtrix format.
1272
+ export_grad_fsl: export the diffusion-weighted gradient table to files\
1273
+ in FSL (bvecs / bvals) format.
1274
+ import_pe_table: import a phase-encoding table from file.
1275
+ import_pe_eddy: import phase-encoding information from an EDDY-style\
1276
+ config / index file pair.
1277
+ export_pe_table: export phase-encoding table to file.
1278
+ export_pe_eddy: export phase-encoding information to an EDDY-style\
1279
+ config / index file pair.
1280
+ info: display information messages.
1281
+ quiet: do not display information messages or progress status;\
1282
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
1283
+ environment variable to a non-empty string.
1284
+ debug: display debugging messages.
1285
+ force: force overwrite of output files (caution: using the same file as\
1286
+ input and output might cause unexpected behaviour).
1287
+ nthreads: use this number of threads in multi-threaded applications\
1288
+ (set to 0 to disable multi-threading).
1289
+ config: temporarily set the value of an MRtrix config file entry.
1290
+ help_: display this information page and exit.
1291
+ version: display version information and exit.
1292
+ Returns:
1293
+ Parameter dictionary
1294
+ """
1295
+ params = {
1296
+ "@type": "mrtrix/mrconvert",
1297
+ "info": info,
1298
+ "quiet": quiet,
1299
+ "debug": debug,
1300
+ "force": force,
1301
+ "help": help_,
1302
+ "version": version,
1303
+ "input": input_,
1304
+ "output": output,
1305
+ }
1306
+ if coord is not None:
1307
+ params["coord"] = coord
1308
+ if vox is not None:
1309
+ params["vox"] = vox
1310
+ if axes is not None:
1311
+ params["axes"] = axes
1312
+ if scaling is not None:
1313
+ params["scaling"] = scaling
1314
+ if json_import is not None:
1315
+ params["json_import"] = json_import
1316
+ if json_export is not None:
1317
+ params["json_export"] = json_export
1318
+ if clear_property is not None:
1319
+ params["clear_property"] = clear_property
1320
+ if set_property is not None:
1321
+ params["set_property"] = set_property
1322
+ if append_property is not None:
1323
+ params["append_property"] = append_property
1324
+ if copy_properties is not None:
1325
+ params["copy_properties"] = copy_properties
1326
+ if strides is not None:
1327
+ params["strides"] = strides
1328
+ if datatype is not None:
1329
+ params["datatype"] = datatype
1330
+ if grad is not None:
1331
+ params["grad"] = grad
1332
+ if fslgrad is not None:
1333
+ params["fslgrad"] = fslgrad
1334
+ if bvalue_scaling is not None:
1335
+ params["bvalue_scaling"] = bvalue_scaling
1336
+ if export_grad_mrtrix is not None:
1337
+ params["export_grad_mrtrix"] = export_grad_mrtrix
1338
+ if export_grad_fsl is not None:
1339
+ params["export_grad_fsl"] = export_grad_fsl
1340
+ if import_pe_table is not None:
1341
+ params["import_pe_table"] = import_pe_table
1342
+ if import_pe_eddy is not None:
1343
+ params["import_pe_eddy"] = import_pe_eddy
1344
+ if export_pe_table is not None:
1345
+ params["export_pe_table"] = export_pe_table
1346
+ if export_pe_eddy is not None:
1347
+ params["export_pe_eddy"] = export_pe_eddy
1348
+ if nthreads is not None:
1349
+ params["nthreads"] = nthreads
1350
+ if config is not None:
1351
+ params["config"] = config
1352
+ return params
1353
+
1354
+
1355
+ def mrconvert_validate(
1356
+ params: typing.Any,
1357
+ ) -> None:
1358
+ """
1359
+ Validate parameters. Throws an error if `params` is not a valid
1360
+ `MrconvertParamsDict` object.
1361
+
1362
+ Args:
1363
+ params: The parameters object to validate.
1364
+ """
1365
+ if params is None or not isinstance(params, dict):
1366
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1367
+ if params.get("coord", None) is not None:
1368
+ if not isinstance(params["coord"], list):
1369
+ raise StyxValidationError(f'`coord` has the wrong type: Received `{type(params.get("coord", None))}` expected `list[MrconvertCoordParamsDict] | None`')
1370
+ for e in params["coord"]:
1371
+ mrconvert_coord_validate(e)
1372
+ if params.get("vox", None) is not None:
1373
+ if not isinstance(params["vox"], list):
1374
+ raise StyxValidationError(f'`vox` has the wrong type: Received `{type(params.get("vox", None))}` expected `list[float] | None`')
1375
+ for e in params["vox"]:
1376
+ if not isinstance(e, (float, int)):
1377
+ raise StyxValidationError(f'`vox` has the wrong type: Received `{type(params.get("vox", None))}` expected `list[float] | None`')
1378
+ if params.get("axes", None) is not None:
1379
+ if not isinstance(params["axes"], list):
1380
+ raise StyxValidationError(f'`axes` has the wrong type: Received `{type(params.get("axes", None))}` expected `list[int] | None`')
1381
+ for e in params["axes"]:
1382
+ if not isinstance(e, int):
1383
+ raise StyxValidationError(f'`axes` has the wrong type: Received `{type(params.get("axes", None))}` expected `list[int] | None`')
1384
+ if params.get("scaling", None) is not None:
1385
+ if not isinstance(params["scaling"], list):
1386
+ raise StyxValidationError(f'`scaling` has the wrong type: Received `{type(params.get("scaling", None))}` expected `list[float] | None`')
1387
+ for e in params["scaling"]:
1388
+ if not isinstance(e, (float, int)):
1389
+ raise StyxValidationError(f'`scaling` has the wrong type: Received `{type(params.get("scaling", None))}` expected `list[float] | None`')
1390
+ if params.get("json_import", None) is not None:
1391
+ if not isinstance(params["json_import"], (pathlib.Path, str)):
1392
+ raise StyxValidationError(f'`json_import` has the wrong type: Received `{type(params.get("json_import", None))}` expected `InputPathType | None`')
1393
+ if params.get("json_export", None) is not None:
1394
+ if not isinstance(params["json_export"], str):
1395
+ raise StyxValidationError(f'`json_export` has the wrong type: Received `{type(params.get("json_export", None))}` expected `str | None`')
1396
+ if params.get("clear_property", None) is not None:
1397
+ if not isinstance(params["clear_property"], list):
1398
+ raise StyxValidationError(f'`clear_property` has the wrong type: Received `{type(params.get("clear_property", None))}` expected `list[MrconvertClearPropertyParamsDict] | None`')
1399
+ for e in params["clear_property"]:
1400
+ mrconvert_clear_property_validate(e)
1401
+ if params.get("set_property", None) is not None:
1402
+ if not isinstance(params["set_property"], list):
1403
+ raise StyxValidationError(f'`set_property` has the wrong type: Received `{type(params.get("set_property", None))}` expected `list[MrconvertSetPropertyParamsDict] | None`')
1404
+ for e in params["set_property"]:
1405
+ mrconvert_set_property_validate(e)
1406
+ if params.get("append_property", None) is not None:
1407
+ if not isinstance(params["append_property"], list):
1408
+ raise StyxValidationError(f'`append_property` has the wrong type: Received `{type(params.get("append_property", None))}` expected `list[MrconvertAppendPropertyParamsDict] | None`')
1409
+ for e in params["append_property"]:
1410
+ mrconvert_append_property_validate(e)
1411
+ if params.get("copy_properties", None) is not None:
1412
+ if not isinstance(params["copy_properties"], dict):
1413
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params["copy_properties"])}\'')
1414
+ if "@type" not in params["copy_properties"]:
1415
+ raise StyxValidationError("Params object is missing `@type`")
1416
+ if params["copy_properties"]["@type"] not in ["VariousString", "VariousFile"]:
1417
+ raise StyxValidationError("Parameter `copy_properties`s `@type` must be one of [\"VariousString\", \"VariousFile\"]")
1418
+ mrconvert_copy_properties_validate_dyn_fn(params["copy_properties"]["@type"])(params["copy_properties"])
1419
+ if params.get("strides", None) is not None:
1420
+ if not isinstance(params["strides"], dict):
1421
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params["strides"])}\'')
1422
+ if "@type" not in params["strides"]:
1423
+ raise StyxValidationError("Params object is missing `@type`")
1424
+ if params["strides"]["@type"] not in ["VariousString_1", "VariousFile_1"]:
1425
+ raise StyxValidationError("Parameter `strides`s `@type` must be one of [\"VariousString_1\", \"VariousFile_1\"]")
1426
+ mrconvert_strides_validate_dyn_fn(params["strides"]["@type"])(params["strides"])
1427
+ if params.get("datatype", None) is not None:
1428
+ if not isinstance(params["datatype"], str):
1429
+ raise StyxValidationError(f'`datatype` has the wrong type: Received `{type(params.get("datatype", None))}` expected `str | None`')
1430
+ if params.get("grad", None) is not None:
1431
+ if not isinstance(params["grad"], (pathlib.Path, str)):
1432
+ raise StyxValidationError(f'`grad` has the wrong type: Received `{type(params.get("grad", None))}` expected `InputPathType | None`')
1433
+ if params.get("fslgrad", None) is not None:
1434
+ mrconvert_fslgrad_validate(params["fslgrad"])
1435
+ if params.get("bvalue_scaling", None) is not None:
1436
+ if not isinstance(params["bvalue_scaling"], str):
1437
+ raise StyxValidationError(f'`bvalue_scaling` has the wrong type: Received `{type(params.get("bvalue_scaling", None))}` expected `str | None`')
1438
+ if params.get("export_grad_mrtrix", None) is not None:
1439
+ if not isinstance(params["export_grad_mrtrix"], str):
1440
+ raise StyxValidationError(f'`export_grad_mrtrix` has the wrong type: Received `{type(params.get("export_grad_mrtrix", None))}` expected `str | None`')
1441
+ if params.get("export_grad_fsl", None) is not None:
1442
+ mrconvert_export_grad_fsl_validate(params["export_grad_fsl"])
1443
+ if params.get("import_pe_table", None) is not None:
1444
+ if not isinstance(params["import_pe_table"], (pathlib.Path, str)):
1445
+ raise StyxValidationError(f'`import_pe_table` has the wrong type: Received `{type(params.get("import_pe_table", None))}` expected `InputPathType | None`')
1446
+ if params.get("import_pe_eddy", None) is not None:
1447
+ mrconvert_import_pe_eddy_validate(params["import_pe_eddy"])
1448
+ if params.get("export_pe_table", None) is not None:
1449
+ if not isinstance(params["export_pe_table"], str):
1450
+ raise StyxValidationError(f'`export_pe_table` has the wrong type: Received `{type(params.get("export_pe_table", None))}` expected `str | None`')
1451
+ if params.get("export_pe_eddy", None) is not None:
1452
+ mrconvert_export_pe_eddy_validate(params["export_pe_eddy"])
1453
+ if params.get("info", False) is None:
1454
+ raise StyxValidationError("`info` must not be None")
1455
+ if not isinstance(params["info"], bool):
1456
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
1457
+ if params.get("quiet", False) is None:
1458
+ raise StyxValidationError("`quiet` must not be None")
1459
+ if not isinstance(params["quiet"], bool):
1460
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
1461
+ if params.get("debug", False) is None:
1462
+ raise StyxValidationError("`debug` must not be None")
1463
+ if not isinstance(params["debug"], bool):
1464
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
1465
+ if params.get("force", False) is None:
1466
+ raise StyxValidationError("`force` must not be None")
1467
+ if not isinstance(params["force"], bool):
1468
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
1469
+ if params.get("nthreads", None) is not None:
1470
+ if not isinstance(params["nthreads"], int):
1471
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
1472
+ if params.get("config", None) is not None:
1473
+ if not isinstance(params["config"], list):
1474
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[MrconvertConfigParamsDict] | None`')
1475
+ for e in params["config"]:
1476
+ mrconvert_config_validate(e)
1477
+ if params.get("help", False) is None:
1478
+ raise StyxValidationError("`help` must not be None")
1479
+ if not isinstance(params["help"], bool):
1480
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
1481
+ if params.get("version", False) is None:
1482
+ raise StyxValidationError("`version` must not be None")
1483
+ if not isinstance(params["version"], bool):
1484
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
1485
+ if params.get("input", None) is None:
1486
+ raise StyxValidationError("`input` must not be None")
1487
+ if not isinstance(params["input"], (pathlib.Path, str)):
1488
+ raise StyxValidationError(f'`input` has the wrong type: Received `{type(params.get("input", None))}` expected `InputPathType`')
1489
+ if params.get("output", None) is None:
1490
+ raise StyxValidationError("`output` must not be None")
1491
+ if not isinstance(params["output"], str):
1492
+ raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `str`')
1493
+
1494
+
1495
+ def mrconvert_cargs(
1496
+ params: MrconvertParamsDict,
1497
+ execution: Execution,
1498
+ ) -> list[str]:
1499
+ """
1500
+ Build command-line arguments from parameters.
1501
+
1502
+ Args:
1503
+ params: The parameters.
1504
+ execution: The execution object for resolving input paths.
1505
+ Returns:
1506
+ Command-line arguments.
1507
+ """
1508
+ cargs = []
1509
+ cargs.append("mrconvert")
1510
+ if params.get("coord", None) is not None:
1511
+ cargs.extend([a for c in [mrconvert_coord_cargs(s, execution) for s in params.get("coord", None)] for a in c])
1512
+ if params.get("vox", None) is not None:
1513
+ cargs.extend([
1514
+ "-vox",
1515
+ *map(str, params.get("vox", None))
1516
+ ])
1517
+ if params.get("axes", None) is not None:
1518
+ cargs.extend([
1519
+ "-axes",
1520
+ ",".join(map(str, params.get("axes", None)))
1521
+ ])
1522
+ if params.get("scaling", None) is not None:
1523
+ cargs.extend([
1524
+ "-scaling",
1525
+ *map(str, params.get("scaling", None))
1526
+ ])
1527
+ if params.get("json_import", None) is not None:
1528
+ cargs.extend([
1529
+ "-json_import",
1530
+ execution.input_file(params.get("json_import", None))
1531
+ ])
1532
+ if params.get("json_export", None) is not None:
1533
+ cargs.extend([
1534
+ "-json_export",
1535
+ params.get("json_export", None)
1536
+ ])
1537
+ if params.get("clear_property", None) is not None:
1538
+ cargs.extend([a for c in [mrconvert_clear_property_cargs(s, execution) for s in params.get("clear_property", None)] for a in c])
1539
+ if params.get("set_property", None) is not None:
1540
+ cargs.extend([a for c in [mrconvert_set_property_cargs(s, execution) for s in params.get("set_property", None)] for a in c])
1541
+ if params.get("append_property", None) is not None:
1542
+ cargs.extend([a for c in [mrconvert_append_property_cargs(s, execution) for s in params.get("append_property", None)] for a in c])
1543
+ if params.get("copy_properties", None) is not None:
1544
+ cargs.extend([
1545
+ "-copy_properties",
1546
+ *mrconvert_copy_properties_cargs_dyn_fn(params.get("copy_properties", None)["@type"])(params.get("copy_properties", None), execution)
1547
+ ])
1548
+ if params.get("strides", None) is not None:
1549
+ cargs.extend([
1550
+ "-strides",
1551
+ *mrconvert_strides_cargs_dyn_fn(params.get("strides", None)["@type"])(params.get("strides", None), execution)
1552
+ ])
1553
+ if params.get("datatype", None) is not None:
1554
+ cargs.extend([
1555
+ "-datatype",
1556
+ params.get("datatype", None)
1557
+ ])
1558
+ if params.get("grad", None) is not None:
1559
+ cargs.extend([
1560
+ "-grad",
1561
+ execution.input_file(params.get("grad", None))
1562
+ ])
1563
+ if params.get("fslgrad", None) is not None:
1564
+ cargs.extend(mrconvert_fslgrad_cargs(params.get("fslgrad", None), execution))
1565
+ if params.get("bvalue_scaling", None) is not None:
1566
+ cargs.extend([
1567
+ "-bvalue_scaling",
1568
+ params.get("bvalue_scaling", None)
1569
+ ])
1570
+ if params.get("export_grad_mrtrix", None) is not None:
1571
+ cargs.extend([
1572
+ "-export_grad_mrtrix",
1573
+ params.get("export_grad_mrtrix", None)
1574
+ ])
1575
+ if params.get("export_grad_fsl", None) is not None:
1576
+ cargs.extend(mrconvert_export_grad_fsl_cargs(params.get("export_grad_fsl", None), execution))
1577
+ if params.get("import_pe_table", None) is not None:
1578
+ cargs.extend([
1579
+ "-import_pe_table",
1580
+ execution.input_file(params.get("import_pe_table", None))
1581
+ ])
1582
+ if params.get("import_pe_eddy", None) is not None:
1583
+ cargs.extend(mrconvert_import_pe_eddy_cargs(params.get("import_pe_eddy", None), execution))
1584
+ if params.get("export_pe_table", None) is not None:
1585
+ cargs.extend([
1586
+ "-export_pe_table",
1587
+ params.get("export_pe_table", None)
1588
+ ])
1589
+ if params.get("export_pe_eddy", None) is not None:
1590
+ cargs.extend(mrconvert_export_pe_eddy_cargs(params.get("export_pe_eddy", None), execution))
1591
+ if params.get("info", False):
1592
+ cargs.append("-info")
1593
+ if params.get("quiet", False):
1594
+ cargs.append("-quiet")
1595
+ if params.get("debug", False):
1596
+ cargs.append("-debug")
1597
+ if params.get("force", False):
1598
+ cargs.append("-force")
1599
+ if params.get("nthreads", None) is not None:
1600
+ cargs.extend([
1601
+ "-nthreads",
1602
+ str(params.get("nthreads", None))
1603
+ ])
1604
+ if params.get("config", None) is not None:
1605
+ cargs.extend([a for c in [mrconvert_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
1606
+ if params.get("help", False):
1607
+ cargs.append("-help")
1608
+ if params.get("version", False):
1609
+ cargs.append("-version")
1610
+ cargs.append(execution.input_file(params.get("input", None)))
1611
+ cargs.append(params.get("output", None))
1612
+ return cargs
1613
+
1614
+
1615
+ def mrconvert_outputs(
1616
+ params: MrconvertParamsDict,
1617
+ execution: Execution,
1618
+ ) -> MrconvertOutputs:
1619
+ """
1620
+ Build outputs object containing output file paths and possibly stdout/stderr.
1621
+
1622
+ Args:
1623
+ params: The parameters.
1624
+ execution: The execution object for resolving input paths.
1625
+ Returns:
1626
+ Outputs object.
1627
+ """
1628
+ ret = MrconvertOutputs(
1629
+ root=execution.output_file("."),
1630
+ output=execution.output_file(params.get("output", None)),
1631
+ json_export=execution.output_file(params.get("json_export", None)) if (params.get("json_export") is not None) else None,
1632
+ export_grad_mrtrix=execution.output_file(params.get("export_grad_mrtrix", None)) if (params.get("export_grad_mrtrix") is not None) else None,
1633
+ export_pe_table=execution.output_file(params.get("export_pe_table", None)) if (params.get("export_pe_table") is not None) else None,
1634
+ export_grad_fsl=mrconvert_export_grad_fsl_outputs(params.get("export_grad_fsl"), execution) if params.get("export_grad_fsl") else None,
1635
+ export_pe_eddy=mrconvert_export_pe_eddy_outputs(params.get("export_pe_eddy"), execution) if params.get("export_pe_eddy") else None,
1636
+ )
1637
+ return ret
1638
+
1639
+
1640
+ def mrconvert_execute(
1641
+ params: MrconvertParamsDict,
1642
+ runner: Runner | None = None,
1643
+ ) -> MrconvertOutputs:
1644
+ """
1645
+ mrconvert
1646
+
1647
+ Perform conversion between different file types and optionally extract a
1648
+ subset of the input image.
1649
+
1650
+ If used correctly, this program can be a very useful workhorse. In addition
1651
+ to converting images between different formats, it can be used to extract
1652
+ specific studies from a data set, extract a specific region of interest, or
1653
+ flip the images. Some of the possible operations are described in more
1654
+ detail below.
1655
+
1656
+ Note that for both the -coord and -axes options, indexing starts from 0
1657
+ rather than 1. E.g. -coord 3 <#> selects volumes (the fourth dimension) from
1658
+ the series; -axes 0,1,2 includes only the three spatial axes in the output
1659
+ image.
1660
+
1661
+ Additionally, for the second input to the -coord option and the -axes
1662
+ option, you can use any valid number sequence in the selection, as well as
1663
+ the 'end' keyword (see the main documentation for details); this can be
1664
+ particularly useful to select multiple coordinates.
1665
+
1666
+ The -vox option is used to change the size of the voxels in the output image
1667
+ as reported in the image header; note however that this does not re-sample
1668
+ the image based on a new voxel size (that is done using the mrgrid command).
1669
+
1670
+ By default, the intensity scaling parameters in the input image header are
1671
+ passed through to the output image header when writing to an integer image,
1672
+ and reset to 0,1 (i.e. no scaling) for floating-point and binary images.
1673
+ Note that the -scaling option will therefore have no effect for
1674
+ floating-point or binary output images.
1675
+
1676
+ The -axes option specifies which axes from the input image will be used to
1677
+ form the output image. This allows the permutation, omission, or addition of
1678
+ axes into the output image. The axes should be supplied as a comma-separated
1679
+ list of axis indices. If an axis from the input image is to be omitted from
1680
+ the output image, it must either already have a size of 1, or a single
1681
+ coordinate along that axis must be selected by the user by using the -coord
1682
+ option. Examples are provided further below.
1683
+
1684
+ The -bvalue_scaling option controls an aspect of the import of diffusion
1685
+ gradient tables. When the input diffusion-weighting direction vectors have
1686
+ norms that differ substantially from unity, the b-values will be scaled by
1687
+ the square of their corresponding vector norm (this is how multi-shell
1688
+ acquisitions are frequently achieved on scanner platforms). However in some
1689
+ rare instances, the b-values may be correct, despite the vectors not being
1690
+ of unit norm (or conversely, the b-values may need to be rescaled even
1691
+ though the vectors are close to unit norm). This option allows the user to
1692
+ control this operation and override MRrtix3's automatic detection.
1693
+
1694
+ References:
1695
+
1696
+ .
1697
+
1698
+ Author: MRTrix3 Developers
1699
+
1700
+ URL: https://www.mrtrix.org/
1701
+
1702
+ Args:
1703
+ params: The parameters.
1704
+ runner: Command runner.
1705
+ Returns:
1706
+ NamedTuple of outputs (described in `MrconvertOutputs`).
1707
+ """
1708
+ mrconvert_validate(params)
1709
+ runner = runner or get_global_runner()
1710
+ execution = runner.start_execution(MRCONVERT_METADATA)
1711
+ params = execution.params(params)
1712
+ cargs = mrconvert_cargs(params, execution)
1713
+ ret = mrconvert_outputs(params, execution)
1714
+ execution.run(cargs)
1715
+ return ret
1716
+
1717
+
1718
+ def mrconvert(
1719
+ input_: InputPathType,
1720
+ output: str,
1721
+ coord: list[MrconvertCoordParamsDict] | None = None,
1722
+ vox: list[float] | None = None,
1723
+ axes: list[int] | None = None,
1724
+ scaling: list[float] | None = None,
1725
+ json_import: InputPathType | None = None,
1726
+ json_export: str | None = None,
1727
+ clear_property: list[MrconvertClearPropertyParamsDict] | None = None,
1728
+ set_property: list[MrconvertSetPropertyParamsDict] | None = None,
1729
+ append_property: list[MrconvertAppendPropertyParamsDict] | None = None,
1730
+ copy_properties: typing.Union[MrconvertVariousStringParamsDictTagged, MrconvertVariousFileParamsDictTagged] | None = None,
1731
+ strides: typing.Union[MrconvertVariousString1ParamsDictTagged, MrconvertVariousFile1ParamsDictTagged] | None = None,
1732
+ datatype: str | None = None,
1733
+ grad: InputPathType | None = None,
1734
+ fslgrad: MrconvertFslgradParamsDict | None = None,
1735
+ bvalue_scaling: str | None = None,
1736
+ export_grad_mrtrix: str | None = None,
1737
+ export_grad_fsl: MrconvertExportGradFslParamsDict | None = None,
1738
+ import_pe_table: InputPathType | None = None,
1739
+ import_pe_eddy: MrconvertImportPeEddyParamsDict | None = None,
1740
+ export_pe_table: str | None = None,
1741
+ export_pe_eddy: MrconvertExportPeEddyParamsDict | None = None,
1742
+ info: bool = False,
1743
+ quiet: bool = False,
1744
+ debug: bool = False,
1745
+ force: bool = False,
1746
+ nthreads: int | None = None,
1747
+ config: list[MrconvertConfigParamsDict] | None = None,
1748
+ help_: bool = False,
1749
+ version: bool = False,
1750
+ runner: Runner | None = None,
1751
+ ) -> MrconvertOutputs:
1752
+ """
1753
+ mrconvert
1754
+
1755
+ Perform conversion between different file types and optionally extract a
1756
+ subset of the input image.
1757
+
1758
+ If used correctly, this program can be a very useful workhorse. In addition
1759
+ to converting images between different formats, it can be used to extract
1760
+ specific studies from a data set, extract a specific region of interest, or
1761
+ flip the images. Some of the possible operations are described in more
1762
+ detail below.
1763
+
1764
+ Note that for both the -coord and -axes options, indexing starts from 0
1765
+ rather than 1. E.g. -coord 3 <#> selects volumes (the fourth dimension) from
1766
+ the series; -axes 0,1,2 includes only the three spatial axes in the output
1767
+ image.
1768
+
1769
+ Additionally, for the second input to the -coord option and the -axes
1770
+ option, you can use any valid number sequence in the selection, as well as
1771
+ the 'end' keyword (see the main documentation for details); this can be
1772
+ particularly useful to select multiple coordinates.
1773
+
1774
+ The -vox option is used to change the size of the voxels in the output image
1775
+ as reported in the image header; note however that this does not re-sample
1776
+ the image based on a new voxel size (that is done using the mrgrid command).
1777
+
1778
+ By default, the intensity scaling parameters in the input image header are
1779
+ passed through to the output image header when writing to an integer image,
1780
+ and reset to 0,1 (i.e. no scaling) for floating-point and binary images.
1781
+ Note that the -scaling option will therefore have no effect for
1782
+ floating-point or binary output images.
1783
+
1784
+ The -axes option specifies which axes from the input image will be used to
1785
+ form the output image. This allows the permutation, omission, or addition of
1786
+ axes into the output image. The axes should be supplied as a comma-separated
1787
+ list of axis indices. If an axis from the input image is to be omitted from
1788
+ the output image, it must either already have a size of 1, or a single
1789
+ coordinate along that axis must be selected by the user by using the -coord
1790
+ option. Examples are provided further below.
1791
+
1792
+ The -bvalue_scaling option controls an aspect of the import of diffusion
1793
+ gradient tables. When the input diffusion-weighting direction vectors have
1794
+ norms that differ substantially from unity, the b-values will be scaled by
1795
+ the square of their corresponding vector norm (this is how multi-shell
1796
+ acquisitions are frequently achieved on scanner platforms). However in some
1797
+ rare instances, the b-values may be correct, despite the vectors not being
1798
+ of unit norm (or conversely, the b-values may need to be rescaled even
1799
+ though the vectors are close to unit norm). This option allows the user to
1800
+ control this operation and override MRrtix3's automatic detection.
1801
+
1802
+ References:
1803
+
1804
+ .
1805
+
1806
+ Author: MRTrix3 Developers
1807
+
1808
+ URL: https://www.mrtrix.org/
1809
+
1810
+ Args:
1811
+ input_: the input image.
1812
+ output: the output image.
1813
+ coord: retain data from the input image only at the coordinates\
1814
+ specified in the selection along the specified axis. The selection\
1815
+ argument expects a number sequence, which can also include the 'end'\
1816
+ keyword.
1817
+ vox: change the voxel dimensions reported in the output image header.
1818
+ axes: specify the axes from the input image that will be used to form\
1819
+ the output image.
1820
+ scaling: specify the data scaling parameters used to rescale the\
1821
+ intensity values.
1822
+ json_import: import data from a JSON file into header key-value pairs.
1823
+ json_export: export data from an image header key-value pairs into a\
1824
+ JSON file.
1825
+ clear_property: remove the specified key from the image header\
1826
+ altogether.
1827
+ set_property: set the value of the specified key in the image header.
1828
+ append_property: append the given value to the specified key in the\
1829
+ image header (this adds the value specified as a new line in the header\
1830
+ value).
1831
+ copy_properties: clear all generic properties and replace with the\
1832
+ properties from the image / file specified.
1833
+ strides: specify the strides of the output data in memory; either as a\
1834
+ comma-separated list of (signed) integers, or as a template image from\
1835
+ which the strides shall be extracted and used. The actual strides\
1836
+ produced will depend on whether the output image format can support it.
1837
+ datatype: specify output image data type. Valid choices are: float32,\
1838
+ float32le, float32be, float64, float64le, float64be, int64, uint64,\
1839
+ int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
1840
+ int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
1841
+ cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
1842
+ int8, uint8, bit.
1843
+ grad: Provide the diffusion-weighted gradient scheme used in the\
1844
+ acquisition in a text file. This should be supplied as a 4xN text file\
1845
+ with each line is in the format [ X Y Z b ], where [ X Y Z ] describe\
1846
+ the direction of the applied gradient, and b gives the b-value in units\
1847
+ of s/mm^2. If a diffusion gradient scheme is present in the input image\
1848
+ header, the data provided with this option will be instead used.
1849
+ fslgrad: Provide the diffusion-weighted gradient scheme used in the\
1850
+ acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
1851
+ scheme is present in the input image header, the data provided with\
1852
+ this option will be instead used.
1853
+ bvalue_scaling: enable or disable scaling of diffusion b-values by the\
1854
+ square of the corresponding DW gradient norm (see Desciption). Valid\
1855
+ choices are yes/no, true/false, 0/1 (default: automatic).
1856
+ export_grad_mrtrix: export the diffusion-weighted gradient table to\
1857
+ file in MRtrix format.
1858
+ export_grad_fsl: export the diffusion-weighted gradient table to files\
1859
+ in FSL (bvecs / bvals) format.
1860
+ import_pe_table: import a phase-encoding table from file.
1861
+ import_pe_eddy: import phase-encoding information from an EDDY-style\
1862
+ config / index file pair.
1863
+ export_pe_table: export phase-encoding table to file.
1864
+ export_pe_eddy: export phase-encoding information to an EDDY-style\
1865
+ config / index file pair.
1866
+ info: display information messages.
1867
+ quiet: do not display information messages or progress status;\
1868
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
1869
+ environment variable to a non-empty string.
1870
+ debug: display debugging messages.
1871
+ force: force overwrite of output files (caution: using the same file as\
1872
+ input and output might cause unexpected behaviour).
1873
+ nthreads: use this number of threads in multi-threaded applications\
1874
+ (set to 0 to disable multi-threading).
1875
+ config: temporarily set the value of an MRtrix config file entry.
1876
+ help_: display this information page and exit.
1877
+ version: display version information and exit.
1878
+ runner: Command runner.
1879
+ Returns:
1880
+ NamedTuple of outputs (described in `MrconvertOutputs`).
1881
+ """
1882
+ params = mrconvert_params(
1883
+ coord=coord,
1884
+ vox=vox,
1885
+ axes=axes,
1886
+ scaling=scaling,
1887
+ json_import=json_import,
1888
+ json_export=json_export,
1889
+ clear_property=clear_property,
1890
+ set_property=set_property,
1891
+ append_property=append_property,
1892
+ copy_properties=copy_properties,
1893
+ strides=strides,
1894
+ datatype=datatype,
1895
+ grad=grad,
1896
+ fslgrad=fslgrad,
1897
+ bvalue_scaling=bvalue_scaling,
1898
+ export_grad_mrtrix=export_grad_mrtrix,
1899
+ export_grad_fsl=export_grad_fsl,
1900
+ import_pe_table=import_pe_table,
1901
+ import_pe_eddy=import_pe_eddy,
1902
+ export_pe_table=export_pe_table,
1903
+ export_pe_eddy=export_pe_eddy,
1904
+ info=info,
1905
+ quiet=quiet,
1906
+ debug=debug,
1907
+ force=force,
1908
+ nthreads=nthreads,
1909
+ config=config,
1910
+ help_=help_,
1911
+ version=version,
1912
+ input_=input_,
1913
+ output=output,
1914
+ )
1915
+ return mrconvert_execute(params, runner)
1916
+
1917
+
1918
+ __all__ = [
1919
+ "MRCONVERT_METADATA",
1920
+ "MrconvertAppendPropertyParamsDict",
1921
+ "MrconvertAppendPropertyParamsDictTagged",
1922
+ "MrconvertClearPropertyParamsDict",
1923
+ "MrconvertClearPropertyParamsDictTagged",
1924
+ "MrconvertConfigParamsDict",
1925
+ "MrconvertConfigParamsDictTagged",
1926
+ "MrconvertCoordParamsDict",
1927
+ "MrconvertCoordParamsDictTagged",
1928
+ "MrconvertExportGradFslOutputs",
1929
+ "MrconvertExportGradFslParamsDict",
1930
+ "MrconvertExportGradFslParamsDictTagged",
1931
+ "MrconvertExportPeEddyOutputs",
1932
+ "MrconvertExportPeEddyParamsDict",
1933
+ "MrconvertExportPeEddyParamsDictTagged",
1934
+ "MrconvertFslgradParamsDict",
1935
+ "MrconvertFslgradParamsDictTagged",
1936
+ "MrconvertImportPeEddyParamsDict",
1937
+ "MrconvertImportPeEddyParamsDictTagged",
1938
+ "MrconvertOutputs",
1939
+ "MrconvertParamsDict",
1940
+ "MrconvertParamsDictTagged",
1941
+ "MrconvertSetPropertyParamsDict",
1942
+ "MrconvertSetPropertyParamsDictTagged",
1943
+ "MrconvertVariousFile1ParamsDict",
1944
+ "MrconvertVariousFile1ParamsDictTagged",
1945
+ "MrconvertVariousFileParamsDict",
1946
+ "MrconvertVariousFileParamsDictTagged",
1947
+ "MrconvertVariousString1ParamsDict",
1948
+ "MrconvertVariousString1ParamsDictTagged",
1949
+ "MrconvertVariousStringParamsDict",
1950
+ "MrconvertVariousStringParamsDictTagged",
1951
+ "mrconvert",
1952
+ "mrconvert_append_property",
1953
+ "mrconvert_clear_property",
1954
+ "mrconvert_config",
1955
+ "mrconvert_coord",
1956
+ "mrconvert_execute",
1957
+ "mrconvert_export_grad_fsl",
1958
+ "mrconvert_export_pe_eddy",
1959
+ "mrconvert_fslgrad",
1960
+ "mrconvert_import_pe_eddy",
1961
+ "mrconvert_params",
1962
+ "mrconvert_set_property",
1963
+ "mrconvert_various_file",
1964
+ "mrconvert_various_file_1",
1965
+ "mrconvert_various_string",
1966
+ "mrconvert_various_string_1",
1967
+ ]