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
  MRSTATS_METADATA = Metadata(
9
- id="a0e8ad6624129b47028cef6351f07fe776fbe211.boutiques",
9
+ id="28fb063299fa07970bfa62d606e13e87fd3bc94e.boutiques",
10
10
  name="mrstats",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,20 +14,45 @@ MRSTATS_METADATA = Metadata(
14
14
 
15
15
 
16
16
  MrstatsOutputParameters = typing.TypedDict('MrstatsOutputParameters', {
17
- "__STYXTYPE__": typing.Literal["output"],
17
+ "@type": typing.NotRequired[typing.Literal["output"]],
18
+ "field": str,
19
+ })
20
+ MrstatsOutputParametersTagged = typing.TypedDict('MrstatsOutputParametersTagged', {
21
+ "@type": typing.Literal["output"],
18
22
  "field": str,
19
23
  })
20
24
 
21
25
 
22
26
  MrstatsConfigParameters = typing.TypedDict('MrstatsConfigParameters', {
23
- "__STYXTYPE__": typing.Literal["config"],
27
+ "@type": typing.NotRequired[typing.Literal["config"]],
28
+ "key": str,
29
+ "value": str,
30
+ })
31
+ MrstatsConfigParametersTagged = typing.TypedDict('MrstatsConfigParametersTagged', {
32
+ "@type": typing.Literal["config"],
24
33
  "key": str,
25
34
  "value": str,
26
35
  })
27
36
 
28
37
 
29
38
  MrstatsParameters = typing.TypedDict('MrstatsParameters', {
30
- "__STYXTYPE__": typing.Literal["mrstats"],
39
+ "@type": typing.NotRequired[typing.Literal["mrtrix/mrstats"]],
40
+ "output": typing.NotRequired[list[MrstatsOutputParameters] | None],
41
+ "mask": typing.NotRequired[InputPathType | None],
42
+ "ignorezero": bool,
43
+ "allvolumes": bool,
44
+ "info": bool,
45
+ "quiet": bool,
46
+ "debug": bool,
47
+ "force": bool,
48
+ "nthreads": typing.NotRequired[int | None],
49
+ "config": typing.NotRequired[list[MrstatsConfigParameters] | None],
50
+ "help": bool,
51
+ "version": bool,
52
+ "image": InputPathType,
53
+ })
54
+ MrstatsParametersTagged = typing.TypedDict('MrstatsParametersTagged', {
55
+ "@type": typing.Literal["mrtrix/mrstats"],
31
56
  "output": typing.NotRequired[list[MrstatsOutputParameters] | None],
32
57
  "mask": typing.NotRequired[InputPathType | None],
33
58
  "ignorezero": bool,
@@ -42,44 +67,11 @@ MrstatsParameters = typing.TypedDict('MrstatsParameters', {
42
67
  "version": bool,
43
68
  "image": InputPathType,
44
69
  })
45
-
46
-
47
- def dyn_cargs(
48
- t: str,
49
- ) -> typing.Any:
50
- """
51
- Get build cargs function by command type.
52
-
53
- Args:
54
- t: Command type.
55
- Returns:
56
- Build cargs function.
57
- """
58
- return {
59
- "mrstats": mrstats_cargs,
60
- "output": mrstats_output_cargs,
61
- "config": mrstats_config_cargs,
62
- }.get(t)
63
-
64
-
65
- def dyn_outputs(
66
- t: str,
67
- ) -> typing.Any:
68
- """
69
- Get build outputs function by command type.
70
-
71
- Args:
72
- t: Command type.
73
- Returns:
74
- Build outputs function.
75
- """
76
- return {
77
- }.get(t)
78
70
 
79
71
 
80
72
  def mrstats_output_params(
81
73
  field: str,
82
- ) -> MrstatsOutputParameters:
74
+ ) -> MrstatsOutputParametersTagged:
83
75
  """
84
76
  Build parameters.
85
77
 
@@ -95,7 +87,7 @@ def mrstats_output_params(
95
87
  Parameter dictionary
96
88
  """
97
89
  params = {
98
- "__STYXTYPE__": "output",
90
+ "@type": "output",
99
91
  "field": field,
100
92
  }
101
93
  return params
@@ -116,14 +108,14 @@ def mrstats_output_cargs(
116
108
  """
117
109
  cargs = []
118
110
  cargs.append("-output")
119
- cargs.append(params.get("field"))
111
+ cargs.append(params.get("field", None))
120
112
  return cargs
121
113
 
122
114
 
123
115
  def mrstats_config_params(
124
116
  key: str,
125
117
  value: str,
126
- ) -> MrstatsConfigParameters:
118
+ ) -> MrstatsConfigParametersTagged:
127
119
  """
128
120
  Build parameters.
129
121
 
@@ -134,7 +126,7 @@ def mrstats_config_params(
134
126
  Parameter dictionary
135
127
  """
136
128
  params = {
137
- "__STYXTYPE__": "config",
129
+ "@type": "config",
138
130
  "key": key,
139
131
  "value": value,
140
132
  }
@@ -156,14 +148,14 @@ def mrstats_config_cargs(
156
148
  """
157
149
  cargs = []
158
150
  cargs.append("-config")
159
- cargs.append(params.get("key"))
160
- cargs.append(params.get("value"))
151
+ cargs.append(params.get("key", None))
152
+ cargs.append(params.get("value", None))
161
153
  return cargs
162
154
 
163
155
 
164
156
  class MrstatsOutputs(typing.NamedTuple):
165
157
  """
166
- Output object returned when calling `mrstats(...)`.
158
+ Output object returned when calling `MrstatsParameters(...)`.
167
159
  """
168
160
  root: OutputPathType
169
161
  """Output root folder. This is the root folder for all outputs."""
@@ -183,7 +175,7 @@ def mrstats_params(
183
175
  config: list[MrstatsConfigParameters] | None = None,
184
176
  help_: bool = False,
185
177
  version: bool = False,
186
- ) -> MrstatsParameters:
178
+ ) -> MrstatsParametersTagged:
187
179
  """
188
180
  Build parameters.
189
181
 
@@ -216,7 +208,7 @@ def mrstats_params(
216
208
  Parameter dictionary
217
209
  """
218
210
  params = {
219
- "__STYXTYPE__": "mrstats",
211
+ "@type": "mrtrix/mrstats",
220
212
  "ignorezero": ignorezero,
221
213
  "allvolumes": allvolumes,
222
214
  "info": info,
@@ -253,37 +245,37 @@ def mrstats_cargs(
253
245
  """
254
246
  cargs = []
255
247
  cargs.append("mrstats")
256
- if params.get("output") is not None:
257
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("output")] for a in c])
258
- if params.get("mask") is not None:
248
+ if params.get("output", None) is not None:
249
+ cargs.extend([a for c in [mrstats_output_cargs(s, execution) for s in params.get("output", None)] for a in c])
250
+ if params.get("mask", None) is not None:
259
251
  cargs.extend([
260
252
  "-mask",
261
- execution.input_file(params.get("mask"))
253
+ execution.input_file(params.get("mask", None))
262
254
  ])
263
- if params.get("ignorezero"):
255
+ if params.get("ignorezero", False):
264
256
  cargs.append("-ignorezero")
265
- if params.get("allvolumes"):
257
+ if params.get("allvolumes", False):
266
258
  cargs.append("-allvolumes")
267
- if params.get("info"):
259
+ if params.get("info", False):
268
260
  cargs.append("-info")
269
- if params.get("quiet"):
261
+ if params.get("quiet", False):
270
262
  cargs.append("-quiet")
271
- if params.get("debug"):
263
+ if params.get("debug", False):
272
264
  cargs.append("-debug")
273
- if params.get("force"):
265
+ if params.get("force", False):
274
266
  cargs.append("-force")
275
- if params.get("nthreads") is not None:
267
+ if params.get("nthreads", None) is not None:
276
268
  cargs.extend([
277
269
  "-nthreads",
278
- str(params.get("nthreads"))
270
+ str(params.get("nthreads", None))
279
271
  ])
280
- if params.get("config") is not None:
281
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
282
- if params.get("help"):
272
+ if params.get("config", None) is not None:
273
+ cargs.extend([a for c in [mrstats_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
274
+ if params.get("help", False):
283
275
  cargs.append("-help")
284
- if params.get("version"):
276
+ if params.get("version", False):
285
277
  cargs.append("-version")
286
- cargs.append(execution.input_file(params.get("image")))
278
+ cargs.append(execution.input_file(params.get("image", None)))
287
279
  return cargs
288
280
 
289
281
 
@@ -308,9 +300,11 @@ def mrstats_outputs(
308
300
 
309
301
  def mrstats_execute(
310
302
  params: MrstatsParameters,
311
- execution: Execution,
303
+ runner: Runner | None = None,
312
304
  ) -> MrstatsOutputs:
313
305
  """
306
+ mrstats
307
+
314
308
  Compute images statistics.
315
309
 
316
310
 
@@ -325,10 +319,12 @@ def mrstats_execute(
325
319
 
326
320
  Args:
327
321
  params: The parameters.
328
- execution: The execution object.
322
+ runner: Command runner.
329
323
  Returns:
330
324
  NamedTuple of outputs (described in `MrstatsOutputs`).
331
325
  """
326
+ runner = runner or get_global_runner()
327
+ execution = runner.start_execution(MRSTATS_METADATA)
332
328
  params = execution.params(params)
333
329
  cargs = mrstats_cargs(params, execution)
334
330
  ret = mrstats_outputs(params, execution)
@@ -353,6 +349,8 @@ def mrstats(
353
349
  runner: Runner | None = None,
354
350
  ) -> MrstatsOutputs:
355
351
  """
352
+ mrstats
353
+
356
354
  Compute images statistics.
357
355
 
358
356
 
@@ -394,8 +392,6 @@ def mrstats(
394
392
  Returns:
395
393
  NamedTuple of outputs (described in `MrstatsOutputs`).
396
394
  """
397
- runner = runner or get_global_runner()
398
- execution = runner.start_execution(MRSTATS_METADATA)
399
395
  params = mrstats_params(
400
396
  output=output,
401
397
  mask=mask,
@@ -411,17 +407,15 @@ def mrstats(
411
407
  version=version,
412
408
  image=image,
413
409
  )
414
- return mrstats_execute(params, execution)
410
+ return mrstats_execute(params, runner)
415
411
 
416
412
 
417
413
  __all__ = [
418
414
  "MRSTATS_METADATA",
419
- "MrstatsConfigParameters",
420
- "MrstatsOutputParameters",
421
415
  "MrstatsOutputs",
422
- "MrstatsParameters",
423
416
  "mrstats",
424
417
  "mrstats_config_params",
418
+ "mrstats_execute",
425
419
  "mrstats_output_params",
426
420
  "mrstats_params",
427
421
  ]
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  MRTHRESHOLD_METADATA = Metadata(
9
- id="63955d6506c219775e9ca4df901c67a97355416d.boutiques",
9
+ id="c55432e6110a1d139e985a99eec2382bb7a91c6e.boutiques",
10
10
  name="mrthreshold",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,14 +14,43 @@ MRTHRESHOLD_METADATA = Metadata(
14
14
 
15
15
 
16
16
  MrthresholdConfigParameters = typing.TypedDict('MrthresholdConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ MrthresholdConfigParametersTagged = typing.TypedDict('MrthresholdConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  MrthresholdParameters = typing.TypedDict('MrthresholdParameters', {
24
- "__STYXTYPE__": typing.Literal["mrthreshold"],
29
+ "@type": typing.NotRequired[typing.Literal["mrtrix/mrthreshold"]],
30
+ "abs": typing.NotRequired[float | None],
31
+ "percentile": typing.NotRequired[float | None],
32
+ "top": typing.NotRequired[int | None],
33
+ "bottom": typing.NotRequired[int | None],
34
+ "allvolumes": bool,
35
+ "ignorezero": bool,
36
+ "mask": typing.NotRequired[InputPathType | None],
37
+ "comparison": typing.NotRequired[str | None],
38
+ "invert": bool,
39
+ "out_masked": bool,
40
+ "nan": bool,
41
+ "info": bool,
42
+ "quiet": bool,
43
+ "debug": bool,
44
+ "force": bool,
45
+ "nthreads": typing.NotRequired[int | None],
46
+ "config": typing.NotRequired[list[MrthresholdConfigParameters] | None],
47
+ "help": bool,
48
+ "version": bool,
49
+ "input": InputPathType,
50
+ "output": typing.NotRequired[str | None],
51
+ })
52
+ MrthresholdParametersTagged = typing.TypedDict('MrthresholdParametersTagged', {
53
+ "@type": typing.Literal["mrtrix/mrthreshold"],
25
54
  "abs": typing.NotRequired[float | None],
26
55
  "percentile": typing.NotRequired[float | None],
27
56
  "top": typing.NotRequired[int | None],
@@ -44,45 +73,12 @@ MrthresholdParameters = typing.TypedDict('MrthresholdParameters', {
44
73
  "input": InputPathType,
45
74
  "output": typing.NotRequired[str | None],
46
75
  })
47
-
48
-
49
- def dyn_cargs(
50
- t: str,
51
- ) -> typing.Any:
52
- """
53
- Get build cargs function by command type.
54
-
55
- Args:
56
- t: Command type.
57
- Returns:
58
- Build cargs function.
59
- """
60
- return {
61
- "mrthreshold": mrthreshold_cargs,
62
- "config": mrthreshold_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
- "mrthreshold": mrthreshold_outputs,
79
- }.get(t)
80
76
 
81
77
 
82
78
  def mrthreshold_config_params(
83
79
  key: str,
84
80
  value: str,
85
- ) -> MrthresholdConfigParameters:
81
+ ) -> MrthresholdConfigParametersTagged:
86
82
  """
87
83
  Build parameters.
88
84
 
@@ -93,7 +89,7 @@ def mrthreshold_config_params(
93
89
  Parameter dictionary
94
90
  """
95
91
  params = {
96
- "__STYXTYPE__": "config",
92
+ "@type": "config",
97
93
  "key": key,
98
94
  "value": value,
99
95
  }
@@ -115,14 +111,14 @@ def mrthreshold_config_cargs(
115
111
  """
116
112
  cargs = []
117
113
  cargs.append("-config")
118
- cargs.append(params.get("key"))
119
- cargs.append(params.get("value"))
114
+ cargs.append(params.get("key", None))
115
+ cargs.append(params.get("value", None))
120
116
  return cargs
121
117
 
122
118
 
123
119
  class MrthresholdOutputs(typing.NamedTuple):
124
120
  """
125
- Output object returned when calling `mrthreshold(...)`.
121
+ Output object returned when calling `MrthresholdParameters(...)`.
126
122
  """
127
123
  root: OutputPathType
128
124
  """Output root folder. This is the root folder for all outputs."""
@@ -152,7 +148,7 @@ def mrthreshold_params(
152
148
  help_: bool = False,
153
149
  version: bool = False,
154
150
  output: str | None = None,
155
- ) -> MrthresholdParameters:
151
+ ) -> MrthresholdParametersTagged:
156
152
  """
157
153
  Build parameters.
158
154
 
@@ -197,7 +193,7 @@ def mrthreshold_params(
197
193
  Parameter dictionary
198
194
  """
199
195
  params = {
200
- "__STYXTYPE__": "mrthreshold",
196
+ "@type": "mrtrix/mrthreshold",
201
197
  "allvolumes": allvolumes,
202
198
  "ignorezero": ignorezero,
203
199
  "invert": invert,
@@ -247,68 +243,68 @@ def mrthreshold_cargs(
247
243
  """
248
244
  cargs = []
249
245
  cargs.append("mrthreshold")
250
- if params.get("abs") is not None:
246
+ if params.get("abs", None) is not None:
251
247
  cargs.extend([
252
248
  "-abs",
253
- str(params.get("abs"))
249
+ str(params.get("abs", None))
254
250
  ])
255
- if params.get("percentile") is not None:
251
+ if params.get("percentile", None) is not None:
256
252
  cargs.extend([
257
253
  "-percentile",
258
- str(params.get("percentile"))
254
+ str(params.get("percentile", None))
259
255
  ])
260
- if params.get("top") is not None:
256
+ if params.get("top", None) is not None:
261
257
  cargs.extend([
262
258
  "-top",
263
- str(params.get("top"))
259
+ str(params.get("top", None))
264
260
  ])
265
- if params.get("bottom") is not None:
261
+ if params.get("bottom", None) is not None:
266
262
  cargs.extend([
267
263
  "-bottom",
268
- str(params.get("bottom"))
264
+ str(params.get("bottom", None))
269
265
  ])
270
- if params.get("allvolumes"):
266
+ if params.get("allvolumes", False):
271
267
  cargs.append("-allvolumes")
272
- if params.get("ignorezero"):
268
+ if params.get("ignorezero", False):
273
269
  cargs.append("-ignorezero")
274
- if params.get("mask") is not None:
270
+ if params.get("mask", None) is not None:
275
271
  cargs.extend([
276
272
  "-mask",
277
- execution.input_file(params.get("mask"))
273
+ execution.input_file(params.get("mask", None))
278
274
  ])
279
- if params.get("comparison") is not None:
275
+ if params.get("comparison", None) is not None:
280
276
  cargs.extend([
281
277
  "-comparison",
282
- params.get("comparison")
278
+ params.get("comparison", None)
283
279
  ])
284
- if params.get("invert"):
280
+ if params.get("invert", False):
285
281
  cargs.append("-invert")
286
- if params.get("out_masked"):
282
+ if params.get("out_masked", False):
287
283
  cargs.append("-out_masked")
288
- if params.get("nan"):
284
+ if params.get("nan", False):
289
285
  cargs.append("-nan")
290
- if params.get("info"):
286
+ if params.get("info", False):
291
287
  cargs.append("-info")
292
- if params.get("quiet"):
288
+ if params.get("quiet", False):
293
289
  cargs.append("-quiet")
294
- if params.get("debug"):
290
+ if params.get("debug", False):
295
291
  cargs.append("-debug")
296
- if params.get("force"):
292
+ if params.get("force", False):
297
293
  cargs.append("-force")
298
- if params.get("nthreads") is not None:
294
+ if params.get("nthreads", None) is not None:
299
295
  cargs.extend([
300
296
  "-nthreads",
301
- str(params.get("nthreads"))
297
+ str(params.get("nthreads", None))
302
298
  ])
303
- if params.get("config") is not None:
304
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
305
- if params.get("help"):
299
+ if params.get("config", None) is not None:
300
+ cargs.extend([a for c in [mrthreshold_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
301
+ if params.get("help", False):
306
302
  cargs.append("-help")
307
- if params.get("version"):
303
+ if params.get("version", False):
308
304
  cargs.append("-version")
309
- cargs.append(execution.input_file(params.get("input")))
310
- if params.get("output") is not None:
311
- cargs.append(params.get("output"))
305
+ cargs.append(execution.input_file(params.get("input", None)))
306
+ if params.get("output", None) is not None:
307
+ cargs.append(params.get("output", None))
312
308
  return cargs
313
309
 
314
310
 
@@ -327,16 +323,18 @@ def mrthreshold_outputs(
327
323
  """
328
324
  ret = MrthresholdOutputs(
329
325
  root=execution.output_file("."),
330
- output=execution.output_file(params.get("output")) if (params.get("output") is not None) else None,
326
+ output=execution.output_file(params.get("output", None)) if (params.get("output") is not None) else None,
331
327
  )
332
328
  return ret
333
329
 
334
330
 
335
331
  def mrthreshold_execute(
336
332
  params: MrthresholdParameters,
337
- execution: Execution,
333
+ runner: Runner | None = None,
338
334
  ) -> MrthresholdOutputs:
339
335
  """
336
+ mrthreshold
337
+
340
338
  Create bitwise image by thresholding image intensity.
341
339
 
342
340
  The threshold value to be applied can be determined in one of a number of
@@ -386,10 +384,12 @@ def mrthreshold_execute(
386
384
 
387
385
  Args:
388
386
  params: The parameters.
389
- execution: The execution object.
387
+ runner: Command runner.
390
388
  Returns:
391
389
  NamedTuple of outputs (described in `MrthresholdOutputs`).
392
390
  """
391
+ runner = runner or get_global_runner()
392
+ execution = runner.start_execution(MRTHRESHOLD_METADATA)
393
393
  params = execution.params(params)
394
394
  cargs = mrthreshold_cargs(params, execution)
395
395
  ret = mrthreshold_outputs(params, execution)
@@ -422,6 +422,8 @@ def mrthreshold(
422
422
  runner: Runner | None = None,
423
423
  ) -> MrthresholdOutputs:
424
424
  """
425
+ mrthreshold
426
+
425
427
  Create bitwise image by thresholding image intensity.
426
428
 
427
429
  The threshold value to be applied can be determined in one of a number of
@@ -510,8 +512,6 @@ def mrthreshold(
510
512
  Returns:
511
513
  NamedTuple of outputs (described in `MrthresholdOutputs`).
512
514
  """
513
- runner = runner or get_global_runner()
514
- execution = runner.start_execution(MRTHRESHOLD_METADATA)
515
515
  params = mrthreshold_params(
516
516
  abs_=abs_,
517
517
  percentile=percentile,
@@ -535,15 +535,14 @@ def mrthreshold(
535
535
  input_=input_,
536
536
  output=output,
537
537
  )
538
- return mrthreshold_execute(params, execution)
538
+ return mrthreshold_execute(params, runner)
539
539
 
540
540
 
541
541
  __all__ = [
542
542
  "MRTHRESHOLD_METADATA",
543
- "MrthresholdConfigParameters",
544
543
  "MrthresholdOutputs",
545
- "MrthresholdParameters",
546
544
  "mrthreshold",
547
545
  "mrthreshold_config_params",
546
+ "mrthreshold_execute",
548
547
  "mrthreshold_params",
549
548
  ]