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
  FIXEL2TSF_METADATA = Metadata(
9
- id="e93f2c3f230efc9c99322e33cb8144f25fec561e.boutiques",
9
+ id="633221e2ad511634bae92b1740122dc5ec9d02cb.boutiques",
10
10
  name="fixel2tsf",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,14 +14,34 @@ FIXEL2TSF_METADATA = Metadata(
14
14
 
15
15
 
16
16
  Fixel2tsfConfigParameters = typing.TypedDict('Fixel2tsfConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ Fixel2tsfConfigParametersTagged = typing.TypedDict('Fixel2tsfConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  Fixel2tsfParameters = typing.TypedDict('Fixel2tsfParameters', {
24
- "__STYXTYPE__": typing.Literal["fixel2tsf"],
29
+ "@type": typing.NotRequired[typing.Literal["mrtrix/fixel2tsf"]],
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[Fixel2tsfConfigParameters] | None],
37
+ "help": bool,
38
+ "version": bool,
39
+ "fixel_in": InputPathType,
40
+ "tracks": InputPathType,
41
+ "tsf": str,
42
+ })
43
+ Fixel2tsfParametersTagged = typing.TypedDict('Fixel2tsfParametersTagged', {
44
+ "@type": typing.Literal["mrtrix/fixel2tsf"],
25
45
  "angle": typing.NotRequired[float | None],
26
46
  "info": bool,
27
47
  "quiet": bool,
@@ -35,45 +55,12 @@ Fixel2tsfParameters = typing.TypedDict('Fixel2tsfParameters', {
35
55
  "tracks": InputPathType,
36
56
  "tsf": str,
37
57
  })
38
-
39
-
40
- def dyn_cargs(
41
- t: str,
42
- ) -> typing.Any:
43
- """
44
- Get build cargs function by command type.
45
-
46
- Args:
47
- t: Command type.
48
- Returns:
49
- Build cargs function.
50
- """
51
- return {
52
- "fixel2tsf": fixel2tsf_cargs,
53
- "config": fixel2tsf_config_cargs,
54
- }.get(t)
55
-
56
-
57
- def dyn_outputs(
58
- t: str,
59
- ) -> typing.Any:
60
- """
61
- Get build outputs function by command type.
62
-
63
- Args:
64
- t: Command type.
65
- Returns:
66
- Build outputs function.
67
- """
68
- return {
69
- "fixel2tsf": fixel2tsf_outputs,
70
- }.get(t)
71
58
 
72
59
 
73
60
  def fixel2tsf_config_params(
74
61
  key: str,
75
62
  value: str,
76
- ) -> Fixel2tsfConfigParameters:
63
+ ) -> Fixel2tsfConfigParametersTagged:
77
64
  """
78
65
  Build parameters.
79
66
 
@@ -84,7 +71,7 @@ def fixel2tsf_config_params(
84
71
  Parameter dictionary
85
72
  """
86
73
  params = {
87
- "__STYXTYPE__": "config",
74
+ "@type": "config",
88
75
  "key": key,
89
76
  "value": value,
90
77
  }
@@ -106,14 +93,14 @@ def fixel2tsf_config_cargs(
106
93
  """
107
94
  cargs = []
108
95
  cargs.append("-config")
109
- cargs.append(params.get("key"))
110
- cargs.append(params.get("value"))
96
+ cargs.append(params.get("key", None))
97
+ cargs.append(params.get("value", None))
111
98
  return cargs
112
99
 
113
100
 
114
101
  class Fixel2tsfOutputs(typing.NamedTuple):
115
102
  """
116
- Output object returned when calling `fixel2tsf(...)`.
103
+ Output object returned when calling `Fixel2tsfParameters(...)`.
117
104
  """
118
105
  root: OutputPathType
119
106
  """Output root folder. This is the root folder for all outputs."""
@@ -134,7 +121,7 @@ def fixel2tsf_params(
134
121
  config: list[Fixel2tsfConfigParameters] | None = None,
135
122
  help_: bool = False,
136
123
  version: bool = False,
137
- ) -> Fixel2tsfParameters:
124
+ ) -> Fixel2tsfParametersTagged:
138
125
  """
139
126
  Build parameters.
140
127
 
@@ -160,7 +147,7 @@ def fixel2tsf_params(
160
147
  Parameter dictionary
161
148
  """
162
149
  params = {
163
- "__STYXTYPE__": "fixel2tsf",
150
+ "@type": "mrtrix/fixel2tsf",
164
151
  "info": info,
165
152
  "quiet": quiet,
166
153
  "debug": debug,
@@ -195,33 +182,33 @@ def fixel2tsf_cargs(
195
182
  """
196
183
  cargs = []
197
184
  cargs.append("fixel2tsf")
198
- if params.get("angle") is not None:
185
+ if params.get("angle", None) is not None:
199
186
  cargs.extend([
200
187
  "-angle",
201
- str(params.get("angle"))
188
+ str(params.get("angle", None))
202
189
  ])
203
- if params.get("info"):
190
+ if params.get("info", False):
204
191
  cargs.append("-info")
205
- if params.get("quiet"):
192
+ if params.get("quiet", False):
206
193
  cargs.append("-quiet")
207
- if params.get("debug"):
194
+ if params.get("debug", False):
208
195
  cargs.append("-debug")
209
- if params.get("force"):
196
+ if params.get("force", False):
210
197
  cargs.append("-force")
211
- if params.get("nthreads") is not None:
198
+ if params.get("nthreads", None) is not None:
212
199
  cargs.extend([
213
200
  "-nthreads",
214
- str(params.get("nthreads"))
201
+ str(params.get("nthreads", None))
215
202
  ])
216
- if params.get("config") is not None:
217
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
218
- if params.get("help"):
203
+ if params.get("config", None) is not None:
204
+ cargs.extend([a for c in [fixel2tsf_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
205
+ if params.get("help", False):
219
206
  cargs.append("-help")
220
- if params.get("version"):
207
+ if params.get("version", False):
221
208
  cargs.append("-version")
222
- cargs.append(execution.input_file(params.get("fixel_in")))
223
- cargs.append(execution.input_file(params.get("tracks")))
224
- cargs.append(params.get("tsf"))
209
+ cargs.append(execution.input_file(params.get("fixel_in", None)))
210
+ cargs.append(execution.input_file(params.get("tracks", None)))
211
+ cargs.append(params.get("tsf", None))
225
212
  return cargs
226
213
 
227
214
 
@@ -240,16 +227,18 @@ def fixel2tsf_outputs(
240
227
  """
241
228
  ret = Fixel2tsfOutputs(
242
229
  root=execution.output_file("."),
243
- tsf=execution.output_file(params.get("tsf")),
230
+ tsf=execution.output_file(params.get("tsf", None)),
244
231
  )
245
232
  return ret
246
233
 
247
234
 
248
235
  def fixel2tsf_execute(
249
236
  params: Fixel2tsfParameters,
250
- execution: Execution,
237
+ runner: Runner | None = None,
251
238
  ) -> Fixel2tsfOutputs:
252
239
  """
240
+ fixel2tsf
241
+
253
242
  Map fixel values to a track scalar file based on an input tractogram.
254
243
 
255
244
  This command is useful for visualising all brain fixels (e.g. the output
@@ -265,10 +254,12 @@ def fixel2tsf_execute(
265
254
 
266
255
  Args:
267
256
  params: The parameters.
268
- execution: The execution object.
257
+ runner: Command runner.
269
258
  Returns:
270
259
  NamedTuple of outputs (described in `Fixel2tsfOutputs`).
271
260
  """
261
+ runner = runner or get_global_runner()
262
+ execution = runner.start_execution(FIXEL2TSF_METADATA)
272
263
  params = execution.params(params)
273
264
  cargs = fixel2tsf_cargs(params, execution)
274
265
  ret = fixel2tsf_outputs(params, execution)
@@ -292,6 +283,8 @@ def fixel2tsf(
292
283
  runner: Runner | None = None,
293
284
  ) -> Fixel2tsfOutputs:
294
285
  """
286
+ fixel2tsf
287
+
295
288
  Map fixel values to a track scalar file based on an input tractogram.
296
289
 
297
290
  This command is useful for visualising all brain fixels (e.g. the output
@@ -327,8 +320,6 @@ def fixel2tsf(
327
320
  Returns:
328
321
  NamedTuple of outputs (described in `Fixel2tsfOutputs`).
329
322
  """
330
- runner = runner or get_global_runner()
331
- execution = runner.start_execution(FIXEL2TSF_METADATA)
332
323
  params = fixel2tsf_params(
333
324
  angle=angle,
334
325
  info=info,
@@ -343,15 +334,14 @@ def fixel2tsf(
343
334
  tracks=tracks,
344
335
  tsf=tsf,
345
336
  )
346
- return fixel2tsf_execute(params, execution)
337
+ return fixel2tsf_execute(params, runner)
347
338
 
348
339
 
349
340
  __all__ = [
350
341
  "FIXEL2TSF_METADATA",
351
- "Fixel2tsfConfigParameters",
352
342
  "Fixel2tsfOutputs",
353
- "Fixel2tsfParameters",
354
343
  "fixel2tsf",
355
344
  "fixel2tsf_config_params",
345
+ "fixel2tsf_execute",
356
346
  "fixel2tsf_params",
357
347
  ]
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  FIXEL2VOXEL_METADATA = Metadata(
9
- id="0afc45451f7f27c8cd742d2496ae81b774ab9243.boutiques",
9
+ id="0e517d0eb23dea1741bca5bac37fc1918bda4919.boutiques",
10
10
  name="fixel2voxel",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,14 +14,36 @@ FIXEL2VOXEL_METADATA = Metadata(
14
14
 
15
15
 
16
16
  Fixel2voxelConfigParameters = typing.TypedDict('Fixel2voxelConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ Fixel2voxelConfigParametersTagged = typing.TypedDict('Fixel2voxelConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  Fixel2voxelParameters = typing.TypedDict('Fixel2voxelParameters', {
24
- "__STYXTYPE__": typing.Literal["fixel2voxel"],
29
+ "@type": typing.NotRequired[typing.Literal["mrtrix/fixel2voxel"]],
30
+ "number": typing.NotRequired[int | None],
31
+ "fill": typing.NotRequired[float | None],
32
+ "weighted": typing.NotRequired[InputPathType | None],
33
+ "info": bool,
34
+ "quiet": bool,
35
+ "debug": bool,
36
+ "force": bool,
37
+ "nthreads": typing.NotRequired[int | None],
38
+ "config": typing.NotRequired[list[Fixel2voxelConfigParameters] | None],
39
+ "help": bool,
40
+ "version": bool,
41
+ "fixel_in": InputPathType,
42
+ "operation": str,
43
+ "image_out": str,
44
+ })
45
+ Fixel2voxelParametersTagged = typing.TypedDict('Fixel2voxelParametersTagged', {
46
+ "@type": typing.Literal["mrtrix/fixel2voxel"],
25
47
  "number": typing.NotRequired[int | None],
26
48
  "fill": typing.NotRequired[float | None],
27
49
  "weighted": typing.NotRequired[InputPathType | None],
@@ -37,45 +59,12 @@ Fixel2voxelParameters = typing.TypedDict('Fixel2voxelParameters', {
37
59
  "operation": str,
38
60
  "image_out": str,
39
61
  })
40
-
41
-
42
- def dyn_cargs(
43
- t: str,
44
- ) -> typing.Any:
45
- """
46
- Get build cargs function by command type.
47
-
48
- Args:
49
- t: Command type.
50
- Returns:
51
- Build cargs function.
52
- """
53
- return {
54
- "fixel2voxel": fixel2voxel_cargs,
55
- "config": fixel2voxel_config_cargs,
56
- }.get(t)
57
-
58
-
59
- def dyn_outputs(
60
- t: str,
61
- ) -> typing.Any:
62
- """
63
- Get build outputs function by command type.
64
-
65
- Args:
66
- t: Command type.
67
- Returns:
68
- Build outputs function.
69
- """
70
- return {
71
- "fixel2voxel": fixel2voxel_outputs,
72
- }.get(t)
73
62
 
74
63
 
75
64
  def fixel2voxel_config_params(
76
65
  key: str,
77
66
  value: str,
78
- ) -> Fixel2voxelConfigParameters:
67
+ ) -> Fixel2voxelConfigParametersTagged:
79
68
  """
80
69
  Build parameters.
81
70
 
@@ -86,7 +75,7 @@ def fixel2voxel_config_params(
86
75
  Parameter dictionary
87
76
  """
88
77
  params = {
89
- "__STYXTYPE__": "config",
78
+ "@type": "config",
90
79
  "key": key,
91
80
  "value": value,
92
81
  }
@@ -108,14 +97,14 @@ def fixel2voxel_config_cargs(
108
97
  """
109
98
  cargs = []
110
99
  cargs.append("-config")
111
- cargs.append(params.get("key"))
112
- cargs.append(params.get("value"))
100
+ cargs.append(params.get("key", None))
101
+ cargs.append(params.get("value", None))
113
102
  return cargs
114
103
 
115
104
 
116
105
  class Fixel2voxelOutputs(typing.NamedTuple):
117
106
  """
118
- Output object returned when calling `fixel2voxel(...)`.
107
+ Output object returned when calling `Fixel2voxelParameters(...)`.
119
108
  """
120
109
  root: OutputPathType
121
110
  """Output root folder. This is the root folder for all outputs."""
@@ -138,7 +127,7 @@ def fixel2voxel_params(
138
127
  config: list[Fixel2voxelConfigParameters] | None = None,
139
128
  help_: bool = False,
140
129
  version: bool = False,
141
- ) -> Fixel2voxelParameters:
130
+ ) -> Fixel2voxelParametersTagged:
142
131
  """
143
132
  Build parameters.
144
133
 
@@ -170,7 +159,7 @@ def fixel2voxel_params(
170
159
  Parameter dictionary
171
160
  """
172
161
  params = {
173
- "__STYXTYPE__": "fixel2voxel",
162
+ "@type": "mrtrix/fixel2voxel",
174
163
  "info": info,
175
164
  "quiet": quiet,
176
165
  "debug": debug,
@@ -209,43 +198,43 @@ def fixel2voxel_cargs(
209
198
  """
210
199
  cargs = []
211
200
  cargs.append("fixel2voxel")
212
- if params.get("number") is not None:
201
+ if params.get("number", None) is not None:
213
202
  cargs.extend([
214
203
  "-number",
215
- str(params.get("number"))
204
+ str(params.get("number", None))
216
205
  ])
217
- if params.get("fill") is not None:
206
+ if params.get("fill", None) is not None:
218
207
  cargs.extend([
219
208
  "-fill",
220
- str(params.get("fill"))
209
+ str(params.get("fill", None))
221
210
  ])
222
- if params.get("weighted") is not None:
211
+ if params.get("weighted", None) is not None:
223
212
  cargs.extend([
224
213
  "-weighted",
225
- execution.input_file(params.get("weighted"))
214
+ execution.input_file(params.get("weighted", None))
226
215
  ])
227
- if params.get("info"):
216
+ if params.get("info", False):
228
217
  cargs.append("-info")
229
- if params.get("quiet"):
218
+ if params.get("quiet", False):
230
219
  cargs.append("-quiet")
231
- if params.get("debug"):
220
+ if params.get("debug", False):
232
221
  cargs.append("-debug")
233
- if params.get("force"):
222
+ if params.get("force", False):
234
223
  cargs.append("-force")
235
- if params.get("nthreads") is not None:
224
+ if params.get("nthreads", None) is not None:
236
225
  cargs.extend([
237
226
  "-nthreads",
238
- str(params.get("nthreads"))
227
+ str(params.get("nthreads", None))
239
228
  ])
240
- if params.get("config") is not None:
241
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
242
- if params.get("help"):
229
+ if params.get("config", None) is not None:
230
+ cargs.extend([a for c in [fixel2voxel_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
231
+ if params.get("help", False):
243
232
  cargs.append("-help")
244
- if params.get("version"):
233
+ if params.get("version", False):
245
234
  cargs.append("-version")
246
- cargs.append(execution.input_file(params.get("fixel_in")))
247
- cargs.append(params.get("operation"))
248
- cargs.append(params.get("image_out"))
235
+ cargs.append(execution.input_file(params.get("fixel_in", None)))
236
+ cargs.append(params.get("operation", None))
237
+ cargs.append(params.get("image_out", None))
249
238
  return cargs
250
239
 
251
240
 
@@ -264,16 +253,18 @@ def fixel2voxel_outputs(
264
253
  """
265
254
  ret = Fixel2voxelOutputs(
266
255
  root=execution.output_file("."),
267
- image_out=execution.output_file(params.get("image_out")),
256
+ image_out=execution.output_file(params.get("image_out", None)),
268
257
  )
269
258
  return ret
270
259
 
271
260
 
272
261
  def fixel2voxel_execute(
273
262
  params: Fixel2voxelParameters,
274
- execution: Execution,
263
+ runner: Runner | None = None,
275
264
  ) -> Fixel2voxelOutputs:
276
265
  """
266
+ fixel2voxel
267
+
277
268
  Convert a fixel-based sparse-data image into some form of scalar image.
278
269
 
279
270
  Fixel data can be reduced to voxel data in a number of ways:
@@ -312,10 +303,12 @@ def fixel2voxel_execute(
312
303
 
313
304
  Args:
314
305
  params: The parameters.
315
- execution: The execution object.
306
+ runner: Command runner.
316
307
  Returns:
317
308
  NamedTuple of outputs (described in `Fixel2voxelOutputs`).
318
309
  """
310
+ runner = runner or get_global_runner()
311
+ execution = runner.start_execution(FIXEL2VOXEL_METADATA)
319
312
  params = execution.params(params)
320
313
  cargs = fixel2voxel_cargs(params, execution)
321
314
  ret = fixel2voxel_outputs(params, execution)
@@ -341,6 +334,8 @@ def fixel2voxel(
341
334
  runner: Runner | None = None,
342
335
  ) -> Fixel2voxelOutputs:
343
336
  """
337
+ fixel2voxel
338
+
344
339
  Convert a fixel-based sparse-data image into some form of scalar image.
345
340
 
346
341
  Fixel data can be reduced to voxel data in a number of ways:
@@ -405,8 +400,6 @@ def fixel2voxel(
405
400
  Returns:
406
401
  NamedTuple of outputs (described in `Fixel2voxelOutputs`).
407
402
  """
408
- runner = runner or get_global_runner()
409
- execution = runner.start_execution(FIXEL2VOXEL_METADATA)
410
403
  params = fixel2voxel_params(
411
404
  number=number,
412
405
  fill=fill,
@@ -423,15 +416,14 @@ def fixel2voxel(
423
416
  operation=operation,
424
417
  image_out=image_out,
425
418
  )
426
- return fixel2voxel_execute(params, execution)
419
+ return fixel2voxel_execute(params, runner)
427
420
 
428
421
 
429
422
  __all__ = [
430
423
  "FIXEL2VOXEL_METADATA",
431
- "Fixel2voxelConfigParameters",
432
424
  "Fixel2voxelOutputs",
433
- "Fixel2voxelParameters",
434
425
  "fixel2voxel",
435
426
  "fixel2voxel_config_params",
427
+ "fixel2voxel_execute",
436
428
  "fixel2voxel_params",
437
429
  ]