niwrap-mrtrix 0.6.3__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.3.dist-info/METADATA +0 -8
  121. niwrap_mrtrix-0.6.3.dist-info/RECORD +0 -119
  122. niwrap_mrtrix-0.6.3.dist-info/WHEEL +0 -4
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  SHCONV_METADATA = Metadata(
9
- id="fd5362bc6d2af00ffe1866d4f370ae826df3dd4d.boutiques",
9
+ id="b17c6209ec80f04a818c3feb05bf3e7580772b75.boutiques",
10
10
  name="shconv",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,28 +14,56 @@ SHCONV_METADATA = Metadata(
14
14
 
15
15
 
16
16
  ShconvVariousStringParameters = typing.TypedDict('ShconvVariousStringParameters', {
17
- "__STYXTYPE__": typing.Literal["VariousString"],
17
+ "@type": typing.NotRequired[typing.Literal["VariousString"]],
18
+ "obj": str,
19
+ })
20
+ ShconvVariousStringParametersTagged = typing.TypedDict('ShconvVariousStringParametersTagged', {
21
+ "@type": typing.Literal["VariousString"],
18
22
  "obj": str,
19
23
  })
20
24
 
21
25
 
22
26
  ShconvVariousFileParameters = typing.TypedDict('ShconvVariousFileParameters', {
23
- "__STYXTYPE__": typing.Literal["VariousFile"],
27
+ "@type": typing.NotRequired[typing.Literal["VariousFile"]],
28
+ "obj": InputPathType,
29
+ })
30
+ ShconvVariousFileParametersTagged = typing.TypedDict('ShconvVariousFileParametersTagged', {
31
+ "@type": typing.Literal["VariousFile"],
24
32
  "obj": InputPathType,
25
33
  })
26
34
 
27
35
 
28
36
  ShconvConfigParameters = typing.TypedDict('ShconvConfigParameters', {
29
- "__STYXTYPE__": typing.Literal["config"],
37
+ "@type": typing.NotRequired[typing.Literal["config"]],
38
+ "key": str,
39
+ "value": str,
40
+ })
41
+ ShconvConfigParametersTagged = typing.TypedDict('ShconvConfigParametersTagged', {
42
+ "@type": typing.Literal["config"],
30
43
  "key": str,
31
44
  "value": str,
32
45
  })
33
46
 
34
47
 
35
48
  ShconvParameters = typing.TypedDict('ShconvParameters', {
36
- "__STYXTYPE__": typing.Literal["shconv"],
49
+ "@type": typing.NotRequired[typing.Literal["mrtrix/shconv"]],
50
+ "datatype": typing.NotRequired[str | None],
51
+ "strides": typing.NotRequired[typing.Union[ShconvVariousStringParametersTagged, ShconvVariousFileParametersTagged] | None],
52
+ "info": bool,
53
+ "quiet": bool,
54
+ "debug": bool,
55
+ "force": bool,
56
+ "nthreads": typing.NotRequired[int | None],
57
+ "config": typing.NotRequired[list[ShconvConfigParameters] | None],
58
+ "help": bool,
59
+ "version": bool,
60
+ "odf_response": list[str],
61
+ "SH_out": str,
62
+ })
63
+ ShconvParametersTagged = typing.TypedDict('ShconvParametersTagged', {
64
+ "@type": typing.Literal["mrtrix/shconv"],
37
65
  "datatype": typing.NotRequired[str | None],
38
- "strides": typing.NotRequired[typing.Union[ShconvVariousStringParameters, ShconvVariousFileParameters] | None],
66
+ "strides": typing.NotRequired[typing.Union[ShconvVariousStringParametersTagged, ShconvVariousFileParametersTagged] | None],
39
67
  "info": bool,
40
68
  "quiet": bool,
41
69
  "debug": bool,
@@ -49,7 +77,7 @@ ShconvParameters = typing.TypedDict('ShconvParameters', {
49
77
  })
50
78
 
51
79
 
52
- def dyn_cargs(
80
+ def shconv_strides_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
- "shconv": shconv_cargs,
65
92
  "VariousString": shconv_various_string_cargs,
66
93
  "VariousFile": shconv_various_file_cargs,
67
- "config": shconv_config_cargs,
68
94
  }.get(t)
69
95
 
70
96
 
71
- def dyn_outputs(
97
+ def shconv_strides_outputs_dyn_fn(
72
98
  t: str,
73
99
  ) -> typing.Any:
74
100
  """
@@ -80,13 +106,12 @@ def dyn_outputs(
80
106
  Build outputs function.
81
107
  """
82
108
  return {
83
- "shconv": shconv_outputs,
84
109
  }.get(t)
85
110
 
86
111
 
87
112
  def shconv_various_string_params(
88
113
  obj: str,
89
- ) -> ShconvVariousStringParameters:
114
+ ) -> ShconvVariousStringParametersTagged:
90
115
  """
91
116
  Build parameters.
92
117
 
@@ -96,7 +121,7 @@ def shconv_various_string_params(
96
121
  Parameter dictionary
97
122
  """
98
123
  params = {
99
- "__STYXTYPE__": "VariousString",
124
+ "@type": "VariousString",
100
125
  "obj": obj,
101
126
  }
102
127
  return params
@@ -116,13 +141,13 @@ def shconv_various_string_cargs(
116
141
  Command-line arguments.
117
142
  """
118
143
  cargs = []
119
- cargs.append(params.get("obj"))
144
+ cargs.append(params.get("obj", None))
120
145
  return cargs
121
146
 
122
147
 
123
148
  def shconv_various_file_params(
124
149
  obj: InputPathType,
125
- ) -> ShconvVariousFileParameters:
150
+ ) -> ShconvVariousFileParametersTagged:
126
151
  """
127
152
  Build parameters.
128
153
 
@@ -132,7 +157,7 @@ def shconv_various_file_params(
132
157
  Parameter dictionary
133
158
  """
134
159
  params = {
135
- "__STYXTYPE__": "VariousFile",
160
+ "@type": "VariousFile",
136
161
  "obj": obj,
137
162
  }
138
163
  return params
@@ -152,14 +177,14 @@ def shconv_various_file_cargs(
152
177
  Command-line arguments.
153
178
  """
154
179
  cargs = []
155
- cargs.append(execution.input_file(params.get("obj")))
180
+ cargs.append(execution.input_file(params.get("obj", None)))
156
181
  return cargs
157
182
 
158
183
 
159
184
  def shconv_config_params(
160
185
  key: str,
161
186
  value: str,
162
- ) -> ShconvConfigParameters:
187
+ ) -> ShconvConfigParametersTagged:
163
188
  """
164
189
  Build parameters.
165
190
 
@@ -170,7 +195,7 @@ def shconv_config_params(
170
195
  Parameter dictionary
171
196
  """
172
197
  params = {
173
- "__STYXTYPE__": "config",
198
+ "@type": "config",
174
199
  "key": key,
175
200
  "value": value,
176
201
  }
@@ -192,14 +217,14 @@ def shconv_config_cargs(
192
217
  """
193
218
  cargs = []
194
219
  cargs.append("-config")
195
- cargs.append(params.get("key"))
196
- cargs.append(params.get("value"))
220
+ cargs.append(params.get("key", None))
221
+ cargs.append(params.get("value", None))
197
222
  return cargs
198
223
 
199
224
 
200
225
  class ShconvOutputs(typing.NamedTuple):
201
226
  """
202
- Output object returned when calling `shconv(...)`.
227
+ Output object returned when calling `ShconvParameters(...)`.
203
228
  """
204
229
  root: OutputPathType
205
230
  """Output root folder. This is the root folder for all outputs."""
@@ -211,7 +236,7 @@ def shconv_params(
211
236
  odf_response: list[str],
212
237
  sh_out: str,
213
238
  datatype: str | None = None,
214
- strides: typing.Union[ShconvVariousStringParameters, ShconvVariousFileParameters] | None = None,
239
+ strides: typing.Union[ShconvVariousStringParametersTagged, ShconvVariousFileParametersTagged] | None = None,
215
240
  info: bool = False,
216
241
  quiet: bool = False,
217
242
  debug: bool = False,
@@ -220,7 +245,7 @@ def shconv_params(
220
245
  config: list[ShconvConfigParameters] | None = None,
221
246
  help_: bool = False,
222
247
  version: bool = False,
223
- ) -> ShconvParameters:
248
+ ) -> ShconvParametersTagged:
224
249
  """
225
250
  Build parameters.
226
251
 
@@ -253,7 +278,7 @@ def shconv_params(
253
278
  Parameter dictionary
254
279
  """
255
280
  params = {
256
- "__STYXTYPE__": "shconv",
281
+ "@type": "mrtrix/shconv",
257
282
  "info": info,
258
283
  "quiet": quiet,
259
284
  "debug": debug,
@@ -289,37 +314,37 @@ def shconv_cargs(
289
314
  """
290
315
  cargs = []
291
316
  cargs.append("shconv")
292
- if params.get("datatype") is not None:
317
+ if params.get("datatype", None) is not None:
293
318
  cargs.extend([
294
319
  "-datatype",
295
- params.get("datatype")
320
+ params.get("datatype", None)
296
321
  ])
297
- if params.get("strides") is not None:
322
+ if params.get("strides", None) is not None:
298
323
  cargs.extend([
299
324
  "-strides",
300
- *dyn_cargs(params.get("strides")["__STYXTYPE__"])(params.get("strides"), execution)
325
+ *shconv_strides_cargs_dyn_fn(params.get("strides", None)["@type"])(params.get("strides", None), execution)
301
326
  ])
302
- if params.get("info"):
327
+ if params.get("info", False):
303
328
  cargs.append("-info")
304
- if params.get("quiet"):
329
+ if params.get("quiet", False):
305
330
  cargs.append("-quiet")
306
- if params.get("debug"):
331
+ if params.get("debug", False):
307
332
  cargs.append("-debug")
308
- if params.get("force"):
333
+ if params.get("force", False):
309
334
  cargs.append("-force")
310
- if params.get("nthreads") is not None:
335
+ if params.get("nthreads", None) is not None:
311
336
  cargs.extend([
312
337
  "-nthreads",
313
- str(params.get("nthreads"))
338
+ str(params.get("nthreads", None))
314
339
  ])
315
- if params.get("config") is not None:
316
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
317
- if params.get("help"):
340
+ if params.get("config", None) is not None:
341
+ cargs.extend([a for c in [shconv_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
342
+ if params.get("help", False):
318
343
  cargs.append("-help")
319
- if params.get("version"):
344
+ if params.get("version", False):
320
345
  cargs.append("-version")
321
- cargs.extend(params.get("odf_response"))
322
- cargs.append(params.get("SH_out"))
346
+ cargs.extend(params.get("odf_response", None))
347
+ cargs.append(params.get("SH_out", None))
323
348
  return cargs
324
349
 
325
350
 
@@ -338,16 +363,18 @@ def shconv_outputs(
338
363
  """
339
364
  ret = ShconvOutputs(
340
365
  root=execution.output_file("."),
341
- sh_out=execution.output_file(params.get("SH_out")),
366
+ sh_out=execution.output_file(params.get("SH_out", None)),
342
367
  )
343
368
  return ret
344
369
 
345
370
 
346
371
  def shconv_execute(
347
372
  params: ShconvParameters,
348
- execution: Execution,
373
+ runner: Runner | None = None,
349
374
  ) -> ShconvOutputs:
350
375
  """
376
+ shconv
377
+
351
378
  Perform spherical convolution.
352
379
 
353
380
  Provided with matching pairs of response function and ODF images (containing
@@ -379,10 +406,12 @@ def shconv_execute(
379
406
 
380
407
  Args:
381
408
  params: The parameters.
382
- execution: The execution object.
409
+ runner: Command runner.
383
410
  Returns:
384
411
  NamedTuple of outputs (described in `ShconvOutputs`).
385
412
  """
413
+ runner = runner or get_global_runner()
414
+ execution = runner.start_execution(SHCONV_METADATA)
386
415
  params = execution.params(params)
387
416
  cargs = shconv_cargs(params, execution)
388
417
  ret = shconv_outputs(params, execution)
@@ -394,7 +423,7 @@ def shconv(
394
423
  odf_response: list[str],
395
424
  sh_out: str,
396
425
  datatype: str | None = None,
397
- strides: typing.Union[ShconvVariousStringParameters, ShconvVariousFileParameters] | None = None,
426
+ strides: typing.Union[ShconvVariousStringParametersTagged, ShconvVariousFileParametersTagged] | None = None,
398
427
  info: bool = False,
399
428
  quiet: bool = False,
400
429
  debug: bool = False,
@@ -406,6 +435,8 @@ def shconv(
406
435
  runner: Runner | None = None,
407
436
  ) -> ShconvOutputs:
408
437
  """
438
+ shconv
439
+
409
440
  Perform spherical convolution.
410
441
 
411
442
  Provided with matching pairs of response function and ODF images (containing
@@ -464,8 +495,6 @@ def shconv(
464
495
  Returns:
465
496
  NamedTuple of outputs (described in `ShconvOutputs`).
466
497
  """
467
- runner = runner or get_global_runner()
468
- execution = runner.start_execution(SHCONV_METADATA)
469
498
  params = shconv_params(
470
499
  datatype=datatype,
471
500
  strides=strides,
@@ -480,18 +509,15 @@ def shconv(
480
509
  odf_response=odf_response,
481
510
  sh_out=sh_out,
482
511
  )
483
- return shconv_execute(params, execution)
512
+ return shconv_execute(params, runner)
484
513
 
485
514
 
486
515
  __all__ = [
487
516
  "SHCONV_METADATA",
488
- "ShconvConfigParameters",
489
517
  "ShconvOutputs",
490
- "ShconvParameters",
491
- "ShconvVariousFileParameters",
492
- "ShconvVariousStringParameters",
493
518
  "shconv",
494
519
  "shconv_config_params",
520
+ "shconv_execute",
495
521
  "shconv_params",
496
522
  "shconv_various_file_params",
497
523
  "shconv_various_string_params",
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  TCK2CONNECTOME_METADATA = Metadata(
9
- id="738d3835f7defdf440eba97b62da7245751874db.boutiques",
9
+ id="a66d5312bce1284177c4cf9ad60b3718c4a1a2b0.boutiques",
10
10
  name="tck2connectome",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,14 +14,49 @@ TCK2CONNECTOME_METADATA = Metadata(
14
14
 
15
15
 
16
16
  Tck2connectomeConfigParameters = typing.TypedDict('Tck2connectomeConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ Tck2connectomeConfigParametersTagged = typing.TypedDict('Tck2connectomeConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  Tck2connectomeParameters = typing.TypedDict('Tck2connectomeParameters', {
24
- "__STYXTYPE__": typing.Literal["tck2connectome"],
29
+ "@type": typing.NotRequired[typing.Literal["mrtrix/tck2connectome"]],
30
+ "assignment_end_voxels": bool,
31
+ "assignment_radial_search": typing.NotRequired[float | None],
32
+ "assignment_reverse_search": typing.NotRequired[float | None],
33
+ "assignment_forward_search": typing.NotRequired[float | None],
34
+ "assignment_all_voxels": bool,
35
+ "scale_length": bool,
36
+ "scale_invlength": bool,
37
+ "scale_invnodevol": bool,
38
+ "scale_file": typing.NotRequired[InputPathType | None],
39
+ "symmetric": bool,
40
+ "zero_diagonal": bool,
41
+ "stat_edge": typing.NotRequired[str | None],
42
+ "tck_weights_in": typing.NotRequired[InputPathType | None],
43
+ "keep_unassigned": bool,
44
+ "out_assignments": typing.NotRequired[str | None],
45
+ "vector": bool,
46
+ "info": bool,
47
+ "quiet": bool,
48
+ "debug": bool,
49
+ "force": bool,
50
+ "nthreads": typing.NotRequired[int | None],
51
+ "config": typing.NotRequired[list[Tck2connectomeConfigParameters] | None],
52
+ "help": bool,
53
+ "version": bool,
54
+ "tracks_in": InputPathType,
55
+ "nodes_in": InputPathType,
56
+ "connectome_out": str,
57
+ })
58
+ Tck2connectomeParametersTagged = typing.TypedDict('Tck2connectomeParametersTagged', {
59
+ "@type": typing.Literal["mrtrix/tck2connectome"],
25
60
  "assignment_end_voxels": bool,
26
61
  "assignment_radial_search": typing.NotRequired[float | None],
27
62
  "assignment_reverse_search": typing.NotRequired[float | None],
@@ -50,45 +85,12 @@ Tck2connectomeParameters = typing.TypedDict('Tck2connectomeParameters', {
50
85
  "nodes_in": InputPathType,
51
86
  "connectome_out": str,
52
87
  })
53
-
54
-
55
- def dyn_cargs(
56
- t: str,
57
- ) -> typing.Any:
58
- """
59
- Get build cargs function by command type.
60
-
61
- Args:
62
- t: Command type.
63
- Returns:
64
- Build cargs function.
65
- """
66
- return {
67
- "tck2connectome": tck2connectome_cargs,
68
- "config": tck2connectome_config_cargs,
69
- }.get(t)
70
-
71
-
72
- def dyn_outputs(
73
- t: str,
74
- ) -> typing.Any:
75
- """
76
- Get build outputs function by command type.
77
-
78
- Args:
79
- t: Command type.
80
- Returns:
81
- Build outputs function.
82
- """
83
- return {
84
- "tck2connectome": tck2connectome_outputs,
85
- }.get(t)
86
88
 
87
89
 
88
90
  def tck2connectome_config_params(
89
91
  key: str,
90
92
  value: str,
91
- ) -> Tck2connectomeConfigParameters:
93
+ ) -> Tck2connectomeConfigParametersTagged:
92
94
  """
93
95
  Build parameters.
94
96
 
@@ -99,7 +101,7 @@ def tck2connectome_config_params(
99
101
  Parameter dictionary
100
102
  """
101
103
  params = {
102
- "__STYXTYPE__": "config",
104
+ "@type": "config",
103
105
  "key": key,
104
106
  "value": value,
105
107
  }
@@ -121,14 +123,14 @@ def tck2connectome_config_cargs(
121
123
  """
122
124
  cargs = []
123
125
  cargs.append("-config")
124
- cargs.append(params.get("key"))
125
- cargs.append(params.get("value"))
126
+ cargs.append(params.get("key", None))
127
+ cargs.append(params.get("value", None))
126
128
  return cargs
127
129
 
128
130
 
129
131
  class Tck2connectomeOutputs(typing.NamedTuple):
130
132
  """
131
- Output object returned when calling `tck2connectome(...)`.
133
+ Output object returned when calling `Tck2connectomeParameters(...)`.
132
134
  """
133
135
  root: OutputPathType
134
136
  """Output root folder. This is the root folder for all outputs."""
@@ -167,7 +169,7 @@ def tck2connectome_params(
167
169
  config: list[Tck2connectomeConfigParameters] | None = None,
168
170
  help_: bool = False,
169
171
  version: bool = False,
170
- ) -> Tck2connectomeParameters:
172
+ ) -> Tck2connectomeParametersTagged:
171
173
  """
172
174
  Build parameters.
173
175
 
@@ -230,7 +232,7 @@ def tck2connectome_params(
230
232
  Parameter dictionary
231
233
  """
232
234
  params = {
233
- "__STYXTYPE__": "tck2connectome",
235
+ "@type": "mrtrix/tck2connectome",
234
236
  "assignment_end_voxels": assignment_end_voxels,
235
237
  "assignment_all_voxels": assignment_all_voxels,
236
238
  "scale_length": scale_length,
@@ -286,81 +288,81 @@ def tck2connectome_cargs(
286
288
  """
287
289
  cargs = []
288
290
  cargs.append("tck2connectome")
289
- if params.get("assignment_end_voxels"):
291
+ if params.get("assignment_end_voxels", False):
290
292
  cargs.append("-assignment_end_voxels")
291
- if params.get("assignment_radial_search") is not None:
293
+ if params.get("assignment_radial_search", None) is not None:
292
294
  cargs.extend([
293
295
  "-assignment_radial_search",
294
- str(params.get("assignment_radial_search"))
296
+ str(params.get("assignment_radial_search", None))
295
297
  ])
296
- if params.get("assignment_reverse_search") is not None:
298
+ if params.get("assignment_reverse_search", None) is not None:
297
299
  cargs.extend([
298
300
  "-assignment_reverse_search",
299
- str(params.get("assignment_reverse_search"))
301
+ str(params.get("assignment_reverse_search", None))
300
302
  ])
301
- if params.get("assignment_forward_search") is not None:
303
+ if params.get("assignment_forward_search", None) is not None:
302
304
  cargs.extend([
303
305
  "-assignment_forward_search",
304
- str(params.get("assignment_forward_search"))
306
+ str(params.get("assignment_forward_search", None))
305
307
  ])
306
- if params.get("assignment_all_voxels"):
308
+ if params.get("assignment_all_voxels", False):
307
309
  cargs.append("-assignment_all_voxels")
308
- if params.get("scale_length"):
310
+ if params.get("scale_length", False):
309
311
  cargs.append("-scale_length")
310
- if params.get("scale_invlength"):
312
+ if params.get("scale_invlength", False):
311
313
  cargs.append("-scale_invlength")
312
- if params.get("scale_invnodevol"):
314
+ if params.get("scale_invnodevol", False):
313
315
  cargs.append("-scale_invnodevol")
314
- if params.get("scale_file") is not None:
316
+ if params.get("scale_file", None) is not None:
315
317
  cargs.extend([
316
318
  "-scale_file",
317
- execution.input_file(params.get("scale_file"))
319
+ execution.input_file(params.get("scale_file", None))
318
320
  ])
319
- if params.get("symmetric"):
321
+ if params.get("symmetric", False):
320
322
  cargs.append("-symmetric")
321
- if params.get("zero_diagonal"):
323
+ if params.get("zero_diagonal", False):
322
324
  cargs.append("-zero_diagonal")
323
- if params.get("stat_edge") is not None:
325
+ if params.get("stat_edge", None) is not None:
324
326
  cargs.extend([
325
327
  "-stat_edge",
326
- params.get("stat_edge")
328
+ params.get("stat_edge", None)
327
329
  ])
328
- if params.get("tck_weights_in") is not None:
330
+ if params.get("tck_weights_in", None) is not None:
329
331
  cargs.extend([
330
332
  "-tck_weights_in",
331
- execution.input_file(params.get("tck_weights_in"))
333
+ execution.input_file(params.get("tck_weights_in", None))
332
334
  ])
333
- if params.get("keep_unassigned"):
335
+ if params.get("keep_unassigned", False):
334
336
  cargs.append("-keep_unassigned")
335
- if params.get("out_assignments") is not None:
337
+ if params.get("out_assignments", None) is not None:
336
338
  cargs.extend([
337
339
  "-out_assignments",
338
- params.get("out_assignments")
340
+ params.get("out_assignments", None)
339
341
  ])
340
- if params.get("vector"):
342
+ if params.get("vector", False):
341
343
  cargs.append("-vector")
342
- if params.get("info"):
344
+ if params.get("info", False):
343
345
  cargs.append("-info")
344
- if params.get("quiet"):
346
+ if params.get("quiet", False):
345
347
  cargs.append("-quiet")
346
- if params.get("debug"):
348
+ if params.get("debug", False):
347
349
  cargs.append("-debug")
348
- if params.get("force"):
350
+ if params.get("force", False):
349
351
  cargs.append("-force")
350
- if params.get("nthreads") is not None:
352
+ if params.get("nthreads", None) is not None:
351
353
  cargs.extend([
352
354
  "-nthreads",
353
- str(params.get("nthreads"))
355
+ str(params.get("nthreads", None))
354
356
  ])
355
- if params.get("config") is not None:
356
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
357
- if params.get("help"):
357
+ if params.get("config", None) is not None:
358
+ cargs.extend([a for c in [tck2connectome_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
359
+ if params.get("help", False):
358
360
  cargs.append("-help")
359
- if params.get("version"):
361
+ if params.get("version", False):
360
362
  cargs.append("-version")
361
- cargs.append(execution.input_file(params.get("tracks_in")))
362
- cargs.append(execution.input_file(params.get("nodes_in")))
363
- cargs.append(params.get("connectome_out"))
363
+ cargs.append(execution.input_file(params.get("tracks_in", None)))
364
+ cargs.append(execution.input_file(params.get("nodes_in", None)))
365
+ cargs.append(params.get("connectome_out", None))
364
366
  return cargs
365
367
 
366
368
 
@@ -379,17 +381,19 @@ def tck2connectome_outputs(
379
381
  """
380
382
  ret = Tck2connectomeOutputs(
381
383
  root=execution.output_file("."),
382
- connectome_out=execution.output_file(params.get("connectome_out")),
383
- out_assignments=execution.output_file(params.get("out_assignments")) if (params.get("out_assignments") is not None) else None,
384
+ connectome_out=execution.output_file(params.get("connectome_out", None)),
385
+ out_assignments=execution.output_file(params.get("out_assignments", None)) if (params.get("out_assignments") is not None) else None,
384
386
  )
385
387
  return ret
386
388
 
387
389
 
388
390
  def tck2connectome_execute(
389
391
  params: Tck2connectomeParameters,
390
- execution: Execution,
392
+ runner: Runner | None = None,
391
393
  ) -> Tck2connectomeOutputs:
392
394
  """
395
+ tck2connectome
396
+
393
397
  Generate a connectome matrix from a streamlines file and a node parcellation
394
398
  image.
395
399
 
@@ -413,10 +417,12 @@ def tck2connectome_execute(
413
417
 
414
418
  Args:
415
419
  params: The parameters.
416
- execution: The execution object.
420
+ runner: Command runner.
417
421
  Returns:
418
422
  NamedTuple of outputs (described in `Tck2connectomeOutputs`).
419
423
  """
424
+ runner = runner or get_global_runner()
425
+ execution = runner.start_execution(TCK2CONNECTOME_METADATA)
420
426
  params = execution.params(params)
421
427
  cargs = tck2connectome_cargs(params, execution)
422
428
  ret = tck2connectome_outputs(params, execution)
@@ -455,6 +461,8 @@ def tck2connectome(
455
461
  runner: Runner | None = None,
456
462
  ) -> Tck2connectomeOutputs:
457
463
  """
464
+ tck2connectome
465
+
458
466
  Generate a connectome matrix from a streamlines file and a node parcellation
459
467
  image.
460
468
 
@@ -535,8 +543,6 @@ def tck2connectome(
535
543
  Returns:
536
544
  NamedTuple of outputs (described in `Tck2connectomeOutputs`).
537
545
  """
538
- runner = runner or get_global_runner()
539
- execution = runner.start_execution(TCK2CONNECTOME_METADATA)
540
546
  params = tck2connectome_params(
541
547
  assignment_end_voxels=assignment_end_voxels,
542
548
  assignment_radial_search=assignment_radial_search,
@@ -566,15 +572,14 @@ def tck2connectome(
566
572
  nodes_in=nodes_in,
567
573
  connectome_out=connectome_out,
568
574
  )
569
- return tck2connectome_execute(params, execution)
575
+ return tck2connectome_execute(params, runner)
570
576
 
571
577
 
572
578
  __all__ = [
573
579
  "TCK2CONNECTOME_METADATA",
574
- "Tck2connectomeConfigParameters",
575
580
  "Tck2connectomeOutputs",
576
- "Tck2connectomeParameters",
577
581
  "tck2connectome",
578
582
  "tck2connectome_config_params",
583
+ "tck2connectome_execute",
579
584
  "tck2connectome_params",
580
585
  ]