niwrap-mrtrix 0.5.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 (119) hide show
  1. niwrap_mrtrix/mrtrix/__init__.py +130 -0
  2. niwrap_mrtrix/mrtrix/afdconnectivity.py +445 -0
  3. niwrap_mrtrix/mrtrix/amp2response.py +453 -0
  4. niwrap_mrtrix/mrtrix/amp2sh.py +656 -0
  5. niwrap_mrtrix/mrtrix/connectome2tck.py +470 -0
  6. niwrap_mrtrix/mrtrix/connectomeedit.py +338 -0
  7. niwrap_mrtrix/mrtrix/connectomestats.py +767 -0
  8. niwrap_mrtrix/mrtrix/dcmedit.py +440 -0
  9. niwrap_mrtrix/mrtrix/dcminfo.py +416 -0
  10. niwrap_mrtrix/mrtrix/dirflip.py +362 -0
  11. niwrap_mrtrix/mrtrix/dirgen.py +423 -0
  12. niwrap_mrtrix/mrtrix/dirmerge.py +365 -0
  13. niwrap_mrtrix/mrtrix/dirorder.py +347 -0
  14. niwrap_mrtrix/mrtrix/dirsplit.py +358 -0
  15. niwrap_mrtrix/mrtrix/dirstat.py +530 -0
  16. niwrap_mrtrix/mrtrix/dwi2adc.py +428 -0
  17. niwrap_mrtrix/mrtrix/dwi2fod.py +879 -0
  18. niwrap_mrtrix/mrtrix/dwi2mask.py +463 -0
  19. niwrap_mrtrix/mrtrix/dwi2response.py +1295 -0
  20. niwrap_mrtrix/mrtrix/dwi2tensor.py +587 -0
  21. niwrap_mrtrix/mrtrix/dwibiascorrect.py +467 -0
  22. niwrap_mrtrix/mrtrix/dwidenoise.py +478 -0
  23. niwrap_mrtrix/mrtrix/dwiextract.py +825 -0
  24. niwrap_mrtrix/mrtrix/dwigradcheck.py +534 -0
  25. niwrap_mrtrix/mrtrix/fixel2peaks.py +452 -0
  26. niwrap_mrtrix/mrtrix/fixel2sh.py +357 -0
  27. niwrap_mrtrix/mrtrix/fixel2tsf.py +357 -0
  28. niwrap_mrtrix/mrtrix/fixel2voxel.py +437 -0
  29. niwrap_mrtrix/mrtrix/fixelcfestats.py +893 -0
  30. niwrap_mrtrix/mrtrix/fixelconnectivity.py +391 -0
  31. niwrap_mrtrix/mrtrix/fixelconvert.py +588 -0
  32. niwrap_mrtrix/mrtrix/fixelcorrespondence.py +371 -0
  33. niwrap_mrtrix/mrtrix/fixelcrop.py +348 -0
  34. niwrap_mrtrix/mrtrix/fixelfilter.py +616 -0
  35. niwrap_mrtrix/mrtrix/fixelreorient.py +361 -0
  36. niwrap_mrtrix/mrtrix/fod2dec.py +469 -0
  37. niwrap_mrtrix/mrtrix/fod2fixel.py +530 -0
  38. niwrap_mrtrix/mrtrix/label2colour.py +351 -0
  39. niwrap_mrtrix/mrtrix/label2mesh.py +343 -0
  40. niwrap_mrtrix/mrtrix/labelconvert.py +377 -0
  41. niwrap_mrtrix/mrtrix/labelstats.py +344 -0
  42. niwrap_mrtrix/mrtrix/maskdump.py +336 -0
  43. niwrap_mrtrix/mrtrix/maskfilter.py +537 -0
  44. niwrap_mrtrix/mrtrix/mesh2voxel.py +348 -0
  45. niwrap_mrtrix/mrtrix/meshconvert.py +410 -0
  46. niwrap_mrtrix/mrtrix/meshfilter.py +370 -0
  47. niwrap_mrtrix/mrtrix/mraverageheader.py +396 -0
  48. niwrap_mrtrix/mrtrix/mrcalc.py +3047 -0
  49. niwrap_mrtrix/mrtrix/mrcat.py +382 -0
  50. niwrap_mrtrix/mrtrix/mrcentroid.py +344 -0
  51. niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +363 -0
  52. niwrap_mrtrix/mrtrix/mrclusterstats.py +736 -0
  53. niwrap_mrtrix/mrtrix/mrcolour.py +401 -0
  54. niwrap_mrtrix/mrtrix/mrconvert.py +1423 -0
  55. niwrap_mrtrix/mrtrix/mrdegibbs.py +443 -0
  56. niwrap_mrtrix/mrtrix/mrdump.py +351 -0
  57. niwrap_mrtrix/mrtrix/mredit.py +546 -0
  58. niwrap_mrtrix/mrtrix/mrfilter.py +716 -0
  59. niwrap_mrtrix/mrtrix/mrgrid.py +819 -0
  60. niwrap_mrtrix/mrtrix/mrhistmatch.py +403 -0
  61. niwrap_mrtrix/mrtrix/mrhistogram.py +393 -0
  62. niwrap_mrtrix/mrtrix/mrinfo.py +990 -0
  63. niwrap_mrtrix/mrtrix/mrmath.py +413 -0
  64. niwrap_mrtrix/mrtrix/mrmetric.py +425 -0
  65. niwrap_mrtrix/mrtrix/mrregister.py +1676 -0
  66. niwrap_mrtrix/mrtrix/mrstats.py +427 -0
  67. niwrap_mrtrix/mrtrix/mrthreshold.py +549 -0
  68. niwrap_mrtrix/mrtrix/mrtransform.py +1061 -0
  69. niwrap_mrtrix/mrtrix/mtnormalise.py +596 -0
  70. niwrap_mrtrix/mrtrix/peaks2amp.py +334 -0
  71. niwrap_mrtrix/mrtrix/peaks2fixel.py +349 -0
  72. niwrap_mrtrix/mrtrix/responsemean.py +316 -0
  73. niwrap_mrtrix/mrtrix/sh2amp.py +640 -0
  74. niwrap_mrtrix/mrtrix/sh2peaks.py +505 -0
  75. niwrap_mrtrix/mrtrix/sh2power.py +353 -0
  76. niwrap_mrtrix/mrtrix/sh2response.py +394 -0
  77. niwrap_mrtrix/mrtrix/shbasis.py +373 -0
  78. niwrap_mrtrix/mrtrix/shconv.py +498 -0
  79. niwrap_mrtrix/mrtrix/tck2connectome.py +580 -0
  80. niwrap_mrtrix/mrtrix/tck2fixel.py +363 -0
  81. niwrap_mrtrix/mrtrix/tckconvert.py +580 -0
  82. niwrap_mrtrix/mrtrix/tckdfc.py +551 -0
  83. niwrap_mrtrix/mrtrix/tckedit.py +1003 -0
  84. niwrap_mrtrix/mrtrix/tckgen.py +1983 -0
  85. niwrap_mrtrix/mrtrix/tckglobal.py +758 -0
  86. niwrap_mrtrix/mrtrix/tckinfo.py +329 -0
  87. niwrap_mrtrix/mrtrix/tckmap.py +772 -0
  88. niwrap_mrtrix/mrtrix/tckresample.py +580 -0
  89. niwrap_mrtrix/mrtrix/tcksample.py +404 -0
  90. niwrap_mrtrix/mrtrix/tcksift.py +592 -0
  91. niwrap_mrtrix/mrtrix/tcksift2.py +730 -0
  92. niwrap_mrtrix/mrtrix/tckstats.py +441 -0
  93. niwrap_mrtrix/mrtrix/tcktransform.py +340 -0
  94. niwrap_mrtrix/mrtrix/tensor2metric.py +544 -0
  95. niwrap_mrtrix/mrtrix/transformcalc.py +344 -0
  96. niwrap_mrtrix/mrtrix/transformcompose.py +465 -0
  97. niwrap_mrtrix/mrtrix/transformconvert.py +346 -0
  98. niwrap_mrtrix/mrtrix/tsfdivide.py +340 -0
  99. niwrap_mrtrix/mrtrix/tsfinfo.py +344 -0
  100. niwrap_mrtrix/mrtrix/tsfmult.py +340 -0
  101. niwrap_mrtrix/mrtrix/tsfsmooth.py +347 -0
  102. niwrap_mrtrix/mrtrix/tsfthreshold.py +349 -0
  103. niwrap_mrtrix/mrtrix/tsfvalidate.py +328 -0
  104. niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +359 -0
  105. niwrap_mrtrix/mrtrix/v_5tt2vis.py +412 -0
  106. niwrap_mrtrix/mrtrix/v_5ttcheck.py +337 -0
  107. niwrap_mrtrix/mrtrix/v_5ttedit.py +420 -0
  108. niwrap_mrtrix/mrtrix/v_5ttgen.py +816 -0
  109. niwrap_mrtrix/mrtrix/vectorstats.py +585 -0
  110. niwrap_mrtrix/mrtrix/voxel2fixel.py +350 -0
  111. niwrap_mrtrix/mrtrix/voxel2mesh.py +376 -0
  112. niwrap_mrtrix/mrtrix/warp2metric.py +449 -0
  113. niwrap_mrtrix/mrtrix/warpconvert.py +411 -0
  114. niwrap_mrtrix/mrtrix/warpcorrect.py +368 -0
  115. niwrap_mrtrix/mrtrix/warpinit.py +356 -0
  116. niwrap_mrtrix/mrtrix/warpinvert.py +370 -0
  117. niwrap_mrtrix-0.5.0.dist-info/METADATA +8 -0
  118. niwrap_mrtrix-0.5.0.dist-info/RECORD +119 -0
  119. niwrap_mrtrix-0.5.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,377 @@
1
+ # This file was auto generated by Styx.
2
+ # Do not edit this file directly.
3
+
4
+ import typing
5
+ import pathlib
6
+ from styxdefs import *
7
+
8
+ LABELCONVERT_METADATA = Metadata(
9
+ id="70b1b32bfcb741c07b8d256b92dbe12ed0418e5f.boutiques",
10
+ name="labelconvert",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ LabelconvertConfigParameters = typing.TypedDict('LabelconvertConfigParameters', {
17
+ "__STYX_TYPE__": typing.Literal["config"],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+
22
+
23
+ LabelconvertParameters = typing.TypedDict('LabelconvertParameters', {
24
+ "__STYX_TYPE__": typing.Literal["labelconvert"],
25
+ "spine": typing.NotRequired[InputPathType | None],
26
+ "info": bool,
27
+ "quiet": bool,
28
+ "debug": bool,
29
+ "force": bool,
30
+ "nthreads": typing.NotRequired[int | None],
31
+ "config": typing.NotRequired[list[LabelconvertConfigParameters] | None],
32
+ "help": bool,
33
+ "version": bool,
34
+ "path_in": InputPathType,
35
+ "lut_in": InputPathType,
36
+ "lut_out": InputPathType,
37
+ "image_out": str,
38
+ })
39
+
40
+
41
+ def dyn_cargs(
42
+ t: str,
43
+ ) -> typing.Any:
44
+ """
45
+ Get build cargs function by command type.
46
+
47
+ Args:
48
+ t: Command type.
49
+ Returns:
50
+ Build cargs function.
51
+ """
52
+ return {
53
+ "labelconvert": labelconvert_cargs,
54
+ "config": labelconvert_config_cargs,
55
+ }.get(t)
56
+
57
+
58
+ def dyn_outputs(
59
+ t: str,
60
+ ) -> typing.Any:
61
+ """
62
+ Get build outputs function by command type.
63
+
64
+ Args:
65
+ t: Command type.
66
+ Returns:
67
+ Build outputs function.
68
+ """
69
+ return {
70
+ "labelconvert": labelconvert_outputs,
71
+ }.get(t)
72
+
73
+
74
+ def labelconvert_config_params(
75
+ key: str,
76
+ value: str,
77
+ ) -> LabelconvertConfigParameters:
78
+ """
79
+ Build parameters.
80
+
81
+ Args:
82
+ key: temporarily set the value of an MRtrix config file entry.
83
+ value: temporarily set the value of an MRtrix config file entry.
84
+ Returns:
85
+ Parameter dictionary
86
+ """
87
+ params = {
88
+ "__STYXTYPE__": "config",
89
+ "key": key,
90
+ "value": value,
91
+ }
92
+ return params
93
+
94
+
95
+ def labelconvert_config_cargs(
96
+ params: LabelconvertConfigParameters,
97
+ execution: Execution,
98
+ ) -> list[str]:
99
+ """
100
+ Build command-line arguments from parameters.
101
+
102
+ Args:
103
+ params: The parameters.
104
+ execution: The execution object for resolving input paths.
105
+ Returns:
106
+ Command-line arguments.
107
+ """
108
+ cargs = []
109
+ cargs.append("-config")
110
+ cargs.append(params.get("key"))
111
+ cargs.append(params.get("value"))
112
+ return cargs
113
+
114
+
115
+ class LabelconvertOutputs(typing.NamedTuple):
116
+ """
117
+ Output object returned when calling `labelconvert(...)`.
118
+ """
119
+ root: OutputPathType
120
+ """Output root folder. This is the root folder for all outputs."""
121
+ image_out: OutputPathType
122
+ """the output image"""
123
+
124
+
125
+ def labelconvert_params(
126
+ path_in: InputPathType,
127
+ lut_in: InputPathType,
128
+ lut_out: InputPathType,
129
+ image_out: str,
130
+ spine: InputPathType | None = None,
131
+ info: bool = False,
132
+ quiet: bool = False,
133
+ debug: bool = False,
134
+ force: bool = False,
135
+ nthreads: int | None = None,
136
+ config: list[LabelconvertConfigParameters] | None = None,
137
+ help_: bool = False,
138
+ version: bool = False,
139
+ ) -> LabelconvertParameters:
140
+ """
141
+ Build parameters.
142
+
143
+ Args:
144
+ path_in: the input image.
145
+ lut_in: the connectome lookup table corresponding to the input image.
146
+ lut_out: the target connectome lookup table for the output image.
147
+ image_out: the output image.
148
+ spine: provide a manually-defined segmentation of the base of the spine\
149
+ where the streamlines terminate, so that this can become a node in the\
150
+ connection matrix.
151
+ info: display information messages.
152
+ quiet: do not display information messages or progress status;\
153
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
154
+ environment variable to a non-empty string.
155
+ debug: display debugging messages.
156
+ force: force overwrite of output files (caution: using the same file as\
157
+ input and output might cause unexpected behaviour).
158
+ nthreads: use this number of threads in multi-threaded applications\
159
+ (set to 0 to disable multi-threading).
160
+ config: temporarily set the value of an MRtrix config file entry.
161
+ help_: display this information page and exit.
162
+ version: display version information and exit.
163
+ Returns:
164
+ Parameter dictionary
165
+ """
166
+ params = {
167
+ "__STYXTYPE__": "labelconvert",
168
+ "info": info,
169
+ "quiet": quiet,
170
+ "debug": debug,
171
+ "force": force,
172
+ "help": help_,
173
+ "version": version,
174
+ "path_in": path_in,
175
+ "lut_in": lut_in,
176
+ "lut_out": lut_out,
177
+ "image_out": image_out,
178
+ }
179
+ if spine is not None:
180
+ params["spine"] = spine
181
+ if nthreads is not None:
182
+ params["nthreads"] = nthreads
183
+ if config is not None:
184
+ params["config"] = config
185
+ return params
186
+
187
+
188
+ def labelconvert_cargs(
189
+ params: LabelconvertParameters,
190
+ execution: Execution,
191
+ ) -> list[str]:
192
+ """
193
+ Build command-line arguments from parameters.
194
+
195
+ Args:
196
+ params: The parameters.
197
+ execution: The execution object for resolving input paths.
198
+ Returns:
199
+ Command-line arguments.
200
+ """
201
+ cargs = []
202
+ cargs.append("labelconvert")
203
+ if params.get("spine") is not None:
204
+ cargs.extend([
205
+ "-spine",
206
+ execution.input_file(params.get("spine"))
207
+ ])
208
+ if params.get("info"):
209
+ cargs.append("-info")
210
+ if params.get("quiet"):
211
+ cargs.append("-quiet")
212
+ if params.get("debug"):
213
+ cargs.append("-debug")
214
+ if params.get("force"):
215
+ cargs.append("-force")
216
+ if params.get("nthreads") is not None:
217
+ cargs.extend([
218
+ "-nthreads",
219
+ str(params.get("nthreads"))
220
+ ])
221
+ if params.get("config") is not None:
222
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
223
+ if params.get("help"):
224
+ cargs.append("-help")
225
+ if params.get("version"):
226
+ cargs.append("-version")
227
+ cargs.append(execution.input_file(params.get("path_in")))
228
+ cargs.append(execution.input_file(params.get("lut_in")))
229
+ cargs.append(execution.input_file(params.get("lut_out")))
230
+ cargs.append(params.get("image_out"))
231
+ return cargs
232
+
233
+
234
+ def labelconvert_outputs(
235
+ params: LabelconvertParameters,
236
+ execution: Execution,
237
+ ) -> LabelconvertOutputs:
238
+ """
239
+ Build outputs object containing output file paths and possibly stdout/stderr.
240
+
241
+ Args:
242
+ params: The parameters.
243
+ execution: The execution object for resolving input paths.
244
+ Returns:
245
+ Outputs object.
246
+ """
247
+ ret = LabelconvertOutputs(
248
+ root=execution.output_file("."),
249
+ image_out=execution.output_file(params.get("image_out")),
250
+ )
251
+ return ret
252
+
253
+
254
+ def labelconvert_execute(
255
+ params: LabelconvertParameters,
256
+ execution: Execution,
257
+ ) -> LabelconvertOutputs:
258
+ """
259
+ Convert a connectome node image from one lookup table to another.
260
+
261
+ Typical usage is to convert a parcellation image provided by some other
262
+ software, based on the lookup table provided by that software, to conform to
263
+ a new lookup table, particularly one where the node indices increment from
264
+ 1, in preparation for connectome construction; examples of such target
265
+ lookup table files are provided in share//mrtrix3//labelconvert//, but can
266
+ be created by the user to provide the desired node set // ordering //
267
+ colours.
268
+
269
+ References:
270
+
271
+ .
272
+
273
+ Author: MRTrix3 Developers
274
+
275
+ URL: https://www.mrtrix.org/
276
+
277
+ Args:
278
+ params: The parameters.
279
+ execution: The execution object.
280
+ Returns:
281
+ NamedTuple of outputs (described in `LabelconvertOutputs`).
282
+ """
283
+ params = execution.params(params)
284
+ cargs = labelconvert_cargs(params, execution)
285
+ ret = labelconvert_outputs(params, execution)
286
+ execution.run(cargs)
287
+ return ret
288
+
289
+
290
+ def labelconvert(
291
+ path_in: InputPathType,
292
+ lut_in: InputPathType,
293
+ lut_out: InputPathType,
294
+ image_out: str,
295
+ spine: InputPathType | None = None,
296
+ info: bool = False,
297
+ quiet: bool = False,
298
+ debug: bool = False,
299
+ force: bool = False,
300
+ nthreads: int | None = None,
301
+ config: list[LabelconvertConfigParameters] | None = None,
302
+ help_: bool = False,
303
+ version: bool = False,
304
+ runner: Runner | None = None,
305
+ ) -> LabelconvertOutputs:
306
+ """
307
+ Convert a connectome node image from one lookup table to another.
308
+
309
+ Typical usage is to convert a parcellation image provided by some other
310
+ software, based on the lookup table provided by that software, to conform to
311
+ a new lookup table, particularly one where the node indices increment from
312
+ 1, in preparation for connectome construction; examples of such target
313
+ lookup table files are provided in share//mrtrix3//labelconvert//, but can
314
+ be created by the user to provide the desired node set // ordering //
315
+ colours.
316
+
317
+ References:
318
+
319
+ .
320
+
321
+ Author: MRTrix3 Developers
322
+
323
+ URL: https://www.mrtrix.org/
324
+
325
+ Args:
326
+ path_in: the input image.
327
+ lut_in: the connectome lookup table corresponding to the input image.
328
+ lut_out: the target connectome lookup table for the output image.
329
+ image_out: the output image.
330
+ spine: provide a manually-defined segmentation of the base of the spine\
331
+ where the streamlines terminate, so that this can become a node in the\
332
+ connection matrix.
333
+ info: display information messages.
334
+ quiet: do not display information messages or progress status;\
335
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
336
+ environment variable to a non-empty string.
337
+ debug: display debugging messages.
338
+ force: force overwrite of output files (caution: using the same file as\
339
+ input and output might cause unexpected behaviour).
340
+ nthreads: use this number of threads in multi-threaded applications\
341
+ (set to 0 to disable multi-threading).
342
+ config: temporarily set the value of an MRtrix config file entry.
343
+ help_: display this information page and exit.
344
+ version: display version information and exit.
345
+ runner: Command runner.
346
+ Returns:
347
+ NamedTuple of outputs (described in `LabelconvertOutputs`).
348
+ """
349
+ runner = runner or get_global_runner()
350
+ execution = runner.start_execution(LABELCONVERT_METADATA)
351
+ params = labelconvert_params(
352
+ spine=spine,
353
+ info=info,
354
+ quiet=quiet,
355
+ debug=debug,
356
+ force=force,
357
+ nthreads=nthreads,
358
+ config=config,
359
+ help_=help_,
360
+ version=version,
361
+ path_in=path_in,
362
+ lut_in=lut_in,
363
+ lut_out=lut_out,
364
+ image_out=image_out,
365
+ )
366
+ return labelconvert_execute(params, execution)
367
+
368
+
369
+ __all__ = [
370
+ "LABELCONVERT_METADATA",
371
+ "LabelconvertConfigParameters",
372
+ "LabelconvertOutputs",
373
+ "LabelconvertParameters",
374
+ "labelconvert",
375
+ "labelconvert_config_params",
376
+ "labelconvert_params",
377
+ ]
@@ -0,0 +1,344 @@
1
+ # This file was auto generated by Styx.
2
+ # Do not edit this file directly.
3
+
4
+ import typing
5
+ import pathlib
6
+ from styxdefs import *
7
+
8
+ LABELSTATS_METADATA = Metadata(
9
+ id="254f5ddf0636d16c200b150f7e9d225ebb08df1b.boutiques",
10
+ name="labelstats",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ LabelstatsConfigParameters = typing.TypedDict('LabelstatsConfigParameters', {
17
+ "__STYX_TYPE__": typing.Literal["config"],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+
22
+
23
+ LabelstatsParameters = typing.TypedDict('LabelstatsParameters', {
24
+ "__STYX_TYPE__": typing.Literal["labelstats"],
25
+ "output": typing.NotRequired[str | None],
26
+ "voxelspace": bool,
27
+ "info": bool,
28
+ "quiet": bool,
29
+ "debug": bool,
30
+ "force": bool,
31
+ "nthreads": typing.NotRequired[int | None],
32
+ "config": typing.NotRequired[list[LabelstatsConfigParameters] | None],
33
+ "help": bool,
34
+ "version": bool,
35
+ "input": InputPathType,
36
+ })
37
+
38
+
39
+ def dyn_cargs(
40
+ t: str,
41
+ ) -> typing.Any:
42
+ """
43
+ Get build cargs function by command type.
44
+
45
+ Args:
46
+ t: Command type.
47
+ Returns:
48
+ Build cargs function.
49
+ """
50
+ return {
51
+ "labelstats": labelstats_cargs,
52
+ "config": labelstats_config_cargs,
53
+ }.get(t)
54
+
55
+
56
+ def dyn_outputs(
57
+ t: str,
58
+ ) -> typing.Any:
59
+ """
60
+ Get build outputs function by command type.
61
+
62
+ Args:
63
+ t: Command type.
64
+ Returns:
65
+ Build outputs function.
66
+ """
67
+ return {
68
+ }.get(t)
69
+
70
+
71
+ def labelstats_config_params(
72
+ key: str,
73
+ value: str,
74
+ ) -> LabelstatsConfigParameters:
75
+ """
76
+ Build parameters.
77
+
78
+ Args:
79
+ key: temporarily set the value of an MRtrix config file entry.
80
+ value: temporarily set the value of an MRtrix config file entry.
81
+ Returns:
82
+ Parameter dictionary
83
+ """
84
+ params = {
85
+ "__STYXTYPE__": "config",
86
+ "key": key,
87
+ "value": value,
88
+ }
89
+ return params
90
+
91
+
92
+ def labelstats_config_cargs(
93
+ params: LabelstatsConfigParameters,
94
+ execution: Execution,
95
+ ) -> list[str]:
96
+ """
97
+ Build command-line arguments from parameters.
98
+
99
+ Args:
100
+ params: The parameters.
101
+ execution: The execution object for resolving input paths.
102
+ Returns:
103
+ Command-line arguments.
104
+ """
105
+ cargs = []
106
+ cargs.append("-config")
107
+ cargs.append(params.get("key"))
108
+ cargs.append(params.get("value"))
109
+ return cargs
110
+
111
+
112
+ class LabelstatsOutputs(typing.NamedTuple):
113
+ """
114
+ Output object returned when calling `labelstats(...)`.
115
+ """
116
+ root: OutputPathType
117
+ """Output root folder. This is the root folder for all outputs."""
118
+
119
+
120
+ def labelstats_params(
121
+ input_: InputPathType,
122
+ output: str | None = None,
123
+ voxelspace: bool = False,
124
+ info: bool = False,
125
+ quiet: bool = False,
126
+ debug: bool = False,
127
+ force: bool = False,
128
+ nthreads: int | None = None,
129
+ config: list[LabelstatsConfigParameters] | None = None,
130
+ help_: bool = False,
131
+ version: bool = False,
132
+ ) -> LabelstatsParameters:
133
+ """
134
+ Build parameters.
135
+
136
+ Args:
137
+ input_: the input label image.
138
+ output: output only the field specified; options are: mass,centre.
139
+ voxelspace: report parcel centres of mass in voxel space rather than\
140
+ scanner space.
141
+ info: display information messages.
142
+ quiet: do not display information messages or progress status;\
143
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
144
+ environment variable to a non-empty string.
145
+ debug: display debugging messages.
146
+ force: force overwrite of output files (caution: using the same file as\
147
+ input and output might cause unexpected behaviour).
148
+ nthreads: use this number of threads in multi-threaded applications\
149
+ (set to 0 to disable multi-threading).
150
+ config: temporarily set the value of an MRtrix config file entry.
151
+ help_: display this information page and exit.
152
+ version: display version information and exit.
153
+ Returns:
154
+ Parameter dictionary
155
+ """
156
+ params = {
157
+ "__STYXTYPE__": "labelstats",
158
+ "voxelspace": voxelspace,
159
+ "info": info,
160
+ "quiet": quiet,
161
+ "debug": debug,
162
+ "force": force,
163
+ "help": help_,
164
+ "version": version,
165
+ "input": input_,
166
+ }
167
+ if output is not None:
168
+ params["output"] = output
169
+ if nthreads is not None:
170
+ params["nthreads"] = nthreads
171
+ if config is not None:
172
+ params["config"] = config
173
+ return params
174
+
175
+
176
+ def labelstats_cargs(
177
+ params: LabelstatsParameters,
178
+ execution: Execution,
179
+ ) -> list[str]:
180
+ """
181
+ Build command-line arguments from parameters.
182
+
183
+ Args:
184
+ params: The parameters.
185
+ execution: The execution object for resolving input paths.
186
+ Returns:
187
+ Command-line arguments.
188
+ """
189
+ cargs = []
190
+ cargs.append("labelstats")
191
+ if params.get("output") is not None:
192
+ cargs.extend([
193
+ "-output",
194
+ params.get("output")
195
+ ])
196
+ if params.get("voxelspace"):
197
+ cargs.append("-voxelspace")
198
+ if params.get("info"):
199
+ cargs.append("-info")
200
+ if params.get("quiet"):
201
+ cargs.append("-quiet")
202
+ if params.get("debug"):
203
+ cargs.append("-debug")
204
+ if params.get("force"):
205
+ cargs.append("-force")
206
+ if params.get("nthreads") is not None:
207
+ cargs.extend([
208
+ "-nthreads",
209
+ str(params.get("nthreads"))
210
+ ])
211
+ if params.get("config") is not None:
212
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
213
+ if params.get("help"):
214
+ cargs.append("-help")
215
+ if params.get("version"):
216
+ cargs.append("-version")
217
+ cargs.append(execution.input_file(params.get("input")))
218
+ return cargs
219
+
220
+
221
+ def labelstats_outputs(
222
+ params: LabelstatsParameters,
223
+ execution: Execution,
224
+ ) -> LabelstatsOutputs:
225
+ """
226
+ Build outputs object containing output file paths and possibly stdout/stderr.
227
+
228
+ Args:
229
+ params: The parameters.
230
+ execution: The execution object for resolving input paths.
231
+ Returns:
232
+ Outputs object.
233
+ """
234
+ ret = LabelstatsOutputs(
235
+ root=execution.output_file("."),
236
+ )
237
+ return ret
238
+
239
+
240
+ def labelstats_execute(
241
+ params: LabelstatsParameters,
242
+ execution: Execution,
243
+ ) -> LabelstatsOutputs:
244
+ """
245
+ Compute statistics of parcels within a label image.
246
+
247
+
248
+
249
+ References:
250
+
251
+ .
252
+
253
+ Author: MRTrix3 Developers
254
+
255
+ URL: https://www.mrtrix.org/
256
+
257
+ Args:
258
+ params: The parameters.
259
+ execution: The execution object.
260
+ Returns:
261
+ NamedTuple of outputs (described in `LabelstatsOutputs`).
262
+ """
263
+ params = execution.params(params)
264
+ cargs = labelstats_cargs(params, execution)
265
+ ret = labelstats_outputs(params, execution)
266
+ execution.run(cargs)
267
+ return ret
268
+
269
+
270
+ def labelstats(
271
+ input_: InputPathType,
272
+ output: str | None = None,
273
+ voxelspace: bool = False,
274
+ info: bool = False,
275
+ quiet: bool = False,
276
+ debug: bool = False,
277
+ force: bool = False,
278
+ nthreads: int | None = None,
279
+ config: list[LabelstatsConfigParameters] | None = None,
280
+ help_: bool = False,
281
+ version: bool = False,
282
+ runner: Runner | None = None,
283
+ ) -> LabelstatsOutputs:
284
+ """
285
+ Compute statistics of parcels within a label image.
286
+
287
+
288
+
289
+ References:
290
+
291
+ .
292
+
293
+ Author: MRTrix3 Developers
294
+
295
+ URL: https://www.mrtrix.org/
296
+
297
+ Args:
298
+ input_: the input label image.
299
+ output: output only the field specified; options are: mass,centre.
300
+ voxelspace: report parcel centres of mass in voxel space rather than\
301
+ scanner space.
302
+ info: display information messages.
303
+ quiet: do not display information messages or progress status;\
304
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
305
+ environment variable to a non-empty string.
306
+ debug: display debugging messages.
307
+ force: force overwrite of output files (caution: using the same file as\
308
+ input and output might cause unexpected behaviour).
309
+ nthreads: use this number of threads in multi-threaded applications\
310
+ (set to 0 to disable multi-threading).
311
+ config: temporarily set the value of an MRtrix config file entry.
312
+ help_: display this information page and exit.
313
+ version: display version information and exit.
314
+ runner: Command runner.
315
+ Returns:
316
+ NamedTuple of outputs (described in `LabelstatsOutputs`).
317
+ """
318
+ runner = runner or get_global_runner()
319
+ execution = runner.start_execution(LABELSTATS_METADATA)
320
+ params = labelstats_params(
321
+ output=output,
322
+ voxelspace=voxelspace,
323
+ info=info,
324
+ quiet=quiet,
325
+ debug=debug,
326
+ force=force,
327
+ nthreads=nthreads,
328
+ config=config,
329
+ help_=help_,
330
+ version=version,
331
+ input_=input_,
332
+ )
333
+ return labelstats_execute(params, execution)
334
+
335
+
336
+ __all__ = [
337
+ "LABELSTATS_METADATA",
338
+ "LabelstatsConfigParameters",
339
+ "LabelstatsOutputs",
340
+ "LabelstatsParameters",
341
+ "labelstats",
342
+ "labelstats_config_params",
343
+ "labelstats_params",
344
+ ]