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,4302 @@
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
+ MRCALC_METADATA = Metadata(
9
+ id="653dbc736bd2e23e6344aa23f92d7d2506dd4a3a.boutiques",
10
+ name="mrcalc",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _MrcalcAbsParamsDictNoTag = typing.TypedDict('_MrcalcAbsParamsDictNoTag', {})
17
+ MrcalcAbsParamsDictTagged = typing.TypedDict('MrcalcAbsParamsDictTagged', {
18
+ "@type": typing.Literal["abs"],
19
+ })
20
+ MrcalcAbsParamsDict = _MrcalcAbsParamsDictNoTag | MrcalcAbsParamsDictTagged
21
+
22
+
23
+ _MrcalcNegParamsDictNoTag = typing.TypedDict('_MrcalcNegParamsDictNoTag', {})
24
+ MrcalcNegParamsDictTagged = typing.TypedDict('MrcalcNegParamsDictTagged', {
25
+ "@type": typing.Literal["neg"],
26
+ })
27
+ MrcalcNegParamsDict = _MrcalcNegParamsDictNoTag | MrcalcNegParamsDictTagged
28
+
29
+
30
+ _MrcalcAddParamsDictNoTag = typing.TypedDict('_MrcalcAddParamsDictNoTag', {})
31
+ MrcalcAddParamsDictTagged = typing.TypedDict('MrcalcAddParamsDictTagged', {
32
+ "@type": typing.Literal["add"],
33
+ })
34
+ MrcalcAddParamsDict = _MrcalcAddParamsDictNoTag | MrcalcAddParamsDictTagged
35
+
36
+
37
+ _MrcalcSubtractParamsDictNoTag = typing.TypedDict('_MrcalcSubtractParamsDictNoTag', {})
38
+ MrcalcSubtractParamsDictTagged = typing.TypedDict('MrcalcSubtractParamsDictTagged', {
39
+ "@type": typing.Literal["subtract"],
40
+ })
41
+ MrcalcSubtractParamsDict = _MrcalcSubtractParamsDictNoTag | MrcalcSubtractParamsDictTagged
42
+
43
+
44
+ _MrcalcMultiplyParamsDictNoTag = typing.TypedDict('_MrcalcMultiplyParamsDictNoTag', {})
45
+ MrcalcMultiplyParamsDictTagged = typing.TypedDict('MrcalcMultiplyParamsDictTagged', {
46
+ "@type": typing.Literal["multiply"],
47
+ })
48
+ MrcalcMultiplyParamsDict = _MrcalcMultiplyParamsDictNoTag | MrcalcMultiplyParamsDictTagged
49
+
50
+
51
+ _MrcalcDivideParamsDictNoTag = typing.TypedDict('_MrcalcDivideParamsDictNoTag', {})
52
+ MrcalcDivideParamsDictTagged = typing.TypedDict('MrcalcDivideParamsDictTagged', {
53
+ "@type": typing.Literal["divide"],
54
+ })
55
+ MrcalcDivideParamsDict = _MrcalcDivideParamsDictNoTag | MrcalcDivideParamsDictTagged
56
+
57
+
58
+ _MrcalcMinParamsDictNoTag = typing.TypedDict('_MrcalcMinParamsDictNoTag', {})
59
+ MrcalcMinParamsDictTagged = typing.TypedDict('MrcalcMinParamsDictTagged', {
60
+ "@type": typing.Literal["min"],
61
+ })
62
+ MrcalcMinParamsDict = _MrcalcMinParamsDictNoTag | MrcalcMinParamsDictTagged
63
+
64
+
65
+ _MrcalcMaxParamsDictNoTag = typing.TypedDict('_MrcalcMaxParamsDictNoTag', {})
66
+ MrcalcMaxParamsDictTagged = typing.TypedDict('MrcalcMaxParamsDictTagged', {
67
+ "@type": typing.Literal["max"],
68
+ })
69
+ MrcalcMaxParamsDict = _MrcalcMaxParamsDictNoTag | MrcalcMaxParamsDictTagged
70
+
71
+
72
+ _MrcalcLtParamsDictNoTag = typing.TypedDict('_MrcalcLtParamsDictNoTag', {})
73
+ MrcalcLtParamsDictTagged = typing.TypedDict('MrcalcLtParamsDictTagged', {
74
+ "@type": typing.Literal["lt"],
75
+ })
76
+ MrcalcLtParamsDict = _MrcalcLtParamsDictNoTag | MrcalcLtParamsDictTagged
77
+
78
+
79
+ _MrcalcGtParamsDictNoTag = typing.TypedDict('_MrcalcGtParamsDictNoTag', {})
80
+ MrcalcGtParamsDictTagged = typing.TypedDict('MrcalcGtParamsDictTagged', {
81
+ "@type": typing.Literal["gt"],
82
+ })
83
+ MrcalcGtParamsDict = _MrcalcGtParamsDictNoTag | MrcalcGtParamsDictTagged
84
+
85
+
86
+ _MrcalcLeParamsDictNoTag = typing.TypedDict('_MrcalcLeParamsDictNoTag', {})
87
+ MrcalcLeParamsDictTagged = typing.TypedDict('MrcalcLeParamsDictTagged', {
88
+ "@type": typing.Literal["le"],
89
+ })
90
+ MrcalcLeParamsDict = _MrcalcLeParamsDictNoTag | MrcalcLeParamsDictTagged
91
+
92
+
93
+ _MrcalcGeParamsDictNoTag = typing.TypedDict('_MrcalcGeParamsDictNoTag', {})
94
+ MrcalcGeParamsDictTagged = typing.TypedDict('MrcalcGeParamsDictTagged', {
95
+ "@type": typing.Literal["ge"],
96
+ })
97
+ MrcalcGeParamsDict = _MrcalcGeParamsDictNoTag | MrcalcGeParamsDictTagged
98
+
99
+
100
+ _MrcalcEqParamsDictNoTag = typing.TypedDict('_MrcalcEqParamsDictNoTag', {})
101
+ MrcalcEqParamsDictTagged = typing.TypedDict('MrcalcEqParamsDictTagged', {
102
+ "@type": typing.Literal["eq"],
103
+ })
104
+ MrcalcEqParamsDict = _MrcalcEqParamsDictNoTag | MrcalcEqParamsDictTagged
105
+
106
+
107
+ _MrcalcNeqParamsDictNoTag = typing.TypedDict('_MrcalcNeqParamsDictNoTag', {})
108
+ MrcalcNeqParamsDictTagged = typing.TypedDict('MrcalcNeqParamsDictTagged', {
109
+ "@type": typing.Literal["neq"],
110
+ })
111
+ MrcalcNeqParamsDict = _MrcalcNeqParamsDictNoTag | MrcalcNeqParamsDictTagged
112
+
113
+
114
+ _MrcalcIfParamsDictNoTag = typing.TypedDict('_MrcalcIfParamsDictNoTag', {})
115
+ MrcalcIfParamsDictTagged = typing.TypedDict('MrcalcIfParamsDictTagged', {
116
+ "@type": typing.Literal["if"],
117
+ })
118
+ MrcalcIfParamsDict = _MrcalcIfParamsDictNoTag | MrcalcIfParamsDictTagged
119
+
120
+
121
+ _MrcalcReplaceParamsDictNoTag = typing.TypedDict('_MrcalcReplaceParamsDictNoTag', {})
122
+ MrcalcReplaceParamsDictTagged = typing.TypedDict('MrcalcReplaceParamsDictTagged', {
123
+ "@type": typing.Literal["replace"],
124
+ })
125
+ MrcalcReplaceParamsDict = _MrcalcReplaceParamsDictNoTag | MrcalcReplaceParamsDictTagged
126
+
127
+
128
+ _MrcalcSqrtParamsDictNoTag = typing.TypedDict('_MrcalcSqrtParamsDictNoTag', {})
129
+ MrcalcSqrtParamsDictTagged = typing.TypedDict('MrcalcSqrtParamsDictTagged', {
130
+ "@type": typing.Literal["sqrt"],
131
+ })
132
+ MrcalcSqrtParamsDict = _MrcalcSqrtParamsDictNoTag | MrcalcSqrtParamsDictTagged
133
+
134
+
135
+ _MrcalcPowParamsDictNoTag = typing.TypedDict('_MrcalcPowParamsDictNoTag', {})
136
+ MrcalcPowParamsDictTagged = typing.TypedDict('MrcalcPowParamsDictTagged', {
137
+ "@type": typing.Literal["pow"],
138
+ })
139
+ MrcalcPowParamsDict = _MrcalcPowParamsDictNoTag | MrcalcPowParamsDictTagged
140
+
141
+
142
+ _MrcalcRoundParamsDictNoTag = typing.TypedDict('_MrcalcRoundParamsDictNoTag', {})
143
+ MrcalcRoundParamsDictTagged = typing.TypedDict('MrcalcRoundParamsDictTagged', {
144
+ "@type": typing.Literal["round"],
145
+ })
146
+ MrcalcRoundParamsDict = _MrcalcRoundParamsDictNoTag | MrcalcRoundParamsDictTagged
147
+
148
+
149
+ _MrcalcCeilParamsDictNoTag = typing.TypedDict('_MrcalcCeilParamsDictNoTag', {})
150
+ MrcalcCeilParamsDictTagged = typing.TypedDict('MrcalcCeilParamsDictTagged', {
151
+ "@type": typing.Literal["ceil"],
152
+ })
153
+ MrcalcCeilParamsDict = _MrcalcCeilParamsDictNoTag | MrcalcCeilParamsDictTagged
154
+
155
+
156
+ _MrcalcFloorParamsDictNoTag = typing.TypedDict('_MrcalcFloorParamsDictNoTag', {})
157
+ MrcalcFloorParamsDictTagged = typing.TypedDict('MrcalcFloorParamsDictTagged', {
158
+ "@type": typing.Literal["floor"],
159
+ })
160
+ MrcalcFloorParamsDict = _MrcalcFloorParamsDictNoTag | MrcalcFloorParamsDictTagged
161
+
162
+
163
+ _MrcalcNotParamsDictNoTag = typing.TypedDict('_MrcalcNotParamsDictNoTag', {})
164
+ MrcalcNotParamsDictTagged = typing.TypedDict('MrcalcNotParamsDictTagged', {
165
+ "@type": typing.Literal["not"],
166
+ })
167
+ MrcalcNotParamsDict = _MrcalcNotParamsDictNoTag | MrcalcNotParamsDictTagged
168
+
169
+
170
+ _MrcalcAndParamsDictNoTag = typing.TypedDict('_MrcalcAndParamsDictNoTag', {})
171
+ MrcalcAndParamsDictTagged = typing.TypedDict('MrcalcAndParamsDictTagged', {
172
+ "@type": typing.Literal["and"],
173
+ })
174
+ MrcalcAndParamsDict = _MrcalcAndParamsDictNoTag | MrcalcAndParamsDictTagged
175
+
176
+
177
+ _MrcalcOrParamsDictNoTag = typing.TypedDict('_MrcalcOrParamsDictNoTag', {})
178
+ MrcalcOrParamsDictTagged = typing.TypedDict('MrcalcOrParamsDictTagged', {
179
+ "@type": typing.Literal["or"],
180
+ })
181
+ MrcalcOrParamsDict = _MrcalcOrParamsDictNoTag | MrcalcOrParamsDictTagged
182
+
183
+
184
+ _MrcalcXorParamsDictNoTag = typing.TypedDict('_MrcalcXorParamsDictNoTag', {})
185
+ MrcalcXorParamsDictTagged = typing.TypedDict('MrcalcXorParamsDictTagged', {
186
+ "@type": typing.Literal["xor"],
187
+ })
188
+ MrcalcXorParamsDict = _MrcalcXorParamsDictNoTag | MrcalcXorParamsDictTagged
189
+
190
+
191
+ _MrcalcIsnanParamsDictNoTag = typing.TypedDict('_MrcalcIsnanParamsDictNoTag', {})
192
+ MrcalcIsnanParamsDictTagged = typing.TypedDict('MrcalcIsnanParamsDictTagged', {
193
+ "@type": typing.Literal["isnan"],
194
+ })
195
+ MrcalcIsnanParamsDict = _MrcalcIsnanParamsDictNoTag | MrcalcIsnanParamsDictTagged
196
+
197
+
198
+ _MrcalcIsinfParamsDictNoTag = typing.TypedDict('_MrcalcIsinfParamsDictNoTag', {})
199
+ MrcalcIsinfParamsDictTagged = typing.TypedDict('MrcalcIsinfParamsDictTagged', {
200
+ "@type": typing.Literal["isinf"],
201
+ })
202
+ MrcalcIsinfParamsDict = _MrcalcIsinfParamsDictNoTag | MrcalcIsinfParamsDictTagged
203
+
204
+
205
+ _MrcalcFiniteParamsDictNoTag = typing.TypedDict('_MrcalcFiniteParamsDictNoTag', {})
206
+ MrcalcFiniteParamsDictTagged = typing.TypedDict('MrcalcFiniteParamsDictTagged', {
207
+ "@type": typing.Literal["finite"],
208
+ })
209
+ MrcalcFiniteParamsDict = _MrcalcFiniteParamsDictNoTag | MrcalcFiniteParamsDictTagged
210
+
211
+
212
+ _MrcalcComplexParamsDictNoTag = typing.TypedDict('_MrcalcComplexParamsDictNoTag', {})
213
+ MrcalcComplexParamsDictTagged = typing.TypedDict('MrcalcComplexParamsDictTagged', {
214
+ "@type": typing.Literal["complex"],
215
+ })
216
+ MrcalcComplexParamsDict = _MrcalcComplexParamsDictNoTag | MrcalcComplexParamsDictTagged
217
+
218
+
219
+ _MrcalcPolarParamsDictNoTag = typing.TypedDict('_MrcalcPolarParamsDictNoTag', {})
220
+ MrcalcPolarParamsDictTagged = typing.TypedDict('MrcalcPolarParamsDictTagged', {
221
+ "@type": typing.Literal["polar"],
222
+ })
223
+ MrcalcPolarParamsDict = _MrcalcPolarParamsDictNoTag | MrcalcPolarParamsDictTagged
224
+
225
+
226
+ _MrcalcRealParamsDictNoTag = typing.TypedDict('_MrcalcRealParamsDictNoTag', {})
227
+ MrcalcRealParamsDictTagged = typing.TypedDict('MrcalcRealParamsDictTagged', {
228
+ "@type": typing.Literal["real"],
229
+ })
230
+ MrcalcRealParamsDict = _MrcalcRealParamsDictNoTag | MrcalcRealParamsDictTagged
231
+
232
+
233
+ _MrcalcImagParamsDictNoTag = typing.TypedDict('_MrcalcImagParamsDictNoTag', {})
234
+ MrcalcImagParamsDictTagged = typing.TypedDict('MrcalcImagParamsDictTagged', {
235
+ "@type": typing.Literal["imag"],
236
+ })
237
+ MrcalcImagParamsDict = _MrcalcImagParamsDictNoTag | MrcalcImagParamsDictTagged
238
+
239
+
240
+ _MrcalcPhaseParamsDictNoTag = typing.TypedDict('_MrcalcPhaseParamsDictNoTag', {})
241
+ MrcalcPhaseParamsDictTagged = typing.TypedDict('MrcalcPhaseParamsDictTagged', {
242
+ "@type": typing.Literal["phase"],
243
+ })
244
+ MrcalcPhaseParamsDict = _MrcalcPhaseParamsDictNoTag | MrcalcPhaseParamsDictTagged
245
+
246
+
247
+ _MrcalcConjParamsDictNoTag = typing.TypedDict('_MrcalcConjParamsDictNoTag', {})
248
+ MrcalcConjParamsDictTagged = typing.TypedDict('MrcalcConjParamsDictTagged', {
249
+ "@type": typing.Literal["conj"],
250
+ })
251
+ MrcalcConjParamsDict = _MrcalcConjParamsDictNoTag | MrcalcConjParamsDictTagged
252
+
253
+
254
+ _MrcalcProjParamsDictNoTag = typing.TypedDict('_MrcalcProjParamsDictNoTag', {})
255
+ MrcalcProjParamsDictTagged = typing.TypedDict('MrcalcProjParamsDictTagged', {
256
+ "@type": typing.Literal["proj"],
257
+ })
258
+ MrcalcProjParamsDict = _MrcalcProjParamsDictNoTag | MrcalcProjParamsDictTagged
259
+
260
+
261
+ _MrcalcExpParamsDictNoTag = typing.TypedDict('_MrcalcExpParamsDictNoTag', {})
262
+ MrcalcExpParamsDictTagged = typing.TypedDict('MrcalcExpParamsDictTagged', {
263
+ "@type": typing.Literal["exp"],
264
+ })
265
+ MrcalcExpParamsDict = _MrcalcExpParamsDictNoTag | MrcalcExpParamsDictTagged
266
+
267
+
268
+ _MrcalcLogParamsDictNoTag = typing.TypedDict('_MrcalcLogParamsDictNoTag', {})
269
+ MrcalcLogParamsDictTagged = typing.TypedDict('MrcalcLogParamsDictTagged', {
270
+ "@type": typing.Literal["log"],
271
+ })
272
+ MrcalcLogParamsDict = _MrcalcLogParamsDictNoTag | MrcalcLogParamsDictTagged
273
+
274
+
275
+ _MrcalcLog10ParamsDictNoTag = typing.TypedDict('_MrcalcLog10ParamsDictNoTag', {})
276
+ MrcalcLog10ParamsDictTagged = typing.TypedDict('MrcalcLog10ParamsDictTagged', {
277
+ "@type": typing.Literal["log10"],
278
+ })
279
+ MrcalcLog10ParamsDict = _MrcalcLog10ParamsDictNoTag | MrcalcLog10ParamsDictTagged
280
+
281
+
282
+ _MrcalcCosParamsDictNoTag = typing.TypedDict('_MrcalcCosParamsDictNoTag', {})
283
+ MrcalcCosParamsDictTagged = typing.TypedDict('MrcalcCosParamsDictTagged', {
284
+ "@type": typing.Literal["cos"],
285
+ })
286
+ MrcalcCosParamsDict = _MrcalcCosParamsDictNoTag | MrcalcCosParamsDictTagged
287
+
288
+
289
+ _MrcalcSinParamsDictNoTag = typing.TypedDict('_MrcalcSinParamsDictNoTag', {})
290
+ MrcalcSinParamsDictTagged = typing.TypedDict('MrcalcSinParamsDictTagged', {
291
+ "@type": typing.Literal["sin"],
292
+ })
293
+ MrcalcSinParamsDict = _MrcalcSinParamsDictNoTag | MrcalcSinParamsDictTagged
294
+
295
+
296
+ _MrcalcTanParamsDictNoTag = typing.TypedDict('_MrcalcTanParamsDictNoTag', {})
297
+ MrcalcTanParamsDictTagged = typing.TypedDict('MrcalcTanParamsDictTagged', {
298
+ "@type": typing.Literal["tan"],
299
+ })
300
+ MrcalcTanParamsDict = _MrcalcTanParamsDictNoTag | MrcalcTanParamsDictTagged
301
+
302
+
303
+ _MrcalcAcosParamsDictNoTag = typing.TypedDict('_MrcalcAcosParamsDictNoTag', {})
304
+ MrcalcAcosParamsDictTagged = typing.TypedDict('MrcalcAcosParamsDictTagged', {
305
+ "@type": typing.Literal["acos"],
306
+ })
307
+ MrcalcAcosParamsDict = _MrcalcAcosParamsDictNoTag | MrcalcAcosParamsDictTagged
308
+
309
+
310
+ _MrcalcAsinParamsDictNoTag = typing.TypedDict('_MrcalcAsinParamsDictNoTag', {})
311
+ MrcalcAsinParamsDictTagged = typing.TypedDict('MrcalcAsinParamsDictTagged', {
312
+ "@type": typing.Literal["asin"],
313
+ })
314
+ MrcalcAsinParamsDict = _MrcalcAsinParamsDictNoTag | MrcalcAsinParamsDictTagged
315
+
316
+
317
+ _MrcalcAtanParamsDictNoTag = typing.TypedDict('_MrcalcAtanParamsDictNoTag', {})
318
+ MrcalcAtanParamsDictTagged = typing.TypedDict('MrcalcAtanParamsDictTagged', {
319
+ "@type": typing.Literal["atan"],
320
+ })
321
+ MrcalcAtanParamsDict = _MrcalcAtanParamsDictNoTag | MrcalcAtanParamsDictTagged
322
+
323
+
324
+ _MrcalcCoshParamsDictNoTag = typing.TypedDict('_MrcalcCoshParamsDictNoTag', {})
325
+ MrcalcCoshParamsDictTagged = typing.TypedDict('MrcalcCoshParamsDictTagged', {
326
+ "@type": typing.Literal["cosh"],
327
+ })
328
+ MrcalcCoshParamsDict = _MrcalcCoshParamsDictNoTag | MrcalcCoshParamsDictTagged
329
+
330
+
331
+ _MrcalcSinhParamsDictNoTag = typing.TypedDict('_MrcalcSinhParamsDictNoTag', {})
332
+ MrcalcSinhParamsDictTagged = typing.TypedDict('MrcalcSinhParamsDictTagged', {
333
+ "@type": typing.Literal["sinh"],
334
+ })
335
+ MrcalcSinhParamsDict = _MrcalcSinhParamsDictNoTag | MrcalcSinhParamsDictTagged
336
+
337
+
338
+ _MrcalcTanhParamsDictNoTag = typing.TypedDict('_MrcalcTanhParamsDictNoTag', {})
339
+ MrcalcTanhParamsDictTagged = typing.TypedDict('MrcalcTanhParamsDictTagged', {
340
+ "@type": typing.Literal["tanh"],
341
+ })
342
+ MrcalcTanhParamsDict = _MrcalcTanhParamsDictNoTag | MrcalcTanhParamsDictTagged
343
+
344
+
345
+ _MrcalcAcoshParamsDictNoTag = typing.TypedDict('_MrcalcAcoshParamsDictNoTag', {})
346
+ MrcalcAcoshParamsDictTagged = typing.TypedDict('MrcalcAcoshParamsDictTagged', {
347
+ "@type": typing.Literal["acosh"],
348
+ })
349
+ MrcalcAcoshParamsDict = _MrcalcAcoshParamsDictNoTag | MrcalcAcoshParamsDictTagged
350
+
351
+
352
+ _MrcalcAsinhParamsDictNoTag = typing.TypedDict('_MrcalcAsinhParamsDictNoTag', {})
353
+ MrcalcAsinhParamsDictTagged = typing.TypedDict('MrcalcAsinhParamsDictTagged', {
354
+ "@type": typing.Literal["asinh"],
355
+ })
356
+ MrcalcAsinhParamsDict = _MrcalcAsinhParamsDictNoTag | MrcalcAsinhParamsDictTagged
357
+
358
+
359
+ _MrcalcAtanhParamsDictNoTag = typing.TypedDict('_MrcalcAtanhParamsDictNoTag', {})
360
+ MrcalcAtanhParamsDictTagged = typing.TypedDict('MrcalcAtanhParamsDictTagged', {
361
+ "@type": typing.Literal["atanh"],
362
+ })
363
+ MrcalcAtanhParamsDict = _MrcalcAtanhParamsDictNoTag | MrcalcAtanhParamsDictTagged
364
+
365
+
366
+ _MrcalcConfigParamsDictNoTag = typing.TypedDict('_MrcalcConfigParamsDictNoTag', {
367
+ "key": str,
368
+ "value": str,
369
+ })
370
+ MrcalcConfigParamsDictTagged = typing.TypedDict('MrcalcConfigParamsDictTagged', {
371
+ "@type": typing.Literal["config"],
372
+ "key": str,
373
+ "value": str,
374
+ })
375
+ MrcalcConfigParamsDict = _MrcalcConfigParamsDictNoTag | MrcalcConfigParamsDictTagged
376
+
377
+
378
+ _MrcalcVariousStringParamsDictNoTag = typing.TypedDict('_MrcalcVariousStringParamsDictNoTag', {
379
+ "obj": str,
380
+ })
381
+ MrcalcVariousStringParamsDictTagged = typing.TypedDict('MrcalcVariousStringParamsDictTagged', {
382
+ "@type": typing.Literal["VariousString"],
383
+ "obj": str,
384
+ })
385
+ MrcalcVariousStringParamsDict = _MrcalcVariousStringParamsDictNoTag | MrcalcVariousStringParamsDictTagged
386
+
387
+
388
+ _MrcalcVariousFileParamsDictNoTag = typing.TypedDict('_MrcalcVariousFileParamsDictNoTag', {
389
+ "obj": InputPathType,
390
+ })
391
+ MrcalcVariousFileParamsDictTagged = typing.TypedDict('MrcalcVariousFileParamsDictTagged', {
392
+ "@type": typing.Literal["VariousFile"],
393
+ "obj": InputPathType,
394
+ })
395
+ MrcalcVariousFileParamsDict = _MrcalcVariousFileParamsDictNoTag | MrcalcVariousFileParamsDictTagged
396
+
397
+
398
+ _MrcalcParamsDictNoTag = typing.TypedDict('_MrcalcParamsDictNoTag', {
399
+ "abs": typing.NotRequired[list[MrcalcAbsParamsDict] | None],
400
+ "neg": typing.NotRequired[list[MrcalcNegParamsDict] | None],
401
+ "add": typing.NotRequired[list[MrcalcAddParamsDict] | None],
402
+ "subtract": typing.NotRequired[list[MrcalcSubtractParamsDict] | None],
403
+ "multiply": typing.NotRequired[list[MrcalcMultiplyParamsDict] | None],
404
+ "divide": typing.NotRequired[list[MrcalcDivideParamsDict] | None],
405
+ "min": typing.NotRequired[list[MrcalcMinParamsDict] | None],
406
+ "max": typing.NotRequired[list[MrcalcMaxParamsDict] | None],
407
+ "lt": typing.NotRequired[list[MrcalcLtParamsDict] | None],
408
+ "gt": typing.NotRequired[list[MrcalcGtParamsDict] | None],
409
+ "le": typing.NotRequired[list[MrcalcLeParamsDict] | None],
410
+ "ge": typing.NotRequired[list[MrcalcGeParamsDict] | None],
411
+ "eq": typing.NotRequired[list[MrcalcEqParamsDict] | None],
412
+ "neq": typing.NotRequired[list[MrcalcNeqParamsDict] | None],
413
+ "if": typing.NotRequired[list[MrcalcIfParamsDict] | None],
414
+ "replace": typing.NotRequired[list[MrcalcReplaceParamsDict] | None],
415
+ "sqrt": typing.NotRequired[list[MrcalcSqrtParamsDict] | None],
416
+ "pow": typing.NotRequired[list[MrcalcPowParamsDict] | None],
417
+ "round": typing.NotRequired[list[MrcalcRoundParamsDict] | None],
418
+ "ceil": typing.NotRequired[list[MrcalcCeilParamsDict] | None],
419
+ "floor": typing.NotRequired[list[MrcalcFloorParamsDict] | None],
420
+ "not": typing.NotRequired[list[MrcalcNotParamsDict] | None],
421
+ "and": typing.NotRequired[list[MrcalcAndParamsDict] | None],
422
+ "or": typing.NotRequired[list[MrcalcOrParamsDict] | None],
423
+ "xor": typing.NotRequired[list[MrcalcXorParamsDict] | None],
424
+ "isnan": typing.NotRequired[list[MrcalcIsnanParamsDict] | None],
425
+ "isinf": typing.NotRequired[list[MrcalcIsinfParamsDict] | None],
426
+ "finite": typing.NotRequired[list[MrcalcFiniteParamsDict] | None],
427
+ "complex": typing.NotRequired[list[MrcalcComplexParamsDict] | None],
428
+ "polar": typing.NotRequired[list[MrcalcPolarParamsDict] | None],
429
+ "real": typing.NotRequired[list[MrcalcRealParamsDict] | None],
430
+ "imag": typing.NotRequired[list[MrcalcImagParamsDict] | None],
431
+ "phase": typing.NotRequired[list[MrcalcPhaseParamsDict] | None],
432
+ "conj": typing.NotRequired[list[MrcalcConjParamsDict] | None],
433
+ "proj": typing.NotRequired[list[MrcalcProjParamsDict] | None],
434
+ "exp": typing.NotRequired[list[MrcalcExpParamsDict] | None],
435
+ "log": typing.NotRequired[list[MrcalcLogParamsDict] | None],
436
+ "log10": typing.NotRequired[list[MrcalcLog10ParamsDict] | None],
437
+ "cos": typing.NotRequired[list[MrcalcCosParamsDict] | None],
438
+ "sin": typing.NotRequired[list[MrcalcSinParamsDict] | None],
439
+ "tan": typing.NotRequired[list[MrcalcTanParamsDict] | None],
440
+ "acos": typing.NotRequired[list[MrcalcAcosParamsDict] | None],
441
+ "asin": typing.NotRequired[list[MrcalcAsinParamsDict] | None],
442
+ "atan": typing.NotRequired[list[MrcalcAtanParamsDict] | None],
443
+ "cosh": typing.NotRequired[list[MrcalcCoshParamsDict] | None],
444
+ "sinh": typing.NotRequired[list[MrcalcSinhParamsDict] | None],
445
+ "tanh": typing.NotRequired[list[MrcalcTanhParamsDict] | None],
446
+ "acosh": typing.NotRequired[list[MrcalcAcoshParamsDict] | None],
447
+ "asinh": typing.NotRequired[list[MrcalcAsinhParamsDict] | None],
448
+ "atanh": typing.NotRequired[list[MrcalcAtanhParamsDict] | None],
449
+ "datatype": typing.NotRequired[str | None],
450
+ "info": bool,
451
+ "quiet": bool,
452
+ "debug": bool,
453
+ "force": bool,
454
+ "nthreads": typing.NotRequired[int | None],
455
+ "config": typing.NotRequired[list[MrcalcConfigParamsDict] | None],
456
+ "help": bool,
457
+ "version": bool,
458
+ "operand": list[typing.Union[MrcalcVariousStringParamsDictTagged, MrcalcVariousFileParamsDictTagged]],
459
+ })
460
+ MrcalcParamsDictTagged = typing.TypedDict('MrcalcParamsDictTagged', {
461
+ "@type": typing.Literal["mrtrix/mrcalc"],
462
+ "abs": typing.NotRequired[list[MrcalcAbsParamsDict] | None],
463
+ "neg": typing.NotRequired[list[MrcalcNegParamsDict] | None],
464
+ "add": typing.NotRequired[list[MrcalcAddParamsDict] | None],
465
+ "subtract": typing.NotRequired[list[MrcalcSubtractParamsDict] | None],
466
+ "multiply": typing.NotRequired[list[MrcalcMultiplyParamsDict] | None],
467
+ "divide": typing.NotRequired[list[MrcalcDivideParamsDict] | None],
468
+ "min": typing.NotRequired[list[MrcalcMinParamsDict] | None],
469
+ "max": typing.NotRequired[list[MrcalcMaxParamsDict] | None],
470
+ "lt": typing.NotRequired[list[MrcalcLtParamsDict] | None],
471
+ "gt": typing.NotRequired[list[MrcalcGtParamsDict] | None],
472
+ "le": typing.NotRequired[list[MrcalcLeParamsDict] | None],
473
+ "ge": typing.NotRequired[list[MrcalcGeParamsDict] | None],
474
+ "eq": typing.NotRequired[list[MrcalcEqParamsDict] | None],
475
+ "neq": typing.NotRequired[list[MrcalcNeqParamsDict] | None],
476
+ "if": typing.NotRequired[list[MrcalcIfParamsDict] | None],
477
+ "replace": typing.NotRequired[list[MrcalcReplaceParamsDict] | None],
478
+ "sqrt": typing.NotRequired[list[MrcalcSqrtParamsDict] | None],
479
+ "pow": typing.NotRequired[list[MrcalcPowParamsDict] | None],
480
+ "round": typing.NotRequired[list[MrcalcRoundParamsDict] | None],
481
+ "ceil": typing.NotRequired[list[MrcalcCeilParamsDict] | None],
482
+ "floor": typing.NotRequired[list[MrcalcFloorParamsDict] | None],
483
+ "not": typing.NotRequired[list[MrcalcNotParamsDict] | None],
484
+ "and": typing.NotRequired[list[MrcalcAndParamsDict] | None],
485
+ "or": typing.NotRequired[list[MrcalcOrParamsDict] | None],
486
+ "xor": typing.NotRequired[list[MrcalcXorParamsDict] | None],
487
+ "isnan": typing.NotRequired[list[MrcalcIsnanParamsDict] | None],
488
+ "isinf": typing.NotRequired[list[MrcalcIsinfParamsDict] | None],
489
+ "finite": typing.NotRequired[list[MrcalcFiniteParamsDict] | None],
490
+ "complex": typing.NotRequired[list[MrcalcComplexParamsDict] | None],
491
+ "polar": typing.NotRequired[list[MrcalcPolarParamsDict] | None],
492
+ "real": typing.NotRequired[list[MrcalcRealParamsDict] | None],
493
+ "imag": typing.NotRequired[list[MrcalcImagParamsDict] | None],
494
+ "phase": typing.NotRequired[list[MrcalcPhaseParamsDict] | None],
495
+ "conj": typing.NotRequired[list[MrcalcConjParamsDict] | None],
496
+ "proj": typing.NotRequired[list[MrcalcProjParamsDict] | None],
497
+ "exp": typing.NotRequired[list[MrcalcExpParamsDict] | None],
498
+ "log": typing.NotRequired[list[MrcalcLogParamsDict] | None],
499
+ "log10": typing.NotRequired[list[MrcalcLog10ParamsDict] | None],
500
+ "cos": typing.NotRequired[list[MrcalcCosParamsDict] | None],
501
+ "sin": typing.NotRequired[list[MrcalcSinParamsDict] | None],
502
+ "tan": typing.NotRequired[list[MrcalcTanParamsDict] | None],
503
+ "acos": typing.NotRequired[list[MrcalcAcosParamsDict] | None],
504
+ "asin": typing.NotRequired[list[MrcalcAsinParamsDict] | None],
505
+ "atan": typing.NotRequired[list[MrcalcAtanParamsDict] | None],
506
+ "cosh": typing.NotRequired[list[MrcalcCoshParamsDict] | None],
507
+ "sinh": typing.NotRequired[list[MrcalcSinhParamsDict] | None],
508
+ "tanh": typing.NotRequired[list[MrcalcTanhParamsDict] | None],
509
+ "acosh": typing.NotRequired[list[MrcalcAcoshParamsDict] | None],
510
+ "asinh": typing.NotRequired[list[MrcalcAsinhParamsDict] | None],
511
+ "atanh": typing.NotRequired[list[MrcalcAtanhParamsDict] | None],
512
+ "datatype": typing.NotRequired[str | None],
513
+ "info": bool,
514
+ "quiet": bool,
515
+ "debug": bool,
516
+ "force": bool,
517
+ "nthreads": typing.NotRequired[int | None],
518
+ "config": typing.NotRequired[list[MrcalcConfigParamsDict] | None],
519
+ "help": bool,
520
+ "version": bool,
521
+ "operand": list[typing.Union[MrcalcVariousStringParamsDictTagged, MrcalcVariousFileParamsDictTagged]],
522
+ })
523
+ MrcalcParamsDict = _MrcalcParamsDictNoTag | MrcalcParamsDictTagged
524
+
525
+
526
+ def mrcalc_operand_cargs_dyn_fn(
527
+ t: str,
528
+ ) -> typing.Any:
529
+ """
530
+ Get build cargs function by command type.
531
+
532
+ Args:
533
+ t: Command type.
534
+ Returns:
535
+ Build cargs function.
536
+ """
537
+ return {
538
+ "VariousString": mrcalc_various_string_cargs,
539
+ "VariousFile": mrcalc_various_file_cargs,
540
+ }.get(t)
541
+
542
+
543
+ def mrcalc_operand_validate_dyn_fn(
544
+ t: str,
545
+ ) -> typing.Any:
546
+ """
547
+ Get validate params function by command type.
548
+
549
+ Args:
550
+ t: Command type.
551
+ Returns:
552
+ Validate params function.
553
+ """
554
+ return {
555
+ "VariousString": mrcalc_various_string_validate,
556
+ "VariousFile": mrcalc_various_file_validate,
557
+ }.get(t)
558
+
559
+
560
+ def mrcalc_abs(
561
+ ) -> MrcalcAbsParamsDictTagged:
562
+ """
563
+ Build parameters.
564
+
565
+ Args:
566
+ Returns:
567
+ Parameter dictionary
568
+ """
569
+ params = {
570
+ "@type": "abs",
571
+ }
572
+ return params
573
+
574
+
575
+ def mrcalc_abs_validate(
576
+ params: typing.Any,
577
+ ) -> None:
578
+ """
579
+ Validate parameters. Throws an error if `params` is not a valid
580
+ `MrcalcAbsParamsDict` object.
581
+
582
+ Args:
583
+ params: The parameters object to validate.
584
+ """
585
+ if params is None or not isinstance(params, dict):
586
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
587
+
588
+
589
+ def mrcalc_abs_cargs(
590
+ params: MrcalcAbsParamsDict,
591
+ execution: Execution,
592
+ ) -> list[str]:
593
+ """
594
+ Build command-line arguments from parameters.
595
+
596
+ Args:
597
+ params: The parameters.
598
+ execution: The execution object for resolving input paths.
599
+ Returns:
600
+ Command-line arguments.
601
+ """
602
+ cargs = []
603
+ cargs.append("-abs")
604
+ return cargs
605
+
606
+
607
+ def mrcalc_neg(
608
+ ) -> MrcalcNegParamsDictTagged:
609
+ """
610
+ Build parameters.
611
+
612
+ Args:
613
+ Returns:
614
+ Parameter dictionary
615
+ """
616
+ params = {
617
+ "@type": "neg",
618
+ }
619
+ return params
620
+
621
+
622
+ def mrcalc_neg_validate(
623
+ params: typing.Any,
624
+ ) -> None:
625
+ """
626
+ Validate parameters. Throws an error if `params` is not a valid
627
+ `MrcalcNegParamsDict` object.
628
+
629
+ Args:
630
+ params: The parameters object to validate.
631
+ """
632
+ if params is None or not isinstance(params, dict):
633
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
634
+
635
+
636
+ def mrcalc_neg_cargs(
637
+ params: MrcalcNegParamsDict,
638
+ execution: Execution,
639
+ ) -> list[str]:
640
+ """
641
+ Build command-line arguments from parameters.
642
+
643
+ Args:
644
+ params: The parameters.
645
+ execution: The execution object for resolving input paths.
646
+ Returns:
647
+ Command-line arguments.
648
+ """
649
+ cargs = []
650
+ cargs.append("-neg")
651
+ return cargs
652
+
653
+
654
+ def mrcalc_add(
655
+ ) -> MrcalcAddParamsDictTagged:
656
+ """
657
+ Build parameters.
658
+
659
+ Args:
660
+ Returns:
661
+ Parameter dictionary
662
+ """
663
+ params = {
664
+ "@type": "add",
665
+ }
666
+ return params
667
+
668
+
669
+ def mrcalc_add_validate(
670
+ params: typing.Any,
671
+ ) -> None:
672
+ """
673
+ Validate parameters. Throws an error if `params` is not a valid
674
+ `MrcalcAddParamsDict` object.
675
+
676
+ Args:
677
+ params: The parameters object to validate.
678
+ """
679
+ if params is None or not isinstance(params, dict):
680
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
681
+
682
+
683
+ def mrcalc_add_cargs(
684
+ params: MrcalcAddParamsDict,
685
+ execution: Execution,
686
+ ) -> list[str]:
687
+ """
688
+ Build command-line arguments from parameters.
689
+
690
+ Args:
691
+ params: The parameters.
692
+ execution: The execution object for resolving input paths.
693
+ Returns:
694
+ Command-line arguments.
695
+ """
696
+ cargs = []
697
+ cargs.append("-add")
698
+ return cargs
699
+
700
+
701
+ def mrcalc_subtract(
702
+ ) -> MrcalcSubtractParamsDictTagged:
703
+ """
704
+ Build parameters.
705
+
706
+ Args:
707
+ Returns:
708
+ Parameter dictionary
709
+ """
710
+ params = {
711
+ "@type": "subtract",
712
+ }
713
+ return params
714
+
715
+
716
+ def mrcalc_subtract_validate(
717
+ params: typing.Any,
718
+ ) -> None:
719
+ """
720
+ Validate parameters. Throws an error if `params` is not a valid
721
+ `MrcalcSubtractParamsDict` object.
722
+
723
+ Args:
724
+ params: The parameters object to validate.
725
+ """
726
+ if params is None or not isinstance(params, dict):
727
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
728
+
729
+
730
+ def mrcalc_subtract_cargs(
731
+ params: MrcalcSubtractParamsDict,
732
+ execution: Execution,
733
+ ) -> list[str]:
734
+ """
735
+ Build command-line arguments from parameters.
736
+
737
+ Args:
738
+ params: The parameters.
739
+ execution: The execution object for resolving input paths.
740
+ Returns:
741
+ Command-line arguments.
742
+ """
743
+ cargs = []
744
+ cargs.append("-subtract")
745
+ return cargs
746
+
747
+
748
+ def mrcalc_multiply(
749
+ ) -> MrcalcMultiplyParamsDictTagged:
750
+ """
751
+ Build parameters.
752
+
753
+ Args:
754
+ Returns:
755
+ Parameter dictionary
756
+ """
757
+ params = {
758
+ "@type": "multiply",
759
+ }
760
+ return params
761
+
762
+
763
+ def mrcalc_multiply_validate(
764
+ params: typing.Any,
765
+ ) -> None:
766
+ """
767
+ Validate parameters. Throws an error if `params` is not a valid
768
+ `MrcalcMultiplyParamsDict` object.
769
+
770
+ Args:
771
+ params: The parameters object to validate.
772
+ """
773
+ if params is None or not isinstance(params, dict):
774
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
775
+
776
+
777
+ def mrcalc_multiply_cargs(
778
+ params: MrcalcMultiplyParamsDict,
779
+ execution: Execution,
780
+ ) -> list[str]:
781
+ """
782
+ Build command-line arguments from parameters.
783
+
784
+ Args:
785
+ params: The parameters.
786
+ execution: The execution object for resolving input paths.
787
+ Returns:
788
+ Command-line arguments.
789
+ """
790
+ cargs = []
791
+ cargs.append("-multiply")
792
+ return cargs
793
+
794
+
795
+ def mrcalc_divide(
796
+ ) -> MrcalcDivideParamsDictTagged:
797
+ """
798
+ Build parameters.
799
+
800
+ Args:
801
+ Returns:
802
+ Parameter dictionary
803
+ """
804
+ params = {
805
+ "@type": "divide",
806
+ }
807
+ return params
808
+
809
+
810
+ def mrcalc_divide_validate(
811
+ params: typing.Any,
812
+ ) -> None:
813
+ """
814
+ Validate parameters. Throws an error if `params` is not a valid
815
+ `MrcalcDivideParamsDict` object.
816
+
817
+ Args:
818
+ params: The parameters object to validate.
819
+ """
820
+ if params is None or not isinstance(params, dict):
821
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
822
+
823
+
824
+ def mrcalc_divide_cargs(
825
+ params: MrcalcDivideParamsDict,
826
+ execution: Execution,
827
+ ) -> list[str]:
828
+ """
829
+ Build command-line arguments from parameters.
830
+
831
+ Args:
832
+ params: The parameters.
833
+ execution: The execution object for resolving input paths.
834
+ Returns:
835
+ Command-line arguments.
836
+ """
837
+ cargs = []
838
+ cargs.append("-divide")
839
+ return cargs
840
+
841
+
842
+ def mrcalc_min(
843
+ ) -> MrcalcMinParamsDictTagged:
844
+ """
845
+ Build parameters.
846
+
847
+ Args:
848
+ Returns:
849
+ Parameter dictionary
850
+ """
851
+ params = {
852
+ "@type": "min",
853
+ }
854
+ return params
855
+
856
+
857
+ def mrcalc_min_validate(
858
+ params: typing.Any,
859
+ ) -> None:
860
+ """
861
+ Validate parameters. Throws an error if `params` is not a valid
862
+ `MrcalcMinParamsDict` object.
863
+
864
+ Args:
865
+ params: The parameters object to validate.
866
+ """
867
+ if params is None or not isinstance(params, dict):
868
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
869
+
870
+
871
+ def mrcalc_min_cargs(
872
+ params: MrcalcMinParamsDict,
873
+ execution: Execution,
874
+ ) -> list[str]:
875
+ """
876
+ Build command-line arguments from parameters.
877
+
878
+ Args:
879
+ params: The parameters.
880
+ execution: The execution object for resolving input paths.
881
+ Returns:
882
+ Command-line arguments.
883
+ """
884
+ cargs = []
885
+ cargs.append("-min")
886
+ return cargs
887
+
888
+
889
+ def mrcalc_max(
890
+ ) -> MrcalcMaxParamsDictTagged:
891
+ """
892
+ Build parameters.
893
+
894
+ Args:
895
+ Returns:
896
+ Parameter dictionary
897
+ """
898
+ params = {
899
+ "@type": "max",
900
+ }
901
+ return params
902
+
903
+
904
+ def mrcalc_max_validate(
905
+ params: typing.Any,
906
+ ) -> None:
907
+ """
908
+ Validate parameters. Throws an error if `params` is not a valid
909
+ `MrcalcMaxParamsDict` object.
910
+
911
+ Args:
912
+ params: The parameters object to validate.
913
+ """
914
+ if params is None or not isinstance(params, dict):
915
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
916
+
917
+
918
+ def mrcalc_max_cargs(
919
+ params: MrcalcMaxParamsDict,
920
+ execution: Execution,
921
+ ) -> list[str]:
922
+ """
923
+ Build command-line arguments from parameters.
924
+
925
+ Args:
926
+ params: The parameters.
927
+ execution: The execution object for resolving input paths.
928
+ Returns:
929
+ Command-line arguments.
930
+ """
931
+ cargs = []
932
+ cargs.append("-max")
933
+ return cargs
934
+
935
+
936
+ def mrcalc_lt(
937
+ ) -> MrcalcLtParamsDictTagged:
938
+ """
939
+ Build parameters.
940
+
941
+ Args:
942
+ Returns:
943
+ Parameter dictionary
944
+ """
945
+ params = {
946
+ "@type": "lt",
947
+ }
948
+ return params
949
+
950
+
951
+ def mrcalc_lt_validate(
952
+ params: typing.Any,
953
+ ) -> None:
954
+ """
955
+ Validate parameters. Throws an error if `params` is not a valid
956
+ `MrcalcLtParamsDict` object.
957
+
958
+ Args:
959
+ params: The parameters object to validate.
960
+ """
961
+ if params is None or not isinstance(params, dict):
962
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
963
+
964
+
965
+ def mrcalc_lt_cargs(
966
+ params: MrcalcLtParamsDict,
967
+ execution: Execution,
968
+ ) -> list[str]:
969
+ """
970
+ Build command-line arguments from parameters.
971
+
972
+ Args:
973
+ params: The parameters.
974
+ execution: The execution object for resolving input paths.
975
+ Returns:
976
+ Command-line arguments.
977
+ """
978
+ cargs = []
979
+ cargs.append("-lt")
980
+ return cargs
981
+
982
+
983
+ def mrcalc_gt(
984
+ ) -> MrcalcGtParamsDictTagged:
985
+ """
986
+ Build parameters.
987
+
988
+ Args:
989
+ Returns:
990
+ Parameter dictionary
991
+ """
992
+ params = {
993
+ "@type": "gt",
994
+ }
995
+ return params
996
+
997
+
998
+ def mrcalc_gt_validate(
999
+ params: typing.Any,
1000
+ ) -> None:
1001
+ """
1002
+ Validate parameters. Throws an error if `params` is not a valid
1003
+ `MrcalcGtParamsDict` object.
1004
+
1005
+ Args:
1006
+ params: The parameters object to validate.
1007
+ """
1008
+ if params is None or not isinstance(params, dict):
1009
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1010
+
1011
+
1012
+ def mrcalc_gt_cargs(
1013
+ params: MrcalcGtParamsDict,
1014
+ execution: Execution,
1015
+ ) -> list[str]:
1016
+ """
1017
+ Build command-line arguments from parameters.
1018
+
1019
+ Args:
1020
+ params: The parameters.
1021
+ execution: The execution object for resolving input paths.
1022
+ Returns:
1023
+ Command-line arguments.
1024
+ """
1025
+ cargs = []
1026
+ cargs.append("-gt")
1027
+ return cargs
1028
+
1029
+
1030
+ def mrcalc_le(
1031
+ ) -> MrcalcLeParamsDictTagged:
1032
+ """
1033
+ Build parameters.
1034
+
1035
+ Args:
1036
+ Returns:
1037
+ Parameter dictionary
1038
+ """
1039
+ params = {
1040
+ "@type": "le",
1041
+ }
1042
+ return params
1043
+
1044
+
1045
+ def mrcalc_le_validate(
1046
+ params: typing.Any,
1047
+ ) -> None:
1048
+ """
1049
+ Validate parameters. Throws an error if `params` is not a valid
1050
+ `MrcalcLeParamsDict` object.
1051
+
1052
+ Args:
1053
+ params: The parameters object to validate.
1054
+ """
1055
+ if params is None or not isinstance(params, dict):
1056
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1057
+
1058
+
1059
+ def mrcalc_le_cargs(
1060
+ params: MrcalcLeParamsDict,
1061
+ execution: Execution,
1062
+ ) -> list[str]:
1063
+ """
1064
+ Build command-line arguments from parameters.
1065
+
1066
+ Args:
1067
+ params: The parameters.
1068
+ execution: The execution object for resolving input paths.
1069
+ Returns:
1070
+ Command-line arguments.
1071
+ """
1072
+ cargs = []
1073
+ cargs.append("-le")
1074
+ return cargs
1075
+
1076
+
1077
+ def mrcalc_ge(
1078
+ ) -> MrcalcGeParamsDictTagged:
1079
+ """
1080
+ Build parameters.
1081
+
1082
+ Args:
1083
+ Returns:
1084
+ Parameter dictionary
1085
+ """
1086
+ params = {
1087
+ "@type": "ge",
1088
+ }
1089
+ return params
1090
+
1091
+
1092
+ def mrcalc_ge_validate(
1093
+ params: typing.Any,
1094
+ ) -> None:
1095
+ """
1096
+ Validate parameters. Throws an error if `params` is not a valid
1097
+ `MrcalcGeParamsDict` object.
1098
+
1099
+ Args:
1100
+ params: The parameters object to validate.
1101
+ """
1102
+ if params is None or not isinstance(params, dict):
1103
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1104
+
1105
+
1106
+ def mrcalc_ge_cargs(
1107
+ params: MrcalcGeParamsDict,
1108
+ execution: Execution,
1109
+ ) -> list[str]:
1110
+ """
1111
+ Build command-line arguments from parameters.
1112
+
1113
+ Args:
1114
+ params: The parameters.
1115
+ execution: The execution object for resolving input paths.
1116
+ Returns:
1117
+ Command-line arguments.
1118
+ """
1119
+ cargs = []
1120
+ cargs.append("-ge")
1121
+ return cargs
1122
+
1123
+
1124
+ def mrcalc_eq(
1125
+ ) -> MrcalcEqParamsDictTagged:
1126
+ """
1127
+ Build parameters.
1128
+
1129
+ Args:
1130
+ Returns:
1131
+ Parameter dictionary
1132
+ """
1133
+ params = {
1134
+ "@type": "eq",
1135
+ }
1136
+ return params
1137
+
1138
+
1139
+ def mrcalc_eq_validate(
1140
+ params: typing.Any,
1141
+ ) -> None:
1142
+ """
1143
+ Validate parameters. Throws an error if `params` is not a valid
1144
+ `MrcalcEqParamsDict` object.
1145
+
1146
+ Args:
1147
+ params: The parameters object to validate.
1148
+ """
1149
+ if params is None or not isinstance(params, dict):
1150
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1151
+
1152
+
1153
+ def mrcalc_eq_cargs(
1154
+ params: MrcalcEqParamsDict,
1155
+ execution: Execution,
1156
+ ) -> list[str]:
1157
+ """
1158
+ Build command-line arguments from parameters.
1159
+
1160
+ Args:
1161
+ params: The parameters.
1162
+ execution: The execution object for resolving input paths.
1163
+ Returns:
1164
+ Command-line arguments.
1165
+ """
1166
+ cargs = []
1167
+ cargs.append("-eq")
1168
+ return cargs
1169
+
1170
+
1171
+ def mrcalc_neq(
1172
+ ) -> MrcalcNeqParamsDictTagged:
1173
+ """
1174
+ Build parameters.
1175
+
1176
+ Args:
1177
+ Returns:
1178
+ Parameter dictionary
1179
+ """
1180
+ params = {
1181
+ "@type": "neq",
1182
+ }
1183
+ return params
1184
+
1185
+
1186
+ def mrcalc_neq_validate(
1187
+ params: typing.Any,
1188
+ ) -> None:
1189
+ """
1190
+ Validate parameters. Throws an error if `params` is not a valid
1191
+ `MrcalcNeqParamsDict` object.
1192
+
1193
+ Args:
1194
+ params: The parameters object to validate.
1195
+ """
1196
+ if params is None or not isinstance(params, dict):
1197
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1198
+
1199
+
1200
+ def mrcalc_neq_cargs(
1201
+ params: MrcalcNeqParamsDict,
1202
+ execution: Execution,
1203
+ ) -> list[str]:
1204
+ """
1205
+ Build command-line arguments from parameters.
1206
+
1207
+ Args:
1208
+ params: The parameters.
1209
+ execution: The execution object for resolving input paths.
1210
+ Returns:
1211
+ Command-line arguments.
1212
+ """
1213
+ cargs = []
1214
+ cargs.append("-neq")
1215
+ return cargs
1216
+
1217
+
1218
+ def mrcalc_if(
1219
+ ) -> MrcalcIfParamsDictTagged:
1220
+ """
1221
+ Build parameters.
1222
+
1223
+ Args:
1224
+ Returns:
1225
+ Parameter dictionary
1226
+ """
1227
+ params = {
1228
+ "@type": "if",
1229
+ }
1230
+ return params
1231
+
1232
+
1233
+ def mrcalc_if_validate(
1234
+ params: typing.Any,
1235
+ ) -> None:
1236
+ """
1237
+ Validate parameters. Throws an error if `params` is not a valid
1238
+ `MrcalcIfParamsDict` object.
1239
+
1240
+ Args:
1241
+ params: The parameters object to validate.
1242
+ """
1243
+ if params is None or not isinstance(params, dict):
1244
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1245
+
1246
+
1247
+ def mrcalc_if_cargs(
1248
+ params: MrcalcIfParamsDict,
1249
+ execution: Execution,
1250
+ ) -> list[str]:
1251
+ """
1252
+ Build command-line arguments from parameters.
1253
+
1254
+ Args:
1255
+ params: The parameters.
1256
+ execution: The execution object for resolving input paths.
1257
+ Returns:
1258
+ Command-line arguments.
1259
+ """
1260
+ cargs = []
1261
+ cargs.append("-if")
1262
+ return cargs
1263
+
1264
+
1265
+ def mrcalc_replace(
1266
+ ) -> MrcalcReplaceParamsDictTagged:
1267
+ """
1268
+ Build parameters.
1269
+
1270
+ Args:
1271
+ Returns:
1272
+ Parameter dictionary
1273
+ """
1274
+ params = {
1275
+ "@type": "replace",
1276
+ }
1277
+ return params
1278
+
1279
+
1280
+ def mrcalc_replace_validate(
1281
+ params: typing.Any,
1282
+ ) -> None:
1283
+ """
1284
+ Validate parameters. Throws an error if `params` is not a valid
1285
+ `MrcalcReplaceParamsDict` object.
1286
+
1287
+ Args:
1288
+ params: The parameters object to validate.
1289
+ """
1290
+ if params is None or not isinstance(params, dict):
1291
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1292
+
1293
+
1294
+ def mrcalc_replace_cargs(
1295
+ params: MrcalcReplaceParamsDict,
1296
+ execution: Execution,
1297
+ ) -> list[str]:
1298
+ """
1299
+ Build command-line arguments from parameters.
1300
+
1301
+ Args:
1302
+ params: The parameters.
1303
+ execution: The execution object for resolving input paths.
1304
+ Returns:
1305
+ Command-line arguments.
1306
+ """
1307
+ cargs = []
1308
+ cargs.append("-replace")
1309
+ return cargs
1310
+
1311
+
1312
+ def mrcalc_sqrt(
1313
+ ) -> MrcalcSqrtParamsDictTagged:
1314
+ """
1315
+ Build parameters.
1316
+
1317
+ Args:
1318
+ Returns:
1319
+ Parameter dictionary
1320
+ """
1321
+ params = {
1322
+ "@type": "sqrt",
1323
+ }
1324
+ return params
1325
+
1326
+
1327
+ def mrcalc_sqrt_validate(
1328
+ params: typing.Any,
1329
+ ) -> None:
1330
+ """
1331
+ Validate parameters. Throws an error if `params` is not a valid
1332
+ `MrcalcSqrtParamsDict` object.
1333
+
1334
+ Args:
1335
+ params: The parameters object to validate.
1336
+ """
1337
+ if params is None or not isinstance(params, dict):
1338
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1339
+
1340
+
1341
+ def mrcalc_sqrt_cargs(
1342
+ params: MrcalcSqrtParamsDict,
1343
+ execution: Execution,
1344
+ ) -> list[str]:
1345
+ """
1346
+ Build command-line arguments from parameters.
1347
+
1348
+ Args:
1349
+ params: The parameters.
1350
+ execution: The execution object for resolving input paths.
1351
+ Returns:
1352
+ Command-line arguments.
1353
+ """
1354
+ cargs = []
1355
+ cargs.append("-sqrt")
1356
+ return cargs
1357
+
1358
+
1359
+ def mrcalc_pow(
1360
+ ) -> MrcalcPowParamsDictTagged:
1361
+ """
1362
+ Build parameters.
1363
+
1364
+ Args:
1365
+ Returns:
1366
+ Parameter dictionary
1367
+ """
1368
+ params = {
1369
+ "@type": "pow",
1370
+ }
1371
+ return params
1372
+
1373
+
1374
+ def mrcalc_pow_validate(
1375
+ params: typing.Any,
1376
+ ) -> None:
1377
+ """
1378
+ Validate parameters. Throws an error if `params` is not a valid
1379
+ `MrcalcPowParamsDict` object.
1380
+
1381
+ Args:
1382
+ params: The parameters object to validate.
1383
+ """
1384
+ if params is None or not isinstance(params, dict):
1385
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1386
+
1387
+
1388
+ def mrcalc_pow_cargs(
1389
+ params: MrcalcPowParamsDict,
1390
+ execution: Execution,
1391
+ ) -> list[str]:
1392
+ """
1393
+ Build command-line arguments from parameters.
1394
+
1395
+ Args:
1396
+ params: The parameters.
1397
+ execution: The execution object for resolving input paths.
1398
+ Returns:
1399
+ Command-line arguments.
1400
+ """
1401
+ cargs = []
1402
+ cargs.append("-pow")
1403
+ return cargs
1404
+
1405
+
1406
+ def mrcalc_round(
1407
+ ) -> MrcalcRoundParamsDictTagged:
1408
+ """
1409
+ Build parameters.
1410
+
1411
+ Args:
1412
+ Returns:
1413
+ Parameter dictionary
1414
+ """
1415
+ params = {
1416
+ "@type": "round",
1417
+ }
1418
+ return params
1419
+
1420
+
1421
+ def mrcalc_round_validate(
1422
+ params: typing.Any,
1423
+ ) -> None:
1424
+ """
1425
+ Validate parameters. Throws an error if `params` is not a valid
1426
+ `MrcalcRoundParamsDict` object.
1427
+
1428
+ Args:
1429
+ params: The parameters object to validate.
1430
+ """
1431
+ if params is None or not isinstance(params, dict):
1432
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1433
+
1434
+
1435
+ def mrcalc_round_cargs(
1436
+ params: MrcalcRoundParamsDict,
1437
+ execution: Execution,
1438
+ ) -> list[str]:
1439
+ """
1440
+ Build command-line arguments from parameters.
1441
+
1442
+ Args:
1443
+ params: The parameters.
1444
+ execution: The execution object for resolving input paths.
1445
+ Returns:
1446
+ Command-line arguments.
1447
+ """
1448
+ cargs = []
1449
+ cargs.append("-round")
1450
+ return cargs
1451
+
1452
+
1453
+ def mrcalc_ceil(
1454
+ ) -> MrcalcCeilParamsDictTagged:
1455
+ """
1456
+ Build parameters.
1457
+
1458
+ Args:
1459
+ Returns:
1460
+ Parameter dictionary
1461
+ """
1462
+ params = {
1463
+ "@type": "ceil",
1464
+ }
1465
+ return params
1466
+
1467
+
1468
+ def mrcalc_ceil_validate(
1469
+ params: typing.Any,
1470
+ ) -> None:
1471
+ """
1472
+ Validate parameters. Throws an error if `params` is not a valid
1473
+ `MrcalcCeilParamsDict` object.
1474
+
1475
+ Args:
1476
+ params: The parameters object to validate.
1477
+ """
1478
+ if params is None or not isinstance(params, dict):
1479
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1480
+
1481
+
1482
+ def mrcalc_ceil_cargs(
1483
+ params: MrcalcCeilParamsDict,
1484
+ execution: Execution,
1485
+ ) -> list[str]:
1486
+ """
1487
+ Build command-line arguments from parameters.
1488
+
1489
+ Args:
1490
+ params: The parameters.
1491
+ execution: The execution object for resolving input paths.
1492
+ Returns:
1493
+ Command-line arguments.
1494
+ """
1495
+ cargs = []
1496
+ cargs.append("-ceil")
1497
+ return cargs
1498
+
1499
+
1500
+ def mrcalc_floor(
1501
+ ) -> MrcalcFloorParamsDictTagged:
1502
+ """
1503
+ Build parameters.
1504
+
1505
+ Args:
1506
+ Returns:
1507
+ Parameter dictionary
1508
+ """
1509
+ params = {
1510
+ "@type": "floor",
1511
+ }
1512
+ return params
1513
+
1514
+
1515
+ def mrcalc_floor_validate(
1516
+ params: typing.Any,
1517
+ ) -> None:
1518
+ """
1519
+ Validate parameters. Throws an error if `params` is not a valid
1520
+ `MrcalcFloorParamsDict` object.
1521
+
1522
+ Args:
1523
+ params: The parameters object to validate.
1524
+ """
1525
+ if params is None or not isinstance(params, dict):
1526
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1527
+
1528
+
1529
+ def mrcalc_floor_cargs(
1530
+ params: MrcalcFloorParamsDict,
1531
+ execution: Execution,
1532
+ ) -> list[str]:
1533
+ """
1534
+ Build command-line arguments from parameters.
1535
+
1536
+ Args:
1537
+ params: The parameters.
1538
+ execution: The execution object for resolving input paths.
1539
+ Returns:
1540
+ Command-line arguments.
1541
+ """
1542
+ cargs = []
1543
+ cargs.append("-floor")
1544
+ return cargs
1545
+
1546
+
1547
+ def mrcalc_not(
1548
+ ) -> MrcalcNotParamsDictTagged:
1549
+ """
1550
+ Build parameters.
1551
+
1552
+ Args:
1553
+ Returns:
1554
+ Parameter dictionary
1555
+ """
1556
+ params = {
1557
+ "@type": "not",
1558
+ }
1559
+ return params
1560
+
1561
+
1562
+ def mrcalc_not_validate(
1563
+ params: typing.Any,
1564
+ ) -> None:
1565
+ """
1566
+ Validate parameters. Throws an error if `params` is not a valid
1567
+ `MrcalcNotParamsDict` object.
1568
+
1569
+ Args:
1570
+ params: The parameters object to validate.
1571
+ """
1572
+ if params is None or not isinstance(params, dict):
1573
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1574
+
1575
+
1576
+ def mrcalc_not_cargs(
1577
+ params: MrcalcNotParamsDict,
1578
+ execution: Execution,
1579
+ ) -> list[str]:
1580
+ """
1581
+ Build command-line arguments from parameters.
1582
+
1583
+ Args:
1584
+ params: The parameters.
1585
+ execution: The execution object for resolving input paths.
1586
+ Returns:
1587
+ Command-line arguments.
1588
+ """
1589
+ cargs = []
1590
+ cargs.append("-not")
1591
+ return cargs
1592
+
1593
+
1594
+ def mrcalc_and(
1595
+ ) -> MrcalcAndParamsDictTagged:
1596
+ """
1597
+ Build parameters.
1598
+
1599
+ Args:
1600
+ Returns:
1601
+ Parameter dictionary
1602
+ """
1603
+ params = {
1604
+ "@type": "and",
1605
+ }
1606
+ return params
1607
+
1608
+
1609
+ def mrcalc_and_validate(
1610
+ params: typing.Any,
1611
+ ) -> None:
1612
+ """
1613
+ Validate parameters. Throws an error if `params` is not a valid
1614
+ `MrcalcAndParamsDict` object.
1615
+
1616
+ Args:
1617
+ params: The parameters object to validate.
1618
+ """
1619
+ if params is None or not isinstance(params, dict):
1620
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1621
+
1622
+
1623
+ def mrcalc_and_cargs(
1624
+ params: MrcalcAndParamsDict,
1625
+ execution: Execution,
1626
+ ) -> list[str]:
1627
+ """
1628
+ Build command-line arguments from parameters.
1629
+
1630
+ Args:
1631
+ params: The parameters.
1632
+ execution: The execution object for resolving input paths.
1633
+ Returns:
1634
+ Command-line arguments.
1635
+ """
1636
+ cargs = []
1637
+ cargs.append("-and")
1638
+ return cargs
1639
+
1640
+
1641
+ def mrcalc_or(
1642
+ ) -> MrcalcOrParamsDictTagged:
1643
+ """
1644
+ Build parameters.
1645
+
1646
+ Args:
1647
+ Returns:
1648
+ Parameter dictionary
1649
+ """
1650
+ params = {
1651
+ "@type": "or",
1652
+ }
1653
+ return params
1654
+
1655
+
1656
+ def mrcalc_or_validate(
1657
+ params: typing.Any,
1658
+ ) -> None:
1659
+ """
1660
+ Validate parameters. Throws an error if `params` is not a valid
1661
+ `MrcalcOrParamsDict` object.
1662
+
1663
+ Args:
1664
+ params: The parameters object to validate.
1665
+ """
1666
+ if params is None or not isinstance(params, dict):
1667
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1668
+
1669
+
1670
+ def mrcalc_or_cargs(
1671
+ params: MrcalcOrParamsDict,
1672
+ execution: Execution,
1673
+ ) -> list[str]:
1674
+ """
1675
+ Build command-line arguments from parameters.
1676
+
1677
+ Args:
1678
+ params: The parameters.
1679
+ execution: The execution object for resolving input paths.
1680
+ Returns:
1681
+ Command-line arguments.
1682
+ """
1683
+ cargs = []
1684
+ cargs.append("-or")
1685
+ return cargs
1686
+
1687
+
1688
+ def mrcalc_xor(
1689
+ ) -> MrcalcXorParamsDictTagged:
1690
+ """
1691
+ Build parameters.
1692
+
1693
+ Args:
1694
+ Returns:
1695
+ Parameter dictionary
1696
+ """
1697
+ params = {
1698
+ "@type": "xor",
1699
+ }
1700
+ return params
1701
+
1702
+
1703
+ def mrcalc_xor_validate(
1704
+ params: typing.Any,
1705
+ ) -> None:
1706
+ """
1707
+ Validate parameters. Throws an error if `params` is not a valid
1708
+ `MrcalcXorParamsDict` object.
1709
+
1710
+ Args:
1711
+ params: The parameters object to validate.
1712
+ """
1713
+ if params is None or not isinstance(params, dict):
1714
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1715
+
1716
+
1717
+ def mrcalc_xor_cargs(
1718
+ params: MrcalcXorParamsDict,
1719
+ execution: Execution,
1720
+ ) -> list[str]:
1721
+ """
1722
+ Build command-line arguments from parameters.
1723
+
1724
+ Args:
1725
+ params: The parameters.
1726
+ execution: The execution object for resolving input paths.
1727
+ Returns:
1728
+ Command-line arguments.
1729
+ """
1730
+ cargs = []
1731
+ cargs.append("-xor")
1732
+ return cargs
1733
+
1734
+
1735
+ def mrcalc_isnan(
1736
+ ) -> MrcalcIsnanParamsDictTagged:
1737
+ """
1738
+ Build parameters.
1739
+
1740
+ Args:
1741
+ Returns:
1742
+ Parameter dictionary
1743
+ """
1744
+ params = {
1745
+ "@type": "isnan",
1746
+ }
1747
+ return params
1748
+
1749
+
1750
+ def mrcalc_isnan_validate(
1751
+ params: typing.Any,
1752
+ ) -> None:
1753
+ """
1754
+ Validate parameters. Throws an error if `params` is not a valid
1755
+ `MrcalcIsnanParamsDict` object.
1756
+
1757
+ Args:
1758
+ params: The parameters object to validate.
1759
+ """
1760
+ if params is None or not isinstance(params, dict):
1761
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1762
+
1763
+
1764
+ def mrcalc_isnan_cargs(
1765
+ params: MrcalcIsnanParamsDict,
1766
+ execution: Execution,
1767
+ ) -> list[str]:
1768
+ """
1769
+ Build command-line arguments from parameters.
1770
+
1771
+ Args:
1772
+ params: The parameters.
1773
+ execution: The execution object for resolving input paths.
1774
+ Returns:
1775
+ Command-line arguments.
1776
+ """
1777
+ cargs = []
1778
+ cargs.append("-isnan")
1779
+ return cargs
1780
+
1781
+
1782
+ def mrcalc_isinf(
1783
+ ) -> MrcalcIsinfParamsDictTagged:
1784
+ """
1785
+ Build parameters.
1786
+
1787
+ Args:
1788
+ Returns:
1789
+ Parameter dictionary
1790
+ """
1791
+ params = {
1792
+ "@type": "isinf",
1793
+ }
1794
+ return params
1795
+
1796
+
1797
+ def mrcalc_isinf_validate(
1798
+ params: typing.Any,
1799
+ ) -> None:
1800
+ """
1801
+ Validate parameters. Throws an error if `params` is not a valid
1802
+ `MrcalcIsinfParamsDict` object.
1803
+
1804
+ Args:
1805
+ params: The parameters object to validate.
1806
+ """
1807
+ if params is None or not isinstance(params, dict):
1808
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1809
+
1810
+
1811
+ def mrcalc_isinf_cargs(
1812
+ params: MrcalcIsinfParamsDict,
1813
+ execution: Execution,
1814
+ ) -> list[str]:
1815
+ """
1816
+ Build command-line arguments from parameters.
1817
+
1818
+ Args:
1819
+ params: The parameters.
1820
+ execution: The execution object for resolving input paths.
1821
+ Returns:
1822
+ Command-line arguments.
1823
+ """
1824
+ cargs = []
1825
+ cargs.append("-isinf")
1826
+ return cargs
1827
+
1828
+
1829
+ def mrcalc_finite(
1830
+ ) -> MrcalcFiniteParamsDictTagged:
1831
+ """
1832
+ Build parameters.
1833
+
1834
+ Args:
1835
+ Returns:
1836
+ Parameter dictionary
1837
+ """
1838
+ params = {
1839
+ "@type": "finite",
1840
+ }
1841
+ return params
1842
+
1843
+
1844
+ def mrcalc_finite_validate(
1845
+ params: typing.Any,
1846
+ ) -> None:
1847
+ """
1848
+ Validate parameters. Throws an error if `params` is not a valid
1849
+ `MrcalcFiniteParamsDict` object.
1850
+
1851
+ Args:
1852
+ params: The parameters object to validate.
1853
+ """
1854
+ if params is None or not isinstance(params, dict):
1855
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1856
+
1857
+
1858
+ def mrcalc_finite_cargs(
1859
+ params: MrcalcFiniteParamsDict,
1860
+ execution: Execution,
1861
+ ) -> list[str]:
1862
+ """
1863
+ Build command-line arguments from parameters.
1864
+
1865
+ Args:
1866
+ params: The parameters.
1867
+ execution: The execution object for resolving input paths.
1868
+ Returns:
1869
+ Command-line arguments.
1870
+ """
1871
+ cargs = []
1872
+ cargs.append("-finite")
1873
+ return cargs
1874
+
1875
+
1876
+ def mrcalc_complex(
1877
+ ) -> MrcalcComplexParamsDictTagged:
1878
+ """
1879
+ Build parameters.
1880
+
1881
+ Args:
1882
+ Returns:
1883
+ Parameter dictionary
1884
+ """
1885
+ params = {
1886
+ "@type": "complex",
1887
+ }
1888
+ return params
1889
+
1890
+
1891
+ def mrcalc_complex_validate(
1892
+ params: typing.Any,
1893
+ ) -> None:
1894
+ """
1895
+ Validate parameters. Throws an error if `params` is not a valid
1896
+ `MrcalcComplexParamsDict` object.
1897
+
1898
+ Args:
1899
+ params: The parameters object to validate.
1900
+ """
1901
+ if params is None or not isinstance(params, dict):
1902
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1903
+
1904
+
1905
+ def mrcalc_complex_cargs(
1906
+ params: MrcalcComplexParamsDict,
1907
+ execution: Execution,
1908
+ ) -> list[str]:
1909
+ """
1910
+ Build command-line arguments from parameters.
1911
+
1912
+ Args:
1913
+ params: The parameters.
1914
+ execution: The execution object for resolving input paths.
1915
+ Returns:
1916
+ Command-line arguments.
1917
+ """
1918
+ cargs = []
1919
+ cargs.append("-complex")
1920
+ return cargs
1921
+
1922
+
1923
+ def mrcalc_polar(
1924
+ ) -> MrcalcPolarParamsDictTagged:
1925
+ """
1926
+ Build parameters.
1927
+
1928
+ Args:
1929
+ Returns:
1930
+ Parameter dictionary
1931
+ """
1932
+ params = {
1933
+ "@type": "polar",
1934
+ }
1935
+ return params
1936
+
1937
+
1938
+ def mrcalc_polar_validate(
1939
+ params: typing.Any,
1940
+ ) -> None:
1941
+ """
1942
+ Validate parameters. Throws an error if `params` is not a valid
1943
+ `MrcalcPolarParamsDict` object.
1944
+
1945
+ Args:
1946
+ params: The parameters object to validate.
1947
+ """
1948
+ if params is None or not isinstance(params, dict):
1949
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1950
+
1951
+
1952
+ def mrcalc_polar_cargs(
1953
+ params: MrcalcPolarParamsDict,
1954
+ execution: Execution,
1955
+ ) -> list[str]:
1956
+ """
1957
+ Build command-line arguments from parameters.
1958
+
1959
+ Args:
1960
+ params: The parameters.
1961
+ execution: The execution object for resolving input paths.
1962
+ Returns:
1963
+ Command-line arguments.
1964
+ """
1965
+ cargs = []
1966
+ cargs.append("-polar")
1967
+ return cargs
1968
+
1969
+
1970
+ def mrcalc_real(
1971
+ ) -> MrcalcRealParamsDictTagged:
1972
+ """
1973
+ Build parameters.
1974
+
1975
+ Args:
1976
+ Returns:
1977
+ Parameter dictionary
1978
+ """
1979
+ params = {
1980
+ "@type": "real",
1981
+ }
1982
+ return params
1983
+
1984
+
1985
+ def mrcalc_real_validate(
1986
+ params: typing.Any,
1987
+ ) -> None:
1988
+ """
1989
+ Validate parameters. Throws an error if `params` is not a valid
1990
+ `MrcalcRealParamsDict` object.
1991
+
1992
+ Args:
1993
+ params: The parameters object to validate.
1994
+ """
1995
+ if params is None or not isinstance(params, dict):
1996
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
1997
+
1998
+
1999
+ def mrcalc_real_cargs(
2000
+ params: MrcalcRealParamsDict,
2001
+ execution: Execution,
2002
+ ) -> list[str]:
2003
+ """
2004
+ Build command-line arguments from parameters.
2005
+
2006
+ Args:
2007
+ params: The parameters.
2008
+ execution: The execution object for resolving input paths.
2009
+ Returns:
2010
+ Command-line arguments.
2011
+ """
2012
+ cargs = []
2013
+ cargs.append("-real")
2014
+ return cargs
2015
+
2016
+
2017
+ def mrcalc_imag(
2018
+ ) -> MrcalcImagParamsDictTagged:
2019
+ """
2020
+ Build parameters.
2021
+
2022
+ Args:
2023
+ Returns:
2024
+ Parameter dictionary
2025
+ """
2026
+ params = {
2027
+ "@type": "imag",
2028
+ }
2029
+ return params
2030
+
2031
+
2032
+ def mrcalc_imag_validate(
2033
+ params: typing.Any,
2034
+ ) -> None:
2035
+ """
2036
+ Validate parameters. Throws an error if `params` is not a valid
2037
+ `MrcalcImagParamsDict` object.
2038
+
2039
+ Args:
2040
+ params: The parameters object to validate.
2041
+ """
2042
+ if params is None or not isinstance(params, dict):
2043
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2044
+
2045
+
2046
+ def mrcalc_imag_cargs(
2047
+ params: MrcalcImagParamsDict,
2048
+ execution: Execution,
2049
+ ) -> list[str]:
2050
+ """
2051
+ Build command-line arguments from parameters.
2052
+
2053
+ Args:
2054
+ params: The parameters.
2055
+ execution: The execution object for resolving input paths.
2056
+ Returns:
2057
+ Command-line arguments.
2058
+ """
2059
+ cargs = []
2060
+ cargs.append("-imag")
2061
+ return cargs
2062
+
2063
+
2064
+ def mrcalc_phase(
2065
+ ) -> MrcalcPhaseParamsDictTagged:
2066
+ """
2067
+ Build parameters.
2068
+
2069
+ Args:
2070
+ Returns:
2071
+ Parameter dictionary
2072
+ """
2073
+ params = {
2074
+ "@type": "phase",
2075
+ }
2076
+ return params
2077
+
2078
+
2079
+ def mrcalc_phase_validate(
2080
+ params: typing.Any,
2081
+ ) -> None:
2082
+ """
2083
+ Validate parameters. Throws an error if `params` is not a valid
2084
+ `MrcalcPhaseParamsDict` object.
2085
+
2086
+ Args:
2087
+ params: The parameters object to validate.
2088
+ """
2089
+ if params is None or not isinstance(params, dict):
2090
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2091
+
2092
+
2093
+ def mrcalc_phase_cargs(
2094
+ params: MrcalcPhaseParamsDict,
2095
+ execution: Execution,
2096
+ ) -> list[str]:
2097
+ """
2098
+ Build command-line arguments from parameters.
2099
+
2100
+ Args:
2101
+ params: The parameters.
2102
+ execution: The execution object for resolving input paths.
2103
+ Returns:
2104
+ Command-line arguments.
2105
+ """
2106
+ cargs = []
2107
+ cargs.append("-phase")
2108
+ return cargs
2109
+
2110
+
2111
+ def mrcalc_conj(
2112
+ ) -> MrcalcConjParamsDictTagged:
2113
+ """
2114
+ Build parameters.
2115
+
2116
+ Args:
2117
+ Returns:
2118
+ Parameter dictionary
2119
+ """
2120
+ params = {
2121
+ "@type": "conj",
2122
+ }
2123
+ return params
2124
+
2125
+
2126
+ def mrcalc_conj_validate(
2127
+ params: typing.Any,
2128
+ ) -> None:
2129
+ """
2130
+ Validate parameters. Throws an error if `params` is not a valid
2131
+ `MrcalcConjParamsDict` object.
2132
+
2133
+ Args:
2134
+ params: The parameters object to validate.
2135
+ """
2136
+ if params is None or not isinstance(params, dict):
2137
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2138
+
2139
+
2140
+ def mrcalc_conj_cargs(
2141
+ params: MrcalcConjParamsDict,
2142
+ execution: Execution,
2143
+ ) -> list[str]:
2144
+ """
2145
+ Build command-line arguments from parameters.
2146
+
2147
+ Args:
2148
+ params: The parameters.
2149
+ execution: The execution object for resolving input paths.
2150
+ Returns:
2151
+ Command-line arguments.
2152
+ """
2153
+ cargs = []
2154
+ cargs.append("-conj")
2155
+ return cargs
2156
+
2157
+
2158
+ def mrcalc_proj(
2159
+ ) -> MrcalcProjParamsDictTagged:
2160
+ """
2161
+ Build parameters.
2162
+
2163
+ Args:
2164
+ Returns:
2165
+ Parameter dictionary
2166
+ """
2167
+ params = {
2168
+ "@type": "proj",
2169
+ }
2170
+ return params
2171
+
2172
+
2173
+ def mrcalc_proj_validate(
2174
+ params: typing.Any,
2175
+ ) -> None:
2176
+ """
2177
+ Validate parameters. Throws an error if `params` is not a valid
2178
+ `MrcalcProjParamsDict` object.
2179
+
2180
+ Args:
2181
+ params: The parameters object to validate.
2182
+ """
2183
+ if params is None or not isinstance(params, dict):
2184
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2185
+
2186
+
2187
+ def mrcalc_proj_cargs(
2188
+ params: MrcalcProjParamsDict,
2189
+ execution: Execution,
2190
+ ) -> list[str]:
2191
+ """
2192
+ Build command-line arguments from parameters.
2193
+
2194
+ Args:
2195
+ params: The parameters.
2196
+ execution: The execution object for resolving input paths.
2197
+ Returns:
2198
+ Command-line arguments.
2199
+ """
2200
+ cargs = []
2201
+ cargs.append("-proj")
2202
+ return cargs
2203
+
2204
+
2205
+ def mrcalc_exp(
2206
+ ) -> MrcalcExpParamsDictTagged:
2207
+ """
2208
+ Build parameters.
2209
+
2210
+ Args:
2211
+ Returns:
2212
+ Parameter dictionary
2213
+ """
2214
+ params = {
2215
+ "@type": "exp",
2216
+ }
2217
+ return params
2218
+
2219
+
2220
+ def mrcalc_exp_validate(
2221
+ params: typing.Any,
2222
+ ) -> None:
2223
+ """
2224
+ Validate parameters. Throws an error if `params` is not a valid
2225
+ `MrcalcExpParamsDict` object.
2226
+
2227
+ Args:
2228
+ params: The parameters object to validate.
2229
+ """
2230
+ if params is None or not isinstance(params, dict):
2231
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2232
+
2233
+
2234
+ def mrcalc_exp_cargs(
2235
+ params: MrcalcExpParamsDict,
2236
+ execution: Execution,
2237
+ ) -> list[str]:
2238
+ """
2239
+ Build command-line arguments from parameters.
2240
+
2241
+ Args:
2242
+ params: The parameters.
2243
+ execution: The execution object for resolving input paths.
2244
+ Returns:
2245
+ Command-line arguments.
2246
+ """
2247
+ cargs = []
2248
+ cargs.append("-exp")
2249
+ return cargs
2250
+
2251
+
2252
+ def mrcalc_log(
2253
+ ) -> MrcalcLogParamsDictTagged:
2254
+ """
2255
+ Build parameters.
2256
+
2257
+ Args:
2258
+ Returns:
2259
+ Parameter dictionary
2260
+ """
2261
+ params = {
2262
+ "@type": "log",
2263
+ }
2264
+ return params
2265
+
2266
+
2267
+ def mrcalc_log_validate(
2268
+ params: typing.Any,
2269
+ ) -> None:
2270
+ """
2271
+ Validate parameters. Throws an error if `params` is not a valid
2272
+ `MrcalcLogParamsDict` object.
2273
+
2274
+ Args:
2275
+ params: The parameters object to validate.
2276
+ """
2277
+ if params is None or not isinstance(params, dict):
2278
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2279
+
2280
+
2281
+ def mrcalc_log_cargs(
2282
+ params: MrcalcLogParamsDict,
2283
+ execution: Execution,
2284
+ ) -> list[str]:
2285
+ """
2286
+ Build command-line arguments from parameters.
2287
+
2288
+ Args:
2289
+ params: The parameters.
2290
+ execution: The execution object for resolving input paths.
2291
+ Returns:
2292
+ Command-line arguments.
2293
+ """
2294
+ cargs = []
2295
+ cargs.append("-log")
2296
+ return cargs
2297
+
2298
+
2299
+ def mrcalc_log10(
2300
+ ) -> MrcalcLog10ParamsDictTagged:
2301
+ """
2302
+ Build parameters.
2303
+
2304
+ Args:
2305
+ Returns:
2306
+ Parameter dictionary
2307
+ """
2308
+ params = {
2309
+ "@type": "log10",
2310
+ }
2311
+ return params
2312
+
2313
+
2314
+ def mrcalc_log10_validate(
2315
+ params: typing.Any,
2316
+ ) -> None:
2317
+ """
2318
+ Validate parameters. Throws an error if `params` is not a valid
2319
+ `MrcalcLog10ParamsDict` object.
2320
+
2321
+ Args:
2322
+ params: The parameters object to validate.
2323
+ """
2324
+ if params is None or not isinstance(params, dict):
2325
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2326
+
2327
+
2328
+ def mrcalc_log10_cargs(
2329
+ params: MrcalcLog10ParamsDict,
2330
+ execution: Execution,
2331
+ ) -> list[str]:
2332
+ """
2333
+ Build command-line arguments from parameters.
2334
+
2335
+ Args:
2336
+ params: The parameters.
2337
+ execution: The execution object for resolving input paths.
2338
+ Returns:
2339
+ Command-line arguments.
2340
+ """
2341
+ cargs = []
2342
+ cargs.append("-log10")
2343
+ return cargs
2344
+
2345
+
2346
+ def mrcalc_cos(
2347
+ ) -> MrcalcCosParamsDictTagged:
2348
+ """
2349
+ Build parameters.
2350
+
2351
+ Args:
2352
+ Returns:
2353
+ Parameter dictionary
2354
+ """
2355
+ params = {
2356
+ "@type": "cos",
2357
+ }
2358
+ return params
2359
+
2360
+
2361
+ def mrcalc_cos_validate(
2362
+ params: typing.Any,
2363
+ ) -> None:
2364
+ """
2365
+ Validate parameters. Throws an error if `params` is not a valid
2366
+ `MrcalcCosParamsDict` object.
2367
+
2368
+ Args:
2369
+ params: The parameters object to validate.
2370
+ """
2371
+ if params is None or not isinstance(params, dict):
2372
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2373
+
2374
+
2375
+ def mrcalc_cos_cargs(
2376
+ params: MrcalcCosParamsDict,
2377
+ execution: Execution,
2378
+ ) -> list[str]:
2379
+ """
2380
+ Build command-line arguments from parameters.
2381
+
2382
+ Args:
2383
+ params: The parameters.
2384
+ execution: The execution object for resolving input paths.
2385
+ Returns:
2386
+ Command-line arguments.
2387
+ """
2388
+ cargs = []
2389
+ cargs.append("-cos")
2390
+ return cargs
2391
+
2392
+
2393
+ def mrcalc_sin(
2394
+ ) -> MrcalcSinParamsDictTagged:
2395
+ """
2396
+ Build parameters.
2397
+
2398
+ Args:
2399
+ Returns:
2400
+ Parameter dictionary
2401
+ """
2402
+ params = {
2403
+ "@type": "sin",
2404
+ }
2405
+ return params
2406
+
2407
+
2408
+ def mrcalc_sin_validate(
2409
+ params: typing.Any,
2410
+ ) -> None:
2411
+ """
2412
+ Validate parameters. Throws an error if `params` is not a valid
2413
+ `MrcalcSinParamsDict` object.
2414
+
2415
+ Args:
2416
+ params: The parameters object to validate.
2417
+ """
2418
+ if params is None or not isinstance(params, dict):
2419
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2420
+
2421
+
2422
+ def mrcalc_sin_cargs(
2423
+ params: MrcalcSinParamsDict,
2424
+ execution: Execution,
2425
+ ) -> list[str]:
2426
+ """
2427
+ Build command-line arguments from parameters.
2428
+
2429
+ Args:
2430
+ params: The parameters.
2431
+ execution: The execution object for resolving input paths.
2432
+ Returns:
2433
+ Command-line arguments.
2434
+ """
2435
+ cargs = []
2436
+ cargs.append("-sin")
2437
+ return cargs
2438
+
2439
+
2440
+ def mrcalc_tan(
2441
+ ) -> MrcalcTanParamsDictTagged:
2442
+ """
2443
+ Build parameters.
2444
+
2445
+ Args:
2446
+ Returns:
2447
+ Parameter dictionary
2448
+ """
2449
+ params = {
2450
+ "@type": "tan",
2451
+ }
2452
+ return params
2453
+
2454
+
2455
+ def mrcalc_tan_validate(
2456
+ params: typing.Any,
2457
+ ) -> None:
2458
+ """
2459
+ Validate parameters. Throws an error if `params` is not a valid
2460
+ `MrcalcTanParamsDict` object.
2461
+
2462
+ Args:
2463
+ params: The parameters object to validate.
2464
+ """
2465
+ if params is None or not isinstance(params, dict):
2466
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2467
+
2468
+
2469
+ def mrcalc_tan_cargs(
2470
+ params: MrcalcTanParamsDict,
2471
+ execution: Execution,
2472
+ ) -> list[str]:
2473
+ """
2474
+ Build command-line arguments from parameters.
2475
+
2476
+ Args:
2477
+ params: The parameters.
2478
+ execution: The execution object for resolving input paths.
2479
+ Returns:
2480
+ Command-line arguments.
2481
+ """
2482
+ cargs = []
2483
+ cargs.append("-tan")
2484
+ return cargs
2485
+
2486
+
2487
+ def mrcalc_acos(
2488
+ ) -> MrcalcAcosParamsDictTagged:
2489
+ """
2490
+ Build parameters.
2491
+
2492
+ Args:
2493
+ Returns:
2494
+ Parameter dictionary
2495
+ """
2496
+ params = {
2497
+ "@type": "acos",
2498
+ }
2499
+ return params
2500
+
2501
+
2502
+ def mrcalc_acos_validate(
2503
+ params: typing.Any,
2504
+ ) -> None:
2505
+ """
2506
+ Validate parameters. Throws an error if `params` is not a valid
2507
+ `MrcalcAcosParamsDict` object.
2508
+
2509
+ Args:
2510
+ params: The parameters object to validate.
2511
+ """
2512
+ if params is None or not isinstance(params, dict):
2513
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2514
+
2515
+
2516
+ def mrcalc_acos_cargs(
2517
+ params: MrcalcAcosParamsDict,
2518
+ execution: Execution,
2519
+ ) -> list[str]:
2520
+ """
2521
+ Build command-line arguments from parameters.
2522
+
2523
+ Args:
2524
+ params: The parameters.
2525
+ execution: The execution object for resolving input paths.
2526
+ Returns:
2527
+ Command-line arguments.
2528
+ """
2529
+ cargs = []
2530
+ cargs.append("-acos")
2531
+ return cargs
2532
+
2533
+
2534
+ def mrcalc_asin(
2535
+ ) -> MrcalcAsinParamsDictTagged:
2536
+ """
2537
+ Build parameters.
2538
+
2539
+ Args:
2540
+ Returns:
2541
+ Parameter dictionary
2542
+ """
2543
+ params = {
2544
+ "@type": "asin",
2545
+ }
2546
+ return params
2547
+
2548
+
2549
+ def mrcalc_asin_validate(
2550
+ params: typing.Any,
2551
+ ) -> None:
2552
+ """
2553
+ Validate parameters. Throws an error if `params` is not a valid
2554
+ `MrcalcAsinParamsDict` object.
2555
+
2556
+ Args:
2557
+ params: The parameters object to validate.
2558
+ """
2559
+ if params is None or not isinstance(params, dict):
2560
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2561
+
2562
+
2563
+ def mrcalc_asin_cargs(
2564
+ params: MrcalcAsinParamsDict,
2565
+ execution: Execution,
2566
+ ) -> list[str]:
2567
+ """
2568
+ Build command-line arguments from parameters.
2569
+
2570
+ Args:
2571
+ params: The parameters.
2572
+ execution: The execution object for resolving input paths.
2573
+ Returns:
2574
+ Command-line arguments.
2575
+ """
2576
+ cargs = []
2577
+ cargs.append("-asin")
2578
+ return cargs
2579
+
2580
+
2581
+ def mrcalc_atan(
2582
+ ) -> MrcalcAtanParamsDictTagged:
2583
+ """
2584
+ Build parameters.
2585
+
2586
+ Args:
2587
+ Returns:
2588
+ Parameter dictionary
2589
+ """
2590
+ params = {
2591
+ "@type": "atan",
2592
+ }
2593
+ return params
2594
+
2595
+
2596
+ def mrcalc_atan_validate(
2597
+ params: typing.Any,
2598
+ ) -> None:
2599
+ """
2600
+ Validate parameters. Throws an error if `params` is not a valid
2601
+ `MrcalcAtanParamsDict` object.
2602
+
2603
+ Args:
2604
+ params: The parameters object to validate.
2605
+ """
2606
+ if params is None or not isinstance(params, dict):
2607
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2608
+
2609
+
2610
+ def mrcalc_atan_cargs(
2611
+ params: MrcalcAtanParamsDict,
2612
+ execution: Execution,
2613
+ ) -> list[str]:
2614
+ """
2615
+ Build command-line arguments from parameters.
2616
+
2617
+ Args:
2618
+ params: The parameters.
2619
+ execution: The execution object for resolving input paths.
2620
+ Returns:
2621
+ Command-line arguments.
2622
+ """
2623
+ cargs = []
2624
+ cargs.append("-atan")
2625
+ return cargs
2626
+
2627
+
2628
+ def mrcalc_cosh(
2629
+ ) -> MrcalcCoshParamsDictTagged:
2630
+ """
2631
+ Build parameters.
2632
+
2633
+ Args:
2634
+ Returns:
2635
+ Parameter dictionary
2636
+ """
2637
+ params = {
2638
+ "@type": "cosh",
2639
+ }
2640
+ return params
2641
+
2642
+
2643
+ def mrcalc_cosh_validate(
2644
+ params: typing.Any,
2645
+ ) -> None:
2646
+ """
2647
+ Validate parameters. Throws an error if `params` is not a valid
2648
+ `MrcalcCoshParamsDict` object.
2649
+
2650
+ Args:
2651
+ params: The parameters object to validate.
2652
+ """
2653
+ if params is None or not isinstance(params, dict):
2654
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2655
+
2656
+
2657
+ def mrcalc_cosh_cargs(
2658
+ params: MrcalcCoshParamsDict,
2659
+ execution: Execution,
2660
+ ) -> list[str]:
2661
+ """
2662
+ Build command-line arguments from parameters.
2663
+
2664
+ Args:
2665
+ params: The parameters.
2666
+ execution: The execution object for resolving input paths.
2667
+ Returns:
2668
+ Command-line arguments.
2669
+ """
2670
+ cargs = []
2671
+ cargs.append("-cosh")
2672
+ return cargs
2673
+
2674
+
2675
+ def mrcalc_sinh(
2676
+ ) -> MrcalcSinhParamsDictTagged:
2677
+ """
2678
+ Build parameters.
2679
+
2680
+ Args:
2681
+ Returns:
2682
+ Parameter dictionary
2683
+ """
2684
+ params = {
2685
+ "@type": "sinh",
2686
+ }
2687
+ return params
2688
+
2689
+
2690
+ def mrcalc_sinh_validate(
2691
+ params: typing.Any,
2692
+ ) -> None:
2693
+ """
2694
+ Validate parameters. Throws an error if `params` is not a valid
2695
+ `MrcalcSinhParamsDict` object.
2696
+
2697
+ Args:
2698
+ params: The parameters object to validate.
2699
+ """
2700
+ if params is None or not isinstance(params, dict):
2701
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2702
+
2703
+
2704
+ def mrcalc_sinh_cargs(
2705
+ params: MrcalcSinhParamsDict,
2706
+ execution: Execution,
2707
+ ) -> list[str]:
2708
+ """
2709
+ Build command-line arguments from parameters.
2710
+
2711
+ Args:
2712
+ params: The parameters.
2713
+ execution: The execution object for resolving input paths.
2714
+ Returns:
2715
+ Command-line arguments.
2716
+ """
2717
+ cargs = []
2718
+ cargs.append("-sinh")
2719
+ return cargs
2720
+
2721
+
2722
+ def mrcalc_tanh(
2723
+ ) -> MrcalcTanhParamsDictTagged:
2724
+ """
2725
+ Build parameters.
2726
+
2727
+ Args:
2728
+ Returns:
2729
+ Parameter dictionary
2730
+ """
2731
+ params = {
2732
+ "@type": "tanh",
2733
+ }
2734
+ return params
2735
+
2736
+
2737
+ def mrcalc_tanh_validate(
2738
+ params: typing.Any,
2739
+ ) -> None:
2740
+ """
2741
+ Validate parameters. Throws an error if `params` is not a valid
2742
+ `MrcalcTanhParamsDict` object.
2743
+
2744
+ Args:
2745
+ params: The parameters object to validate.
2746
+ """
2747
+ if params is None or not isinstance(params, dict):
2748
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2749
+
2750
+
2751
+ def mrcalc_tanh_cargs(
2752
+ params: MrcalcTanhParamsDict,
2753
+ execution: Execution,
2754
+ ) -> list[str]:
2755
+ """
2756
+ Build command-line arguments from parameters.
2757
+
2758
+ Args:
2759
+ params: The parameters.
2760
+ execution: The execution object for resolving input paths.
2761
+ Returns:
2762
+ Command-line arguments.
2763
+ """
2764
+ cargs = []
2765
+ cargs.append("-tanh")
2766
+ return cargs
2767
+
2768
+
2769
+ def mrcalc_acosh(
2770
+ ) -> MrcalcAcoshParamsDictTagged:
2771
+ """
2772
+ Build parameters.
2773
+
2774
+ Args:
2775
+ Returns:
2776
+ Parameter dictionary
2777
+ """
2778
+ params = {
2779
+ "@type": "acosh",
2780
+ }
2781
+ return params
2782
+
2783
+
2784
+ def mrcalc_acosh_validate(
2785
+ params: typing.Any,
2786
+ ) -> None:
2787
+ """
2788
+ Validate parameters. Throws an error if `params` is not a valid
2789
+ `MrcalcAcoshParamsDict` object.
2790
+
2791
+ Args:
2792
+ params: The parameters object to validate.
2793
+ """
2794
+ if params is None or not isinstance(params, dict):
2795
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2796
+
2797
+
2798
+ def mrcalc_acosh_cargs(
2799
+ params: MrcalcAcoshParamsDict,
2800
+ execution: Execution,
2801
+ ) -> list[str]:
2802
+ """
2803
+ Build command-line arguments from parameters.
2804
+
2805
+ Args:
2806
+ params: The parameters.
2807
+ execution: The execution object for resolving input paths.
2808
+ Returns:
2809
+ Command-line arguments.
2810
+ """
2811
+ cargs = []
2812
+ cargs.append("-acosh")
2813
+ return cargs
2814
+
2815
+
2816
+ def mrcalc_asinh(
2817
+ ) -> MrcalcAsinhParamsDictTagged:
2818
+ """
2819
+ Build parameters.
2820
+
2821
+ Args:
2822
+ Returns:
2823
+ Parameter dictionary
2824
+ """
2825
+ params = {
2826
+ "@type": "asinh",
2827
+ }
2828
+ return params
2829
+
2830
+
2831
+ def mrcalc_asinh_validate(
2832
+ params: typing.Any,
2833
+ ) -> None:
2834
+ """
2835
+ Validate parameters. Throws an error if `params` is not a valid
2836
+ `MrcalcAsinhParamsDict` object.
2837
+
2838
+ Args:
2839
+ params: The parameters object to validate.
2840
+ """
2841
+ if params is None or not isinstance(params, dict):
2842
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2843
+
2844
+
2845
+ def mrcalc_asinh_cargs(
2846
+ params: MrcalcAsinhParamsDict,
2847
+ execution: Execution,
2848
+ ) -> list[str]:
2849
+ """
2850
+ Build command-line arguments from parameters.
2851
+
2852
+ Args:
2853
+ params: The parameters.
2854
+ execution: The execution object for resolving input paths.
2855
+ Returns:
2856
+ Command-line arguments.
2857
+ """
2858
+ cargs = []
2859
+ cargs.append("-asinh")
2860
+ return cargs
2861
+
2862
+
2863
+ def mrcalc_atanh(
2864
+ ) -> MrcalcAtanhParamsDictTagged:
2865
+ """
2866
+ Build parameters.
2867
+
2868
+ Args:
2869
+ Returns:
2870
+ Parameter dictionary
2871
+ """
2872
+ params = {
2873
+ "@type": "atanh",
2874
+ }
2875
+ return params
2876
+
2877
+
2878
+ def mrcalc_atanh_validate(
2879
+ params: typing.Any,
2880
+ ) -> None:
2881
+ """
2882
+ Validate parameters. Throws an error if `params` is not a valid
2883
+ `MrcalcAtanhParamsDict` object.
2884
+
2885
+ Args:
2886
+ params: The parameters object to validate.
2887
+ """
2888
+ if params is None or not isinstance(params, dict):
2889
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2890
+
2891
+
2892
+ def mrcalc_atanh_cargs(
2893
+ params: MrcalcAtanhParamsDict,
2894
+ execution: Execution,
2895
+ ) -> list[str]:
2896
+ """
2897
+ Build command-line arguments from parameters.
2898
+
2899
+ Args:
2900
+ params: The parameters.
2901
+ execution: The execution object for resolving input paths.
2902
+ Returns:
2903
+ Command-line arguments.
2904
+ """
2905
+ cargs = []
2906
+ cargs.append("-atanh")
2907
+ return cargs
2908
+
2909
+
2910
+ def mrcalc_config(
2911
+ key: str,
2912
+ value: str,
2913
+ ) -> MrcalcConfigParamsDictTagged:
2914
+ """
2915
+ Build parameters.
2916
+
2917
+ Args:
2918
+ key: temporarily set the value of an MRtrix config file entry.
2919
+ value: temporarily set the value of an MRtrix config file entry.
2920
+ Returns:
2921
+ Parameter dictionary
2922
+ """
2923
+ params = {
2924
+ "@type": "config",
2925
+ "key": key,
2926
+ "value": value,
2927
+ }
2928
+ return params
2929
+
2930
+
2931
+ def mrcalc_config_validate(
2932
+ params: typing.Any,
2933
+ ) -> None:
2934
+ """
2935
+ Validate parameters. Throws an error if `params` is not a valid
2936
+ `MrcalcConfigParamsDict` object.
2937
+
2938
+ Args:
2939
+ params: The parameters object to validate.
2940
+ """
2941
+ if params is None or not isinstance(params, dict):
2942
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
2943
+ if params.get("key", None) is None:
2944
+ raise StyxValidationError("`key` must not be None")
2945
+ if not isinstance(params["key"], str):
2946
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
2947
+ if params.get("value", None) is None:
2948
+ raise StyxValidationError("`value` must not be None")
2949
+ if not isinstance(params["value"], str):
2950
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
2951
+
2952
+
2953
+ def mrcalc_config_cargs(
2954
+ params: MrcalcConfigParamsDict,
2955
+ execution: Execution,
2956
+ ) -> list[str]:
2957
+ """
2958
+ Build command-line arguments from parameters.
2959
+
2960
+ Args:
2961
+ params: The parameters.
2962
+ execution: The execution object for resolving input paths.
2963
+ Returns:
2964
+ Command-line arguments.
2965
+ """
2966
+ cargs = []
2967
+ cargs.append("-config")
2968
+ cargs.append(params.get("key", None))
2969
+ cargs.append(params.get("value", None))
2970
+ return cargs
2971
+
2972
+
2973
+ def mrcalc_various_string(
2974
+ obj: str,
2975
+ ) -> MrcalcVariousStringParamsDictTagged:
2976
+ """
2977
+ Build parameters.
2978
+
2979
+ Args:
2980
+ obj: String object.
2981
+ Returns:
2982
+ Parameter dictionary
2983
+ """
2984
+ params = {
2985
+ "@type": "VariousString",
2986
+ "obj": obj,
2987
+ }
2988
+ return params
2989
+
2990
+
2991
+ def mrcalc_various_string_validate(
2992
+ params: typing.Any,
2993
+ ) -> None:
2994
+ """
2995
+ Validate parameters. Throws an error if `params` is not a valid
2996
+ `MrcalcVariousStringParamsDict` object.
2997
+
2998
+ Args:
2999
+ params: The parameters object to validate.
3000
+ """
3001
+ if params is None or not isinstance(params, dict):
3002
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
3003
+ if params.get("obj", None) is None:
3004
+ raise StyxValidationError("`obj` must not be None")
3005
+ if not isinstance(params["obj"], str):
3006
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `str`')
3007
+
3008
+
3009
+ def mrcalc_various_string_cargs(
3010
+ params: MrcalcVariousStringParamsDict,
3011
+ execution: Execution,
3012
+ ) -> list[str]:
3013
+ """
3014
+ Build command-line arguments from parameters.
3015
+
3016
+ Args:
3017
+ params: The parameters.
3018
+ execution: The execution object for resolving input paths.
3019
+ Returns:
3020
+ Command-line arguments.
3021
+ """
3022
+ cargs = []
3023
+ cargs.append(params.get("obj", None))
3024
+ return cargs
3025
+
3026
+
3027
+ def mrcalc_various_file(
3028
+ obj: InputPathType,
3029
+ ) -> MrcalcVariousFileParamsDictTagged:
3030
+ """
3031
+ Build parameters.
3032
+
3033
+ Args:
3034
+ obj: File object.
3035
+ Returns:
3036
+ Parameter dictionary
3037
+ """
3038
+ params = {
3039
+ "@type": "VariousFile",
3040
+ "obj": obj,
3041
+ }
3042
+ return params
3043
+
3044
+
3045
+ def mrcalc_various_file_validate(
3046
+ params: typing.Any,
3047
+ ) -> None:
3048
+ """
3049
+ Validate parameters. Throws an error if `params` is not a valid
3050
+ `MrcalcVariousFileParamsDict` object.
3051
+
3052
+ Args:
3053
+ params: The parameters object to validate.
3054
+ """
3055
+ if params is None or not isinstance(params, dict):
3056
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
3057
+ if params.get("obj", None) is None:
3058
+ raise StyxValidationError("`obj` must not be None")
3059
+ if not isinstance(params["obj"], (pathlib.Path, str)):
3060
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `InputPathType`')
3061
+
3062
+
3063
+ def mrcalc_various_file_cargs(
3064
+ params: MrcalcVariousFileParamsDict,
3065
+ execution: Execution,
3066
+ ) -> list[str]:
3067
+ """
3068
+ Build command-line arguments from parameters.
3069
+
3070
+ Args:
3071
+ params: The parameters.
3072
+ execution: The execution object for resolving input paths.
3073
+ Returns:
3074
+ Command-line arguments.
3075
+ """
3076
+ cargs = []
3077
+ cargs.append(execution.input_file(params.get("obj", None)))
3078
+ return cargs
3079
+
3080
+
3081
+ class MrcalcOutputs(typing.NamedTuple):
3082
+ """
3083
+ Output object returned when calling `MrcalcParamsDict(...)`.
3084
+ """
3085
+ root: OutputPathType
3086
+ """Output root folder. This is the root folder for all outputs."""
3087
+
3088
+
3089
+ def mrcalc_params(
3090
+ operand: list[typing.Union[MrcalcVariousStringParamsDictTagged, MrcalcVariousFileParamsDictTagged]],
3091
+ abs_: list[MrcalcAbsParamsDict] | None = None,
3092
+ neg: list[MrcalcNegParamsDict] | None = None,
3093
+ add: list[MrcalcAddParamsDict] | None = None,
3094
+ subtract: list[MrcalcSubtractParamsDict] | None = None,
3095
+ multiply: list[MrcalcMultiplyParamsDict] | None = None,
3096
+ divide: list[MrcalcDivideParamsDict] | None = None,
3097
+ min_: list[MrcalcMinParamsDict] | None = None,
3098
+ max_: list[MrcalcMaxParamsDict] | None = None,
3099
+ lt: list[MrcalcLtParamsDict] | None = None,
3100
+ gt: list[MrcalcGtParamsDict] | None = None,
3101
+ le: list[MrcalcLeParamsDict] | None = None,
3102
+ ge: list[MrcalcGeParamsDict] | None = None,
3103
+ eq: list[MrcalcEqParamsDict] | None = None,
3104
+ neq: list[MrcalcNeqParamsDict] | None = None,
3105
+ if_: list[MrcalcIfParamsDict] | None = None,
3106
+ replace: list[MrcalcReplaceParamsDict] | None = None,
3107
+ sqrt: list[MrcalcSqrtParamsDict] | None = None,
3108
+ pow_: list[MrcalcPowParamsDict] | None = None,
3109
+ round_: list[MrcalcRoundParamsDict] | None = None,
3110
+ ceil: list[MrcalcCeilParamsDict] | None = None,
3111
+ floor: list[MrcalcFloorParamsDict] | None = None,
3112
+ not_: list[MrcalcNotParamsDict] | None = None,
3113
+ and_: list[MrcalcAndParamsDict] | None = None,
3114
+ or_: list[MrcalcOrParamsDict] | None = None,
3115
+ xor: list[MrcalcXorParamsDict] | None = None,
3116
+ isnan: list[MrcalcIsnanParamsDict] | None = None,
3117
+ isinf: list[MrcalcIsinfParamsDict] | None = None,
3118
+ finite: list[MrcalcFiniteParamsDict] | None = None,
3119
+ complex_: list[MrcalcComplexParamsDict] | None = None,
3120
+ polar: list[MrcalcPolarParamsDict] | None = None,
3121
+ real: list[MrcalcRealParamsDict] | None = None,
3122
+ imag: list[MrcalcImagParamsDict] | None = None,
3123
+ phase: list[MrcalcPhaseParamsDict] | None = None,
3124
+ conj: list[MrcalcConjParamsDict] | None = None,
3125
+ proj: list[MrcalcProjParamsDict] | None = None,
3126
+ exp: list[MrcalcExpParamsDict] | None = None,
3127
+ log: list[MrcalcLogParamsDict] | None = None,
3128
+ log10: list[MrcalcLog10ParamsDict] | None = None,
3129
+ cos: list[MrcalcCosParamsDict] | None = None,
3130
+ sin: list[MrcalcSinParamsDict] | None = None,
3131
+ tan: list[MrcalcTanParamsDict] | None = None,
3132
+ acos: list[MrcalcAcosParamsDict] | None = None,
3133
+ asin: list[MrcalcAsinParamsDict] | None = None,
3134
+ atan: list[MrcalcAtanParamsDict] | None = None,
3135
+ cosh: list[MrcalcCoshParamsDict] | None = None,
3136
+ sinh: list[MrcalcSinhParamsDict] | None = None,
3137
+ tanh: list[MrcalcTanhParamsDict] | None = None,
3138
+ acosh: list[MrcalcAcoshParamsDict] | None = None,
3139
+ asinh: list[MrcalcAsinhParamsDict] | None = None,
3140
+ atanh: list[MrcalcAtanhParamsDict] | None = None,
3141
+ datatype: str | None = None,
3142
+ info: bool = False,
3143
+ quiet: bool = False,
3144
+ debug: bool = False,
3145
+ force: bool = False,
3146
+ nthreads: int | None = None,
3147
+ config: list[MrcalcConfigParamsDict] | None = None,
3148
+ help_: bool = False,
3149
+ version: bool = False,
3150
+ ) -> MrcalcParamsDictTagged:
3151
+ """
3152
+ Build parameters.
3153
+
3154
+ Args:
3155
+ operand: an input image, intensity value, or the special keywords\
3156
+ 'rand' (random number between 0 and 1) or 'randn' (random number from\
3157
+ unit std.dev. normal distribution) or the mathematical constants 'e'\
3158
+ and 'pi'.
3159
+ abs_: |%1| : return absolute value (magnitude) of real or complex\
3160
+ number.
3161
+ neg: -%1 : negative value.
3162
+ add: (%1 + %2) : add values.
3163
+ subtract: (%1 - %2) : subtract nth operand from (n-1)th.
3164
+ multiply: (%1 * %2) : multiply values.
3165
+ divide: (%1 / %2) : divide (n-1)th operand by nth.
3166
+ min_: min (%1, %2) : smallest of last two operands.
3167
+ max_: max (%1, %2) : greatest of last two operands.
3168
+ lt: (%1 < %2) : less-than operator (true=1, false=0).
3169
+ gt: (%1 > %2) : greater-than operator (true=1, false=0).
3170
+ le: (%1 <= %2) : less-than-or-equal-to operator (true=1, false=0).
3171
+ ge: (%1 >= %2) : greater-than-or-equal-to operator (true=1, false=0).
3172
+ eq: (%1 == %2) : equal-to operator (true=1, false=0).
3173
+ neq: (%1 != %2) : not-equal-to operator (true=1, false=0).
3174
+ if_: (%1 ? %2 : %3) : if first operand is true (non-zero), return\
3175
+ second operand, otherwise return third operand.
3176
+ replace: (%1, %2 -> %3) : Wherever first operand is equal to the second\
3177
+ operand, replace with third operand.
3178
+ sqrt: sqrt (%1) : square root.
3179
+ pow_: %1^%2 : raise (n-1)th operand to nth power.
3180
+ round_: round (%1) : round to nearest integer.
3181
+ ceil: ceil (%1) : round up to nearest integer.
3182
+ floor: floor (%1) : round down to nearest integer.
3183
+ not_: !%1 : NOT operator: true (1) if operand is false (i.e. zero).
3184
+ and_: (%1 && %2) : AND operator: true (1) if both operands are true\
3185
+ (i.e. non-zero).
3186
+ or_: (%1 || %2) : OR operator: true (1) if either operand is true (i.e.\
3187
+ non-zero).
3188
+ xor: (%1 ^^ %2) : XOR operator: true (1) if only one of the operands is\
3189
+ true (i.e. non-zero).
3190
+ isnan: isnan (%1) : true (1) if operand is not-a-number (NaN).
3191
+ isinf: isinf (%1) : true (1) if operand is infinite (Inf).
3192
+ finite: finite (%1) : true (1) if operand is finite (i.e. not NaN or\
3193
+ Inf).
3194
+ complex_: (%1 + %2 i) : create complex number using the last two\
3195
+ operands as real,imaginary components.
3196
+ polar: (%1 /_ %2) : create complex number using the last two operands\
3197
+ as magnitude,phase components (phase in radians).
3198
+ real: real (%1) : real part of complex number.
3199
+ imag: imag (%1) : imaginary part of complex number.
3200
+ phase: phase (%1) : phase of complex number (use -abs for magnitude).
3201
+ conj: conj (%1) : complex conjugate.
3202
+ proj: proj (%1) : projection onto the Riemann sphere.
3203
+ exp: exp (%1) : exponential function.
3204
+ log: log (%1) : natural logarithm.
3205
+ log10: log10 (%1) : common logarithm.
3206
+ cos: cos (%1) : cosine.
3207
+ sin: sin (%1) : sine.
3208
+ tan: tan (%1) : tangent.
3209
+ acos: acos (%1) : inverse cosine.
3210
+ asin: asin (%1) : inverse sine.
3211
+ atan: atan (%1) : inverse tangent.
3212
+ cosh: cosh (%1) : hyperbolic cosine.
3213
+ sinh: sinh (%1) : hyperbolic sine.
3214
+ tanh: tanh (%1) : hyperbolic tangent.
3215
+ acosh: acosh (%1) : inverse hyperbolic cosine.
3216
+ asinh: asinh (%1) : inverse hyperbolic sine.
3217
+ atanh: atanh (%1) : inverse hyperbolic tangent.
3218
+ datatype: specify output image data type. Valid choices are: float32,\
3219
+ float32le, float32be, float64, float64le, float64be, int64, uint64,\
3220
+ int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
3221
+ int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
3222
+ cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
3223
+ int8, uint8, bit.
3224
+ info: display information messages.
3225
+ quiet: do not display information messages or progress status;\
3226
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
3227
+ environment variable to a non-empty string.
3228
+ debug: display debugging messages.
3229
+ force: force overwrite of output files (caution: using the same file as\
3230
+ input and output might cause unexpected behaviour).
3231
+ nthreads: use this number of threads in multi-threaded applications\
3232
+ (set to 0 to disable multi-threading).
3233
+ config: temporarily set the value of an MRtrix config file entry.
3234
+ help_: display this information page and exit.
3235
+ version: display version information and exit.
3236
+ Returns:
3237
+ Parameter dictionary
3238
+ """
3239
+ params = {
3240
+ "@type": "mrtrix/mrcalc",
3241
+ "info": info,
3242
+ "quiet": quiet,
3243
+ "debug": debug,
3244
+ "force": force,
3245
+ "help": help_,
3246
+ "version": version,
3247
+ "operand": operand,
3248
+ }
3249
+ if abs_ is not None:
3250
+ params["abs"] = abs_
3251
+ if neg is not None:
3252
+ params["neg"] = neg
3253
+ if add is not None:
3254
+ params["add"] = add
3255
+ if subtract is not None:
3256
+ params["subtract"] = subtract
3257
+ if multiply is not None:
3258
+ params["multiply"] = multiply
3259
+ if divide is not None:
3260
+ params["divide"] = divide
3261
+ if min_ is not None:
3262
+ params["min"] = min_
3263
+ if max_ is not None:
3264
+ params["max"] = max_
3265
+ if lt is not None:
3266
+ params["lt"] = lt
3267
+ if gt is not None:
3268
+ params["gt"] = gt
3269
+ if le is not None:
3270
+ params["le"] = le
3271
+ if ge is not None:
3272
+ params["ge"] = ge
3273
+ if eq is not None:
3274
+ params["eq"] = eq
3275
+ if neq is not None:
3276
+ params["neq"] = neq
3277
+ if if_ is not None:
3278
+ params["if"] = if_
3279
+ if replace is not None:
3280
+ params["replace"] = replace
3281
+ if sqrt is not None:
3282
+ params["sqrt"] = sqrt
3283
+ if pow_ is not None:
3284
+ params["pow"] = pow_
3285
+ if round_ is not None:
3286
+ params["round"] = round_
3287
+ if ceil is not None:
3288
+ params["ceil"] = ceil
3289
+ if floor is not None:
3290
+ params["floor"] = floor
3291
+ if not_ is not None:
3292
+ params["not"] = not_
3293
+ if and_ is not None:
3294
+ params["and"] = and_
3295
+ if or_ is not None:
3296
+ params["or"] = or_
3297
+ if xor is not None:
3298
+ params["xor"] = xor
3299
+ if isnan is not None:
3300
+ params["isnan"] = isnan
3301
+ if isinf is not None:
3302
+ params["isinf"] = isinf
3303
+ if finite is not None:
3304
+ params["finite"] = finite
3305
+ if complex_ is not None:
3306
+ params["complex"] = complex_
3307
+ if polar is not None:
3308
+ params["polar"] = polar
3309
+ if real is not None:
3310
+ params["real"] = real
3311
+ if imag is not None:
3312
+ params["imag"] = imag
3313
+ if phase is not None:
3314
+ params["phase"] = phase
3315
+ if conj is not None:
3316
+ params["conj"] = conj
3317
+ if proj is not None:
3318
+ params["proj"] = proj
3319
+ if exp is not None:
3320
+ params["exp"] = exp
3321
+ if log is not None:
3322
+ params["log"] = log
3323
+ if log10 is not None:
3324
+ params["log10"] = log10
3325
+ if cos is not None:
3326
+ params["cos"] = cos
3327
+ if sin is not None:
3328
+ params["sin"] = sin
3329
+ if tan is not None:
3330
+ params["tan"] = tan
3331
+ if acos is not None:
3332
+ params["acos"] = acos
3333
+ if asin is not None:
3334
+ params["asin"] = asin
3335
+ if atan is not None:
3336
+ params["atan"] = atan
3337
+ if cosh is not None:
3338
+ params["cosh"] = cosh
3339
+ if sinh is not None:
3340
+ params["sinh"] = sinh
3341
+ if tanh is not None:
3342
+ params["tanh"] = tanh
3343
+ if acosh is not None:
3344
+ params["acosh"] = acosh
3345
+ if asinh is not None:
3346
+ params["asinh"] = asinh
3347
+ if atanh is not None:
3348
+ params["atanh"] = atanh
3349
+ if datatype is not None:
3350
+ params["datatype"] = datatype
3351
+ if nthreads is not None:
3352
+ params["nthreads"] = nthreads
3353
+ if config is not None:
3354
+ params["config"] = config
3355
+ return params
3356
+
3357
+
3358
+ def mrcalc_validate(
3359
+ params: typing.Any,
3360
+ ) -> None:
3361
+ """
3362
+ Validate parameters. Throws an error if `params` is not a valid
3363
+ `MrcalcParamsDict` object.
3364
+
3365
+ Args:
3366
+ params: The parameters object to validate.
3367
+ """
3368
+ if params is None or not isinstance(params, dict):
3369
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
3370
+ if params.get("abs", None) is not None:
3371
+ if not isinstance(params["abs"], list):
3372
+ raise StyxValidationError(f'`abs` has the wrong type: Received `{type(params.get("abs", None))}` expected `list[MrcalcAbsParamsDict] | None`')
3373
+ for e in params["abs"]:
3374
+ mrcalc_abs_validate(e)
3375
+ if params.get("neg", None) is not None:
3376
+ if not isinstance(params["neg"], list):
3377
+ raise StyxValidationError(f'`neg` has the wrong type: Received `{type(params.get("neg", None))}` expected `list[MrcalcNegParamsDict] | None`')
3378
+ for e in params["neg"]:
3379
+ mrcalc_neg_validate(e)
3380
+ if params.get("add", None) is not None:
3381
+ if not isinstance(params["add"], list):
3382
+ raise StyxValidationError(f'`add` has the wrong type: Received `{type(params.get("add", None))}` expected `list[MrcalcAddParamsDict] | None`')
3383
+ for e in params["add"]:
3384
+ mrcalc_add_validate(e)
3385
+ if params.get("subtract", None) is not None:
3386
+ if not isinstance(params["subtract"], list):
3387
+ raise StyxValidationError(f'`subtract` has the wrong type: Received `{type(params.get("subtract", None))}` expected `list[MrcalcSubtractParamsDict] | None`')
3388
+ for e in params["subtract"]:
3389
+ mrcalc_subtract_validate(e)
3390
+ if params.get("multiply", None) is not None:
3391
+ if not isinstance(params["multiply"], list):
3392
+ raise StyxValidationError(f'`multiply` has the wrong type: Received `{type(params.get("multiply", None))}` expected `list[MrcalcMultiplyParamsDict] | None`')
3393
+ for e in params["multiply"]:
3394
+ mrcalc_multiply_validate(e)
3395
+ if params.get("divide", None) is not None:
3396
+ if not isinstance(params["divide"], list):
3397
+ raise StyxValidationError(f'`divide` has the wrong type: Received `{type(params.get("divide", None))}` expected `list[MrcalcDivideParamsDict] | None`')
3398
+ for e in params["divide"]:
3399
+ mrcalc_divide_validate(e)
3400
+ if params.get("min", None) is not None:
3401
+ if not isinstance(params["min"], list):
3402
+ raise StyxValidationError(f'`min` has the wrong type: Received `{type(params.get("min", None))}` expected `list[MrcalcMinParamsDict] | None`')
3403
+ for e in params["min"]:
3404
+ mrcalc_min_validate(e)
3405
+ if params.get("max", None) is not None:
3406
+ if not isinstance(params["max"], list):
3407
+ raise StyxValidationError(f'`max` has the wrong type: Received `{type(params.get("max", None))}` expected `list[MrcalcMaxParamsDict] | None`')
3408
+ for e in params["max"]:
3409
+ mrcalc_max_validate(e)
3410
+ if params.get("lt", None) is not None:
3411
+ if not isinstance(params["lt"], list):
3412
+ raise StyxValidationError(f'`lt` has the wrong type: Received `{type(params.get("lt", None))}` expected `list[MrcalcLtParamsDict] | None`')
3413
+ for e in params["lt"]:
3414
+ mrcalc_lt_validate(e)
3415
+ if params.get("gt", None) is not None:
3416
+ if not isinstance(params["gt"], list):
3417
+ raise StyxValidationError(f'`gt` has the wrong type: Received `{type(params.get("gt", None))}` expected `list[MrcalcGtParamsDict] | None`')
3418
+ for e in params["gt"]:
3419
+ mrcalc_gt_validate(e)
3420
+ if params.get("le", None) is not None:
3421
+ if not isinstance(params["le"], list):
3422
+ raise StyxValidationError(f'`le` has the wrong type: Received `{type(params.get("le", None))}` expected `list[MrcalcLeParamsDict] | None`')
3423
+ for e in params["le"]:
3424
+ mrcalc_le_validate(e)
3425
+ if params.get("ge", None) is not None:
3426
+ if not isinstance(params["ge"], list):
3427
+ raise StyxValidationError(f'`ge` has the wrong type: Received `{type(params.get("ge", None))}` expected `list[MrcalcGeParamsDict] | None`')
3428
+ for e in params["ge"]:
3429
+ mrcalc_ge_validate(e)
3430
+ if params.get("eq", None) is not None:
3431
+ if not isinstance(params["eq"], list):
3432
+ raise StyxValidationError(f'`eq` has the wrong type: Received `{type(params.get("eq", None))}` expected `list[MrcalcEqParamsDict] | None`')
3433
+ for e in params["eq"]:
3434
+ mrcalc_eq_validate(e)
3435
+ if params.get("neq", None) is not None:
3436
+ if not isinstance(params["neq"], list):
3437
+ raise StyxValidationError(f'`neq` has the wrong type: Received `{type(params.get("neq", None))}` expected `list[MrcalcNeqParamsDict] | None`')
3438
+ for e in params["neq"]:
3439
+ mrcalc_neq_validate(e)
3440
+ if params.get("if", None) is not None:
3441
+ if not isinstance(params["if"], list):
3442
+ raise StyxValidationError(f'`if` has the wrong type: Received `{type(params.get("if", None))}` expected `list[MrcalcIfParamsDict] | None`')
3443
+ for e in params["if"]:
3444
+ mrcalc_if_validate(e)
3445
+ if params.get("replace", None) is not None:
3446
+ if not isinstance(params["replace"], list):
3447
+ raise StyxValidationError(f'`replace` has the wrong type: Received `{type(params.get("replace", None))}` expected `list[MrcalcReplaceParamsDict] | None`')
3448
+ for e in params["replace"]:
3449
+ mrcalc_replace_validate(e)
3450
+ if params.get("sqrt", None) is not None:
3451
+ if not isinstance(params["sqrt"], list):
3452
+ raise StyxValidationError(f'`sqrt` has the wrong type: Received `{type(params.get("sqrt", None))}` expected `list[MrcalcSqrtParamsDict] | None`')
3453
+ for e in params["sqrt"]:
3454
+ mrcalc_sqrt_validate(e)
3455
+ if params.get("pow", None) is not None:
3456
+ if not isinstance(params["pow"], list):
3457
+ raise StyxValidationError(f'`pow` has the wrong type: Received `{type(params.get("pow", None))}` expected `list[MrcalcPowParamsDict] | None`')
3458
+ for e in params["pow"]:
3459
+ mrcalc_pow_validate(e)
3460
+ if params.get("round", None) is not None:
3461
+ if not isinstance(params["round"], list):
3462
+ raise StyxValidationError(f'`round` has the wrong type: Received `{type(params.get("round", None))}` expected `list[MrcalcRoundParamsDict] | None`')
3463
+ for e in params["round"]:
3464
+ mrcalc_round_validate(e)
3465
+ if params.get("ceil", None) is not None:
3466
+ if not isinstance(params["ceil"], list):
3467
+ raise StyxValidationError(f'`ceil` has the wrong type: Received `{type(params.get("ceil", None))}` expected `list[MrcalcCeilParamsDict] | None`')
3468
+ for e in params["ceil"]:
3469
+ mrcalc_ceil_validate(e)
3470
+ if params.get("floor", None) is not None:
3471
+ if not isinstance(params["floor"], list):
3472
+ raise StyxValidationError(f'`floor` has the wrong type: Received `{type(params.get("floor", None))}` expected `list[MrcalcFloorParamsDict] | None`')
3473
+ for e in params["floor"]:
3474
+ mrcalc_floor_validate(e)
3475
+ if params.get("not", None) is not None:
3476
+ if not isinstance(params["not"], list):
3477
+ raise StyxValidationError(f'`not` has the wrong type: Received `{type(params.get("not", None))}` expected `list[MrcalcNotParamsDict] | None`')
3478
+ for e in params["not"]:
3479
+ mrcalc_not_validate(e)
3480
+ if params.get("and", None) is not None:
3481
+ if not isinstance(params["and"], list):
3482
+ raise StyxValidationError(f'`and` has the wrong type: Received `{type(params.get("and", None))}` expected `list[MrcalcAndParamsDict] | None`')
3483
+ for e in params["and"]:
3484
+ mrcalc_and_validate(e)
3485
+ if params.get("or", None) is not None:
3486
+ if not isinstance(params["or"], list):
3487
+ raise StyxValidationError(f'`or` has the wrong type: Received `{type(params.get("or", None))}` expected `list[MrcalcOrParamsDict] | None`')
3488
+ for e in params["or"]:
3489
+ mrcalc_or_validate(e)
3490
+ if params.get("xor", None) is not None:
3491
+ if not isinstance(params["xor"], list):
3492
+ raise StyxValidationError(f'`xor` has the wrong type: Received `{type(params.get("xor", None))}` expected `list[MrcalcXorParamsDict] | None`')
3493
+ for e in params["xor"]:
3494
+ mrcalc_xor_validate(e)
3495
+ if params.get("isnan", None) is not None:
3496
+ if not isinstance(params["isnan"], list):
3497
+ raise StyxValidationError(f'`isnan` has the wrong type: Received `{type(params.get("isnan", None))}` expected `list[MrcalcIsnanParamsDict] | None`')
3498
+ for e in params["isnan"]:
3499
+ mrcalc_isnan_validate(e)
3500
+ if params.get("isinf", None) is not None:
3501
+ if not isinstance(params["isinf"], list):
3502
+ raise StyxValidationError(f'`isinf` has the wrong type: Received `{type(params.get("isinf", None))}` expected `list[MrcalcIsinfParamsDict] | None`')
3503
+ for e in params["isinf"]:
3504
+ mrcalc_isinf_validate(e)
3505
+ if params.get("finite", None) is not None:
3506
+ if not isinstance(params["finite"], list):
3507
+ raise StyxValidationError(f'`finite` has the wrong type: Received `{type(params.get("finite", None))}` expected `list[MrcalcFiniteParamsDict] | None`')
3508
+ for e in params["finite"]:
3509
+ mrcalc_finite_validate(e)
3510
+ if params.get("complex", None) is not None:
3511
+ if not isinstance(params["complex"], list):
3512
+ raise StyxValidationError(f'`complex` has the wrong type: Received `{type(params.get("complex", None))}` expected `list[MrcalcComplexParamsDict] | None`')
3513
+ for e in params["complex"]:
3514
+ mrcalc_complex_validate(e)
3515
+ if params.get("polar", None) is not None:
3516
+ if not isinstance(params["polar"], list):
3517
+ raise StyxValidationError(f'`polar` has the wrong type: Received `{type(params.get("polar", None))}` expected `list[MrcalcPolarParamsDict] | None`')
3518
+ for e in params["polar"]:
3519
+ mrcalc_polar_validate(e)
3520
+ if params.get("real", None) is not None:
3521
+ if not isinstance(params["real"], list):
3522
+ raise StyxValidationError(f'`real` has the wrong type: Received `{type(params.get("real", None))}` expected `list[MrcalcRealParamsDict] | None`')
3523
+ for e in params["real"]:
3524
+ mrcalc_real_validate(e)
3525
+ if params.get("imag", None) is not None:
3526
+ if not isinstance(params["imag"], list):
3527
+ raise StyxValidationError(f'`imag` has the wrong type: Received `{type(params.get("imag", None))}` expected `list[MrcalcImagParamsDict] | None`')
3528
+ for e in params["imag"]:
3529
+ mrcalc_imag_validate(e)
3530
+ if params.get("phase", None) is not None:
3531
+ if not isinstance(params["phase"], list):
3532
+ raise StyxValidationError(f'`phase` has the wrong type: Received `{type(params.get("phase", None))}` expected `list[MrcalcPhaseParamsDict] | None`')
3533
+ for e in params["phase"]:
3534
+ mrcalc_phase_validate(e)
3535
+ if params.get("conj", None) is not None:
3536
+ if not isinstance(params["conj"], list):
3537
+ raise StyxValidationError(f'`conj` has the wrong type: Received `{type(params.get("conj", None))}` expected `list[MrcalcConjParamsDict] | None`')
3538
+ for e in params["conj"]:
3539
+ mrcalc_conj_validate(e)
3540
+ if params.get("proj", None) is not None:
3541
+ if not isinstance(params["proj"], list):
3542
+ raise StyxValidationError(f'`proj` has the wrong type: Received `{type(params.get("proj", None))}` expected `list[MrcalcProjParamsDict] | None`')
3543
+ for e in params["proj"]:
3544
+ mrcalc_proj_validate(e)
3545
+ if params.get("exp", None) is not None:
3546
+ if not isinstance(params["exp"], list):
3547
+ raise StyxValidationError(f'`exp` has the wrong type: Received `{type(params.get("exp", None))}` expected `list[MrcalcExpParamsDict] | None`')
3548
+ for e in params["exp"]:
3549
+ mrcalc_exp_validate(e)
3550
+ if params.get("log", None) is not None:
3551
+ if not isinstance(params["log"], list):
3552
+ raise StyxValidationError(f'`log` has the wrong type: Received `{type(params.get("log", None))}` expected `list[MrcalcLogParamsDict] | None`')
3553
+ for e in params["log"]:
3554
+ mrcalc_log_validate(e)
3555
+ if params.get("log10", None) is not None:
3556
+ if not isinstance(params["log10"], list):
3557
+ raise StyxValidationError(f'`log10` has the wrong type: Received `{type(params.get("log10", None))}` expected `list[MrcalcLog10ParamsDict] | None`')
3558
+ for e in params["log10"]:
3559
+ mrcalc_log10_validate(e)
3560
+ if params.get("cos", None) is not None:
3561
+ if not isinstance(params["cos"], list):
3562
+ raise StyxValidationError(f'`cos` has the wrong type: Received `{type(params.get("cos", None))}` expected `list[MrcalcCosParamsDict] | None`')
3563
+ for e in params["cos"]:
3564
+ mrcalc_cos_validate(e)
3565
+ if params.get("sin", None) is not None:
3566
+ if not isinstance(params["sin"], list):
3567
+ raise StyxValidationError(f'`sin` has the wrong type: Received `{type(params.get("sin", None))}` expected `list[MrcalcSinParamsDict] | None`')
3568
+ for e in params["sin"]:
3569
+ mrcalc_sin_validate(e)
3570
+ if params.get("tan", None) is not None:
3571
+ if not isinstance(params["tan"], list):
3572
+ raise StyxValidationError(f'`tan` has the wrong type: Received `{type(params.get("tan", None))}` expected `list[MrcalcTanParamsDict] | None`')
3573
+ for e in params["tan"]:
3574
+ mrcalc_tan_validate(e)
3575
+ if params.get("acos", None) is not None:
3576
+ if not isinstance(params["acos"], list):
3577
+ raise StyxValidationError(f'`acos` has the wrong type: Received `{type(params.get("acos", None))}` expected `list[MrcalcAcosParamsDict] | None`')
3578
+ for e in params["acos"]:
3579
+ mrcalc_acos_validate(e)
3580
+ if params.get("asin", None) is not None:
3581
+ if not isinstance(params["asin"], list):
3582
+ raise StyxValidationError(f'`asin` has the wrong type: Received `{type(params.get("asin", None))}` expected `list[MrcalcAsinParamsDict] | None`')
3583
+ for e in params["asin"]:
3584
+ mrcalc_asin_validate(e)
3585
+ if params.get("atan", None) is not None:
3586
+ if not isinstance(params["atan"], list):
3587
+ raise StyxValidationError(f'`atan` has the wrong type: Received `{type(params.get("atan", None))}` expected `list[MrcalcAtanParamsDict] | None`')
3588
+ for e in params["atan"]:
3589
+ mrcalc_atan_validate(e)
3590
+ if params.get("cosh", None) is not None:
3591
+ if not isinstance(params["cosh"], list):
3592
+ raise StyxValidationError(f'`cosh` has the wrong type: Received `{type(params.get("cosh", None))}` expected `list[MrcalcCoshParamsDict] | None`')
3593
+ for e in params["cosh"]:
3594
+ mrcalc_cosh_validate(e)
3595
+ if params.get("sinh", None) is not None:
3596
+ if not isinstance(params["sinh"], list):
3597
+ raise StyxValidationError(f'`sinh` has the wrong type: Received `{type(params.get("sinh", None))}` expected `list[MrcalcSinhParamsDict] | None`')
3598
+ for e in params["sinh"]:
3599
+ mrcalc_sinh_validate(e)
3600
+ if params.get("tanh", None) is not None:
3601
+ if not isinstance(params["tanh"], list):
3602
+ raise StyxValidationError(f'`tanh` has the wrong type: Received `{type(params.get("tanh", None))}` expected `list[MrcalcTanhParamsDict] | None`')
3603
+ for e in params["tanh"]:
3604
+ mrcalc_tanh_validate(e)
3605
+ if params.get("acosh", None) is not None:
3606
+ if not isinstance(params["acosh"], list):
3607
+ raise StyxValidationError(f'`acosh` has the wrong type: Received `{type(params.get("acosh", None))}` expected `list[MrcalcAcoshParamsDict] | None`')
3608
+ for e in params["acosh"]:
3609
+ mrcalc_acosh_validate(e)
3610
+ if params.get("asinh", None) is not None:
3611
+ if not isinstance(params["asinh"], list):
3612
+ raise StyxValidationError(f'`asinh` has the wrong type: Received `{type(params.get("asinh", None))}` expected `list[MrcalcAsinhParamsDict] | None`')
3613
+ for e in params["asinh"]:
3614
+ mrcalc_asinh_validate(e)
3615
+ if params.get("atanh", None) is not None:
3616
+ if not isinstance(params["atanh"], list):
3617
+ raise StyxValidationError(f'`atanh` has the wrong type: Received `{type(params.get("atanh", None))}` expected `list[MrcalcAtanhParamsDict] | None`')
3618
+ for e in params["atanh"]:
3619
+ mrcalc_atanh_validate(e)
3620
+ if params.get("datatype", None) is not None:
3621
+ if not isinstance(params["datatype"], str):
3622
+ raise StyxValidationError(f'`datatype` has the wrong type: Received `{type(params.get("datatype", None))}` expected `str | None`')
3623
+ if params.get("info", False) is None:
3624
+ raise StyxValidationError("`info` must not be None")
3625
+ if not isinstance(params["info"], bool):
3626
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
3627
+ if params.get("quiet", False) is None:
3628
+ raise StyxValidationError("`quiet` must not be None")
3629
+ if not isinstance(params["quiet"], bool):
3630
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
3631
+ if params.get("debug", False) is None:
3632
+ raise StyxValidationError("`debug` must not be None")
3633
+ if not isinstance(params["debug"], bool):
3634
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
3635
+ if params.get("force", False) is None:
3636
+ raise StyxValidationError("`force` must not be None")
3637
+ if not isinstance(params["force"], bool):
3638
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
3639
+ if params.get("nthreads", None) is not None:
3640
+ if not isinstance(params["nthreads"], int):
3641
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
3642
+ if params.get("config", None) is not None:
3643
+ if not isinstance(params["config"], list):
3644
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[MrcalcConfigParamsDict] | None`')
3645
+ for e in params["config"]:
3646
+ mrcalc_config_validate(e)
3647
+ if params.get("help", False) is None:
3648
+ raise StyxValidationError("`help` must not be None")
3649
+ if not isinstance(params["help"], bool):
3650
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
3651
+ if params.get("version", False) is None:
3652
+ raise StyxValidationError("`version` must not be None")
3653
+ if not isinstance(params["version"], bool):
3654
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
3655
+ if params.get("operand", None) is None:
3656
+ raise StyxValidationError("`operand` must not be None")
3657
+ if not isinstance(params["operand"], list):
3658
+ raise StyxValidationError(f'`operand` has the wrong type: Received `{type(params.get("operand", None))}` expected `list[typing.Union[MrcalcVariousStringParamsDictTagged, MrcalcVariousFileParamsDictTagged]]`')
3659
+ for e in params["operand"]:
3660
+ if not isinstance(e, dict):
3661
+ raise StyxValidationError(f'Params object has the wrong type \'{type(e)}\'')
3662
+ if "@type" not in e:
3663
+ raise StyxValidationError("Params object is missing `@type`")
3664
+ if e["@type"] not in ["VariousString", "VariousFile"]:
3665
+ raise StyxValidationError("Parameter `operand`s `@type` must be one of [\"VariousString\", \"VariousFile\"]")
3666
+ mrcalc_operand_validate_dyn_fn(e["@type"])(e)
3667
+
3668
+
3669
+ def mrcalc_cargs(
3670
+ params: MrcalcParamsDict,
3671
+ execution: Execution,
3672
+ ) -> list[str]:
3673
+ """
3674
+ Build command-line arguments from parameters.
3675
+
3676
+ Args:
3677
+ params: The parameters.
3678
+ execution: The execution object for resolving input paths.
3679
+ Returns:
3680
+ Command-line arguments.
3681
+ """
3682
+ cargs = []
3683
+ cargs.append("mrcalc")
3684
+ if params.get("abs", None) is not None:
3685
+ cargs.extend([a for c in [mrcalc_abs_cargs(s, execution) for s in params.get("abs", None)] for a in c])
3686
+ if params.get("neg", None) is not None:
3687
+ cargs.extend([a for c in [mrcalc_neg_cargs(s, execution) for s in params.get("neg", None)] for a in c])
3688
+ if params.get("add", None) is not None:
3689
+ cargs.extend([a for c in [mrcalc_add_cargs(s, execution) for s in params.get("add", None)] for a in c])
3690
+ if params.get("subtract", None) is not None:
3691
+ cargs.extend([a for c in [mrcalc_subtract_cargs(s, execution) for s in params.get("subtract", None)] for a in c])
3692
+ if params.get("multiply", None) is not None:
3693
+ cargs.extend([a for c in [mrcalc_multiply_cargs(s, execution) for s in params.get("multiply", None)] for a in c])
3694
+ if params.get("divide", None) is not None:
3695
+ cargs.extend([a for c in [mrcalc_divide_cargs(s, execution) for s in params.get("divide", None)] for a in c])
3696
+ if params.get("min", None) is not None:
3697
+ cargs.extend([a for c in [mrcalc_min_cargs(s, execution) for s in params.get("min", None)] for a in c])
3698
+ if params.get("max", None) is not None:
3699
+ cargs.extend([a for c in [mrcalc_max_cargs(s, execution) for s in params.get("max", None)] for a in c])
3700
+ if params.get("lt", None) is not None:
3701
+ cargs.extend([a for c in [mrcalc_lt_cargs(s, execution) for s in params.get("lt", None)] for a in c])
3702
+ if params.get("gt", None) is not None:
3703
+ cargs.extend([a for c in [mrcalc_gt_cargs(s, execution) for s in params.get("gt", None)] for a in c])
3704
+ if params.get("le", None) is not None:
3705
+ cargs.extend([a for c in [mrcalc_le_cargs(s, execution) for s in params.get("le", None)] for a in c])
3706
+ if params.get("ge", None) is not None:
3707
+ cargs.extend([a for c in [mrcalc_ge_cargs(s, execution) for s in params.get("ge", None)] for a in c])
3708
+ if params.get("eq", None) is not None:
3709
+ cargs.extend([a for c in [mrcalc_eq_cargs(s, execution) for s in params.get("eq", None)] for a in c])
3710
+ if params.get("neq", None) is not None:
3711
+ cargs.extend([a for c in [mrcalc_neq_cargs(s, execution) for s in params.get("neq", None)] for a in c])
3712
+ if params.get("if", None) is not None:
3713
+ cargs.extend([a for c in [mrcalc_if_cargs(s, execution) for s in params.get("if", None)] for a in c])
3714
+ if params.get("replace", None) is not None:
3715
+ cargs.extend([a for c in [mrcalc_replace_cargs(s, execution) for s in params.get("replace", None)] for a in c])
3716
+ if params.get("sqrt", None) is not None:
3717
+ cargs.extend([a for c in [mrcalc_sqrt_cargs(s, execution) for s in params.get("sqrt", None)] for a in c])
3718
+ if params.get("pow", None) is not None:
3719
+ cargs.extend([a for c in [mrcalc_pow_cargs(s, execution) for s in params.get("pow", None)] for a in c])
3720
+ if params.get("round", None) is not None:
3721
+ cargs.extend([a for c in [mrcalc_round_cargs(s, execution) for s in params.get("round", None)] for a in c])
3722
+ if params.get("ceil", None) is not None:
3723
+ cargs.extend([a for c in [mrcalc_ceil_cargs(s, execution) for s in params.get("ceil", None)] for a in c])
3724
+ if params.get("floor", None) is not None:
3725
+ cargs.extend([a for c in [mrcalc_floor_cargs(s, execution) for s in params.get("floor", None)] for a in c])
3726
+ if params.get("not", None) is not None:
3727
+ cargs.extend([a for c in [mrcalc_not_cargs(s, execution) for s in params.get("not", None)] for a in c])
3728
+ if params.get("and", None) is not None:
3729
+ cargs.extend([a for c in [mrcalc_and_cargs(s, execution) for s in params.get("and", None)] for a in c])
3730
+ if params.get("or", None) is not None:
3731
+ cargs.extend([a for c in [mrcalc_or_cargs(s, execution) for s in params.get("or", None)] for a in c])
3732
+ if params.get("xor", None) is not None:
3733
+ cargs.extend([a for c in [mrcalc_xor_cargs(s, execution) for s in params.get("xor", None)] for a in c])
3734
+ if params.get("isnan", None) is not None:
3735
+ cargs.extend([a for c in [mrcalc_isnan_cargs(s, execution) for s in params.get("isnan", None)] for a in c])
3736
+ if params.get("isinf", None) is not None:
3737
+ cargs.extend([a for c in [mrcalc_isinf_cargs(s, execution) for s in params.get("isinf", None)] for a in c])
3738
+ if params.get("finite", None) is not None:
3739
+ cargs.extend([a for c in [mrcalc_finite_cargs(s, execution) for s in params.get("finite", None)] for a in c])
3740
+ if params.get("complex", None) is not None:
3741
+ cargs.extend([a for c in [mrcalc_complex_cargs(s, execution) for s in params.get("complex", None)] for a in c])
3742
+ if params.get("polar", None) is not None:
3743
+ cargs.extend([a for c in [mrcalc_polar_cargs(s, execution) for s in params.get("polar", None)] for a in c])
3744
+ if params.get("real", None) is not None:
3745
+ cargs.extend([a for c in [mrcalc_real_cargs(s, execution) for s in params.get("real", None)] for a in c])
3746
+ if params.get("imag", None) is not None:
3747
+ cargs.extend([a for c in [mrcalc_imag_cargs(s, execution) for s in params.get("imag", None)] for a in c])
3748
+ if params.get("phase", None) is not None:
3749
+ cargs.extend([a for c in [mrcalc_phase_cargs(s, execution) for s in params.get("phase", None)] for a in c])
3750
+ if params.get("conj", None) is not None:
3751
+ cargs.extend([a for c in [mrcalc_conj_cargs(s, execution) for s in params.get("conj", None)] for a in c])
3752
+ if params.get("proj", None) is not None:
3753
+ cargs.extend([a for c in [mrcalc_proj_cargs(s, execution) for s in params.get("proj", None)] for a in c])
3754
+ if params.get("exp", None) is not None:
3755
+ cargs.extend([a for c in [mrcalc_exp_cargs(s, execution) for s in params.get("exp", None)] for a in c])
3756
+ if params.get("log", None) is not None:
3757
+ cargs.extend([a for c in [mrcalc_log_cargs(s, execution) for s in params.get("log", None)] for a in c])
3758
+ if params.get("log10", None) is not None:
3759
+ cargs.extend([a for c in [mrcalc_log10_cargs(s, execution) for s in params.get("log10", None)] for a in c])
3760
+ if params.get("cos", None) is not None:
3761
+ cargs.extend([a for c in [mrcalc_cos_cargs(s, execution) for s in params.get("cos", None)] for a in c])
3762
+ if params.get("sin", None) is not None:
3763
+ cargs.extend([a for c in [mrcalc_sin_cargs(s, execution) for s in params.get("sin", None)] for a in c])
3764
+ if params.get("tan", None) is not None:
3765
+ cargs.extend([a for c in [mrcalc_tan_cargs(s, execution) for s in params.get("tan", None)] for a in c])
3766
+ if params.get("acos", None) is not None:
3767
+ cargs.extend([a for c in [mrcalc_acos_cargs(s, execution) for s in params.get("acos", None)] for a in c])
3768
+ if params.get("asin", None) is not None:
3769
+ cargs.extend([a for c in [mrcalc_asin_cargs(s, execution) for s in params.get("asin", None)] for a in c])
3770
+ if params.get("atan", None) is not None:
3771
+ cargs.extend([a for c in [mrcalc_atan_cargs(s, execution) for s in params.get("atan", None)] for a in c])
3772
+ if params.get("cosh", None) is not None:
3773
+ cargs.extend([a for c in [mrcalc_cosh_cargs(s, execution) for s in params.get("cosh", None)] for a in c])
3774
+ if params.get("sinh", None) is not None:
3775
+ cargs.extend([a for c in [mrcalc_sinh_cargs(s, execution) for s in params.get("sinh", None)] for a in c])
3776
+ if params.get("tanh", None) is not None:
3777
+ cargs.extend([a for c in [mrcalc_tanh_cargs(s, execution) for s in params.get("tanh", None)] for a in c])
3778
+ if params.get("acosh", None) is not None:
3779
+ cargs.extend([a for c in [mrcalc_acosh_cargs(s, execution) for s in params.get("acosh", None)] for a in c])
3780
+ if params.get("asinh", None) is not None:
3781
+ cargs.extend([a for c in [mrcalc_asinh_cargs(s, execution) for s in params.get("asinh", None)] for a in c])
3782
+ if params.get("atanh", None) is not None:
3783
+ cargs.extend([a for c in [mrcalc_atanh_cargs(s, execution) for s in params.get("atanh", None)] for a in c])
3784
+ if params.get("datatype", None) is not None:
3785
+ cargs.extend([
3786
+ "-datatype",
3787
+ params.get("datatype", None)
3788
+ ])
3789
+ if params.get("info", False):
3790
+ cargs.append("-info")
3791
+ if params.get("quiet", False):
3792
+ cargs.append("-quiet")
3793
+ if params.get("debug", False):
3794
+ cargs.append("-debug")
3795
+ if params.get("force", False):
3796
+ cargs.append("-force")
3797
+ if params.get("nthreads", None) is not None:
3798
+ cargs.extend([
3799
+ "-nthreads",
3800
+ str(params.get("nthreads", None))
3801
+ ])
3802
+ if params.get("config", None) is not None:
3803
+ cargs.extend([a for c in [mrcalc_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
3804
+ if params.get("help", False):
3805
+ cargs.append("-help")
3806
+ if params.get("version", False):
3807
+ cargs.append("-version")
3808
+ cargs.extend([a for c in [mrcalc_operand_cargs_dyn_fn(s["@type"])(s, execution) for s in params.get("operand", None)] for a in c])
3809
+ return cargs
3810
+
3811
+
3812
+ def mrcalc_outputs(
3813
+ params: MrcalcParamsDict,
3814
+ execution: Execution,
3815
+ ) -> MrcalcOutputs:
3816
+ """
3817
+ Build outputs object containing output file paths and possibly stdout/stderr.
3818
+
3819
+ Args:
3820
+ params: The parameters.
3821
+ execution: The execution object for resolving input paths.
3822
+ Returns:
3823
+ Outputs object.
3824
+ """
3825
+ ret = MrcalcOutputs(
3826
+ root=execution.output_file("."),
3827
+ )
3828
+ return ret
3829
+
3830
+
3831
+ def mrcalc_execute(
3832
+ params: MrcalcParamsDict,
3833
+ runner: Runner | None = None,
3834
+ ) -> MrcalcOutputs:
3835
+ """
3836
+ mrcalc
3837
+
3838
+ Apply generic voxel-wise mathematical operations to images.
3839
+
3840
+ This command will only compute per-voxel operations. Use 'mrmath' to compute
3841
+ summary statistics across images or along image axes.
3842
+
3843
+ This command uses a stack-based syntax, with operators (specified using
3844
+ options) operating on the top-most entries (i.e. images or values) in the
3845
+ stack. Operands (values or images) are pushed onto the stack in the order
3846
+ they appear (as arguments) on the command-line, and operators (specified as
3847
+ options) operate on and consume the top-most entries in the stack, and push
3848
+ their output as a new entry on the stack.
3849
+
3850
+ As an additional feature, this command will allow images with different
3851
+ dimensions to be processed, provided they satisfy the following conditions:
3852
+ for each axis, the dimensions match if they are the same size, or one of
3853
+ them has size one. In the latter case, the entire image will be replicated
3854
+ along that axis. This allows for example a 4D image of size [ X Y Z N ] to
3855
+ be added to a 3D image of size [ X Y Z ], as if it consisted of N copies of
3856
+ the 3D image along the 4th axis (the missing dimension is assumed to have
3857
+ size 1). Another example would a single-voxel 4D image of size [ 1 1 1 N ],
3858
+ multiplied by a 3D image of size [ X Y Z ], which would allow the creation
3859
+ of a 4D image where each volume consists of the 3D image scaled by the
3860
+ corresponding value for that volume in the single-voxel image.
3861
+
3862
+ References:
3863
+
3864
+ .
3865
+
3866
+ Author: MRTrix3 Developers
3867
+
3868
+ URL: https://www.mrtrix.org/
3869
+
3870
+ Args:
3871
+ params: The parameters.
3872
+ runner: Command runner.
3873
+ Returns:
3874
+ NamedTuple of outputs (described in `MrcalcOutputs`).
3875
+ """
3876
+ mrcalc_validate(params)
3877
+ runner = runner or get_global_runner()
3878
+ execution = runner.start_execution(MRCALC_METADATA)
3879
+ params = execution.params(params)
3880
+ cargs = mrcalc_cargs(params, execution)
3881
+ ret = mrcalc_outputs(params, execution)
3882
+ execution.run(cargs)
3883
+ return ret
3884
+
3885
+
3886
+ def mrcalc(
3887
+ operand: list[typing.Union[MrcalcVariousStringParamsDictTagged, MrcalcVariousFileParamsDictTagged]],
3888
+ abs_: list[MrcalcAbsParamsDict] | None = None,
3889
+ neg: list[MrcalcNegParamsDict] | None = None,
3890
+ add: list[MrcalcAddParamsDict] | None = None,
3891
+ subtract: list[MrcalcSubtractParamsDict] | None = None,
3892
+ multiply: list[MrcalcMultiplyParamsDict] | None = None,
3893
+ divide: list[MrcalcDivideParamsDict] | None = None,
3894
+ min_: list[MrcalcMinParamsDict] | None = None,
3895
+ max_: list[MrcalcMaxParamsDict] | None = None,
3896
+ lt: list[MrcalcLtParamsDict] | None = None,
3897
+ gt: list[MrcalcGtParamsDict] | None = None,
3898
+ le: list[MrcalcLeParamsDict] | None = None,
3899
+ ge: list[MrcalcGeParamsDict] | None = None,
3900
+ eq: list[MrcalcEqParamsDict] | None = None,
3901
+ neq: list[MrcalcNeqParamsDict] | None = None,
3902
+ if_: list[MrcalcIfParamsDict] | None = None,
3903
+ replace: list[MrcalcReplaceParamsDict] | None = None,
3904
+ sqrt: list[MrcalcSqrtParamsDict] | None = None,
3905
+ pow_: list[MrcalcPowParamsDict] | None = None,
3906
+ round_: list[MrcalcRoundParamsDict] | None = None,
3907
+ ceil: list[MrcalcCeilParamsDict] | None = None,
3908
+ floor: list[MrcalcFloorParamsDict] | None = None,
3909
+ not_: list[MrcalcNotParamsDict] | None = None,
3910
+ and_: list[MrcalcAndParamsDict] | None = None,
3911
+ or_: list[MrcalcOrParamsDict] | None = None,
3912
+ xor: list[MrcalcXorParamsDict] | None = None,
3913
+ isnan: list[MrcalcIsnanParamsDict] | None = None,
3914
+ isinf: list[MrcalcIsinfParamsDict] | None = None,
3915
+ finite: list[MrcalcFiniteParamsDict] | None = None,
3916
+ complex_: list[MrcalcComplexParamsDict] | None = None,
3917
+ polar: list[MrcalcPolarParamsDict] | None = None,
3918
+ real: list[MrcalcRealParamsDict] | None = None,
3919
+ imag: list[MrcalcImagParamsDict] | None = None,
3920
+ phase: list[MrcalcPhaseParamsDict] | None = None,
3921
+ conj: list[MrcalcConjParamsDict] | None = None,
3922
+ proj: list[MrcalcProjParamsDict] | None = None,
3923
+ exp: list[MrcalcExpParamsDict] | None = None,
3924
+ log: list[MrcalcLogParamsDict] | None = None,
3925
+ log10: list[MrcalcLog10ParamsDict] | None = None,
3926
+ cos: list[MrcalcCosParamsDict] | None = None,
3927
+ sin: list[MrcalcSinParamsDict] | None = None,
3928
+ tan: list[MrcalcTanParamsDict] | None = None,
3929
+ acos: list[MrcalcAcosParamsDict] | None = None,
3930
+ asin: list[MrcalcAsinParamsDict] | None = None,
3931
+ atan: list[MrcalcAtanParamsDict] | None = None,
3932
+ cosh: list[MrcalcCoshParamsDict] | None = None,
3933
+ sinh: list[MrcalcSinhParamsDict] | None = None,
3934
+ tanh: list[MrcalcTanhParamsDict] | None = None,
3935
+ acosh: list[MrcalcAcoshParamsDict] | None = None,
3936
+ asinh: list[MrcalcAsinhParamsDict] | None = None,
3937
+ atanh: list[MrcalcAtanhParamsDict] | None = None,
3938
+ datatype: str | None = None,
3939
+ info: bool = False,
3940
+ quiet: bool = False,
3941
+ debug: bool = False,
3942
+ force: bool = False,
3943
+ nthreads: int | None = None,
3944
+ config: list[MrcalcConfigParamsDict] | None = None,
3945
+ help_: bool = False,
3946
+ version: bool = False,
3947
+ runner: Runner | None = None,
3948
+ ) -> MrcalcOutputs:
3949
+ """
3950
+ mrcalc
3951
+
3952
+ Apply generic voxel-wise mathematical operations to images.
3953
+
3954
+ This command will only compute per-voxel operations. Use 'mrmath' to compute
3955
+ summary statistics across images or along image axes.
3956
+
3957
+ This command uses a stack-based syntax, with operators (specified using
3958
+ options) operating on the top-most entries (i.e. images or values) in the
3959
+ stack. Operands (values or images) are pushed onto the stack in the order
3960
+ they appear (as arguments) on the command-line, and operators (specified as
3961
+ options) operate on and consume the top-most entries in the stack, and push
3962
+ their output as a new entry on the stack.
3963
+
3964
+ As an additional feature, this command will allow images with different
3965
+ dimensions to be processed, provided they satisfy the following conditions:
3966
+ for each axis, the dimensions match if they are the same size, or one of
3967
+ them has size one. In the latter case, the entire image will be replicated
3968
+ along that axis. This allows for example a 4D image of size [ X Y Z N ] to
3969
+ be added to a 3D image of size [ X Y Z ], as if it consisted of N copies of
3970
+ the 3D image along the 4th axis (the missing dimension is assumed to have
3971
+ size 1). Another example would a single-voxel 4D image of size [ 1 1 1 N ],
3972
+ multiplied by a 3D image of size [ X Y Z ], which would allow the creation
3973
+ of a 4D image where each volume consists of the 3D image scaled by the
3974
+ corresponding value for that volume in the single-voxel image.
3975
+
3976
+ References:
3977
+
3978
+ .
3979
+
3980
+ Author: MRTrix3 Developers
3981
+
3982
+ URL: https://www.mrtrix.org/
3983
+
3984
+ Args:
3985
+ operand: an input image, intensity value, or the special keywords\
3986
+ 'rand' (random number between 0 and 1) or 'randn' (random number from\
3987
+ unit std.dev. normal distribution) or the mathematical constants 'e'\
3988
+ and 'pi'.
3989
+ abs_: |%1| : return absolute value (magnitude) of real or complex\
3990
+ number.
3991
+ neg: -%1 : negative value.
3992
+ add: (%1 + %2) : add values.
3993
+ subtract: (%1 - %2) : subtract nth operand from (n-1)th.
3994
+ multiply: (%1 * %2) : multiply values.
3995
+ divide: (%1 / %2) : divide (n-1)th operand by nth.
3996
+ min_: min (%1, %2) : smallest of last two operands.
3997
+ max_: max (%1, %2) : greatest of last two operands.
3998
+ lt: (%1 < %2) : less-than operator (true=1, false=0).
3999
+ gt: (%1 > %2) : greater-than operator (true=1, false=0).
4000
+ le: (%1 <= %2) : less-than-or-equal-to operator (true=1, false=0).
4001
+ ge: (%1 >= %2) : greater-than-or-equal-to operator (true=1, false=0).
4002
+ eq: (%1 == %2) : equal-to operator (true=1, false=0).
4003
+ neq: (%1 != %2) : not-equal-to operator (true=1, false=0).
4004
+ if_: (%1 ? %2 : %3) : if first operand is true (non-zero), return\
4005
+ second operand, otherwise return third operand.
4006
+ replace: (%1, %2 -> %3) : Wherever first operand is equal to the second\
4007
+ operand, replace with third operand.
4008
+ sqrt: sqrt (%1) : square root.
4009
+ pow_: %1^%2 : raise (n-1)th operand to nth power.
4010
+ round_: round (%1) : round to nearest integer.
4011
+ ceil: ceil (%1) : round up to nearest integer.
4012
+ floor: floor (%1) : round down to nearest integer.
4013
+ not_: !%1 : NOT operator: true (1) if operand is false (i.e. zero).
4014
+ and_: (%1 && %2) : AND operator: true (1) if both operands are true\
4015
+ (i.e. non-zero).
4016
+ or_: (%1 || %2) : OR operator: true (1) if either operand is true (i.e.\
4017
+ non-zero).
4018
+ xor: (%1 ^^ %2) : XOR operator: true (1) if only one of the operands is\
4019
+ true (i.e. non-zero).
4020
+ isnan: isnan (%1) : true (1) if operand is not-a-number (NaN).
4021
+ isinf: isinf (%1) : true (1) if operand is infinite (Inf).
4022
+ finite: finite (%1) : true (1) if operand is finite (i.e. not NaN or\
4023
+ Inf).
4024
+ complex_: (%1 + %2 i) : create complex number using the last two\
4025
+ operands as real,imaginary components.
4026
+ polar: (%1 /_ %2) : create complex number using the last two operands\
4027
+ as magnitude,phase components (phase in radians).
4028
+ real: real (%1) : real part of complex number.
4029
+ imag: imag (%1) : imaginary part of complex number.
4030
+ phase: phase (%1) : phase of complex number (use -abs for magnitude).
4031
+ conj: conj (%1) : complex conjugate.
4032
+ proj: proj (%1) : projection onto the Riemann sphere.
4033
+ exp: exp (%1) : exponential function.
4034
+ log: log (%1) : natural logarithm.
4035
+ log10: log10 (%1) : common logarithm.
4036
+ cos: cos (%1) : cosine.
4037
+ sin: sin (%1) : sine.
4038
+ tan: tan (%1) : tangent.
4039
+ acos: acos (%1) : inverse cosine.
4040
+ asin: asin (%1) : inverse sine.
4041
+ atan: atan (%1) : inverse tangent.
4042
+ cosh: cosh (%1) : hyperbolic cosine.
4043
+ sinh: sinh (%1) : hyperbolic sine.
4044
+ tanh: tanh (%1) : hyperbolic tangent.
4045
+ acosh: acosh (%1) : inverse hyperbolic cosine.
4046
+ asinh: asinh (%1) : inverse hyperbolic sine.
4047
+ atanh: atanh (%1) : inverse hyperbolic tangent.
4048
+ datatype: specify output image data type. Valid choices are: float32,\
4049
+ float32le, float32be, float64, float64le, float64be, int64, uint64,\
4050
+ int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
4051
+ int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
4052
+ cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
4053
+ int8, uint8, bit.
4054
+ info: display information messages.
4055
+ quiet: do not display information messages or progress status;\
4056
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
4057
+ environment variable to a non-empty string.
4058
+ debug: display debugging messages.
4059
+ force: force overwrite of output files (caution: using the same file as\
4060
+ input and output might cause unexpected behaviour).
4061
+ nthreads: use this number of threads in multi-threaded applications\
4062
+ (set to 0 to disable multi-threading).
4063
+ config: temporarily set the value of an MRtrix config file entry.
4064
+ help_: display this information page and exit.
4065
+ version: display version information and exit.
4066
+ runner: Command runner.
4067
+ Returns:
4068
+ NamedTuple of outputs (described in `MrcalcOutputs`).
4069
+ """
4070
+ params = mrcalc_params(
4071
+ abs_=abs_,
4072
+ neg=neg,
4073
+ add=add,
4074
+ subtract=subtract,
4075
+ multiply=multiply,
4076
+ divide=divide,
4077
+ min_=min_,
4078
+ max_=max_,
4079
+ lt=lt,
4080
+ gt=gt,
4081
+ le=le,
4082
+ ge=ge,
4083
+ eq=eq,
4084
+ neq=neq,
4085
+ if_=if_,
4086
+ replace=replace,
4087
+ sqrt=sqrt,
4088
+ pow_=pow_,
4089
+ round_=round_,
4090
+ ceil=ceil,
4091
+ floor=floor,
4092
+ not_=not_,
4093
+ and_=and_,
4094
+ or_=or_,
4095
+ xor=xor,
4096
+ isnan=isnan,
4097
+ isinf=isinf,
4098
+ finite=finite,
4099
+ complex_=complex_,
4100
+ polar=polar,
4101
+ real=real,
4102
+ imag=imag,
4103
+ phase=phase,
4104
+ conj=conj,
4105
+ proj=proj,
4106
+ exp=exp,
4107
+ log=log,
4108
+ log10=log10,
4109
+ cos=cos,
4110
+ sin=sin,
4111
+ tan=tan,
4112
+ acos=acos,
4113
+ asin=asin,
4114
+ atan=atan,
4115
+ cosh=cosh,
4116
+ sinh=sinh,
4117
+ tanh=tanh,
4118
+ acosh=acosh,
4119
+ asinh=asinh,
4120
+ atanh=atanh,
4121
+ datatype=datatype,
4122
+ info=info,
4123
+ quiet=quiet,
4124
+ debug=debug,
4125
+ force=force,
4126
+ nthreads=nthreads,
4127
+ config=config,
4128
+ help_=help_,
4129
+ version=version,
4130
+ operand=operand,
4131
+ )
4132
+ return mrcalc_execute(params, runner)
4133
+
4134
+
4135
+ __all__ = [
4136
+ "MRCALC_METADATA",
4137
+ "MrcalcAbsParamsDict",
4138
+ "MrcalcAbsParamsDictTagged",
4139
+ "MrcalcAcosParamsDict",
4140
+ "MrcalcAcosParamsDictTagged",
4141
+ "MrcalcAcoshParamsDict",
4142
+ "MrcalcAcoshParamsDictTagged",
4143
+ "MrcalcAddParamsDict",
4144
+ "MrcalcAddParamsDictTagged",
4145
+ "MrcalcAndParamsDict",
4146
+ "MrcalcAndParamsDictTagged",
4147
+ "MrcalcAsinParamsDict",
4148
+ "MrcalcAsinParamsDictTagged",
4149
+ "MrcalcAsinhParamsDict",
4150
+ "MrcalcAsinhParamsDictTagged",
4151
+ "MrcalcAtanParamsDict",
4152
+ "MrcalcAtanParamsDictTagged",
4153
+ "MrcalcAtanhParamsDict",
4154
+ "MrcalcAtanhParamsDictTagged",
4155
+ "MrcalcCeilParamsDict",
4156
+ "MrcalcCeilParamsDictTagged",
4157
+ "MrcalcComplexParamsDict",
4158
+ "MrcalcComplexParamsDictTagged",
4159
+ "MrcalcConfigParamsDict",
4160
+ "MrcalcConfigParamsDictTagged",
4161
+ "MrcalcConjParamsDict",
4162
+ "MrcalcConjParamsDictTagged",
4163
+ "MrcalcCosParamsDict",
4164
+ "MrcalcCosParamsDictTagged",
4165
+ "MrcalcCoshParamsDict",
4166
+ "MrcalcCoshParamsDictTagged",
4167
+ "MrcalcDivideParamsDict",
4168
+ "MrcalcDivideParamsDictTagged",
4169
+ "MrcalcEqParamsDict",
4170
+ "MrcalcEqParamsDictTagged",
4171
+ "MrcalcExpParamsDict",
4172
+ "MrcalcExpParamsDictTagged",
4173
+ "MrcalcFiniteParamsDict",
4174
+ "MrcalcFiniteParamsDictTagged",
4175
+ "MrcalcFloorParamsDict",
4176
+ "MrcalcFloorParamsDictTagged",
4177
+ "MrcalcGeParamsDict",
4178
+ "MrcalcGeParamsDictTagged",
4179
+ "MrcalcGtParamsDict",
4180
+ "MrcalcGtParamsDictTagged",
4181
+ "MrcalcIfParamsDict",
4182
+ "MrcalcIfParamsDictTagged",
4183
+ "MrcalcImagParamsDict",
4184
+ "MrcalcImagParamsDictTagged",
4185
+ "MrcalcIsinfParamsDict",
4186
+ "MrcalcIsinfParamsDictTagged",
4187
+ "MrcalcIsnanParamsDict",
4188
+ "MrcalcIsnanParamsDictTagged",
4189
+ "MrcalcLeParamsDict",
4190
+ "MrcalcLeParamsDictTagged",
4191
+ "MrcalcLog10ParamsDict",
4192
+ "MrcalcLog10ParamsDictTagged",
4193
+ "MrcalcLogParamsDict",
4194
+ "MrcalcLogParamsDictTagged",
4195
+ "MrcalcLtParamsDict",
4196
+ "MrcalcLtParamsDictTagged",
4197
+ "MrcalcMaxParamsDict",
4198
+ "MrcalcMaxParamsDictTagged",
4199
+ "MrcalcMinParamsDict",
4200
+ "MrcalcMinParamsDictTagged",
4201
+ "MrcalcMultiplyParamsDict",
4202
+ "MrcalcMultiplyParamsDictTagged",
4203
+ "MrcalcNegParamsDict",
4204
+ "MrcalcNegParamsDictTagged",
4205
+ "MrcalcNeqParamsDict",
4206
+ "MrcalcNeqParamsDictTagged",
4207
+ "MrcalcNotParamsDict",
4208
+ "MrcalcNotParamsDictTagged",
4209
+ "MrcalcOrParamsDict",
4210
+ "MrcalcOrParamsDictTagged",
4211
+ "MrcalcOutputs",
4212
+ "MrcalcParamsDict",
4213
+ "MrcalcParamsDictTagged",
4214
+ "MrcalcPhaseParamsDict",
4215
+ "MrcalcPhaseParamsDictTagged",
4216
+ "MrcalcPolarParamsDict",
4217
+ "MrcalcPolarParamsDictTagged",
4218
+ "MrcalcPowParamsDict",
4219
+ "MrcalcPowParamsDictTagged",
4220
+ "MrcalcProjParamsDict",
4221
+ "MrcalcProjParamsDictTagged",
4222
+ "MrcalcRealParamsDict",
4223
+ "MrcalcRealParamsDictTagged",
4224
+ "MrcalcReplaceParamsDict",
4225
+ "MrcalcReplaceParamsDictTagged",
4226
+ "MrcalcRoundParamsDict",
4227
+ "MrcalcRoundParamsDictTagged",
4228
+ "MrcalcSinParamsDict",
4229
+ "MrcalcSinParamsDictTagged",
4230
+ "MrcalcSinhParamsDict",
4231
+ "MrcalcSinhParamsDictTagged",
4232
+ "MrcalcSqrtParamsDict",
4233
+ "MrcalcSqrtParamsDictTagged",
4234
+ "MrcalcSubtractParamsDict",
4235
+ "MrcalcSubtractParamsDictTagged",
4236
+ "MrcalcTanParamsDict",
4237
+ "MrcalcTanParamsDictTagged",
4238
+ "MrcalcTanhParamsDict",
4239
+ "MrcalcTanhParamsDictTagged",
4240
+ "MrcalcVariousFileParamsDict",
4241
+ "MrcalcVariousFileParamsDictTagged",
4242
+ "MrcalcVariousStringParamsDict",
4243
+ "MrcalcVariousStringParamsDictTagged",
4244
+ "MrcalcXorParamsDict",
4245
+ "MrcalcXorParamsDictTagged",
4246
+ "mrcalc",
4247
+ "mrcalc_abs",
4248
+ "mrcalc_acos",
4249
+ "mrcalc_acosh",
4250
+ "mrcalc_add",
4251
+ "mrcalc_and",
4252
+ "mrcalc_asin",
4253
+ "mrcalc_asinh",
4254
+ "mrcalc_atan",
4255
+ "mrcalc_atanh",
4256
+ "mrcalc_ceil",
4257
+ "mrcalc_complex",
4258
+ "mrcalc_config",
4259
+ "mrcalc_conj",
4260
+ "mrcalc_cos",
4261
+ "mrcalc_cosh",
4262
+ "mrcalc_divide",
4263
+ "mrcalc_eq",
4264
+ "mrcalc_execute",
4265
+ "mrcalc_exp",
4266
+ "mrcalc_finite",
4267
+ "mrcalc_floor",
4268
+ "mrcalc_ge",
4269
+ "mrcalc_gt",
4270
+ "mrcalc_if",
4271
+ "mrcalc_imag",
4272
+ "mrcalc_isinf",
4273
+ "mrcalc_isnan",
4274
+ "mrcalc_le",
4275
+ "mrcalc_log",
4276
+ "mrcalc_log10",
4277
+ "mrcalc_lt",
4278
+ "mrcalc_max",
4279
+ "mrcalc_min",
4280
+ "mrcalc_multiply",
4281
+ "mrcalc_neg",
4282
+ "mrcalc_neq",
4283
+ "mrcalc_not",
4284
+ "mrcalc_or",
4285
+ "mrcalc_params",
4286
+ "mrcalc_phase",
4287
+ "mrcalc_polar",
4288
+ "mrcalc_pow",
4289
+ "mrcalc_proj",
4290
+ "mrcalc_real",
4291
+ "mrcalc_replace",
4292
+ "mrcalc_round",
4293
+ "mrcalc_sin",
4294
+ "mrcalc_sinh",
4295
+ "mrcalc_sqrt",
4296
+ "mrcalc_subtract",
4297
+ "mrcalc_tan",
4298
+ "mrcalc_tanh",
4299
+ "mrcalc_various_file",
4300
+ "mrcalc_various_string",
4301
+ "mrcalc_xor",
4302
+ ]