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,351 @@
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
+ LABEL2COLOUR_METADATA = Metadata(
9
+ id="c1884f48e15f2a0255f7742d85904c1e94ec1214.boutiques",
10
+ name="label2colour",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ Label2colourConfigParameters = typing.TypedDict('Label2colourConfigParameters', {
17
+ "__STYX_TYPE__": typing.Literal["config"],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+
22
+
23
+ Label2colourParameters = typing.TypedDict('Label2colourParameters', {
24
+ "__STYX_TYPE__": typing.Literal["label2colour"],
25
+ "lut": 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[Label2colourConfigParameters] | None],
32
+ "help": bool,
33
+ "version": bool,
34
+ "nodes_in": InputPathType,
35
+ "colour_out": str,
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
+ "label2colour": label2colour_cargs,
52
+ "config": label2colour_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
+ "label2colour": label2colour_outputs,
69
+ }.get(t)
70
+
71
+
72
+ def label2colour_config_params(
73
+ key: str,
74
+ value: str,
75
+ ) -> Label2colourConfigParameters:
76
+ """
77
+ Build parameters.
78
+
79
+ Args:
80
+ key: temporarily set the value of an MRtrix config file entry.
81
+ value: temporarily set the value of an MRtrix config file entry.
82
+ Returns:
83
+ Parameter dictionary
84
+ """
85
+ params = {
86
+ "__STYXTYPE__": "config",
87
+ "key": key,
88
+ "value": value,
89
+ }
90
+ return params
91
+
92
+
93
+ def label2colour_config_cargs(
94
+ params: Label2colourConfigParameters,
95
+ execution: Execution,
96
+ ) -> list[str]:
97
+ """
98
+ Build command-line arguments from parameters.
99
+
100
+ Args:
101
+ params: The parameters.
102
+ execution: The execution object for resolving input paths.
103
+ Returns:
104
+ Command-line arguments.
105
+ """
106
+ cargs = []
107
+ cargs.append("-config")
108
+ cargs.append(params.get("key"))
109
+ cargs.append(params.get("value"))
110
+ return cargs
111
+
112
+
113
+ class Label2colourOutputs(typing.NamedTuple):
114
+ """
115
+ Output object returned when calling `label2colour(...)`.
116
+ """
117
+ root: OutputPathType
118
+ """Output root folder. This is the root folder for all outputs."""
119
+ colour_out: OutputPathType
120
+ """the output colour image"""
121
+
122
+
123
+ def label2colour_params(
124
+ nodes_in: InputPathType,
125
+ colour_out: str,
126
+ lut: InputPathType | None = None,
127
+ info: bool = False,
128
+ quiet: bool = False,
129
+ debug: bool = False,
130
+ force: bool = False,
131
+ nthreads: int | None = None,
132
+ config: list[Label2colourConfigParameters] | None = None,
133
+ help_: bool = False,
134
+ version: bool = False,
135
+ ) -> Label2colourParameters:
136
+ """
137
+ Build parameters.
138
+
139
+ Args:
140
+ nodes_in: the input node parcellation image.
141
+ colour_out: the output colour image.
142
+ lut: Provide the relevant colour lookup table (if not provided, nodes\
143
+ will be coloured randomly).
144
+ info: display information messages.
145
+ quiet: do not display information messages or progress status;\
146
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
147
+ environment variable to a non-empty string.
148
+ debug: display debugging messages.
149
+ force: force overwrite of output files (caution: using the same file as\
150
+ input and output might cause unexpected behaviour).
151
+ nthreads: use this number of threads in multi-threaded applications\
152
+ (set to 0 to disable multi-threading).
153
+ config: temporarily set the value of an MRtrix config file entry.
154
+ help_: display this information page and exit.
155
+ version: display version information and exit.
156
+ Returns:
157
+ Parameter dictionary
158
+ """
159
+ params = {
160
+ "__STYXTYPE__": "label2colour",
161
+ "info": info,
162
+ "quiet": quiet,
163
+ "debug": debug,
164
+ "force": force,
165
+ "help": help_,
166
+ "version": version,
167
+ "nodes_in": nodes_in,
168
+ "colour_out": colour_out,
169
+ }
170
+ if lut is not None:
171
+ params["lut"] = lut
172
+ if nthreads is not None:
173
+ params["nthreads"] = nthreads
174
+ if config is not None:
175
+ params["config"] = config
176
+ return params
177
+
178
+
179
+ def label2colour_cargs(
180
+ params: Label2colourParameters,
181
+ execution: Execution,
182
+ ) -> list[str]:
183
+ """
184
+ Build command-line arguments from parameters.
185
+
186
+ Args:
187
+ params: The parameters.
188
+ execution: The execution object for resolving input paths.
189
+ Returns:
190
+ Command-line arguments.
191
+ """
192
+ cargs = []
193
+ cargs.append("label2colour")
194
+ if params.get("lut") is not None:
195
+ cargs.extend([
196
+ "-lut",
197
+ execution.input_file(params.get("lut"))
198
+ ])
199
+ if params.get("info"):
200
+ cargs.append("-info")
201
+ if params.get("quiet"):
202
+ cargs.append("-quiet")
203
+ if params.get("debug"):
204
+ cargs.append("-debug")
205
+ if params.get("force"):
206
+ cargs.append("-force")
207
+ if params.get("nthreads") is not None:
208
+ cargs.extend([
209
+ "-nthreads",
210
+ str(params.get("nthreads"))
211
+ ])
212
+ if params.get("config") is not None:
213
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
214
+ if params.get("help"):
215
+ cargs.append("-help")
216
+ if params.get("version"):
217
+ cargs.append("-version")
218
+ cargs.append(execution.input_file(params.get("nodes_in")))
219
+ cargs.append(params.get("colour_out"))
220
+ return cargs
221
+
222
+
223
+ def label2colour_outputs(
224
+ params: Label2colourParameters,
225
+ execution: Execution,
226
+ ) -> Label2colourOutputs:
227
+ """
228
+ Build outputs object containing output file paths and possibly stdout/stderr.
229
+
230
+ Args:
231
+ params: The parameters.
232
+ execution: The execution object for resolving input paths.
233
+ Returns:
234
+ Outputs object.
235
+ """
236
+ ret = Label2colourOutputs(
237
+ root=execution.output_file("."),
238
+ colour_out=execution.output_file(params.get("colour_out")),
239
+ )
240
+ return ret
241
+
242
+
243
+ def label2colour_execute(
244
+ params: Label2colourParameters,
245
+ execution: Execution,
246
+ ) -> Label2colourOutputs:
247
+ """
248
+ Convert a parcellated image (where values are node indices) into a colour image.
249
+
250
+ Many software packages handle this colouring internally within their viewer
251
+ program; this binary explicitly converts a parcellation image into a colour
252
+ image that should be viewable in any software.
253
+
254
+ References:
255
+
256
+ .
257
+
258
+ Author: MRTrix3 Developers
259
+
260
+ URL: https://www.mrtrix.org/
261
+
262
+ Args:
263
+ params: The parameters.
264
+ execution: The execution object.
265
+ Returns:
266
+ NamedTuple of outputs (described in `Label2colourOutputs`).
267
+ """
268
+ params = execution.params(params)
269
+ cargs = label2colour_cargs(params, execution)
270
+ ret = label2colour_outputs(params, execution)
271
+ execution.run(cargs)
272
+ return ret
273
+
274
+
275
+ def label2colour(
276
+ nodes_in: InputPathType,
277
+ colour_out: str,
278
+ lut: InputPathType | None = None,
279
+ info: bool = False,
280
+ quiet: bool = False,
281
+ debug: bool = False,
282
+ force: bool = False,
283
+ nthreads: int | None = None,
284
+ config: list[Label2colourConfigParameters] | None = None,
285
+ help_: bool = False,
286
+ version: bool = False,
287
+ runner: Runner | None = None,
288
+ ) -> Label2colourOutputs:
289
+ """
290
+ Convert a parcellated image (where values are node indices) into a colour image.
291
+
292
+ Many software packages handle this colouring internally within their viewer
293
+ program; this binary explicitly converts a parcellation image into a colour
294
+ image that should be viewable in any software.
295
+
296
+ References:
297
+
298
+ .
299
+
300
+ Author: MRTrix3 Developers
301
+
302
+ URL: https://www.mrtrix.org/
303
+
304
+ Args:
305
+ nodes_in: the input node parcellation image.
306
+ colour_out: the output colour image.
307
+ lut: Provide the relevant colour lookup table (if not provided, nodes\
308
+ will be coloured randomly).
309
+ info: display information messages.
310
+ quiet: do not display information messages or progress status;\
311
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
312
+ environment variable to a non-empty string.
313
+ debug: display debugging messages.
314
+ force: force overwrite of output files (caution: using the same file as\
315
+ input and output might cause unexpected behaviour).
316
+ nthreads: use this number of threads in multi-threaded applications\
317
+ (set to 0 to disable multi-threading).
318
+ config: temporarily set the value of an MRtrix config file entry.
319
+ help_: display this information page and exit.
320
+ version: display version information and exit.
321
+ runner: Command runner.
322
+ Returns:
323
+ NamedTuple of outputs (described in `Label2colourOutputs`).
324
+ """
325
+ runner = runner or get_global_runner()
326
+ execution = runner.start_execution(LABEL2COLOUR_METADATA)
327
+ params = label2colour_params(
328
+ lut=lut,
329
+ info=info,
330
+ quiet=quiet,
331
+ debug=debug,
332
+ force=force,
333
+ nthreads=nthreads,
334
+ config=config,
335
+ help_=help_,
336
+ version=version,
337
+ nodes_in=nodes_in,
338
+ colour_out=colour_out,
339
+ )
340
+ return label2colour_execute(params, execution)
341
+
342
+
343
+ __all__ = [
344
+ "LABEL2COLOUR_METADATA",
345
+ "Label2colourConfigParameters",
346
+ "Label2colourOutputs",
347
+ "Label2colourParameters",
348
+ "label2colour",
349
+ "label2colour_config_params",
350
+ "label2colour_params",
351
+ ]
@@ -0,0 +1,343 @@
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
+ LABEL2MESH_METADATA = Metadata(
9
+ id="cb0fa03ae9a00660e6162ac41aa144e77599bd59.boutiques",
10
+ name="label2mesh",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ Label2meshConfigParameters = typing.TypedDict('Label2meshConfigParameters', {
17
+ "__STYX_TYPE__": typing.Literal["config"],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+
22
+
23
+ Label2meshParameters = typing.TypedDict('Label2meshParameters', {
24
+ "__STYX_TYPE__": typing.Literal["label2mesh"],
25
+ "blocky": bool,
26
+ "info": bool,
27
+ "quiet": bool,
28
+ "debug": bool,
29
+ "force": bool,
30
+ "nthreads": typing.NotRequired[int | None],
31
+ "config": typing.NotRequired[list[Label2meshConfigParameters] | None],
32
+ "help": bool,
33
+ "version": bool,
34
+ "nodes_in": InputPathType,
35
+ "mesh_out": str,
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
+ "label2mesh": label2mesh_cargs,
52
+ "config": label2mesh_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
+ "label2mesh": label2mesh_outputs,
69
+ }.get(t)
70
+
71
+
72
+ def label2mesh_config_params(
73
+ key: str,
74
+ value: str,
75
+ ) -> Label2meshConfigParameters:
76
+ """
77
+ Build parameters.
78
+
79
+ Args:
80
+ key: temporarily set the value of an MRtrix config file entry.
81
+ value: temporarily set the value of an MRtrix config file entry.
82
+ Returns:
83
+ Parameter dictionary
84
+ """
85
+ params = {
86
+ "__STYXTYPE__": "config",
87
+ "key": key,
88
+ "value": value,
89
+ }
90
+ return params
91
+
92
+
93
+ def label2mesh_config_cargs(
94
+ params: Label2meshConfigParameters,
95
+ execution: Execution,
96
+ ) -> list[str]:
97
+ """
98
+ Build command-line arguments from parameters.
99
+
100
+ Args:
101
+ params: The parameters.
102
+ execution: The execution object for resolving input paths.
103
+ Returns:
104
+ Command-line arguments.
105
+ """
106
+ cargs = []
107
+ cargs.append("-config")
108
+ cargs.append(params.get("key"))
109
+ cargs.append(params.get("value"))
110
+ return cargs
111
+
112
+
113
+ class Label2meshOutputs(typing.NamedTuple):
114
+ """
115
+ Output object returned when calling `label2mesh(...)`.
116
+ """
117
+ root: OutputPathType
118
+ """Output root folder. This is the root folder for all outputs."""
119
+ mesh_out: OutputPathType
120
+ """the output mesh file"""
121
+
122
+
123
+ def label2mesh_params(
124
+ nodes_in: InputPathType,
125
+ mesh_out: str,
126
+ blocky: bool = False,
127
+ info: bool = False,
128
+ quiet: bool = False,
129
+ debug: bool = False,
130
+ force: bool = False,
131
+ nthreads: int | None = None,
132
+ config: list[Label2meshConfigParameters] | None = None,
133
+ help_: bool = False,
134
+ version: bool = False,
135
+ ) -> Label2meshParameters:
136
+ """
137
+ Build parameters.
138
+
139
+ Args:
140
+ nodes_in: the input node parcellation image.
141
+ mesh_out: the output mesh file.
142
+ blocky: generate 'blocky' meshes with precise delineation of voxel\
143
+ edges, rather than the default Marching Cubes approach.
144
+ info: display information messages.
145
+ quiet: do not display information messages or progress status;\
146
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
147
+ environment variable to a non-empty string.
148
+ debug: display debugging messages.
149
+ force: force overwrite of output files (caution: using the same file as\
150
+ input and output might cause unexpected behaviour).
151
+ nthreads: use this number of threads in multi-threaded applications\
152
+ (set to 0 to disable multi-threading).
153
+ config: temporarily set the value of an MRtrix config file entry.
154
+ help_: display this information page and exit.
155
+ version: display version information and exit.
156
+ Returns:
157
+ Parameter dictionary
158
+ """
159
+ params = {
160
+ "__STYXTYPE__": "label2mesh",
161
+ "blocky": blocky,
162
+ "info": info,
163
+ "quiet": quiet,
164
+ "debug": debug,
165
+ "force": force,
166
+ "help": help_,
167
+ "version": version,
168
+ "nodes_in": nodes_in,
169
+ "mesh_out": mesh_out,
170
+ }
171
+ if nthreads is not None:
172
+ params["nthreads"] = nthreads
173
+ if config is not None:
174
+ params["config"] = config
175
+ return params
176
+
177
+
178
+ def label2mesh_cargs(
179
+ params: Label2meshParameters,
180
+ execution: Execution,
181
+ ) -> list[str]:
182
+ """
183
+ Build command-line arguments from parameters.
184
+
185
+ Args:
186
+ params: The parameters.
187
+ execution: The execution object for resolving input paths.
188
+ Returns:
189
+ Command-line arguments.
190
+ """
191
+ cargs = []
192
+ cargs.append("label2mesh")
193
+ if params.get("blocky"):
194
+ cargs.append("-blocky")
195
+ if params.get("info"):
196
+ cargs.append("-info")
197
+ if params.get("quiet"):
198
+ cargs.append("-quiet")
199
+ if params.get("debug"):
200
+ cargs.append("-debug")
201
+ if params.get("force"):
202
+ cargs.append("-force")
203
+ if params.get("nthreads") is not None:
204
+ cargs.extend([
205
+ "-nthreads",
206
+ str(params.get("nthreads"))
207
+ ])
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"):
211
+ cargs.append("-help")
212
+ if params.get("version"):
213
+ cargs.append("-version")
214
+ cargs.append(execution.input_file(params.get("nodes_in")))
215
+ cargs.append(params.get("mesh_out"))
216
+ return cargs
217
+
218
+
219
+ def label2mesh_outputs(
220
+ params: Label2meshParameters,
221
+ execution: Execution,
222
+ ) -> Label2meshOutputs:
223
+ """
224
+ Build outputs object containing output file paths and possibly stdout/stderr.
225
+
226
+ Args:
227
+ params: The parameters.
228
+ execution: The execution object for resolving input paths.
229
+ Returns:
230
+ Outputs object.
231
+ """
232
+ ret = Label2meshOutputs(
233
+ root=execution.output_file("."),
234
+ mesh_out=execution.output_file(params.get("mesh_out")),
235
+ )
236
+ return ret
237
+
238
+
239
+ def label2mesh_execute(
240
+ params: Label2meshParameters,
241
+ execution: Execution,
242
+ ) -> Label2meshOutputs:
243
+ """
244
+ Generate meshes from a label image.
245
+
246
+
247
+
248
+ References:
249
+
250
+ .
251
+
252
+ Author: MRTrix3 Developers
253
+
254
+ URL: https://www.mrtrix.org/
255
+
256
+ Args:
257
+ params: The parameters.
258
+ execution: The execution object.
259
+ Returns:
260
+ NamedTuple of outputs (described in `Label2meshOutputs`).
261
+ """
262
+ params = execution.params(params)
263
+ cargs = label2mesh_cargs(params, execution)
264
+ ret = label2mesh_outputs(params, execution)
265
+ execution.run(cargs)
266
+ return ret
267
+
268
+
269
+ def label2mesh(
270
+ nodes_in: InputPathType,
271
+ mesh_out: str,
272
+ blocky: bool = False,
273
+ info: bool = False,
274
+ quiet: bool = False,
275
+ debug: bool = False,
276
+ force: bool = False,
277
+ nthreads: int | None = None,
278
+ config: list[Label2meshConfigParameters] | None = None,
279
+ help_: bool = False,
280
+ version: bool = False,
281
+ runner: Runner | None = None,
282
+ ) -> Label2meshOutputs:
283
+ """
284
+ Generate meshes from a label image.
285
+
286
+
287
+
288
+ References:
289
+
290
+ .
291
+
292
+ Author: MRTrix3 Developers
293
+
294
+ URL: https://www.mrtrix.org/
295
+
296
+ Args:
297
+ nodes_in: the input node parcellation image.
298
+ mesh_out: the output mesh file.
299
+ blocky: generate 'blocky' meshes with precise delineation of voxel\
300
+ edges, rather than the default Marching Cubes approach.
301
+ info: display information messages.
302
+ quiet: do not display information messages or progress status;\
303
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
304
+ environment variable to a non-empty string.
305
+ debug: display debugging messages.
306
+ force: force overwrite of output files (caution: using the same file as\
307
+ input and output might cause unexpected behaviour).
308
+ nthreads: use this number of threads in multi-threaded applications\
309
+ (set to 0 to disable multi-threading).
310
+ config: temporarily set the value of an MRtrix config file entry.
311
+ help_: display this information page and exit.
312
+ version: display version information and exit.
313
+ runner: Command runner.
314
+ Returns:
315
+ NamedTuple of outputs (described in `Label2meshOutputs`).
316
+ """
317
+ runner = runner or get_global_runner()
318
+ execution = runner.start_execution(LABEL2MESH_METADATA)
319
+ params = label2mesh_params(
320
+ blocky=blocky,
321
+ info=info,
322
+ quiet=quiet,
323
+ debug=debug,
324
+ force=force,
325
+ nthreads=nthreads,
326
+ config=config,
327
+ help_=help_,
328
+ version=version,
329
+ nodes_in=nodes_in,
330
+ mesh_out=mesh_out,
331
+ )
332
+ return label2mesh_execute(params, execution)
333
+
334
+
335
+ __all__ = [
336
+ "LABEL2MESH_METADATA",
337
+ "Label2meshConfigParameters",
338
+ "Label2meshOutputs",
339
+ "Label2meshParameters",
340
+ "label2mesh",
341
+ "label2mesh_config_params",
342
+ "label2mesh_params",
343
+ ]