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
  MTNORMALISE_METADATA = Metadata(
9
- id="f1833d2ac76f43cec968d20e8d2c21a993a925a3.boutiques",
9
+ id="3bc2bbe8af34500259b7245db2d18482e852bfea.boutiques",
10
10
  name="mtnormalise",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,21 +14,51 @@ MTNORMALISE_METADATA = Metadata(
14
14
 
15
15
 
16
16
  MtnormaliseConfigParameters = typing.TypedDict('MtnormaliseConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ MtnormaliseConfigParametersTagged = typing.TypedDict('MtnormaliseConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  MtnormaliseInputOutputParameters = typing.TypedDict('MtnormaliseInputOutputParameters', {
24
- "__STYXTYPE__": typing.Literal["input_output"],
29
+ "@type": typing.NotRequired[typing.Literal["input_output"]],
30
+ "input": InputPathType,
31
+ "output": str,
32
+ })
33
+ MtnormaliseInputOutputParametersTagged = typing.TypedDict('MtnormaliseInputOutputParametersTagged', {
34
+ "@type": typing.Literal["input_output"],
25
35
  "input": InputPathType,
26
36
  "output": str,
27
37
  })
28
38
 
29
39
 
30
40
  MtnormaliseParameters = typing.TypedDict('MtnormaliseParameters', {
31
- "__STYXTYPE__": typing.Literal["mtnormalise"],
41
+ "@type": typing.NotRequired[typing.Literal["mrtrix/mtnormalise"]],
42
+ "mask": InputPathType,
43
+ "order": typing.NotRequired[str | None],
44
+ "niter": typing.NotRequired[list[int] | None],
45
+ "reference": typing.NotRequired[float | None],
46
+ "balanced": bool,
47
+ "check_norm": typing.NotRequired[str | None],
48
+ "check_mask": typing.NotRequired[str | None],
49
+ "check_factors": typing.NotRequired[str | None],
50
+ "info": bool,
51
+ "quiet": bool,
52
+ "debug": bool,
53
+ "force": bool,
54
+ "nthreads": typing.NotRequired[int | None],
55
+ "config": typing.NotRequired[list[MtnormaliseConfigParameters] | None],
56
+ "help": bool,
57
+ "version": bool,
58
+ "input_output": list[MtnormaliseInputOutputParameters],
59
+ })
60
+ MtnormaliseParametersTagged = typing.TypedDict('MtnormaliseParametersTagged', {
61
+ "@type": typing.Literal["mrtrix/mtnormalise"],
32
62
  "mask": InputPathType,
33
63
  "order": typing.NotRequired[str | None],
34
64
  "niter": typing.NotRequired[list[int] | None],
@@ -47,47 +77,12 @@ MtnormaliseParameters = typing.TypedDict('MtnormaliseParameters', {
47
77
  "version": bool,
48
78
  "input_output": list[MtnormaliseInputOutputParameters],
49
79
  })
50
-
51
-
52
- def dyn_cargs(
53
- t: str,
54
- ) -> typing.Any:
55
- """
56
- Get build cargs function by command type.
57
-
58
- Args:
59
- t: Command type.
60
- Returns:
61
- Build cargs function.
62
- """
63
- return {
64
- "mtnormalise": mtnormalise_cargs,
65
- "config": mtnormalise_config_cargs,
66
- "input_output": mtnormalise_input_output_cargs,
67
- }.get(t)
68
-
69
-
70
- def dyn_outputs(
71
- t: str,
72
- ) -> typing.Any:
73
- """
74
- Get build outputs function by command type.
75
-
76
- Args:
77
- t: Command type.
78
- Returns:
79
- Build outputs function.
80
- """
81
- return {
82
- "mtnormalise": mtnormalise_outputs,
83
- "input_output": mtnormalise_input_output_outputs,
84
- }.get(t)
85
80
 
86
81
 
87
82
  def mtnormalise_config_params(
88
83
  key: str,
89
84
  value: str,
90
- ) -> MtnormaliseConfigParameters:
85
+ ) -> MtnormaliseConfigParametersTagged:
91
86
  """
92
87
  Build parameters.
93
88
 
@@ -98,7 +93,7 @@ def mtnormalise_config_params(
98
93
  Parameter dictionary
99
94
  """
100
95
  params = {
101
- "__STYXTYPE__": "config",
96
+ "@type": "config",
102
97
  "key": key,
103
98
  "value": value,
104
99
  }
@@ -120,8 +115,8 @@ def mtnormalise_config_cargs(
120
115
  """
121
116
  cargs = []
122
117
  cargs.append("-config")
123
- cargs.append(params.get("key"))
124
- cargs.append(params.get("value"))
118
+ cargs.append(params.get("key", None))
119
+ cargs.append(params.get("value", None))
125
120
  return cargs
126
121
 
127
122
 
@@ -138,7 +133,7 @@ class MtnormaliseInputOutputOutputs(typing.NamedTuple):
138
133
  def mtnormalise_input_output_params(
139
134
  input_: InputPathType,
140
135
  output: str,
141
- ) -> MtnormaliseInputOutputParameters:
136
+ ) -> MtnormaliseInputOutputParametersTagged:
142
137
  """
143
138
  Build parameters.
144
139
 
@@ -149,7 +144,7 @@ def mtnormalise_input_output_params(
149
144
  Parameter dictionary
150
145
  """
151
146
  params = {
152
- "__STYXTYPE__": "input_output",
147
+ "@type": "input_output",
153
148
  "input": input_,
154
149
  "output": output,
155
150
  }
@@ -170,8 +165,8 @@ def mtnormalise_input_output_cargs(
170
165
  Command-line arguments.
171
166
  """
172
167
  cargs = []
173
- cargs.append(execution.input_file(params.get("input")))
174
- cargs.append(params.get("output"))
168
+ cargs.append(execution.input_file(params.get("input", None)))
169
+ cargs.append(params.get("output", None))
175
170
  return cargs
176
171
 
177
172
 
@@ -190,14 +185,14 @@ def mtnormalise_input_output_outputs(
190
185
  """
191
186
  ret = MtnormaliseInputOutputOutputs(
192
187
  root=execution.output_file("."),
193
- output=execution.output_file(params.get("output")),
188
+ output=execution.output_file(params.get("output", None)),
194
189
  )
195
190
  return ret
196
191
 
197
192
 
198
193
  class MtnormaliseOutputs(typing.NamedTuple):
199
194
  """
200
- Output object returned when calling `mtnormalise(...)`.
195
+ Output object returned when calling `MtnormaliseParameters(...)`.
201
196
  """
202
197
  root: OutputPathType
203
198
  """Output root folder. This is the root folder for all outputs."""
@@ -232,7 +227,7 @@ def mtnormalise_params(
232
227
  config: list[MtnormaliseConfigParameters] | None = None,
233
228
  help_: bool = False,
234
229
  version: bool = False,
235
- ) -> MtnormaliseParameters:
230
+ ) -> MtnormaliseParametersTagged:
236
231
  """
237
232
  Build parameters.
238
233
 
@@ -279,7 +274,7 @@ def mtnormalise_params(
279
274
  Parameter dictionary
280
275
  """
281
276
  params = {
282
- "__STYXTYPE__": "mtnormalise",
277
+ "@type": "mrtrix/mtnormalise",
283
278
  "mask": mask,
284
279
  "balanced": balanced,
285
280
  "info": info,
@@ -326,60 +321,60 @@ def mtnormalise_cargs(
326
321
  cargs.append("mtnormalise")
327
322
  cargs.extend([
328
323
  "-mask",
329
- execution.input_file(params.get("mask"))
324
+ execution.input_file(params.get("mask", None))
330
325
  ])
331
- if params.get("order") is not None:
326
+ if params.get("order", None) is not None:
332
327
  cargs.extend([
333
328
  "-order",
334
- params.get("order")
329
+ params.get("order", None)
335
330
  ])
336
- if params.get("niter") is not None:
331
+ if params.get("niter", None) is not None:
337
332
  cargs.extend([
338
333
  "-niter",
339
- ",".join(map(str, params.get("niter")))
334
+ ",".join(map(str, params.get("niter", None)))
340
335
  ])
341
- if params.get("reference") is not None:
336
+ if params.get("reference", None) is not None:
342
337
  cargs.extend([
343
338
  "-reference",
344
- str(params.get("reference"))
339
+ str(params.get("reference", None))
345
340
  ])
346
- if params.get("balanced"):
341
+ if params.get("balanced", False):
347
342
  cargs.append("-balanced")
348
- if params.get("check_norm") is not None:
343
+ if params.get("check_norm", None) is not None:
349
344
  cargs.extend([
350
345
  "-check_norm",
351
- params.get("check_norm")
346
+ params.get("check_norm", None)
352
347
  ])
353
- if params.get("check_mask") is not None:
348
+ if params.get("check_mask", None) is not None:
354
349
  cargs.extend([
355
350
  "-check_mask",
356
- params.get("check_mask")
351
+ params.get("check_mask", None)
357
352
  ])
358
- if params.get("check_factors") is not None:
353
+ if params.get("check_factors", None) is not None:
359
354
  cargs.extend([
360
355
  "-check_factors",
361
- params.get("check_factors")
356
+ params.get("check_factors", None)
362
357
  ])
363
- if params.get("info"):
358
+ if params.get("info", False):
364
359
  cargs.append("-info")
365
- if params.get("quiet"):
360
+ if params.get("quiet", False):
366
361
  cargs.append("-quiet")
367
- if params.get("debug"):
362
+ if params.get("debug", False):
368
363
  cargs.append("-debug")
369
- if params.get("force"):
364
+ if params.get("force", False):
370
365
  cargs.append("-force")
371
- if params.get("nthreads") is not None:
366
+ if params.get("nthreads", None) is not None:
372
367
  cargs.extend([
373
368
  "-nthreads",
374
- str(params.get("nthreads"))
369
+ str(params.get("nthreads", None))
375
370
  ])
376
- if params.get("config") is not None:
377
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
378
- if params.get("help"):
371
+ if params.get("config", None) is not None:
372
+ cargs.extend([a for c in [mtnormalise_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
373
+ if params.get("help", False):
379
374
  cargs.append("-help")
380
- if params.get("version"):
375
+ if params.get("version", False):
381
376
  cargs.append("-version")
382
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("input_output")] for a in c])
377
+ cargs.extend([a for c in [mtnormalise_input_output_cargs(s, execution) for s in params.get("input_output", None)] for a in c])
383
378
  return cargs
384
379
 
385
380
 
@@ -398,19 +393,21 @@ def mtnormalise_outputs(
398
393
  """
399
394
  ret = MtnormaliseOutputs(
400
395
  root=execution.output_file("."),
401
- check_norm=execution.output_file(params.get("check_norm")) if (params.get("check_norm") is not None) else None,
402
- check_mask=execution.output_file(params.get("check_mask")) if (params.get("check_mask") is not None) else None,
403
- check_factors=execution.output_file(params.get("check_factors")) if (params.get("check_factors") is not None) else None,
404
- input_output=[dyn_outputs(i["__STYXTYPE__"])(i, execution) if dyn_outputs(i["__STYXTYPE__"]) else None for i in params.get("input_output")],
396
+ check_norm=execution.output_file(params.get("check_norm", None)) if (params.get("check_norm") is not None) else None,
397
+ check_mask=execution.output_file(params.get("check_mask", None)) if (params.get("check_mask") is not None) else None,
398
+ check_factors=execution.output_file(params.get("check_factors", None)) if (params.get("check_factors") is not None) else None,
399
+ input_output=[mtnormalise_input_output_outputs(i, execution) if mtnormalise_input_output_outputs else None for i in params.get("input_output")],
405
400
  )
406
401
  return ret
407
402
 
408
403
 
409
404
  def mtnormalise_execute(
410
405
  params: MtnormaliseParameters,
411
- execution: Execution,
406
+ runner: Runner | None = None,
412
407
  ) -> MtnormaliseOutputs:
413
408
  """
409
+ mtnormalise
410
+
414
411
  Multi-tissue informed log-domain intensity normalisation.
415
412
 
416
413
  This command takes as input any number of tissue components (e.g. from
@@ -448,10 +445,12 @@ def mtnormalise_execute(
448
445
 
449
446
  Args:
450
447
  params: The parameters.
451
- execution: The execution object.
448
+ runner: Command runner.
452
449
  Returns:
453
450
  NamedTuple of outputs (described in `MtnormaliseOutputs`).
454
451
  """
452
+ runner = runner or get_global_runner()
453
+ execution = runner.start_execution(MTNORMALISE_METADATA)
455
454
  params = execution.params(params)
456
455
  cargs = mtnormalise_cargs(params, execution)
457
456
  ret = mtnormalise_outputs(params, execution)
@@ -480,6 +479,8 @@ def mtnormalise(
480
479
  runner: Runner | None = None,
481
480
  ) -> MtnormaliseOutputs:
482
481
  """
482
+ mtnormalise
483
+
483
484
  Multi-tissue informed log-domain intensity normalisation.
484
485
 
485
486
  This command takes as input any number of tissue components (e.g. from
@@ -558,8 +559,6 @@ def mtnormalise(
558
559
  Returns:
559
560
  NamedTuple of outputs (described in `MtnormaliseOutputs`).
560
561
  """
561
- runner = runner or get_global_runner()
562
- execution = runner.start_execution(MTNORMALISE_METADATA)
563
562
  params = mtnormalise_params(
564
563
  mask=mask,
565
564
  order=order,
@@ -579,18 +578,16 @@ def mtnormalise(
579
578
  version=version,
580
579
  input_output=input_output,
581
580
  )
582
- return mtnormalise_execute(params, execution)
581
+ return mtnormalise_execute(params, runner)
583
582
 
584
583
 
585
584
  __all__ = [
586
585
  "MTNORMALISE_METADATA",
587
- "MtnormaliseConfigParameters",
588
586
  "MtnormaliseInputOutputOutputs",
589
- "MtnormaliseInputOutputParameters",
590
587
  "MtnormaliseOutputs",
591
- "MtnormaliseParameters",
592
588
  "mtnormalise",
593
589
  "mtnormalise_config_params",
590
+ "mtnormalise_execute",
594
591
  "mtnormalise_input_output_params",
595
592
  "mtnormalise_params",
596
593
  ]
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  PEAKS2AMP_METADATA = Metadata(
9
- id="fd8b6b23778dba96a61c88654c44b2dc27f350a7.boutiques",
9
+ id="6bc768161b63752b53f46846463bfe58456071b9.boutiques",
10
10
  name="peaks2amp",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,14 +14,32 @@ PEAKS2AMP_METADATA = Metadata(
14
14
 
15
15
 
16
16
  Peaks2ampConfigParameters = typing.TypedDict('Peaks2ampConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ Peaks2ampConfigParametersTagged = typing.TypedDict('Peaks2ampConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  Peaks2ampParameters = typing.TypedDict('Peaks2ampParameters', {
24
- "__STYXTYPE__": typing.Literal["peaks2amp"],
29
+ "@type": typing.NotRequired[typing.Literal["mrtrix/peaks2amp"]],
30
+ "info": bool,
31
+ "quiet": bool,
32
+ "debug": bool,
33
+ "force": bool,
34
+ "nthreads": typing.NotRequired[int | None],
35
+ "config": typing.NotRequired[list[Peaks2ampConfigParameters] | None],
36
+ "help": bool,
37
+ "version": bool,
38
+ "directions": InputPathType,
39
+ "amplitudes": str,
40
+ })
41
+ Peaks2ampParametersTagged = typing.TypedDict('Peaks2ampParametersTagged', {
42
+ "@type": typing.Literal["mrtrix/peaks2amp"],
25
43
  "info": bool,
26
44
  "quiet": bool,
27
45
  "debug": bool,
@@ -33,45 +51,12 @@ Peaks2ampParameters = typing.TypedDict('Peaks2ampParameters', {
33
51
  "directions": InputPathType,
34
52
  "amplitudes": str,
35
53
  })
36
-
37
-
38
- def dyn_cargs(
39
- t: str,
40
- ) -> typing.Any:
41
- """
42
- Get build cargs function by command type.
43
-
44
- Args:
45
- t: Command type.
46
- Returns:
47
- Build cargs function.
48
- """
49
- return {
50
- "peaks2amp": peaks2amp_cargs,
51
- "config": peaks2amp_config_cargs,
52
- }.get(t)
53
-
54
-
55
- def dyn_outputs(
56
- t: str,
57
- ) -> typing.Any:
58
- """
59
- Get build outputs function by command type.
60
-
61
- Args:
62
- t: Command type.
63
- Returns:
64
- Build outputs function.
65
- """
66
- return {
67
- "peaks2amp": peaks2amp_outputs,
68
- }.get(t)
69
54
 
70
55
 
71
56
  def peaks2amp_config_params(
72
57
  key: str,
73
58
  value: str,
74
- ) -> Peaks2ampConfigParameters:
59
+ ) -> Peaks2ampConfigParametersTagged:
75
60
  """
76
61
  Build parameters.
77
62
 
@@ -82,7 +67,7 @@ def peaks2amp_config_params(
82
67
  Parameter dictionary
83
68
  """
84
69
  params = {
85
- "__STYXTYPE__": "config",
70
+ "@type": "config",
86
71
  "key": key,
87
72
  "value": value,
88
73
  }
@@ -104,14 +89,14 @@ def peaks2amp_config_cargs(
104
89
  """
105
90
  cargs = []
106
91
  cargs.append("-config")
107
- cargs.append(params.get("key"))
108
- cargs.append(params.get("value"))
92
+ cargs.append(params.get("key", None))
93
+ cargs.append(params.get("value", None))
109
94
  return cargs
110
95
 
111
96
 
112
97
  class Peaks2ampOutputs(typing.NamedTuple):
113
98
  """
114
- Output object returned when calling `peaks2amp(...)`.
99
+ Output object returned when calling `Peaks2ampParameters(...)`.
115
100
  """
116
101
  root: OutputPathType
117
102
  """Output root folder. This is the root folder for all outputs."""
@@ -130,7 +115,7 @@ def peaks2amp_params(
130
115
  config: list[Peaks2ampConfigParameters] | None = None,
131
116
  help_: bool = False,
132
117
  version: bool = False,
133
- ) -> Peaks2ampParameters:
118
+ ) -> Peaks2ampParametersTagged:
134
119
  """
135
120
  Build parameters.
136
121
 
@@ -154,7 +139,7 @@ def peaks2amp_params(
154
139
  Parameter dictionary
155
140
  """
156
141
  params = {
157
- "__STYXTYPE__": "peaks2amp",
142
+ "@type": "mrtrix/peaks2amp",
158
143
  "info": info,
159
144
  "quiet": quiet,
160
145
  "debug": debug,
@@ -186,27 +171,27 @@ def peaks2amp_cargs(
186
171
  """
187
172
  cargs = []
188
173
  cargs.append("peaks2amp")
189
- if params.get("info"):
174
+ if params.get("info", False):
190
175
  cargs.append("-info")
191
- if params.get("quiet"):
176
+ if params.get("quiet", False):
192
177
  cargs.append("-quiet")
193
- if params.get("debug"):
178
+ if params.get("debug", False):
194
179
  cargs.append("-debug")
195
- if params.get("force"):
180
+ if params.get("force", False):
196
181
  cargs.append("-force")
197
- if params.get("nthreads") is not None:
182
+ if params.get("nthreads", None) is not None:
198
183
  cargs.extend([
199
184
  "-nthreads",
200
- str(params.get("nthreads"))
185
+ str(params.get("nthreads", None))
201
186
  ])
202
- if params.get("config") is not None:
203
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
204
- if params.get("help"):
187
+ if params.get("config", None) is not None:
188
+ cargs.extend([a for c in [peaks2amp_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
189
+ if params.get("help", False):
205
190
  cargs.append("-help")
206
- if params.get("version"):
191
+ if params.get("version", False):
207
192
  cargs.append("-version")
208
- cargs.append(execution.input_file(params.get("directions")))
209
- cargs.append(params.get("amplitudes"))
193
+ cargs.append(execution.input_file(params.get("directions", None)))
194
+ cargs.append(params.get("amplitudes", None))
210
195
  return cargs
211
196
 
212
197
 
@@ -225,16 +210,18 @@ def peaks2amp_outputs(
225
210
  """
226
211
  ret = Peaks2ampOutputs(
227
212
  root=execution.output_file("."),
228
- amplitudes=execution.output_file(params.get("amplitudes")),
213
+ amplitudes=execution.output_file(params.get("amplitudes", None)),
229
214
  )
230
215
  return ret
231
216
 
232
217
 
233
218
  def peaks2amp_execute(
234
219
  params: Peaks2ampParameters,
235
- execution: Execution,
220
+ runner: Runner | None = None,
236
221
  ) -> Peaks2ampOutputs:
237
222
  """
223
+ peaks2amp
224
+
238
225
  Extract amplitudes from a peak directions image.
239
226
 
240
227
 
@@ -249,10 +236,12 @@ def peaks2amp_execute(
249
236
 
250
237
  Args:
251
238
  params: The parameters.
252
- execution: The execution object.
239
+ runner: Command runner.
253
240
  Returns:
254
241
  NamedTuple of outputs (described in `Peaks2ampOutputs`).
255
242
  """
243
+ runner = runner or get_global_runner()
244
+ execution = runner.start_execution(PEAKS2AMP_METADATA)
256
245
  params = execution.params(params)
257
246
  cargs = peaks2amp_cargs(params, execution)
258
247
  ret = peaks2amp_outputs(params, execution)
@@ -274,6 +263,8 @@ def peaks2amp(
274
263
  runner: Runner | None = None,
275
264
  ) -> Peaks2ampOutputs:
276
265
  """
266
+ peaks2amp
267
+
277
268
  Extract amplitudes from a peak directions image.
278
269
 
279
270
 
@@ -306,8 +297,6 @@ def peaks2amp(
306
297
  Returns:
307
298
  NamedTuple of outputs (described in `Peaks2ampOutputs`).
308
299
  """
309
- runner = runner or get_global_runner()
310
- execution = runner.start_execution(PEAKS2AMP_METADATA)
311
300
  params = peaks2amp_params(
312
301
  info=info,
313
302
  quiet=quiet,
@@ -320,15 +309,14 @@ def peaks2amp(
320
309
  directions=directions,
321
310
  amplitudes=amplitudes,
322
311
  )
323
- return peaks2amp_execute(params, execution)
312
+ return peaks2amp_execute(params, runner)
324
313
 
325
314
 
326
315
  __all__ = [
327
316
  "PEAKS2AMP_METADATA",
328
- "Peaks2ampConfigParameters",
329
317
  "Peaks2ampOutputs",
330
- "Peaks2ampParameters",
331
318
  "peaks2amp",
332
319
  "peaks2amp_config_params",
320
+ "peaks2amp_execute",
333
321
  "peaks2amp_params",
334
322
  ]