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
  VECTORSTATS_METADATA = Metadata(
9
- id="24ba2da446c51868e04d07323b5e99fb4f2ccaad.boutiques",
9
+ id="bb3edd72079d87de8242594d71273892006e9def.boutiques",
10
10
  name="vectorstats",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,20 +14,55 @@ VECTORSTATS_METADATA = Metadata(
14
14
 
15
15
 
16
16
  VectorstatsColumnParameters = typing.TypedDict('VectorstatsColumnParameters', {
17
- "__STYXTYPE__": typing.Literal["column"],
17
+ "@type": typing.NotRequired[typing.Literal["column"]],
18
+ "path": InputPathType,
19
+ })
20
+ VectorstatsColumnParametersTagged = typing.TypedDict('VectorstatsColumnParametersTagged', {
21
+ "@type": typing.Literal["column"],
18
22
  "path": InputPathType,
19
23
  })
20
24
 
21
25
 
22
26
  VectorstatsConfigParameters = typing.TypedDict('VectorstatsConfigParameters', {
23
- "__STYXTYPE__": typing.Literal["config"],
27
+ "@type": typing.NotRequired[typing.Literal["config"]],
28
+ "key": str,
29
+ "value": str,
30
+ })
31
+ VectorstatsConfigParametersTagged = typing.TypedDict('VectorstatsConfigParametersTagged', {
32
+ "@type": typing.Literal["config"],
24
33
  "key": str,
25
34
  "value": str,
26
35
  })
27
36
 
28
37
 
29
38
  VectorstatsParameters = typing.TypedDict('VectorstatsParameters', {
30
- "__STYXTYPE__": typing.Literal["vectorstats"],
39
+ "@type": typing.NotRequired[typing.Literal["mrtrix/vectorstats"]],
40
+ "notest": bool,
41
+ "errors": typing.NotRequired[str | None],
42
+ "exchange_within": typing.NotRequired[InputPathType | None],
43
+ "exchange_whole": typing.NotRequired[InputPathType | None],
44
+ "strong": bool,
45
+ "nshuffles": typing.NotRequired[int | None],
46
+ "permutations": typing.NotRequired[InputPathType | None],
47
+ "variance": typing.NotRequired[InputPathType | None],
48
+ "ftests": typing.NotRequired[InputPathType | None],
49
+ "fonly": bool,
50
+ "column": typing.NotRequired[list[VectorstatsColumnParameters] | None],
51
+ "info": bool,
52
+ "quiet": bool,
53
+ "debug": bool,
54
+ "force": bool,
55
+ "nthreads": typing.NotRequired[int | None],
56
+ "config": typing.NotRequired[list[VectorstatsConfigParameters] | None],
57
+ "help": bool,
58
+ "version": bool,
59
+ "input": InputPathType,
60
+ "design": InputPathType,
61
+ "contrast": InputPathType,
62
+ "output": str,
63
+ })
64
+ VectorstatsParametersTagged = typing.TypedDict('VectorstatsParametersTagged', {
65
+ "@type": typing.Literal["mrtrix/vectorstats"],
31
66
  "notest": bool,
32
67
  "errors": typing.NotRequired[str | None],
33
68
  "exchange_within": typing.NotRequired[InputPathType | None],
@@ -52,44 +87,11 @@ VectorstatsParameters = typing.TypedDict('VectorstatsParameters', {
52
87
  "contrast": InputPathType,
53
88
  "output": str,
54
89
  })
55
-
56
-
57
- def dyn_cargs(
58
- t: str,
59
- ) -> typing.Any:
60
- """
61
- Get build cargs function by command type.
62
-
63
- Args:
64
- t: Command type.
65
- Returns:
66
- Build cargs function.
67
- """
68
- return {
69
- "vectorstats": vectorstats_cargs,
70
- "column": vectorstats_column_cargs,
71
- "config": vectorstats_config_cargs,
72
- }.get(t)
73
-
74
-
75
- def dyn_outputs(
76
- t: str,
77
- ) -> typing.Any:
78
- """
79
- Get build outputs function by command type.
80
-
81
- Args:
82
- t: Command type.
83
- Returns:
84
- Build outputs function.
85
- """
86
- return {
87
- }.get(t)
88
90
 
89
91
 
90
92
  def vectorstats_column_params(
91
93
  path: InputPathType,
92
- ) -> VectorstatsColumnParameters:
94
+ ) -> VectorstatsColumnParametersTagged:
93
95
  """
94
96
  Build parameters.
95
97
 
@@ -102,7 +104,7 @@ def vectorstats_column_params(
102
104
  Parameter dictionary
103
105
  """
104
106
  params = {
105
- "__STYXTYPE__": "column",
107
+ "@type": "column",
106
108
  "path": path,
107
109
  }
108
110
  return params
@@ -123,14 +125,14 @@ def vectorstats_column_cargs(
123
125
  """
124
126
  cargs = []
125
127
  cargs.append("-column")
126
- cargs.append(execution.input_file(params.get("path")))
128
+ cargs.append(execution.input_file(params.get("path", None)))
127
129
  return cargs
128
130
 
129
131
 
130
132
  def vectorstats_config_params(
131
133
  key: str,
132
134
  value: str,
133
- ) -> VectorstatsConfigParameters:
135
+ ) -> VectorstatsConfigParametersTagged:
134
136
  """
135
137
  Build parameters.
136
138
 
@@ -141,7 +143,7 @@ def vectorstats_config_params(
141
143
  Parameter dictionary
142
144
  """
143
145
  params = {
144
- "__STYXTYPE__": "config",
146
+ "@type": "config",
145
147
  "key": key,
146
148
  "value": value,
147
149
  }
@@ -163,14 +165,14 @@ def vectorstats_config_cargs(
163
165
  """
164
166
  cargs = []
165
167
  cargs.append("-config")
166
- cargs.append(params.get("key"))
167
- cargs.append(params.get("value"))
168
+ cargs.append(params.get("key", None))
169
+ cargs.append(params.get("value", None))
168
170
  return cargs
169
171
 
170
172
 
171
173
  class VectorstatsOutputs(typing.NamedTuple):
172
174
  """
173
- Output object returned when calling `vectorstats(...)`.
175
+ Output object returned when calling `VectorstatsParameters(...)`.
174
176
  """
175
177
  root: OutputPathType
176
178
  """Output root folder. This is the root folder for all outputs."""
@@ -200,7 +202,7 @@ def vectorstats_params(
200
202
  config: list[VectorstatsConfigParameters] | None = None,
201
203
  help_: bool = False,
202
204
  version: bool = False,
203
- ) -> VectorstatsParameters:
205
+ ) -> VectorstatsParametersTagged:
204
206
  """
205
207
  Build parameters.
206
208
 
@@ -254,7 +256,7 @@ def vectorstats_params(
254
256
  Parameter dictionary
255
257
  """
256
258
  params = {
257
- "__STYXTYPE__": "vectorstats",
259
+ "@type": "mrtrix/vectorstats",
258
260
  "notest": notest,
259
261
  "strong": strong,
260
262
  "fonly": fonly,
@@ -307,72 +309,72 @@ def vectorstats_cargs(
307
309
  """
308
310
  cargs = []
309
311
  cargs.append("vectorstats")
310
- if params.get("notest"):
312
+ if params.get("notest", False):
311
313
  cargs.append("-notest")
312
- if params.get("errors") is not None:
314
+ if params.get("errors", None) is not None:
313
315
  cargs.extend([
314
316
  "-errors",
315
- params.get("errors")
317
+ params.get("errors", None)
316
318
  ])
317
- if params.get("exchange_within") is not None:
319
+ if params.get("exchange_within", None) is not None:
318
320
  cargs.extend([
319
321
  "-exchange_within",
320
- execution.input_file(params.get("exchange_within"))
322
+ execution.input_file(params.get("exchange_within", None))
321
323
  ])
322
- if params.get("exchange_whole") is not None:
324
+ if params.get("exchange_whole", None) is not None:
323
325
  cargs.extend([
324
326
  "-exchange_whole",
325
- execution.input_file(params.get("exchange_whole"))
327
+ execution.input_file(params.get("exchange_whole", None))
326
328
  ])
327
- if params.get("strong"):
329
+ if params.get("strong", False):
328
330
  cargs.append("-strong")
329
- if params.get("nshuffles") is not None:
331
+ if params.get("nshuffles", None) is not None:
330
332
  cargs.extend([
331
333
  "-nshuffles",
332
- str(params.get("nshuffles"))
334
+ str(params.get("nshuffles", None))
333
335
  ])
334
- if params.get("permutations") is not None:
336
+ if params.get("permutations", None) is not None:
335
337
  cargs.extend([
336
338
  "-permutations",
337
- execution.input_file(params.get("permutations"))
339
+ execution.input_file(params.get("permutations", None))
338
340
  ])
339
- if params.get("variance") is not None:
341
+ if params.get("variance", None) is not None:
340
342
  cargs.extend([
341
343
  "-variance",
342
- execution.input_file(params.get("variance"))
344
+ execution.input_file(params.get("variance", None))
343
345
  ])
344
- if params.get("ftests") is not None:
346
+ if params.get("ftests", None) is not None:
345
347
  cargs.extend([
346
348
  "-ftests",
347
- execution.input_file(params.get("ftests"))
349
+ execution.input_file(params.get("ftests", None))
348
350
  ])
349
- if params.get("fonly"):
351
+ if params.get("fonly", False):
350
352
  cargs.append("-fonly")
351
- if params.get("column") is not None:
352
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("column")] for a in c])
353
- if params.get("info"):
353
+ if params.get("column", None) is not None:
354
+ cargs.extend([a for c in [vectorstats_column_cargs(s, execution) for s in params.get("column", None)] for a in c])
355
+ if params.get("info", False):
354
356
  cargs.append("-info")
355
- if params.get("quiet"):
357
+ if params.get("quiet", False):
356
358
  cargs.append("-quiet")
357
- if params.get("debug"):
359
+ if params.get("debug", False):
358
360
  cargs.append("-debug")
359
- if params.get("force"):
361
+ if params.get("force", False):
360
362
  cargs.append("-force")
361
- if params.get("nthreads") is not None:
363
+ if params.get("nthreads", None) is not None:
362
364
  cargs.extend([
363
365
  "-nthreads",
364
- str(params.get("nthreads"))
366
+ str(params.get("nthreads", None))
365
367
  ])
366
- if params.get("config") is not None:
367
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
368
- if params.get("help"):
368
+ if params.get("config", None) is not None:
369
+ cargs.extend([a for c in [vectorstats_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
370
+ if params.get("help", False):
369
371
  cargs.append("-help")
370
- if params.get("version"):
372
+ if params.get("version", False):
371
373
  cargs.append("-version")
372
- cargs.append(execution.input_file(params.get("input")))
373
- cargs.append(execution.input_file(params.get("design")))
374
- cargs.append(execution.input_file(params.get("contrast")))
375
- cargs.append(params.get("output"))
374
+ cargs.append(execution.input_file(params.get("input", None)))
375
+ cargs.append(execution.input_file(params.get("design", None)))
376
+ cargs.append(execution.input_file(params.get("contrast", None)))
377
+ cargs.append(params.get("output", None))
376
378
  return cargs
377
379
 
378
380
 
@@ -397,9 +399,11 @@ def vectorstats_outputs(
397
399
 
398
400
  def vectorstats_execute(
399
401
  params: VectorstatsParameters,
400
- execution: Execution,
402
+ runner: Runner | None = None,
401
403
  ) -> VectorstatsOutputs:
402
404
  """
405
+ vectorstats
406
+
403
407
  Statistical testing of vector data using non-parametric permutation testing.
404
408
 
405
409
  This command can be used to perform permutation testing of any form of data.
@@ -428,10 +432,12 @@ def vectorstats_execute(
428
432
 
429
433
  Args:
430
434
  params: The parameters.
431
- execution: The execution object.
435
+ runner: Command runner.
432
436
  Returns:
433
437
  NamedTuple of outputs (described in `VectorstatsOutputs`).
434
438
  """
439
+ runner = runner or get_global_runner()
440
+ execution = runner.start_execution(VECTORSTATS_METADATA)
435
441
  params = execution.params(params)
436
442
  cargs = vectorstats_cargs(params, execution)
437
443
  ret = vectorstats_outputs(params, execution)
@@ -466,6 +472,8 @@ def vectorstats(
466
472
  runner: Runner | None = None,
467
473
  ) -> VectorstatsOutputs:
468
474
  """
475
+ vectorstats
476
+
469
477
  Statistical testing of vector data using non-parametric permutation testing.
470
478
 
471
479
  This command can be used to perform permutation testing of any form of data.
@@ -542,8 +550,6 @@ def vectorstats(
542
550
  Returns:
543
551
  NamedTuple of outputs (described in `VectorstatsOutputs`).
544
552
  """
545
- runner = runner or get_global_runner()
546
- execution = runner.start_execution(VECTORSTATS_METADATA)
547
553
  params = vectorstats_params(
548
554
  notest=notest,
549
555
  errors=errors,
@@ -569,17 +575,15 @@ def vectorstats(
569
575
  contrast=contrast,
570
576
  output=output,
571
577
  )
572
- return vectorstats_execute(params, execution)
578
+ return vectorstats_execute(params, runner)
573
579
 
574
580
 
575
581
  __all__ = [
576
582
  "VECTORSTATS_METADATA",
577
- "VectorstatsColumnParameters",
578
- "VectorstatsConfigParameters",
579
583
  "VectorstatsOutputs",
580
- "VectorstatsParameters",
581
584
  "vectorstats",
582
585
  "vectorstats_column_params",
583
586
  "vectorstats_config_params",
587
+ "vectorstats_execute",
584
588
  "vectorstats_params",
585
589
  ]
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  VOXEL2FIXEL_METADATA = Metadata(
9
- id="408593a6668880f0604aa841e52091056f3631b3.boutiques",
9
+ id="d594503cf463c1f9580f4bafd342dc5f91a012f8.boutiques",
10
10
  name="voxel2fixel",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,14 +14,34 @@ VOXEL2FIXEL_METADATA = Metadata(
14
14
 
15
15
 
16
16
  Voxel2fixelConfigParameters = typing.TypedDict('Voxel2fixelConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ Voxel2fixelConfigParametersTagged = typing.TypedDict('Voxel2fixelConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  Voxel2fixelParameters = typing.TypedDict('Voxel2fixelParameters', {
24
- "__STYXTYPE__": typing.Literal["voxel2fixel"],
29
+ "@type": typing.NotRequired[typing.Literal["mrtrix/voxel2fixel"]],
30
+ "info": bool,
31
+ "quiet": bool,
32
+ "debug": bool,
33
+ "force": bool,
34
+ "nthreads": typing.NotRequired[int | None],
35
+ "config": typing.NotRequired[list[Voxel2fixelConfigParameters] | None],
36
+ "help": bool,
37
+ "version": bool,
38
+ "image_in": InputPathType,
39
+ "fixel_directory_in": InputPathType,
40
+ "fixel_directory_out": str,
41
+ "fixel_data_out": str,
42
+ })
43
+ Voxel2fixelParametersTagged = typing.TypedDict('Voxel2fixelParametersTagged', {
44
+ "@type": typing.Literal["mrtrix/voxel2fixel"],
25
45
  "info": bool,
26
46
  "quiet": bool,
27
47
  "debug": bool,
@@ -35,44 +55,12 @@ Voxel2fixelParameters = typing.TypedDict('Voxel2fixelParameters', {
35
55
  "fixel_directory_out": str,
36
56
  "fixel_data_out": 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
- "voxel2fixel": voxel2fixel_cargs,
53
- "config": voxel2fixel_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
- }.get(t)
70
58
 
71
59
 
72
60
  def voxel2fixel_config_params(
73
61
  key: str,
74
62
  value: str,
75
- ) -> Voxel2fixelConfigParameters:
63
+ ) -> Voxel2fixelConfigParametersTagged:
76
64
  """
77
65
  Build parameters.
78
66
 
@@ -83,7 +71,7 @@ def voxel2fixel_config_params(
83
71
  Parameter dictionary
84
72
  """
85
73
  params = {
86
- "__STYXTYPE__": "config",
74
+ "@type": "config",
87
75
  "key": key,
88
76
  "value": value,
89
77
  }
@@ -105,14 +93,14 @@ def voxel2fixel_config_cargs(
105
93
  """
106
94
  cargs = []
107
95
  cargs.append("-config")
108
- cargs.append(params.get("key"))
109
- cargs.append(params.get("value"))
96
+ cargs.append(params.get("key", None))
97
+ cargs.append(params.get("value", None))
110
98
  return cargs
111
99
 
112
100
 
113
101
  class Voxel2fixelOutputs(typing.NamedTuple):
114
102
  """
115
- Output object returned when calling `voxel2fixel(...)`.
103
+ Output object returned when calling `Voxel2fixelParameters(...)`.
116
104
  """
117
105
  root: OutputPathType
118
106
  """Output root folder. This is the root folder for all outputs."""
@@ -131,7 +119,7 @@ def voxel2fixel_params(
131
119
  config: list[Voxel2fixelConfigParameters] | None = None,
132
120
  help_: bool = False,
133
121
  version: bool = False,
134
- ) -> Voxel2fixelParameters:
122
+ ) -> Voxel2fixelParametersTagged:
135
123
  """
136
124
  Build parameters.
137
125
 
@@ -158,7 +146,7 @@ def voxel2fixel_params(
158
146
  Parameter dictionary
159
147
  """
160
148
  params = {
161
- "__STYXTYPE__": "voxel2fixel",
149
+ "@type": "mrtrix/voxel2fixel",
162
150
  "info": info,
163
151
  "quiet": quiet,
164
152
  "debug": debug,
@@ -192,29 +180,29 @@ def voxel2fixel_cargs(
192
180
  """
193
181
  cargs = []
194
182
  cargs.append("voxel2fixel")
195
- if params.get("info"):
183
+ if params.get("info", False):
196
184
  cargs.append("-info")
197
- if params.get("quiet"):
185
+ if params.get("quiet", False):
198
186
  cargs.append("-quiet")
199
- if params.get("debug"):
187
+ if params.get("debug", False):
200
188
  cargs.append("-debug")
201
- if params.get("force"):
189
+ if params.get("force", False):
202
190
  cargs.append("-force")
203
- if params.get("nthreads") is not None:
191
+ if params.get("nthreads", None) is not None:
204
192
  cargs.extend([
205
193
  "-nthreads",
206
- str(params.get("nthreads"))
194
+ str(params.get("nthreads", None))
207
195
  ])
208
- if params.get("config") is not None:
209
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
210
- if params.get("help"):
196
+ if params.get("config", None) is not None:
197
+ cargs.extend([a for c in [voxel2fixel_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
198
+ if params.get("help", False):
211
199
  cargs.append("-help")
212
- if params.get("version"):
200
+ if params.get("version", False):
213
201
  cargs.append("-version")
214
- cargs.append(execution.input_file(params.get("image_in")))
215
- cargs.append(execution.input_file(params.get("fixel_directory_in")))
216
- cargs.append(params.get("fixel_directory_out"))
217
- cargs.append(params.get("fixel_data_out"))
202
+ cargs.append(execution.input_file(params.get("image_in", None)))
203
+ cargs.append(execution.input_file(params.get("fixel_directory_in", None)))
204
+ cargs.append(params.get("fixel_directory_out", None))
205
+ cargs.append(params.get("fixel_data_out", None))
218
206
  return cargs
219
207
 
220
208
 
@@ -239,9 +227,11 @@ def voxel2fixel_outputs(
239
227
 
240
228
  def voxel2fixel_execute(
241
229
  params: Voxel2fixelParameters,
242
- execution: Execution,
230
+ runner: Runner | None = None,
243
231
  ) -> Voxel2fixelOutputs:
244
232
  """
233
+ voxel2fixel
234
+
245
235
  Map the scalar value in each voxel to all fixels within that voxel.
246
236
 
247
237
  This command is designed to enable CFE-based statistical analysis to be
@@ -257,10 +247,12 @@ def voxel2fixel_execute(
257
247
 
258
248
  Args:
259
249
  params: The parameters.
260
- execution: The execution object.
250
+ runner: Command runner.
261
251
  Returns:
262
252
  NamedTuple of outputs (described in `Voxel2fixelOutputs`).
263
253
  """
254
+ runner = runner or get_global_runner()
255
+ execution = runner.start_execution(VOXEL2FIXEL_METADATA)
264
256
  params = execution.params(params)
265
257
  cargs = voxel2fixel_cargs(params, execution)
266
258
  ret = voxel2fixel_outputs(params, execution)
@@ -284,6 +276,8 @@ def voxel2fixel(
284
276
  runner: Runner | None = None,
285
277
  ) -> Voxel2fixelOutputs:
286
278
  """
279
+ voxel2fixel
280
+
287
281
  Map the scalar value in each voxel to all fixels within that voxel.
288
282
 
289
283
  This command is designed to enable CFE-based statistical analysis to be
@@ -320,8 +314,6 @@ def voxel2fixel(
320
314
  Returns:
321
315
  NamedTuple of outputs (described in `Voxel2fixelOutputs`).
322
316
  """
323
- runner = runner or get_global_runner()
324
- execution = runner.start_execution(VOXEL2FIXEL_METADATA)
325
317
  params = voxel2fixel_params(
326
318
  info=info,
327
319
  quiet=quiet,
@@ -336,15 +328,14 @@ def voxel2fixel(
336
328
  fixel_directory_out=fixel_directory_out,
337
329
  fixel_data_out=fixel_data_out,
338
330
  )
339
- return voxel2fixel_execute(params, execution)
331
+ return voxel2fixel_execute(params, runner)
340
332
 
341
333
 
342
334
  __all__ = [
343
335
  "VOXEL2FIXEL_METADATA",
344
- "Voxel2fixelConfigParameters",
345
336
  "Voxel2fixelOutputs",
346
- "Voxel2fixelParameters",
347
337
  "voxel2fixel",
348
338
  "voxel2fixel_config_params",
339
+ "voxel2fixel_execute",
349
340
  "voxel2fixel_params",
350
341
  ]