niwrap-mrtrix 0.6.2__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (122) hide show
  1. niwrap_mrtrix/mrtrix/__init__.py +133 -0
  2. niwrap_mrtrix/mrtrix/afdconnectivity.py +59 -68
  3. niwrap_mrtrix/mrtrix/amp2response.py +72 -77
  4. niwrap_mrtrix/mrtrix/amp2sh.py +109 -74
  5. niwrap_mrtrix/mrtrix/connectome2tck.py +77 -79
  6. niwrap_mrtrix/mrtrix/connectomeedit.py +52 -62
  7. niwrap_mrtrix/mrtrix/connectomestats.py +117 -104
  8. niwrap_mrtrix/mrtrix/dcmedit.py +68 -73
  9. niwrap_mrtrix/mrtrix/dcminfo.py +67 -72
  10. niwrap_mrtrix/mrtrix/dirflip.py +56 -66
  11. niwrap_mrtrix/mrtrix/dirgen.py +68 -75
  12. niwrap_mrtrix/mrtrix/dirmerge.py +56 -66
  13. niwrap_mrtrix/mrtrix/dirorder.py +53 -64
  14. niwrap_mrtrix/mrtrix/dirsplit.py +56 -66
  15. niwrap_mrtrix/mrtrix/dirstat.py +70 -75
  16. niwrap_mrtrix/mrtrix/dwi2adc.py +67 -74
  17. niwrap_mrtrix/mrtrix/dwi2fod.py +141 -96
  18. niwrap_mrtrix/mrtrix/dwi2mask.py +70 -76
  19. niwrap_mrtrix/mrtrix/dwi2response.py +238 -157
  20. niwrap_mrtrix/mrtrix/dwi2tensor.py +87 -88
  21. niwrap_mrtrix/mrtrix/dwibiascorrect.py +97 -95
  22. niwrap_mrtrix/mrtrix/dwidenoise.py +67 -74
  23. niwrap_mrtrix/mrtrix/dwiextract.py +143 -99
  24. niwrap_mrtrix/mrtrix/dwigradcheck.py +89 -91
  25. niwrap_mrtrix/mrtrix/fixel2peaks.py +77 -51
  26. niwrap_mrtrix/mrtrix/fixel2sh.py +54 -65
  27. niwrap_mrtrix/mrtrix/fixel2tsf.py +56 -66
  28. niwrap_mrtrix/mrtrix/fixel2voxel.py +62 -70
  29. niwrap_mrtrix/mrtrix/fixelcfestats.py +145 -93
  30. niwrap_mrtrix/mrtrix/fixelconnectivity.py +62 -70
  31. niwrap_mrtrix/mrtrix/fixelconvert.py +136 -69
  32. niwrap_mrtrix/mrtrix/fixelcorrespondence.py +61 -69
  33. niwrap_mrtrix/mrtrix/fixelcrop.py +53 -64
  34. niwrap_mrtrix/mrtrix/fixelfilter.py +139 -71
  35. niwrap_mrtrix/mrtrix/fixelreorient.py +53 -64
  36. niwrap_mrtrix/mrtrix/fod2dec.py +70 -75
  37. niwrap_mrtrix/mrtrix/fod2fixel.py +84 -85
  38. niwrap_mrtrix/mrtrix/label2colour.py +58 -67
  39. niwrap_mrtrix/mrtrix/label2mesh.py +53 -64
  40. niwrap_mrtrix/mrtrix/labelconvert.py +58 -67
  41. niwrap_mrtrix/mrtrix/labelstats.py +53 -63
  42. niwrap_mrtrix/mrtrix/maskdump.py +52 -64
  43. niwrap_mrtrix/mrtrix/maskfilter.py +93 -61
  44. niwrap_mrtrix/mrtrix/mesh2voxel.py +53 -64
  45. niwrap_mrtrix/mrtrix/meshconvert.py +66 -73
  46. niwrap_mrtrix/mrtrix/meshfilter.py +59 -68
  47. niwrap_mrtrix/mrtrix/mraverageheader.py +62 -70
  48. niwrap_mrtrix/mrtrix/mrcalc.py +522 -397
  49. niwrap_mrtrix/mrtrix/mrcat.py +59 -68
  50. niwrap_mrtrix/mrtrix/mrcentroid.py +53 -63
  51. niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +58 -67
  52. niwrap_mrtrix/mrtrix/mrclusterstats.py +119 -105
  53. niwrap_mrtrix/mrtrix/mrcolour.py +62 -70
  54. niwrap_mrtrix/mrtrix/mrconvert.py +275 -173
  55. niwrap_mrtrix/mrtrix/mrdegibbs.py +66 -73
  56. niwrap_mrtrix/mrtrix/mrdump.py +55 -66
  57. niwrap_mrtrix/mrtrix/mredit.py +97 -94
  58. niwrap_mrtrix/mrtrix/mrfilter.py +124 -81
  59. niwrap_mrtrix/mrtrix/mrgrid.py +131 -88
  60. niwrap_mrtrix/mrtrix/mrhistmatch.py +64 -71
  61. niwrap_mrtrix/mrtrix/mrhistogram.py +64 -71
  62. niwrap_mrtrix/mrtrix/mrinfo.py +160 -137
  63. niwrap_mrtrix/mrtrix/mrmath.py +65 -73
  64. niwrap_mrtrix/mrtrix/mrmetric.py +69 -73
  65. niwrap_mrtrix/mrtrix/mrregister.py +263 -212
  66. niwrap_mrtrix/mrtrix/mrstats.py +66 -72
  67. niwrap_mrtrix/mrtrix/mrthreshold.py +80 -81
  68. niwrap_mrtrix/mrtrix/mrtransform.py +162 -109
  69. niwrap_mrtrix/mrtrix/mtnormalise.py +85 -88
  70. niwrap_mrtrix/mrtrix/peaks2amp.py +51 -63
  71. niwrap_mrtrix/mrtrix/peaks2fixel.py +54 -65
  72. niwrap_mrtrix/mrtrix/responsemean.py +51 -62
  73. niwrap_mrtrix/mrtrix/sh2amp.py +98 -65
  74. niwrap_mrtrix/mrtrix/sh2peaks.py +81 -83
  75. niwrap_mrtrix/mrtrix/sh2power.py +53 -64
  76. niwrap_mrtrix/mrtrix/sh2response.py +62 -70
  77. niwrap_mrtrix/mrtrix/shbasis.py +51 -62
  78. niwrap_mrtrix/mrtrix/shconv.py +78 -52
  79. niwrap_mrtrix/mrtrix/tck2connectome.py +93 -88
  80. niwrap_mrtrix/mrtrix/tck2fixel.py +57 -65
  81. niwrap_mrtrix/mrtrix/tckconvert.py +99 -65
  82. niwrap_mrtrix/mrtrix/tckdfc.py +82 -83
  83. niwrap_mrtrix/mrtrix/tckedit.py +240 -122
  84. niwrap_mrtrix/mrtrix/tckgen.py +364 -207
  85. niwrap_mrtrix/mrtrix/tckglobal.py +127 -115
  86. niwrap_mrtrix/mrtrix/tckinfo.py +50 -61
  87. niwrap_mrtrix/mrtrix/tckmap.py +121 -79
  88. niwrap_mrtrix/mrtrix/tckresample.py +97 -93
  89. niwrap_mrtrix/mrtrix/tcksample.py +62 -69
  90. niwrap_mrtrix/mrtrix/tcksift.py +102 -97
  91. niwrap_mrtrix/mrtrix/tcksift2.py +119 -107
  92. niwrap_mrtrix/mrtrix/tckstats.py +72 -78
  93. niwrap_mrtrix/mrtrix/tcktransform.py +53 -64
  94. niwrap_mrtrix/mrtrix/tensor2metric.py +93 -94
  95. niwrap_mrtrix/mrtrix/transformcalc.py +53 -64
  96. niwrap_mrtrix/mrtrix/transformcompose.py +74 -48
  97. niwrap_mrtrix/mrtrix/transformconvert.py +53 -64
  98. niwrap_mrtrix/mrtrix/tsfdivide.py +53 -64
  99. niwrap_mrtrix/mrtrix/tsfinfo.py +53 -63
  100. niwrap_mrtrix/mrtrix/tsfmult.py +51 -63
  101. niwrap_mrtrix/mrtrix/tsfsmooth.py +54 -65
  102. niwrap_mrtrix/mrtrix/tsfthreshold.py +55 -65
  103. niwrap_mrtrix/mrtrix/tsfvalidate.py +50 -61
  104. niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +54 -65
  105. niwrap_mrtrix/mrtrix/v_5tt2vis.py +69 -75
  106. niwrap_mrtrix/mrtrix/v_5ttcheck.py +51 -62
  107. niwrap_mrtrix/mrtrix/v_5ttedit.py +73 -79
  108. niwrap_mrtrix/mrtrix/v_5ttgen.py +132 -86
  109. niwrap_mrtrix/mrtrix/vectorstats.py +92 -88
  110. niwrap_mrtrix/mrtrix/voxel2fixel.py +54 -63
  111. niwrap_mrtrix/mrtrix/voxel2mesh.py +56 -66
  112. niwrap_mrtrix/mrtrix/warp2metric.py +71 -77
  113. niwrap_mrtrix/mrtrix/warpconvert.py +61 -69
  114. niwrap_mrtrix/mrtrix/warpcorrect.py +61 -71
  115. niwrap_mrtrix/mrtrix/warpinit.py +51 -63
  116. niwrap_mrtrix/mrtrix/warpinvert.py +56 -66
  117. niwrap_mrtrix-0.7.0.dist-info/METADATA +8 -0
  118. niwrap_mrtrix-0.7.0.dist-info/RECORD +119 -0
  119. niwrap_mrtrix-0.7.0.dist-info/WHEEL +4 -0
  120. niwrap_mrtrix-0.6.2.dist-info/METADATA +0 -8
  121. niwrap_mrtrix-0.6.2.dist-info/RECORD +0 -119
  122. niwrap_mrtrix-0.6.2.dist-info/WHEEL +0 -4
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  FIXEL2PEAKS_METADATA = Metadata(
9
- id="5e3b8600a7924403d728fedc4abecdb6bc9848fe.boutiques",
9
+ id="0d92be2b2e1ceff15fcfee87e64154e86fddb5a8.boutiques",
10
10
  name="fixel2peaks",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,26 +14,54 @@ FIXEL2PEAKS_METADATA = Metadata(
14
14
 
15
15
 
16
16
  Fixel2peaksConfigParameters = typing.TypedDict('Fixel2peaksConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ Fixel2peaksConfigParametersTagged = typing.TypedDict('Fixel2peaksConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  Fixel2peaksVariousStringParameters = typing.TypedDict('Fixel2peaksVariousStringParameters', {
24
- "__STYXTYPE__": typing.Literal["VariousString"],
29
+ "@type": typing.NotRequired[typing.Literal["VariousString"]],
30
+ "obj": str,
31
+ })
32
+ Fixel2peaksVariousStringParametersTagged = typing.TypedDict('Fixel2peaksVariousStringParametersTagged', {
33
+ "@type": typing.Literal["VariousString"],
25
34
  "obj": str,
26
35
  })
27
36
 
28
37
 
29
38
  Fixel2peaksVariousFileParameters = typing.TypedDict('Fixel2peaksVariousFileParameters', {
30
- "__STYXTYPE__": typing.Literal["VariousFile"],
39
+ "@type": typing.NotRequired[typing.Literal["VariousFile"]],
40
+ "obj": InputPathType,
41
+ })
42
+ Fixel2peaksVariousFileParametersTagged = typing.TypedDict('Fixel2peaksVariousFileParametersTagged', {
43
+ "@type": typing.Literal["VariousFile"],
31
44
  "obj": InputPathType,
32
45
  })
33
46
 
34
47
 
35
48
  Fixel2peaksParameters = typing.TypedDict('Fixel2peaksParameters', {
36
- "__STYXTYPE__": typing.Literal["fixel2peaks"],
49
+ "@type": typing.NotRequired[typing.Literal["mrtrix/fixel2peaks"]],
50
+ "number": typing.NotRequired[int | None],
51
+ "nan": bool,
52
+ "info": bool,
53
+ "quiet": bool,
54
+ "debug": bool,
55
+ "force": bool,
56
+ "nthreads": typing.NotRequired[int | None],
57
+ "config": typing.NotRequired[list[Fixel2peaksConfigParameters] | None],
58
+ "help": bool,
59
+ "version": bool,
60
+ "in": typing.Union[Fixel2peaksVariousStringParametersTagged, Fixel2peaksVariousFileParametersTagged],
61
+ "out": str,
62
+ })
63
+ Fixel2peaksParametersTagged = typing.TypedDict('Fixel2peaksParametersTagged', {
64
+ "@type": typing.Literal["mrtrix/fixel2peaks"],
37
65
  "number": typing.NotRequired[int | None],
38
66
  "nan": bool,
39
67
  "info": bool,
@@ -44,12 +72,12 @@ Fixel2peaksParameters = typing.TypedDict('Fixel2peaksParameters', {
44
72
  "config": typing.NotRequired[list[Fixel2peaksConfigParameters] | None],
45
73
  "help": bool,
46
74
  "version": bool,
47
- "in": typing.Union[Fixel2peaksVariousStringParameters, Fixel2peaksVariousFileParameters],
75
+ "in": typing.Union[Fixel2peaksVariousStringParametersTagged, Fixel2peaksVariousFileParametersTagged],
48
76
  "out": str,
49
77
  })
50
78
 
51
79
 
52
- def dyn_cargs(
80
+ def fixel2peaks_in_cargs_dyn_fn(
53
81
  t: str,
54
82
  ) -> typing.Any:
55
83
  """
@@ -61,14 +89,12 @@ def dyn_cargs(
61
89
  Build cargs function.
62
90
  """
63
91
  return {
64
- "fixel2peaks": fixel2peaks_cargs,
65
- "config": fixel2peaks_config_cargs,
66
92
  "VariousString": fixel2peaks_various_string_cargs,
67
93
  "VariousFile": fixel2peaks_various_file_cargs,
68
94
  }.get(t)
69
95
 
70
96
 
71
- def dyn_outputs(
97
+ def fixel2peaks_in_outputs_dyn_fn(
72
98
  t: str,
73
99
  ) -> typing.Any:
74
100
  """
@@ -80,14 +106,13 @@ def dyn_outputs(
80
106
  Build outputs function.
81
107
  """
82
108
  return {
83
- "fixel2peaks": fixel2peaks_outputs,
84
109
  }.get(t)
85
110
 
86
111
 
87
112
  def fixel2peaks_config_params(
88
113
  key: str,
89
114
  value: str,
90
- ) -> Fixel2peaksConfigParameters:
115
+ ) -> Fixel2peaksConfigParametersTagged:
91
116
  """
92
117
  Build parameters.
93
118
 
@@ -98,7 +123,7 @@ def fixel2peaks_config_params(
98
123
  Parameter dictionary
99
124
  """
100
125
  params = {
101
- "__STYXTYPE__": "config",
126
+ "@type": "config",
102
127
  "key": key,
103
128
  "value": value,
104
129
  }
@@ -120,14 +145,14 @@ def fixel2peaks_config_cargs(
120
145
  """
121
146
  cargs = []
122
147
  cargs.append("-config")
123
- cargs.append(params.get("key"))
124
- cargs.append(params.get("value"))
148
+ cargs.append(params.get("key", None))
149
+ cargs.append(params.get("value", None))
125
150
  return cargs
126
151
 
127
152
 
128
153
  def fixel2peaks_various_string_params(
129
154
  obj: str,
130
- ) -> Fixel2peaksVariousStringParameters:
155
+ ) -> Fixel2peaksVariousStringParametersTagged:
131
156
  """
132
157
  Build parameters.
133
158
 
@@ -137,7 +162,7 @@ def fixel2peaks_various_string_params(
137
162
  Parameter dictionary
138
163
  """
139
164
  params = {
140
- "__STYXTYPE__": "VariousString",
165
+ "@type": "VariousString",
141
166
  "obj": obj,
142
167
  }
143
168
  return params
@@ -157,13 +182,13 @@ def fixel2peaks_various_string_cargs(
157
182
  Command-line arguments.
158
183
  """
159
184
  cargs = []
160
- cargs.append(params.get("obj"))
185
+ cargs.append(params.get("obj", None))
161
186
  return cargs
162
187
 
163
188
 
164
189
  def fixel2peaks_various_file_params(
165
190
  obj: InputPathType,
166
- ) -> Fixel2peaksVariousFileParameters:
191
+ ) -> Fixel2peaksVariousFileParametersTagged:
167
192
  """
168
193
  Build parameters.
169
194
 
@@ -173,7 +198,7 @@ def fixel2peaks_various_file_params(
173
198
  Parameter dictionary
174
199
  """
175
200
  params = {
176
- "__STYXTYPE__": "VariousFile",
201
+ "@type": "VariousFile",
177
202
  "obj": obj,
178
203
  }
179
204
  return params
@@ -193,13 +218,13 @@ def fixel2peaks_various_file_cargs(
193
218
  Command-line arguments.
194
219
  """
195
220
  cargs = []
196
- cargs.append(execution.input_file(params.get("obj")))
221
+ cargs.append(execution.input_file(params.get("obj", None)))
197
222
  return cargs
198
223
 
199
224
 
200
225
  class Fixel2peaksOutputs(typing.NamedTuple):
201
226
  """
202
- Output object returned when calling `fixel2peaks(...)`.
227
+ Output object returned when calling `Fixel2peaksParameters(...)`.
203
228
  """
204
229
  root: OutputPathType
205
230
  """Output root folder. This is the root folder for all outputs."""
@@ -208,7 +233,7 @@ class Fixel2peaksOutputs(typing.NamedTuple):
208
233
 
209
234
 
210
235
  def fixel2peaks_params(
211
- in_: typing.Union[Fixel2peaksVariousStringParameters, Fixel2peaksVariousFileParameters],
236
+ in_: typing.Union[Fixel2peaksVariousStringParametersTagged, Fixel2peaksVariousFileParametersTagged],
212
237
  out: str,
213
238
  number: int | None = None,
214
239
  nan: bool = False,
@@ -220,7 +245,7 @@ def fixel2peaks_params(
220
245
  config: list[Fixel2peaksConfigParameters] | None = None,
221
246
  help_: bool = False,
222
247
  version: bool = False,
223
- ) -> Fixel2peaksParameters:
248
+ ) -> Fixel2peaksParametersTagged:
224
249
  """
225
250
  Build parameters.
226
251
 
@@ -246,7 +271,7 @@ def fixel2peaks_params(
246
271
  Parameter dictionary
247
272
  """
248
273
  params = {
249
- "__STYXTYPE__": "fixel2peaks",
274
+ "@type": "mrtrix/fixel2peaks",
250
275
  "nan": nan,
251
276
  "info": info,
252
277
  "quiet": quiet,
@@ -281,34 +306,34 @@ def fixel2peaks_cargs(
281
306
  """
282
307
  cargs = []
283
308
  cargs.append("fixel2peaks")
284
- if params.get("number") is not None:
309
+ if params.get("number", None) is not None:
285
310
  cargs.extend([
286
311
  "-number",
287
- str(params.get("number"))
312
+ str(params.get("number", None))
288
313
  ])
289
- if params.get("nan"):
314
+ if params.get("nan", False):
290
315
  cargs.append("-nan")
291
- if params.get("info"):
316
+ if params.get("info", False):
292
317
  cargs.append("-info")
293
- if params.get("quiet"):
318
+ if params.get("quiet", False):
294
319
  cargs.append("-quiet")
295
- if params.get("debug"):
320
+ if params.get("debug", False):
296
321
  cargs.append("-debug")
297
- if params.get("force"):
322
+ if params.get("force", False):
298
323
  cargs.append("-force")
299
- if params.get("nthreads") is not None:
324
+ if params.get("nthreads", None) is not None:
300
325
  cargs.extend([
301
326
  "-nthreads",
302
- str(params.get("nthreads"))
327
+ str(params.get("nthreads", None))
303
328
  ])
304
- if params.get("config") is not None:
305
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
306
- if params.get("help"):
329
+ if params.get("config", None) is not None:
330
+ cargs.extend([a for c in [fixel2peaks_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
331
+ if params.get("help", False):
307
332
  cargs.append("-help")
308
- if params.get("version"):
333
+ if params.get("version", False):
309
334
  cargs.append("-version")
310
- cargs.extend(dyn_cargs(params.get("in")["__STYXTYPE__"])(params.get("in"), execution))
311
- cargs.append(params.get("out"))
335
+ cargs.extend(fixel2peaks_in_cargs_dyn_fn(params.get("in", None)["@type"])(params.get("in", None), execution))
336
+ cargs.append(params.get("out", None))
312
337
  return cargs
313
338
 
314
339
 
@@ -327,16 +352,18 @@ def fixel2peaks_outputs(
327
352
  """
328
353
  ret = Fixel2peaksOutputs(
329
354
  root=execution.output_file("."),
330
- out=execution.output_file(params.get("out")),
355
+ out=execution.output_file(params.get("out", None)),
331
356
  )
332
357
  return ret
333
358
 
334
359
 
335
360
  def fixel2peaks_execute(
336
361
  params: Fixel2peaksParameters,
337
- execution: Execution,
362
+ runner: Runner | None = None,
338
363
  ) -> Fixel2peaksOutputs:
339
364
  """
365
+ fixel2peaks
366
+
340
367
  Convert data in the fixel directory format into a 4D image of 3-vectors.
341
368
 
342
369
  If a fixel data file is provided as input, then the 3-vectors in the output
@@ -354,10 +381,12 @@ def fixel2peaks_execute(
354
381
 
355
382
  Args:
356
383
  params: The parameters.
357
- execution: The execution object.
384
+ runner: Command runner.
358
385
  Returns:
359
386
  NamedTuple of outputs (described in `Fixel2peaksOutputs`).
360
387
  """
388
+ runner = runner or get_global_runner()
389
+ execution = runner.start_execution(FIXEL2PEAKS_METADATA)
361
390
  params = execution.params(params)
362
391
  cargs = fixel2peaks_cargs(params, execution)
363
392
  ret = fixel2peaks_outputs(params, execution)
@@ -366,7 +395,7 @@ def fixel2peaks_execute(
366
395
 
367
396
 
368
397
  def fixel2peaks(
369
- in_: typing.Union[Fixel2peaksVariousStringParameters, Fixel2peaksVariousFileParameters],
398
+ in_: typing.Union[Fixel2peaksVariousStringParametersTagged, Fixel2peaksVariousFileParametersTagged],
370
399
  out: str,
371
400
  number: int | None = None,
372
401
  nan: bool = False,
@@ -381,6 +410,8 @@ def fixel2peaks(
381
410
  runner: Runner | None = None,
382
411
  ) -> Fixel2peaksOutputs:
383
412
  """
413
+ fixel2peaks
414
+
384
415
  Convert data in the fixel directory format into a 4D image of 3-vectors.
385
416
 
386
417
  If a fixel data file is provided as input, then the 3-vectors in the output
@@ -418,8 +449,6 @@ def fixel2peaks(
418
449
  Returns:
419
450
  NamedTuple of outputs (described in `Fixel2peaksOutputs`).
420
451
  """
421
- runner = runner or get_global_runner()
422
- execution = runner.start_execution(FIXEL2PEAKS_METADATA)
423
452
  params = fixel2peaks_params(
424
453
  number=number,
425
454
  nan=nan,
@@ -434,18 +463,15 @@ def fixel2peaks(
434
463
  in_=in_,
435
464
  out=out,
436
465
  )
437
- return fixel2peaks_execute(params, execution)
466
+ return fixel2peaks_execute(params, runner)
438
467
 
439
468
 
440
469
  __all__ = [
441
470
  "FIXEL2PEAKS_METADATA",
442
- "Fixel2peaksConfigParameters",
443
471
  "Fixel2peaksOutputs",
444
- "Fixel2peaksParameters",
445
- "Fixel2peaksVariousFileParameters",
446
- "Fixel2peaksVariousStringParameters",
447
472
  "fixel2peaks",
448
473
  "fixel2peaks_config_params",
474
+ "fixel2peaks_execute",
449
475
  "fixel2peaks_params",
450
476
  "fixel2peaks_various_file_params",
451
477
  "fixel2peaks_various_string_params",
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  FIXEL2SH_METADATA = Metadata(
9
- id="456492282209c486d341a6ea246caa0ca9702172.boutiques",
9
+ id="8c1f4206ebf1611310a84b3b1b1527e0a6b154c6.boutiques",
10
10
  name="fixel2sh",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,14 +14,33 @@ FIXEL2SH_METADATA = Metadata(
14
14
 
15
15
 
16
16
  Fixel2shConfigParameters = typing.TypedDict('Fixel2shConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ Fixel2shConfigParametersTagged = typing.TypedDict('Fixel2shConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  Fixel2shParameters = typing.TypedDict('Fixel2shParameters', {
24
- "__STYXTYPE__": typing.Literal["fixel2sh"],
29
+ "@type": typing.NotRequired[typing.Literal["mrtrix/fixel2sh"]],
30
+ "lmax": typing.NotRequired[int | None],
31
+ "info": bool,
32
+ "quiet": bool,
33
+ "debug": bool,
34
+ "force": bool,
35
+ "nthreads": typing.NotRequired[int | None],
36
+ "config": typing.NotRequired[list[Fixel2shConfigParameters] | None],
37
+ "help": bool,
38
+ "version": bool,
39
+ "fixel_in": InputPathType,
40
+ "sh_out": str,
41
+ })
42
+ Fixel2shParametersTagged = typing.TypedDict('Fixel2shParametersTagged', {
43
+ "@type": typing.Literal["mrtrix/fixel2sh"],
25
44
  "lmax": typing.NotRequired[int | None],
26
45
  "info": bool,
27
46
  "quiet": bool,
@@ -34,45 +53,12 @@ Fixel2shParameters = typing.TypedDict('Fixel2shParameters', {
34
53
  "fixel_in": InputPathType,
35
54
  "sh_out": str,
36
55
  })
37
-
38
-
39
- def dyn_cargs(
40
- t: str,
41
- ) -> typing.Any:
42
- """
43
- Get build cargs function by command type.
44
-
45
- Args:
46
- t: Command type.
47
- Returns:
48
- Build cargs function.
49
- """
50
- return {
51
- "fixel2sh": fixel2sh_cargs,
52
- "config": fixel2sh_config_cargs,
53
- }.get(t)
54
-
55
-
56
- def dyn_outputs(
57
- t: str,
58
- ) -> typing.Any:
59
- """
60
- Get build outputs function by command type.
61
-
62
- Args:
63
- t: Command type.
64
- Returns:
65
- Build outputs function.
66
- """
67
- return {
68
- "fixel2sh": fixel2sh_outputs,
69
- }.get(t)
70
56
 
71
57
 
72
58
  def fixel2sh_config_params(
73
59
  key: str,
74
60
  value: str,
75
- ) -> Fixel2shConfigParameters:
61
+ ) -> Fixel2shConfigParametersTagged:
76
62
  """
77
63
  Build parameters.
78
64
 
@@ -83,7 +69,7 @@ def fixel2sh_config_params(
83
69
  Parameter dictionary
84
70
  """
85
71
  params = {
86
- "__STYXTYPE__": "config",
72
+ "@type": "config",
87
73
  "key": key,
88
74
  "value": value,
89
75
  }
@@ -105,14 +91,14 @@ def fixel2sh_config_cargs(
105
91
  """
106
92
  cargs = []
107
93
  cargs.append("-config")
108
- cargs.append(params.get("key"))
109
- cargs.append(params.get("value"))
94
+ cargs.append(params.get("key", None))
95
+ cargs.append(params.get("value", None))
110
96
  return cargs
111
97
 
112
98
 
113
99
  class Fixel2shOutputs(typing.NamedTuple):
114
100
  """
115
- Output object returned when calling `fixel2sh(...)`.
101
+ Output object returned when calling `Fixel2shParameters(...)`.
116
102
  """
117
103
  root: OutputPathType
118
104
  """Output root folder. This is the root folder for all outputs."""
@@ -132,7 +118,7 @@ def fixel2sh_params(
132
118
  config: list[Fixel2shConfigParameters] | None = None,
133
119
  help_: bool = False,
134
120
  version: bool = False,
135
- ) -> Fixel2shParameters:
121
+ ) -> Fixel2shParametersTagged:
136
122
  """
137
123
  Build parameters.
138
124
 
@@ -156,7 +142,7 @@ def fixel2sh_params(
156
142
  Parameter dictionary
157
143
  """
158
144
  params = {
159
- "__STYXTYPE__": "fixel2sh",
145
+ "@type": "mrtrix/fixel2sh",
160
146
  "info": info,
161
147
  "quiet": quiet,
162
148
  "debug": debug,
@@ -190,32 +176,32 @@ def fixel2sh_cargs(
190
176
  """
191
177
  cargs = []
192
178
  cargs.append("fixel2sh")
193
- if params.get("lmax") is not None:
179
+ if params.get("lmax", None) is not None:
194
180
  cargs.extend([
195
181
  "-lmax",
196
- str(params.get("lmax"))
182
+ str(params.get("lmax", None))
197
183
  ])
198
- if params.get("info"):
184
+ if params.get("info", False):
199
185
  cargs.append("-info")
200
- if params.get("quiet"):
186
+ if params.get("quiet", False):
201
187
  cargs.append("-quiet")
202
- if params.get("debug"):
188
+ if params.get("debug", False):
203
189
  cargs.append("-debug")
204
- if params.get("force"):
190
+ if params.get("force", False):
205
191
  cargs.append("-force")
206
- if params.get("nthreads") is not None:
192
+ if params.get("nthreads", None) is not None:
207
193
  cargs.extend([
208
194
  "-nthreads",
209
- str(params.get("nthreads"))
195
+ str(params.get("nthreads", None))
210
196
  ])
211
- if params.get("config") is not None:
212
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
213
- if params.get("help"):
197
+ if params.get("config", None) is not None:
198
+ cargs.extend([a for c in [fixel2sh_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
199
+ if params.get("help", False):
214
200
  cargs.append("-help")
215
- if params.get("version"):
201
+ if params.get("version", False):
216
202
  cargs.append("-version")
217
- cargs.append(execution.input_file(params.get("fixel_in")))
218
- cargs.append(params.get("sh_out"))
203
+ cargs.append(execution.input_file(params.get("fixel_in", None)))
204
+ cargs.append(params.get("sh_out", None))
219
205
  return cargs
220
206
 
221
207
 
@@ -234,16 +220,18 @@ def fixel2sh_outputs(
234
220
  """
235
221
  ret = Fixel2shOutputs(
236
222
  root=execution.output_file("."),
237
- sh_out=execution.output_file(params.get("sh_out")),
223
+ sh_out=execution.output_file(params.get("sh_out", None)),
238
224
  )
239
225
  return ret
240
226
 
241
227
 
242
228
  def fixel2sh_execute(
243
229
  params: Fixel2shParameters,
244
- execution: Execution,
230
+ runner: Runner | None = None,
245
231
  ) -> Fixel2shOutputs:
246
232
  """
233
+ fixel2sh
234
+
247
235
  Convert a fixel-based sparse-data image into an spherical harmonic image.
248
236
 
249
237
  This command generates spherical harmonic data from fixels that can be
@@ -264,10 +252,12 @@ def fixel2sh_execute(
264
252
 
265
253
  Args:
266
254
  params: The parameters.
267
- execution: The execution object.
255
+ runner: Command runner.
268
256
  Returns:
269
257
  NamedTuple of outputs (described in `Fixel2shOutputs`).
270
258
  """
259
+ runner = runner or get_global_runner()
260
+ execution = runner.start_execution(FIXEL2SH_METADATA)
271
261
  params = execution.params(params)
272
262
  cargs = fixel2sh_cargs(params, execution)
273
263
  ret = fixel2sh_outputs(params, execution)
@@ -290,6 +280,8 @@ def fixel2sh(
290
280
  runner: Runner | None = None,
291
281
  ) -> Fixel2shOutputs:
292
282
  """
283
+ fixel2sh
284
+
293
285
  Convert a fixel-based sparse-data image into an spherical harmonic image.
294
286
 
295
287
  This command generates spherical harmonic data from fixels that can be
@@ -328,8 +320,6 @@ def fixel2sh(
328
320
  Returns:
329
321
  NamedTuple of outputs (described in `Fixel2shOutputs`).
330
322
  """
331
- runner = runner or get_global_runner()
332
- execution = runner.start_execution(FIXEL2SH_METADATA)
333
323
  params = fixel2sh_params(
334
324
  lmax=lmax,
335
325
  info=info,
@@ -343,15 +333,14 @@ def fixel2sh(
343
333
  fixel_in=fixel_in,
344
334
  sh_out=sh_out,
345
335
  )
346
- return fixel2sh_execute(params, execution)
336
+ return fixel2sh_execute(params, runner)
347
337
 
348
338
 
349
339
  __all__ = [
350
340
  "FIXEL2SH_METADATA",
351
- "Fixel2shConfigParameters",
352
341
  "Fixel2shOutputs",
353
- "Fixel2shParameters",
354
342
  "fixel2sh",
355
343
  "fixel2sh_config_params",
344
+ "fixel2sh_execute",
356
345
  "fixel2sh_params",
357
346
  ]