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
  TCKSTATS_METADATA = Metadata(
9
- id="5978fa2db061f719e30d3e2617f6bb60e013d444.boutiques",
9
+ id="1c376e03915b6fa825105cf6a3a1f00bd7cafd03.boutiques",
10
10
  name="tckstats",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,20 +14,46 @@ TCKSTATS_METADATA = Metadata(
14
14
 
15
15
 
16
16
  TckstatsOutputParameters = typing.TypedDict('TckstatsOutputParameters', {
17
- "__STYXTYPE__": typing.Literal["output"],
17
+ "@type": typing.NotRequired[typing.Literal["output"]],
18
+ "field": str,
19
+ })
20
+ TckstatsOutputParametersTagged = typing.TypedDict('TckstatsOutputParametersTagged', {
21
+ "@type": typing.Literal["output"],
18
22
  "field": str,
19
23
  })
20
24
 
21
25
 
22
26
  TckstatsConfigParameters = typing.TypedDict('TckstatsConfigParameters', {
23
- "__STYXTYPE__": typing.Literal["config"],
27
+ "@type": typing.NotRequired[typing.Literal["config"]],
28
+ "key": str,
29
+ "value": str,
30
+ })
31
+ TckstatsConfigParametersTagged = typing.TypedDict('TckstatsConfigParametersTagged', {
32
+ "@type": typing.Literal["config"],
24
33
  "key": str,
25
34
  "value": str,
26
35
  })
27
36
 
28
37
 
29
38
  TckstatsParameters = typing.TypedDict('TckstatsParameters', {
30
- "__STYXTYPE__": typing.Literal["tckstats"],
39
+ "@type": typing.NotRequired[typing.Literal["mrtrix/tckstats"]],
40
+ "output": typing.NotRequired[list[TckstatsOutputParameters] | None],
41
+ "histogram": typing.NotRequired[str | None],
42
+ "dump": typing.NotRequired[str | None],
43
+ "ignorezero": bool,
44
+ "tck_weights_in": typing.NotRequired[InputPathType | None],
45
+ "info": bool,
46
+ "quiet": bool,
47
+ "debug": bool,
48
+ "force": bool,
49
+ "nthreads": typing.NotRequired[int | None],
50
+ "config": typing.NotRequired[list[TckstatsConfigParameters] | None],
51
+ "help": bool,
52
+ "version": bool,
53
+ "tracks_in": InputPathType,
54
+ })
55
+ TckstatsParametersTagged = typing.TypedDict('TckstatsParametersTagged', {
56
+ "@type": typing.Literal["mrtrix/tckstats"],
31
57
  "output": typing.NotRequired[list[TckstatsOutputParameters] | None],
32
58
  "histogram": typing.NotRequired[str | None],
33
59
  "dump": typing.NotRequired[str | None],
@@ -43,45 +69,11 @@ TckstatsParameters = typing.TypedDict('TckstatsParameters', {
43
69
  "version": bool,
44
70
  "tracks_in": InputPathType,
45
71
  })
46
-
47
-
48
- def dyn_cargs(
49
- t: str,
50
- ) -> typing.Any:
51
- """
52
- Get build cargs function by command type.
53
-
54
- Args:
55
- t: Command type.
56
- Returns:
57
- Build cargs function.
58
- """
59
- return {
60
- "tckstats": tckstats_cargs,
61
- "output": tckstats_output_cargs,
62
- "config": tckstats_config_cargs,
63
- }.get(t)
64
-
65
-
66
- def dyn_outputs(
67
- t: str,
68
- ) -> typing.Any:
69
- """
70
- Get build outputs function by command type.
71
-
72
- Args:
73
- t: Command type.
74
- Returns:
75
- Build outputs function.
76
- """
77
- return {
78
- "tckstats": tckstats_outputs,
79
- }.get(t)
80
72
 
81
73
 
82
74
  def tckstats_output_params(
83
75
  field: str,
84
- ) -> TckstatsOutputParameters:
76
+ ) -> TckstatsOutputParametersTagged:
85
77
  """
86
78
  Build parameters.
87
79
 
@@ -93,7 +85,7 @@ def tckstats_output_params(
93
85
  Parameter dictionary
94
86
  """
95
87
  params = {
96
- "__STYXTYPE__": "output",
88
+ "@type": "output",
97
89
  "field": field,
98
90
  }
99
91
  return params
@@ -114,14 +106,14 @@ def tckstats_output_cargs(
114
106
  """
115
107
  cargs = []
116
108
  cargs.append("-output")
117
- cargs.append(params.get("field"))
109
+ cargs.append(params.get("field", None))
118
110
  return cargs
119
111
 
120
112
 
121
113
  def tckstats_config_params(
122
114
  key: str,
123
115
  value: str,
124
- ) -> TckstatsConfigParameters:
116
+ ) -> TckstatsConfigParametersTagged:
125
117
  """
126
118
  Build parameters.
127
119
 
@@ -132,7 +124,7 @@ def tckstats_config_params(
132
124
  Parameter dictionary
133
125
  """
134
126
  params = {
135
- "__STYXTYPE__": "config",
127
+ "@type": "config",
136
128
  "key": key,
137
129
  "value": value,
138
130
  }
@@ -154,14 +146,14 @@ def tckstats_config_cargs(
154
146
  """
155
147
  cargs = []
156
148
  cargs.append("-config")
157
- cargs.append(params.get("key"))
158
- cargs.append(params.get("value"))
149
+ cargs.append(params.get("key", None))
150
+ cargs.append(params.get("value", None))
159
151
  return cargs
160
152
 
161
153
 
162
154
  class TckstatsOutputs(typing.NamedTuple):
163
155
  """
164
- Output object returned when calling `tckstats(...)`.
156
+ Output object returned when calling `TckstatsParameters(...)`.
165
157
  """
166
158
  root: OutputPathType
167
159
  """Output root folder. This is the root folder for all outputs."""
@@ -186,7 +178,7 @@ def tckstats_params(
186
178
  config: list[TckstatsConfigParameters] | None = None,
187
179
  help_: bool = False,
188
180
  version: bool = False,
189
- ) -> TckstatsParameters:
181
+ ) -> TckstatsParametersTagged:
190
182
  """
191
183
  Build parameters.
192
184
 
@@ -217,7 +209,7 @@ def tckstats_params(
217
209
  Parameter dictionary
218
210
  """
219
211
  params = {
220
- "__STYXTYPE__": "tckstats",
212
+ "@type": "mrtrix/tckstats",
221
213
  "ignorezero": ignorezero,
222
214
  "info": info,
223
215
  "quiet": quiet,
@@ -257,45 +249,45 @@ def tckstats_cargs(
257
249
  """
258
250
  cargs = []
259
251
  cargs.append("tckstats")
260
- if params.get("output") is not None:
261
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("output")] for a in c])
262
- if params.get("histogram") is not None:
252
+ if params.get("output", None) is not None:
253
+ cargs.extend([a for c in [tckstats_output_cargs(s, execution) for s in params.get("output", None)] for a in c])
254
+ if params.get("histogram", None) is not None:
263
255
  cargs.extend([
264
256
  "-histogram",
265
- params.get("histogram")
257
+ params.get("histogram", None)
266
258
  ])
267
- if params.get("dump") is not None:
259
+ if params.get("dump", None) is not None:
268
260
  cargs.extend([
269
261
  "-dump",
270
- params.get("dump")
262
+ params.get("dump", None)
271
263
  ])
272
- if params.get("ignorezero"):
264
+ if params.get("ignorezero", False):
273
265
  cargs.append("-ignorezero")
274
- if params.get("tck_weights_in") is not None:
266
+ if params.get("tck_weights_in", None) is not None:
275
267
  cargs.extend([
276
268
  "-tck_weights_in",
277
- execution.input_file(params.get("tck_weights_in"))
269
+ execution.input_file(params.get("tck_weights_in", None))
278
270
  ])
279
- if params.get("info"):
271
+ if params.get("info", False):
280
272
  cargs.append("-info")
281
- if params.get("quiet"):
273
+ if params.get("quiet", False):
282
274
  cargs.append("-quiet")
283
- if params.get("debug"):
275
+ if params.get("debug", False):
284
276
  cargs.append("-debug")
285
- if params.get("force"):
277
+ if params.get("force", False):
286
278
  cargs.append("-force")
287
- if params.get("nthreads") is not None:
279
+ if params.get("nthreads", None) is not None:
288
280
  cargs.extend([
289
281
  "-nthreads",
290
- str(params.get("nthreads"))
282
+ str(params.get("nthreads", None))
291
283
  ])
292
- if params.get("config") is not None:
293
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
294
- if params.get("help"):
284
+ if params.get("config", None) is not None:
285
+ cargs.extend([a for c in [tckstats_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
286
+ if params.get("help", False):
295
287
  cargs.append("-help")
296
- if params.get("version"):
288
+ if params.get("version", False):
297
289
  cargs.append("-version")
298
- cargs.append(execution.input_file(params.get("tracks_in")))
290
+ cargs.append(execution.input_file(params.get("tracks_in", None)))
299
291
  return cargs
300
292
 
301
293
 
@@ -314,17 +306,19 @@ def tckstats_outputs(
314
306
  """
315
307
  ret = TckstatsOutputs(
316
308
  root=execution.output_file("."),
317
- histogram=execution.output_file(params.get("histogram")) if (params.get("histogram") is not None) else None,
318
- dump=execution.output_file(params.get("dump")) if (params.get("dump") is not None) else None,
309
+ histogram=execution.output_file(params.get("histogram", None)) if (params.get("histogram") is not None) else None,
310
+ dump=execution.output_file(params.get("dump", None)) if (params.get("dump") is not None) else None,
319
311
  )
320
312
  return ret
321
313
 
322
314
 
323
315
  def tckstats_execute(
324
316
  params: TckstatsParameters,
325
- execution: Execution,
317
+ runner: Runner | None = None,
326
318
  ) -> TckstatsOutputs:
327
319
  """
320
+ tckstats
321
+
328
322
  Calculate statistics on streamlines lengths.
329
323
 
330
324
 
@@ -339,10 +333,12 @@ def tckstats_execute(
339
333
 
340
334
  Args:
341
335
  params: The parameters.
342
- execution: The execution object.
336
+ runner: Command runner.
343
337
  Returns:
344
338
  NamedTuple of outputs (described in `TckstatsOutputs`).
345
339
  """
340
+ runner = runner or get_global_runner()
341
+ execution = runner.start_execution(TCKSTATS_METADATA)
346
342
  params = execution.params(params)
347
343
  cargs = tckstats_cargs(params, execution)
348
344
  ret = tckstats_outputs(params, execution)
@@ -368,6 +364,8 @@ def tckstats(
368
364
  runner: Runner | None = None,
369
365
  ) -> TckstatsOutputs:
370
366
  """
367
+ tckstats
368
+
371
369
  Calculate statistics on streamlines lengths.
372
370
 
373
371
 
@@ -407,8 +405,6 @@ def tckstats(
407
405
  Returns:
408
406
  NamedTuple of outputs (described in `TckstatsOutputs`).
409
407
  """
410
- runner = runner or get_global_runner()
411
- execution = runner.start_execution(TCKSTATS_METADATA)
412
408
  params = tckstats_params(
413
409
  output=output,
414
410
  histogram=histogram,
@@ -425,17 +421,15 @@ def tckstats(
425
421
  version=version,
426
422
  tracks_in=tracks_in,
427
423
  )
428
- return tckstats_execute(params, execution)
424
+ return tckstats_execute(params, runner)
429
425
 
430
426
 
431
427
  __all__ = [
432
428
  "TCKSTATS_METADATA",
433
- "TckstatsConfigParameters",
434
- "TckstatsOutputParameters",
435
429
  "TckstatsOutputs",
436
- "TckstatsParameters",
437
430
  "tckstats",
438
431
  "tckstats_config_params",
432
+ "tckstats_execute",
439
433
  "tckstats_output_params",
440
434
  "tckstats_params",
441
435
  ]
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  TCKTRANSFORM_METADATA = Metadata(
9
- id="39d807cb4f7b1be3ec75416e1baa8cd35d636522.boutiques",
9
+ id="e269e831330358a696661d691299c44a7c3630bb.boutiques",
10
10
  name="tcktransform",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,14 +14,33 @@ TCKTRANSFORM_METADATA = Metadata(
14
14
 
15
15
 
16
16
  TcktransformConfigParameters = typing.TypedDict('TcktransformConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ TcktransformConfigParametersTagged = typing.TypedDict('TcktransformConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  TcktransformParameters = typing.TypedDict('TcktransformParameters', {
24
- "__STYXTYPE__": typing.Literal["tcktransform"],
29
+ "@type": typing.NotRequired[typing.Literal["mrtrix/tcktransform"]],
30
+ "info": bool,
31
+ "quiet": bool,
32
+ "debug": bool,
33
+ "force": bool,
34
+ "nthreads": typing.NotRequired[int | None],
35
+ "config": typing.NotRequired[list[TcktransformConfigParameters] | None],
36
+ "help": bool,
37
+ "version": bool,
38
+ "tracks": InputPathType,
39
+ "transform": InputPathType,
40
+ "output": str,
41
+ })
42
+ TcktransformParametersTagged = typing.TypedDict('TcktransformParametersTagged', {
43
+ "@type": typing.Literal["mrtrix/tcktransform"],
25
44
  "info": bool,
26
45
  "quiet": bool,
27
46
  "debug": bool,
@@ -34,45 +53,12 @@ TcktransformParameters = typing.TypedDict('TcktransformParameters', {
34
53
  "transform": InputPathType,
35
54
  "output": 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
- "tcktransform": tcktransform_cargs,
52
- "config": tcktransform_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
- "tcktransform": tcktransform_outputs,
69
- }.get(t)
70
56
 
71
57
 
72
58
  def tcktransform_config_params(
73
59
  key: str,
74
60
  value: str,
75
- ) -> TcktransformConfigParameters:
61
+ ) -> TcktransformConfigParametersTagged:
76
62
  """
77
63
  Build parameters.
78
64
 
@@ -83,7 +69,7 @@ def tcktransform_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 tcktransform_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 TcktransformOutputs(typing.NamedTuple):
114
100
  """
115
- Output object returned when calling `tcktransform(...)`.
101
+ Output object returned when calling `TcktransformParameters(...)`.
116
102
  """
117
103
  root: OutputPathType
118
104
  """Output root folder. This is the root folder for all outputs."""
@@ -132,7 +118,7 @@ def tcktransform_params(
132
118
  config: list[TcktransformConfigParameters] | None = None,
133
119
  help_: bool = False,
134
120
  version: bool = False,
135
- ) -> TcktransformParameters:
121
+ ) -> TcktransformParametersTagged:
136
122
  """
137
123
  Build parameters.
138
124
 
@@ -156,7 +142,7 @@ def tcktransform_params(
156
142
  Parameter dictionary
157
143
  """
158
144
  params = {
159
- "__STYXTYPE__": "tcktransform",
145
+ "@type": "mrtrix/tcktransform",
160
146
  "info": info,
161
147
  "quiet": quiet,
162
148
  "debug": debug,
@@ -189,28 +175,28 @@ def tcktransform_cargs(
189
175
  """
190
176
  cargs = []
191
177
  cargs.append("tcktransform")
192
- if params.get("info"):
178
+ if params.get("info", False):
193
179
  cargs.append("-info")
194
- if params.get("quiet"):
180
+ if params.get("quiet", False):
195
181
  cargs.append("-quiet")
196
- if params.get("debug"):
182
+ if params.get("debug", False):
197
183
  cargs.append("-debug")
198
- if params.get("force"):
184
+ if params.get("force", False):
199
185
  cargs.append("-force")
200
- if params.get("nthreads") is not None:
186
+ if params.get("nthreads", None) is not None:
201
187
  cargs.extend([
202
188
  "-nthreads",
203
- str(params.get("nthreads"))
189
+ str(params.get("nthreads", None))
204
190
  ])
205
- if params.get("config") is not None:
206
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
207
- if params.get("help"):
191
+ if params.get("config", None) is not None:
192
+ cargs.extend([a for c in [tcktransform_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
193
+ if params.get("help", False):
208
194
  cargs.append("-help")
209
- if params.get("version"):
195
+ if params.get("version", False):
210
196
  cargs.append("-version")
211
- cargs.append(execution.input_file(params.get("tracks")))
212
- cargs.append(execution.input_file(params.get("transform")))
213
- cargs.append(params.get("output"))
197
+ cargs.append(execution.input_file(params.get("tracks", None)))
198
+ cargs.append(execution.input_file(params.get("transform", None)))
199
+ cargs.append(params.get("output", None))
214
200
  return cargs
215
201
 
216
202
 
@@ -229,16 +215,18 @@ def tcktransform_outputs(
229
215
  """
230
216
  ret = TcktransformOutputs(
231
217
  root=execution.output_file("."),
232
- output=execution.output_file(params.get("output")),
218
+ output=execution.output_file(params.get("output", None)),
233
219
  )
234
220
  return ret
235
221
 
236
222
 
237
223
  def tcktransform_execute(
238
224
  params: TcktransformParameters,
239
- execution: Execution,
225
+ runner: Runner | None = None,
240
226
  ) -> TcktransformOutputs:
241
227
  """
228
+ tcktransform
229
+
242
230
  Apply a spatial transformation to a tracks file.
243
231
 
244
232
 
@@ -253,10 +241,12 @@ def tcktransform_execute(
253
241
 
254
242
  Args:
255
243
  params: The parameters.
256
- execution: The execution object.
244
+ runner: Command runner.
257
245
  Returns:
258
246
  NamedTuple of outputs (described in `TcktransformOutputs`).
259
247
  """
248
+ runner = runner or get_global_runner()
249
+ execution = runner.start_execution(TCKTRANSFORM_METADATA)
260
250
  params = execution.params(params)
261
251
  cargs = tcktransform_cargs(params, execution)
262
252
  ret = tcktransform_outputs(params, execution)
@@ -279,6 +269,8 @@ def tcktransform(
279
269
  runner: Runner | None = None,
280
270
  ) -> TcktransformOutputs:
281
271
  """
272
+ tcktransform
273
+
282
274
  Apply a spatial transformation to a tracks file.
283
275
 
284
276
 
@@ -311,8 +303,6 @@ def tcktransform(
311
303
  Returns:
312
304
  NamedTuple of outputs (described in `TcktransformOutputs`).
313
305
  """
314
- runner = runner or get_global_runner()
315
- execution = runner.start_execution(TCKTRANSFORM_METADATA)
316
306
  params = tcktransform_params(
317
307
  info=info,
318
308
  quiet=quiet,
@@ -326,15 +316,14 @@ def tcktransform(
326
316
  transform=transform,
327
317
  output=output,
328
318
  )
329
- return tcktransform_execute(params, execution)
319
+ return tcktransform_execute(params, runner)
330
320
 
331
321
 
332
322
  __all__ = [
333
323
  "TCKTRANSFORM_METADATA",
334
- "TcktransformConfigParameters",
335
324
  "TcktransformOutputs",
336
- "TcktransformParameters",
337
325
  "tcktransform",
338
326
  "tcktransform_config_params",
327
+ "tcktransform_execute",
339
328
  "tcktransform_params",
340
329
  ]