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
  TCK2FIXEL_METADATA = Metadata(
9
- id="7fb114318f85708b8964636c42efd5059fa77887.boutiques",
9
+ id="90f8734af004cf66512561b61fbe57f5bc2f690a.boutiques",
10
10
  name="tck2fixel",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,14 +14,35 @@ TCK2FIXEL_METADATA = Metadata(
14
14
 
15
15
 
16
16
  Tck2fixelConfigParameters = typing.TypedDict('Tck2fixelConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ Tck2fixelConfigParametersTagged = typing.TypedDict('Tck2fixelConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  Tck2fixelParameters = typing.TypedDict('Tck2fixelParameters', {
24
- "__STYXTYPE__": typing.Literal["tck2fixel"],
29
+ "@type": typing.NotRequired[typing.Literal["mrtrix/tck2fixel"]],
30
+ "angle": typing.NotRequired[float | None],
31
+ "info": bool,
32
+ "quiet": bool,
33
+ "debug": bool,
34
+ "force": bool,
35
+ "nthreads": typing.NotRequired[int | None],
36
+ "config": typing.NotRequired[list[Tck2fixelConfigParameters] | None],
37
+ "help": bool,
38
+ "version": bool,
39
+ "tracks": InputPathType,
40
+ "fixel_folder_in": InputPathType,
41
+ "fixel_folder_out": str,
42
+ "fixel_data_out": str,
43
+ })
44
+ Tck2fixelParametersTagged = typing.TypedDict('Tck2fixelParametersTagged', {
45
+ "@type": typing.Literal["mrtrix/tck2fixel"],
25
46
  "angle": typing.NotRequired[float | None],
26
47
  "info": bool,
27
48
  "quiet": bool,
@@ -36,44 +57,12 @@ Tck2fixelParameters = typing.TypedDict('Tck2fixelParameters', {
36
57
  "fixel_folder_out": str,
37
58
  "fixel_data_out": str,
38
59
  })
39
-
40
-
41
- def dyn_cargs(
42
- t: str,
43
- ) -> typing.Any:
44
- """
45
- Get build cargs function by command type.
46
-
47
- Args:
48
- t: Command type.
49
- Returns:
50
- Build cargs function.
51
- """
52
- return {
53
- "tck2fixel": tck2fixel_cargs,
54
- "config": tck2fixel_config_cargs,
55
- }.get(t)
56
-
57
-
58
- def dyn_outputs(
59
- t: str,
60
- ) -> typing.Any:
61
- """
62
- Get build outputs function by command type.
63
-
64
- Args:
65
- t: Command type.
66
- Returns:
67
- Build outputs function.
68
- """
69
- return {
70
- }.get(t)
71
60
 
72
61
 
73
62
  def tck2fixel_config_params(
74
63
  key: str,
75
64
  value: str,
76
- ) -> Tck2fixelConfigParameters:
65
+ ) -> Tck2fixelConfigParametersTagged:
77
66
  """
78
67
  Build parameters.
79
68
 
@@ -84,7 +73,7 @@ def tck2fixel_config_params(
84
73
  Parameter dictionary
85
74
  """
86
75
  params = {
87
- "__STYXTYPE__": "config",
76
+ "@type": "config",
88
77
  "key": key,
89
78
  "value": value,
90
79
  }
@@ -106,14 +95,14 @@ def tck2fixel_config_cargs(
106
95
  """
107
96
  cargs = []
108
97
  cargs.append("-config")
109
- cargs.append(params.get("key"))
110
- cargs.append(params.get("value"))
98
+ cargs.append(params.get("key", None))
99
+ cargs.append(params.get("value", None))
111
100
  return cargs
112
101
 
113
102
 
114
103
  class Tck2fixelOutputs(typing.NamedTuple):
115
104
  """
116
- Output object returned when calling `tck2fixel(...)`.
105
+ Output object returned when calling `Tck2fixelParameters(...)`.
117
106
  """
118
107
  root: OutputPathType
119
108
  """Output root folder. This is the root folder for all outputs."""
@@ -133,7 +122,7 @@ def tck2fixel_params(
133
122
  config: list[Tck2fixelConfigParameters] | None = None,
134
123
  help_: bool = False,
135
124
  version: bool = False,
136
- ) -> Tck2fixelParameters:
125
+ ) -> Tck2fixelParametersTagged:
137
126
  """
138
127
  Build parameters.
139
128
 
@@ -162,7 +151,7 @@ def tck2fixel_params(
162
151
  Parameter dictionary
163
152
  """
164
153
  params = {
165
- "__STYXTYPE__": "tck2fixel",
154
+ "@type": "mrtrix/tck2fixel",
166
155
  "info": info,
167
156
  "quiet": quiet,
168
157
  "debug": debug,
@@ -198,34 +187,34 @@ def tck2fixel_cargs(
198
187
  """
199
188
  cargs = []
200
189
  cargs.append("tck2fixel")
201
- if params.get("angle") is not None:
190
+ if params.get("angle", None) is not None:
202
191
  cargs.extend([
203
192
  "-angle",
204
- str(params.get("angle"))
193
+ str(params.get("angle", None))
205
194
  ])
206
- if params.get("info"):
195
+ if params.get("info", False):
207
196
  cargs.append("-info")
208
- if params.get("quiet"):
197
+ if params.get("quiet", False):
209
198
  cargs.append("-quiet")
210
- if params.get("debug"):
199
+ if params.get("debug", False):
211
200
  cargs.append("-debug")
212
- if params.get("force"):
201
+ if params.get("force", False):
213
202
  cargs.append("-force")
214
- if params.get("nthreads") is not None:
203
+ if params.get("nthreads", None) is not None:
215
204
  cargs.extend([
216
205
  "-nthreads",
217
- str(params.get("nthreads"))
206
+ str(params.get("nthreads", None))
218
207
  ])
219
- if params.get("config") is not None:
220
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
221
- if params.get("help"):
208
+ if params.get("config", None) is not None:
209
+ cargs.extend([a for c in [tck2fixel_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
210
+ if params.get("help", False):
222
211
  cargs.append("-help")
223
- if params.get("version"):
212
+ if params.get("version", False):
224
213
  cargs.append("-version")
225
- cargs.append(execution.input_file(params.get("tracks")))
226
- cargs.append(execution.input_file(params.get("fixel_folder_in")))
227
- cargs.append(params.get("fixel_folder_out"))
228
- cargs.append(params.get("fixel_data_out"))
214
+ cargs.append(execution.input_file(params.get("tracks", None)))
215
+ cargs.append(execution.input_file(params.get("fixel_folder_in", None)))
216
+ cargs.append(params.get("fixel_folder_out", None))
217
+ cargs.append(params.get("fixel_data_out", None))
229
218
  return cargs
230
219
 
231
220
 
@@ -250,9 +239,11 @@ def tck2fixel_outputs(
250
239
 
251
240
  def tck2fixel_execute(
252
241
  params: Tck2fixelParameters,
253
- execution: Execution,
242
+ runner: Runner | None = None,
254
243
  ) -> Tck2fixelOutputs:
255
244
  """
245
+ tck2fixel
246
+
256
247
  Compute a fixel TDI map from a tractogram.
257
248
 
258
249
 
@@ -267,10 +258,12 @@ def tck2fixel_execute(
267
258
 
268
259
  Args:
269
260
  params: The parameters.
270
- execution: The execution object.
261
+ runner: Command runner.
271
262
  Returns:
272
263
  NamedTuple of outputs (described in `Tck2fixelOutputs`).
273
264
  """
265
+ runner = runner or get_global_runner()
266
+ execution = runner.start_execution(TCK2FIXEL_METADATA)
274
267
  params = execution.params(params)
275
268
  cargs = tck2fixel_cargs(params, execution)
276
269
  ret = tck2fixel_outputs(params, execution)
@@ -295,6 +288,8 @@ def tck2fixel(
295
288
  runner: Runner | None = None,
296
289
  ) -> Tck2fixelOutputs:
297
290
  """
291
+ tck2fixel
292
+
298
293
  Compute a fixel TDI map from a tractogram.
299
294
 
300
295
 
@@ -332,8 +327,6 @@ def tck2fixel(
332
327
  Returns:
333
328
  NamedTuple of outputs (described in `Tck2fixelOutputs`).
334
329
  """
335
- runner = runner or get_global_runner()
336
- execution = runner.start_execution(TCK2FIXEL_METADATA)
337
330
  params = tck2fixel_params(
338
331
  angle=angle,
339
332
  info=info,
@@ -349,15 +342,14 @@ def tck2fixel(
349
342
  fixel_folder_out=fixel_folder_out,
350
343
  fixel_data_out=fixel_data_out,
351
344
  )
352
- return tck2fixel_execute(params, execution)
345
+ return tck2fixel_execute(params, runner)
353
346
 
354
347
 
355
348
  __all__ = [
356
349
  "TCK2FIXEL_METADATA",
357
- "Tck2fixelConfigParameters",
358
350
  "Tck2fixelOutputs",
359
- "Tck2fixelParameters",
360
351
  "tck2fixel",
361
352
  "tck2fixel_config_params",
353
+ "tck2fixel_execute",
362
354
  "tck2fixel_params",
363
355
  ]
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  TCKCONVERT_METADATA = Metadata(
9
- id="6f2654c4a12a998f581d8c09fe91e9d32503db7a.boutiques",
9
+ id="55a4f5691d675bdf7129499cb50a199b880d7c7a.boutiques",
10
10
  name="tckconvert",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,26 +14,62 @@ TCKCONVERT_METADATA = Metadata(
14
14
 
15
15
 
16
16
  TckconvertConfigParameters = typing.TypedDict('TckconvertConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ TckconvertConfigParametersTagged = typing.TypedDict('TckconvertConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  TckconvertVariousStringParameters = typing.TypedDict('TckconvertVariousStringParameters', {
24
- "__STYXTYPE__": typing.Literal["VariousString"],
29
+ "@type": typing.NotRequired[typing.Literal["VariousString"]],
30
+ "obj": str,
31
+ })
32
+ TckconvertVariousStringParametersTagged = typing.TypedDict('TckconvertVariousStringParametersTagged', {
33
+ "@type": typing.Literal["VariousString"],
25
34
  "obj": str,
26
35
  })
27
36
 
28
37
 
29
38
  TckconvertVariousFileParameters = typing.TypedDict('TckconvertVariousFileParameters', {
30
- "__STYXTYPE__": typing.Literal["VariousFile"],
39
+ "@type": typing.NotRequired[typing.Literal["VariousFile"]],
40
+ "obj": InputPathType,
41
+ })
42
+ TckconvertVariousFileParametersTagged = typing.TypedDict('TckconvertVariousFileParametersTagged', {
43
+ "@type": typing.Literal["VariousFile"],
31
44
  "obj": InputPathType,
32
45
  })
33
46
 
34
47
 
35
48
  TckconvertParameters = typing.TypedDict('TckconvertParameters', {
36
- "__STYXTYPE__": typing.Literal["tckconvert"],
49
+ "@type": typing.NotRequired[typing.Literal["mrtrix/tckconvert"]],
50
+ "scanner2voxel": typing.NotRequired[InputPathType | None],
51
+ "scanner2image": typing.NotRequired[InputPathType | None],
52
+ "voxel2scanner": typing.NotRequired[InputPathType | None],
53
+ "image2scanner": typing.NotRequired[InputPathType | None],
54
+ "sides": typing.NotRequired[int | None],
55
+ "increment": typing.NotRequired[int | None],
56
+ "dec": bool,
57
+ "radius": typing.NotRequired[float | None],
58
+ "ascii": bool,
59
+ "binary": bool,
60
+ "info": bool,
61
+ "quiet": bool,
62
+ "debug": bool,
63
+ "force": bool,
64
+ "nthreads": typing.NotRequired[int | None],
65
+ "config": typing.NotRequired[list[TckconvertConfigParameters] | None],
66
+ "help": bool,
67
+ "version": bool,
68
+ "input": typing.Union[TckconvertVariousStringParametersTagged, TckconvertVariousFileParametersTagged],
69
+ "output": str,
70
+ })
71
+ TckconvertParametersTagged = typing.TypedDict('TckconvertParametersTagged', {
72
+ "@type": typing.Literal["mrtrix/tckconvert"],
37
73
  "scanner2voxel": typing.NotRequired[InputPathType | None],
38
74
  "scanner2image": typing.NotRequired[InputPathType | None],
39
75
  "voxel2scanner": typing.NotRequired[InputPathType | None],
@@ -52,12 +88,12 @@ TckconvertParameters = typing.TypedDict('TckconvertParameters', {
52
88
  "config": typing.NotRequired[list[TckconvertConfigParameters] | None],
53
89
  "help": bool,
54
90
  "version": bool,
55
- "input": typing.Union[TckconvertVariousStringParameters, TckconvertVariousFileParameters],
91
+ "input": typing.Union[TckconvertVariousStringParametersTagged, TckconvertVariousFileParametersTagged],
56
92
  "output": str,
57
93
  })
58
94
 
59
95
 
60
- def dyn_cargs(
96
+ def tckconvert_input_cargs_dyn_fn(
61
97
  t: str,
62
98
  ) -> typing.Any:
63
99
  """
@@ -69,14 +105,12 @@ def dyn_cargs(
69
105
  Build cargs function.
70
106
  """
71
107
  return {
72
- "tckconvert": tckconvert_cargs,
73
- "config": tckconvert_config_cargs,
74
108
  "VariousString": tckconvert_various_string_cargs,
75
109
  "VariousFile": tckconvert_various_file_cargs,
76
110
  }.get(t)
77
111
 
78
112
 
79
- def dyn_outputs(
113
+ def tckconvert_input_outputs_dyn_fn(
80
114
  t: str,
81
115
  ) -> typing.Any:
82
116
  """
@@ -88,14 +122,13 @@ def dyn_outputs(
88
122
  Build outputs function.
89
123
  """
90
124
  return {
91
- "tckconvert": tckconvert_outputs,
92
125
  }.get(t)
93
126
 
94
127
 
95
128
  def tckconvert_config_params(
96
129
  key: str,
97
130
  value: str,
98
- ) -> TckconvertConfigParameters:
131
+ ) -> TckconvertConfigParametersTagged:
99
132
  """
100
133
  Build parameters.
101
134
 
@@ -106,7 +139,7 @@ def tckconvert_config_params(
106
139
  Parameter dictionary
107
140
  """
108
141
  params = {
109
- "__STYXTYPE__": "config",
142
+ "@type": "config",
110
143
  "key": key,
111
144
  "value": value,
112
145
  }
@@ -128,14 +161,14 @@ def tckconvert_config_cargs(
128
161
  """
129
162
  cargs = []
130
163
  cargs.append("-config")
131
- cargs.append(params.get("key"))
132
- cargs.append(params.get("value"))
164
+ cargs.append(params.get("key", None))
165
+ cargs.append(params.get("value", None))
133
166
  return cargs
134
167
 
135
168
 
136
169
  def tckconvert_various_string_params(
137
170
  obj: str,
138
- ) -> TckconvertVariousStringParameters:
171
+ ) -> TckconvertVariousStringParametersTagged:
139
172
  """
140
173
  Build parameters.
141
174
 
@@ -145,7 +178,7 @@ def tckconvert_various_string_params(
145
178
  Parameter dictionary
146
179
  """
147
180
  params = {
148
- "__STYXTYPE__": "VariousString",
181
+ "@type": "VariousString",
149
182
  "obj": obj,
150
183
  }
151
184
  return params
@@ -165,13 +198,13 @@ def tckconvert_various_string_cargs(
165
198
  Command-line arguments.
166
199
  """
167
200
  cargs = []
168
- cargs.append(params.get("obj"))
201
+ cargs.append(params.get("obj", None))
169
202
  return cargs
170
203
 
171
204
 
172
205
  def tckconvert_various_file_params(
173
206
  obj: InputPathType,
174
- ) -> TckconvertVariousFileParameters:
207
+ ) -> TckconvertVariousFileParametersTagged:
175
208
  """
176
209
  Build parameters.
177
210
 
@@ -181,7 +214,7 @@ def tckconvert_various_file_params(
181
214
  Parameter dictionary
182
215
  """
183
216
  params = {
184
- "__STYXTYPE__": "VariousFile",
217
+ "@type": "VariousFile",
185
218
  "obj": obj,
186
219
  }
187
220
  return params
@@ -201,13 +234,13 @@ def tckconvert_various_file_cargs(
201
234
  Command-line arguments.
202
235
  """
203
236
  cargs = []
204
- cargs.append(execution.input_file(params.get("obj")))
237
+ cargs.append(execution.input_file(params.get("obj", None)))
205
238
  return cargs
206
239
 
207
240
 
208
241
  class TckconvertOutputs(typing.NamedTuple):
209
242
  """
210
- Output object returned when calling `tckconvert(...)`.
243
+ Output object returned when calling `TckconvertParameters(...)`.
211
244
  """
212
245
  root: OutputPathType
213
246
  """Output root folder. This is the root folder for all outputs."""
@@ -216,7 +249,7 @@ class TckconvertOutputs(typing.NamedTuple):
216
249
 
217
250
 
218
251
  def tckconvert_params(
219
- input_: typing.Union[TckconvertVariousStringParameters, TckconvertVariousFileParameters],
252
+ input_: typing.Union[TckconvertVariousStringParametersTagged, TckconvertVariousFileParametersTagged],
220
253
  output: str,
221
254
  scanner2voxel: InputPathType | None = None,
222
255
  scanner2image: InputPathType | None = None,
@@ -236,7 +269,7 @@ def tckconvert_params(
236
269
  config: list[TckconvertConfigParameters] | None = None,
237
270
  help_: bool = False,
238
271
  version: bool = False,
239
- ) -> TckconvertParameters:
272
+ ) -> TckconvertParametersTagged:
240
273
  """
241
274
  Build parameters.
242
275
 
@@ -277,7 +310,7 @@ def tckconvert_params(
277
310
  Parameter dictionary
278
311
  """
279
312
  params = {
280
- "__STYXTYPE__": "tckconvert",
313
+ "@type": "mrtrix/tckconvert",
281
314
  "dec": dec,
282
315
  "ascii": ascii_,
283
316
  "binary": binary,
@@ -326,68 +359,68 @@ def tckconvert_cargs(
326
359
  """
327
360
  cargs = []
328
361
  cargs.append("tckconvert")
329
- if params.get("scanner2voxel") is not None:
362
+ if params.get("scanner2voxel", None) is not None:
330
363
  cargs.extend([
331
364
  "-scanner2voxel",
332
- execution.input_file(params.get("scanner2voxel"))
365
+ execution.input_file(params.get("scanner2voxel", None))
333
366
  ])
334
- if params.get("scanner2image") is not None:
367
+ if params.get("scanner2image", None) is not None:
335
368
  cargs.extend([
336
369
  "-scanner2image",
337
- execution.input_file(params.get("scanner2image"))
370
+ execution.input_file(params.get("scanner2image", None))
338
371
  ])
339
- if params.get("voxel2scanner") is not None:
372
+ if params.get("voxel2scanner", None) is not None:
340
373
  cargs.extend([
341
374
  "-voxel2scanner",
342
- execution.input_file(params.get("voxel2scanner"))
375
+ execution.input_file(params.get("voxel2scanner", None))
343
376
  ])
344
- if params.get("image2scanner") is not None:
377
+ if params.get("image2scanner", None) is not None:
345
378
  cargs.extend([
346
379
  "-image2scanner",
347
- execution.input_file(params.get("image2scanner"))
380
+ execution.input_file(params.get("image2scanner", None))
348
381
  ])
349
- if params.get("sides") is not None:
382
+ if params.get("sides", None) is not None:
350
383
  cargs.extend([
351
384
  "-sides",
352
- str(params.get("sides"))
385
+ str(params.get("sides", None))
353
386
  ])
354
- if params.get("increment") is not None:
387
+ if params.get("increment", None) is not None:
355
388
  cargs.extend([
356
389
  "-increment",
357
- str(params.get("increment"))
390
+ str(params.get("increment", None))
358
391
  ])
359
- if params.get("dec"):
392
+ if params.get("dec", False):
360
393
  cargs.append("-dec")
361
- if params.get("radius") is not None:
394
+ if params.get("radius", None) is not None:
362
395
  cargs.extend([
363
396
  "-radius",
364
- str(params.get("radius"))
397
+ str(params.get("radius", None))
365
398
  ])
366
- if params.get("ascii"):
399
+ if params.get("ascii", False):
367
400
  cargs.append("-ascii")
368
- if params.get("binary"):
401
+ if params.get("binary", False):
369
402
  cargs.append("-binary")
370
- if params.get("info"):
403
+ if params.get("info", False):
371
404
  cargs.append("-info")
372
- if params.get("quiet"):
405
+ if params.get("quiet", False):
373
406
  cargs.append("-quiet")
374
- if params.get("debug"):
407
+ if params.get("debug", False):
375
408
  cargs.append("-debug")
376
- if params.get("force"):
409
+ if params.get("force", False):
377
410
  cargs.append("-force")
378
- if params.get("nthreads") is not None:
411
+ if params.get("nthreads", None) is not None:
379
412
  cargs.extend([
380
413
  "-nthreads",
381
- str(params.get("nthreads"))
414
+ str(params.get("nthreads", None))
382
415
  ])
383
- if params.get("config") is not None:
384
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
385
- if params.get("help"):
416
+ if params.get("config", None) is not None:
417
+ cargs.extend([a for c in [tckconvert_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
418
+ if params.get("help", False):
386
419
  cargs.append("-help")
387
- if params.get("version"):
420
+ if params.get("version", False):
388
421
  cargs.append("-version")
389
- cargs.extend(dyn_cargs(params.get("input")["__STYXTYPE__"])(params.get("input"), execution))
390
- cargs.append(params.get("output"))
422
+ cargs.extend(tckconvert_input_cargs_dyn_fn(params.get("input", None)["@type"])(params.get("input", None), execution))
423
+ cargs.append(params.get("output", None))
391
424
  return cargs
392
425
 
393
426
 
@@ -406,16 +439,18 @@ def tckconvert_outputs(
406
439
  """
407
440
  ret = TckconvertOutputs(
408
441
  root=execution.output_file("."),
409
- output=execution.output_file(params.get("output")),
442
+ output=execution.output_file(params.get("output", None)),
410
443
  )
411
444
  return ret
412
445
 
413
446
 
414
447
  def tckconvert_execute(
415
448
  params: TckconvertParameters,
416
- execution: Execution,
449
+ runner: Runner | None = None,
417
450
  ) -> TckconvertOutputs:
418
451
  """
452
+ tckconvert
453
+
419
454
  Convert between different track file formats.
420
455
 
421
456
  The program currently supports MRtrix .tck files (input/output), ascii text
@@ -442,10 +477,12 @@ def tckconvert_execute(
442
477
 
443
478
  Args:
444
479
  params: The parameters.
445
- execution: The execution object.
480
+ runner: Command runner.
446
481
  Returns:
447
482
  NamedTuple of outputs (described in `TckconvertOutputs`).
448
483
  """
484
+ runner = runner or get_global_runner()
485
+ execution = runner.start_execution(TCKCONVERT_METADATA)
449
486
  params = execution.params(params)
450
487
  cargs = tckconvert_cargs(params, execution)
451
488
  ret = tckconvert_outputs(params, execution)
@@ -454,7 +491,7 @@ def tckconvert_execute(
454
491
 
455
492
 
456
493
  def tckconvert(
457
- input_: typing.Union[TckconvertVariousStringParameters, TckconvertVariousFileParameters],
494
+ input_: typing.Union[TckconvertVariousStringParametersTagged, TckconvertVariousFileParametersTagged],
458
495
  output: str,
459
496
  scanner2voxel: InputPathType | None = None,
460
497
  scanner2image: InputPathType | None = None,
@@ -477,6 +514,8 @@ def tckconvert(
477
514
  runner: Runner | None = None,
478
515
  ) -> TckconvertOutputs:
479
516
  """
517
+ tckconvert
518
+
480
519
  Convert between different track file formats.
481
520
 
482
521
  The program currently supports MRtrix .tck files (input/output), ascii text
@@ -538,8 +577,6 @@ def tckconvert(
538
577
  Returns:
539
578
  NamedTuple of outputs (described in `TckconvertOutputs`).
540
579
  """
541
- runner = runner or get_global_runner()
542
- execution = runner.start_execution(TCKCONVERT_METADATA)
543
580
  params = tckconvert_params(
544
581
  scanner2voxel=scanner2voxel,
545
582
  scanner2image=scanner2image,
@@ -562,18 +599,15 @@ def tckconvert(
562
599
  input_=input_,
563
600
  output=output,
564
601
  )
565
- return tckconvert_execute(params, execution)
602
+ return tckconvert_execute(params, runner)
566
603
 
567
604
 
568
605
  __all__ = [
569
606
  "TCKCONVERT_METADATA",
570
- "TckconvertConfigParameters",
571
607
  "TckconvertOutputs",
572
- "TckconvertParameters",
573
- "TckconvertVariousFileParameters",
574
- "TckconvertVariousStringParameters",
575
608
  "tckconvert",
576
609
  "tckconvert_config_params",
610
+ "tckconvert_execute",
577
611
  "tckconvert_params",
578
612
  "tckconvert_various_file_params",
579
613
  "tckconvert_various_string_params",