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,816 @@
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
+ V_5TTGEN_METADATA = Metadata(
9
+ id="59e0c6c60fd8800c29de96fdc82fefe3a0af3c55.boutiques",
10
+ name="5ttgen",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ V5ttgenFreesurferParameters = typing.TypedDict('V5ttgenFreesurferParameters', {
17
+ "__STYX_TYPE__": typing.Literal["freesurfer"],
18
+ "input": InputPathType,
19
+ "output": str,
20
+ "lut": typing.NotRequired[InputPathType | None],
21
+ })
22
+
23
+
24
+ V5ttgenFslParameters = typing.TypedDict('V5ttgenFslParameters', {
25
+ "__STYX_TYPE__": typing.Literal["fsl"],
26
+ "input": InputPathType,
27
+ "output": str,
28
+ "t2": typing.NotRequired[InputPathType | None],
29
+ "mask": typing.NotRequired[InputPathType | None],
30
+ "premasked": bool,
31
+ })
32
+
33
+
34
+ V5ttgenGifParameters = typing.TypedDict('V5ttgenGifParameters', {
35
+ "__STYX_TYPE__": typing.Literal["gif"],
36
+ "input": InputPathType,
37
+ "output": str,
38
+ })
39
+
40
+
41
+ V5ttgenHsvsParameters = typing.TypedDict('V5ttgenHsvsParameters', {
42
+ "__STYX_TYPE__": typing.Literal["hsvs"],
43
+ "input": InputPathType,
44
+ "output": str,
45
+ "template": typing.NotRequired[InputPathType | None],
46
+ "hippocampi": typing.NotRequired[typing.Literal["subfields", "first", "aseg"] | None],
47
+ "thalami": typing.NotRequired[typing.Literal["nuclei", "first", "aseg"] | None],
48
+ "white_stem": bool,
49
+ })
50
+
51
+
52
+ V5ttgenConfigParameters = typing.TypedDict('V5ttgenConfigParameters', {
53
+ "__STYX_TYPE__": typing.Literal["config"],
54
+ "key": str,
55
+ "value": str,
56
+ })
57
+
58
+
59
+ V5ttgenParameters = typing.TypedDict('V5ttgenParameters', {
60
+ "__STYX_TYPE__": typing.Literal["5ttgen"],
61
+ "algorithm": typing.Union[V5ttgenFreesurferParameters, V5ttgenFslParameters, V5ttgenGifParameters, V5ttgenHsvsParameters],
62
+ "nocrop": bool,
63
+ "sgm_amyg_hipp": bool,
64
+ "nocleanup": bool,
65
+ "scratch": typing.NotRequired[str | None],
66
+ "continue": typing.NotRequired[str | None],
67
+ "info": bool,
68
+ "quiet": bool,
69
+ "debug": bool,
70
+ "force": bool,
71
+ "nthreads": typing.NotRequired[int | None],
72
+ "config": typing.NotRequired[list[V5ttgenConfigParameters] | None],
73
+ "help": bool,
74
+ "version": bool,
75
+ })
76
+
77
+
78
+ def dyn_cargs(
79
+ t: str,
80
+ ) -> typing.Any:
81
+ """
82
+ Get build cargs function by command type.
83
+
84
+ Args:
85
+ t: Command type.
86
+ Returns:
87
+ Build cargs function.
88
+ """
89
+ return {
90
+ "5ttgen": v_5ttgen_cargs,
91
+ "freesurfer": v_5ttgen_freesurfer_cargs,
92
+ "fsl": v_5ttgen_fsl_cargs,
93
+ "gif": v_5ttgen_gif_cargs,
94
+ "hsvs": v_5ttgen_hsvs_cargs,
95
+ "config": v_5ttgen_config_cargs,
96
+ }.get(t)
97
+
98
+
99
+ def dyn_outputs(
100
+ t: str,
101
+ ) -> typing.Any:
102
+ """
103
+ Get build outputs function by command type.
104
+
105
+ Args:
106
+ t: Command type.
107
+ Returns:
108
+ Build outputs function.
109
+ """
110
+ return {
111
+ "5ttgen": v_5ttgen_outputs,
112
+ "freesurfer": v_5ttgen_freesurfer_outputs,
113
+ "fsl": v_5ttgen_fsl_outputs,
114
+ "gif": v_5ttgen_gif_outputs,
115
+ "hsvs": v_5ttgen_hsvs_outputs,
116
+ }.get(t)
117
+
118
+
119
+ class V5ttgenFreesurferOutputs(typing.NamedTuple):
120
+ """
121
+ Output object returned when calling `V5ttgenFreesurferParameters(...)`.
122
+ """
123
+ root: OutputPathType
124
+ """Output root folder. This is the root folder for all outputs."""
125
+ output: OutputPathType
126
+ """The output 5TT image"""
127
+
128
+
129
+ def v_5ttgen_freesurfer_params(
130
+ input_: InputPathType,
131
+ output: str,
132
+ lut: InputPathType | None = None,
133
+ ) -> V5ttgenFreesurferParameters:
134
+ """
135
+ Build parameters.
136
+
137
+ Args:
138
+ input_: The input FreeSurfer parcellation image (any image containing\
139
+ 'aseg' in its name).
140
+ output: The output 5TT image.
141
+ lut: Manually provide path to the lookup table on which the input\
142
+ parcellation image is based (e.g. FreeSurferColorLUT.txt).
143
+ Returns:
144
+ Parameter dictionary
145
+ """
146
+ params = {
147
+ "__STYXTYPE__": "freesurfer",
148
+ "input": input_,
149
+ "output": output,
150
+ }
151
+ if lut is not None:
152
+ params["lut"] = lut
153
+ return params
154
+
155
+
156
+ def v_5ttgen_freesurfer_cargs(
157
+ params: V5ttgenFreesurferParameters,
158
+ execution: Execution,
159
+ ) -> list[str]:
160
+ """
161
+ Build command-line arguments from parameters.
162
+
163
+ Args:
164
+ params: The parameters.
165
+ execution: The execution object for resolving input paths.
166
+ Returns:
167
+ Command-line arguments.
168
+ """
169
+ cargs = []
170
+ cargs.append("freesurfer")
171
+ cargs.append(execution.input_file(params.get("input")))
172
+ cargs.append(params.get("output"))
173
+ if params.get("lut") is not None:
174
+ cargs.extend([
175
+ "-lut",
176
+ execution.input_file(params.get("lut"))
177
+ ])
178
+ return cargs
179
+
180
+
181
+ def v_5ttgen_freesurfer_outputs(
182
+ params: V5ttgenFreesurferParameters,
183
+ execution: Execution,
184
+ ) -> V5ttgenFreesurferOutputs:
185
+ """
186
+ Build outputs object containing output file paths and possibly stdout/stderr.
187
+
188
+ Args:
189
+ params: The parameters.
190
+ execution: The execution object for resolving input paths.
191
+ Returns:
192
+ Outputs object.
193
+ """
194
+ ret = V5ttgenFreesurferOutputs(
195
+ root=execution.output_file("."),
196
+ output=execution.output_file(params.get("output")),
197
+ )
198
+ return ret
199
+
200
+
201
+ class V5ttgenFslOutputs(typing.NamedTuple):
202
+ """
203
+ Output object returned when calling `V5ttgenFslParameters(...)`.
204
+ """
205
+ root: OutputPathType
206
+ """Output root folder. This is the root folder for all outputs."""
207
+ output: OutputPathType
208
+ """The output 5TT image"""
209
+
210
+
211
+ def v_5ttgen_fsl_params(
212
+ input_: InputPathType,
213
+ output: str,
214
+ t2: InputPathType | None = None,
215
+ mask: InputPathType | None = None,
216
+ premasked: bool = False,
217
+ ) -> V5ttgenFslParameters:
218
+ """
219
+ Build parameters.
220
+
221
+ Args:
222
+ input_: The input T1-weighted image.
223
+ output: The output 5TT image.
224
+ t2: Provide a T2-weighted image in addition to the default T1-weighted\
225
+ image; this will be used as a second input to FSL FAST.
226
+ mask: Manually provide a brain mask, rather than deriving one in the\
227
+ script.
228
+ premasked: Indicate that brain masking has already been applied to the\
229
+ input image.
230
+ Returns:
231
+ Parameter dictionary
232
+ """
233
+ params = {
234
+ "__STYXTYPE__": "fsl",
235
+ "input": input_,
236
+ "output": output,
237
+ "premasked": premasked,
238
+ }
239
+ if t2 is not None:
240
+ params["t2"] = t2
241
+ if mask is not None:
242
+ params["mask"] = mask
243
+ return params
244
+
245
+
246
+ def v_5ttgen_fsl_cargs(
247
+ params: V5ttgenFslParameters,
248
+ execution: Execution,
249
+ ) -> list[str]:
250
+ """
251
+ Build command-line arguments from parameters.
252
+
253
+ Args:
254
+ params: The parameters.
255
+ execution: The execution object for resolving input paths.
256
+ Returns:
257
+ Command-line arguments.
258
+ """
259
+ cargs = []
260
+ cargs.append("fsl")
261
+ cargs.append(execution.input_file(params.get("input")))
262
+ cargs.append(params.get("output"))
263
+ if params.get("t2") is not None:
264
+ cargs.extend([
265
+ "-t2",
266
+ execution.input_file(params.get("t2"))
267
+ ])
268
+ if params.get("mask") is not None:
269
+ cargs.extend([
270
+ "-mask",
271
+ execution.input_file(params.get("mask"))
272
+ ])
273
+ if params.get("premasked"):
274
+ cargs.append("-premasked")
275
+ return cargs
276
+
277
+
278
+ def v_5ttgen_fsl_outputs(
279
+ params: V5ttgenFslParameters,
280
+ execution: Execution,
281
+ ) -> V5ttgenFslOutputs:
282
+ """
283
+ Build outputs object containing output file paths and possibly stdout/stderr.
284
+
285
+ Args:
286
+ params: The parameters.
287
+ execution: The execution object for resolving input paths.
288
+ Returns:
289
+ Outputs object.
290
+ """
291
+ ret = V5ttgenFslOutputs(
292
+ root=execution.output_file("."),
293
+ output=execution.output_file(params.get("output")),
294
+ )
295
+ return ret
296
+
297
+
298
+ class V5ttgenGifOutputs(typing.NamedTuple):
299
+ """
300
+ Output object returned when calling `V5ttgenGifParameters(...)`.
301
+ """
302
+ root: OutputPathType
303
+ """Output root folder. This is the root folder for all outputs."""
304
+ output: OutputPathType
305
+ """The output 5TT image"""
306
+
307
+
308
+ def v_5ttgen_gif_params(
309
+ input_: InputPathType,
310
+ output: str,
311
+ ) -> V5ttgenGifParameters:
312
+ """
313
+ Build parameters.
314
+
315
+ Args:
316
+ input_: The input Geodesic Information Flow (GIF) segmentation image.
317
+ output: The output 5TT image.
318
+ Returns:
319
+ Parameter dictionary
320
+ """
321
+ params = {
322
+ "__STYXTYPE__": "gif",
323
+ "input": input_,
324
+ "output": output,
325
+ }
326
+ return params
327
+
328
+
329
+ def v_5ttgen_gif_cargs(
330
+ params: V5ttgenGifParameters,
331
+ execution: Execution,
332
+ ) -> list[str]:
333
+ """
334
+ Build command-line arguments from parameters.
335
+
336
+ Args:
337
+ params: The parameters.
338
+ execution: The execution object for resolving input paths.
339
+ Returns:
340
+ Command-line arguments.
341
+ """
342
+ cargs = []
343
+ cargs.append("gif")
344
+ cargs.append(execution.input_file(params.get("input")))
345
+ cargs.append(params.get("output"))
346
+ return cargs
347
+
348
+
349
+ def v_5ttgen_gif_outputs(
350
+ params: V5ttgenGifParameters,
351
+ execution: Execution,
352
+ ) -> V5ttgenGifOutputs:
353
+ """
354
+ Build outputs object containing output file paths and possibly stdout/stderr.
355
+
356
+ Args:
357
+ params: The parameters.
358
+ execution: The execution object for resolving input paths.
359
+ Returns:
360
+ Outputs object.
361
+ """
362
+ ret = V5ttgenGifOutputs(
363
+ root=execution.output_file("."),
364
+ output=execution.output_file(params.get("output")),
365
+ )
366
+ return ret
367
+
368
+
369
+ class V5ttgenHsvsOutputs(typing.NamedTuple):
370
+ """
371
+ Output object returned when calling `V5ttgenHsvsParameters(...)`.
372
+ """
373
+ root: OutputPathType
374
+ """Output root folder. This is the root folder for all outputs."""
375
+ output: OutputPathType
376
+ """The output 5TT image"""
377
+
378
+
379
+ def v_5ttgen_hsvs_params(
380
+ input_: InputPathType,
381
+ output: str,
382
+ template: InputPathType | None = None,
383
+ hippocampi: typing.Literal["subfields", "first", "aseg"] | None = None,
384
+ thalami: typing.Literal["nuclei", "first", "aseg"] | None = None,
385
+ white_stem: bool = False,
386
+ ) -> V5ttgenHsvsParameters:
387
+ """
388
+ Build parameters.
389
+
390
+ Args:
391
+ input_: The input FreeSurfer subject directory.
392
+ output: The output 5TT image.
393
+ template: Provide an image that will form the template for the\
394
+ generated 5TT image.
395
+ hippocampi: Select method to be used for hippocampi (& amygdalae)\
396
+ segmentation; options are: subfields,first,aseg.
397
+ thalami: Select method to be used for thalamic segmentation; options\
398
+ are: nuclei,first,aseg.
399
+ white_stem: Classify the brainstem as white matter.
400
+ Returns:
401
+ Parameter dictionary
402
+ """
403
+ params = {
404
+ "__STYXTYPE__": "hsvs",
405
+ "input": input_,
406
+ "output": output,
407
+ "white_stem": white_stem,
408
+ }
409
+ if template is not None:
410
+ params["template"] = template
411
+ if hippocampi is not None:
412
+ params["hippocampi"] = hippocampi
413
+ if thalami is not None:
414
+ params["thalami"] = thalami
415
+ return params
416
+
417
+
418
+ def v_5ttgen_hsvs_cargs(
419
+ params: V5ttgenHsvsParameters,
420
+ execution: Execution,
421
+ ) -> list[str]:
422
+ """
423
+ Build command-line arguments from parameters.
424
+
425
+ Args:
426
+ params: The parameters.
427
+ execution: The execution object for resolving input paths.
428
+ Returns:
429
+ Command-line arguments.
430
+ """
431
+ cargs = []
432
+ cargs.append("hsvs")
433
+ cargs.append(execution.input_file(params.get("input")))
434
+ cargs.append(params.get("output"))
435
+ if params.get("template") is not None:
436
+ cargs.extend([
437
+ "-template",
438
+ execution.input_file(params.get("template"))
439
+ ])
440
+ if params.get("hippocampi") is not None:
441
+ cargs.extend([
442
+ "-hippocampi",
443
+ params.get("hippocampi")
444
+ ])
445
+ if params.get("thalami") is not None:
446
+ cargs.extend([
447
+ "-thalami",
448
+ params.get("thalami")
449
+ ])
450
+ if params.get("white_stem"):
451
+ cargs.append("-white_stem")
452
+ return cargs
453
+
454
+
455
+ def v_5ttgen_hsvs_outputs(
456
+ params: V5ttgenHsvsParameters,
457
+ execution: Execution,
458
+ ) -> V5ttgenHsvsOutputs:
459
+ """
460
+ Build outputs object containing output file paths and possibly stdout/stderr.
461
+
462
+ Args:
463
+ params: The parameters.
464
+ execution: The execution object for resolving input paths.
465
+ Returns:
466
+ Outputs object.
467
+ """
468
+ ret = V5ttgenHsvsOutputs(
469
+ root=execution.output_file("."),
470
+ output=execution.output_file(params.get("output")),
471
+ )
472
+ return ret
473
+
474
+
475
+ def v_5ttgen_config_params(
476
+ key: str,
477
+ value: str,
478
+ ) -> V5ttgenConfigParameters:
479
+ """
480
+ Build parameters.
481
+
482
+ Args:
483
+ key: temporarily set the value of an MRtrix config file entry.
484
+ value: temporarily set the value of an MRtrix config file entry.
485
+ Returns:
486
+ Parameter dictionary
487
+ """
488
+ params = {
489
+ "__STYXTYPE__": "config",
490
+ "key": key,
491
+ "value": value,
492
+ }
493
+ return params
494
+
495
+
496
+ def v_5ttgen_config_cargs(
497
+ params: V5ttgenConfigParameters,
498
+ execution: Execution,
499
+ ) -> list[str]:
500
+ """
501
+ Build command-line arguments from parameters.
502
+
503
+ Args:
504
+ params: The parameters.
505
+ execution: The execution object for resolving input paths.
506
+ Returns:
507
+ Command-line arguments.
508
+ """
509
+ cargs = []
510
+ cargs.append("-config")
511
+ cargs.append(params.get("key"))
512
+ cargs.append(params.get("value"))
513
+ return cargs
514
+
515
+
516
+ class V5ttgenOutputs(typing.NamedTuple):
517
+ """
518
+ Output object returned when calling `v_5ttgen(...)`.
519
+ """
520
+ root: OutputPathType
521
+ """Output root folder. This is the root folder for all outputs."""
522
+ algorithm: typing.Union[V5ttgenFreesurferOutputs, V5ttgenFslOutputs, V5ttgenGifOutputs, V5ttgenHsvsOutputs]
523
+ """Outputs from `V5ttgenFreesurferParameters` or `V5ttgenFslParameters` or
524
+ `V5ttgenGifParameters` or `V5ttgenHsvsParameters`."""
525
+
526
+
527
+ def v_5ttgen_params(
528
+ algorithm: typing.Union[V5ttgenFreesurferParameters, V5ttgenFslParameters, V5ttgenGifParameters, V5ttgenHsvsParameters],
529
+ nocrop: bool = False,
530
+ sgm_amyg_hipp: bool = False,
531
+ nocleanup: bool = False,
532
+ scratch: str | None = None,
533
+ continue_: str | None = None,
534
+ info: bool = False,
535
+ quiet: bool = False,
536
+ debug: bool = False,
537
+ force: bool = False,
538
+ nthreads: int | None = None,
539
+ config: list[V5ttgenConfigParameters] | None = None,
540
+ help_: bool = False,
541
+ version: bool = False,
542
+ ) -> V5ttgenParameters:
543
+ """
544
+ Build parameters.
545
+
546
+ Args:
547
+ algorithm: Select the algorithm to be used to complete the script\
548
+ operation; additional details and options become available once an\
549
+ algorithm is nominated. Options are: freesurfer, fsl, gif, hsvs.
550
+ nocrop: Do NOT crop the resulting 5TT image to reduce its size (keep\
551
+ the same dimensions as the input image).
552
+ sgm_amyg_hipp: Represent the amygdalae and hippocampi as sub-cortical\
553
+ grey matter in the 5TT image.
554
+ nocleanup: do not delete intermediate files during script execution,\
555
+ and do not delete scratch directory at script completion.
556
+ scratch: manually specify the path in which to generate the scratch\
557
+ directory.
558
+ continue_: continue the script from a previous execution; must provide\
559
+ the scratch directory path, and the name of the last\
560
+ successfully-generated file.
561
+ info: display information messages.
562
+ quiet: do not display information messages or progress status;\
563
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
564
+ environment variable to a non-empty string.
565
+ debug: display debugging messages.
566
+ force: force overwrite of output files (caution: using the same file as\
567
+ input and output might cause unexpected behaviour).
568
+ nthreads: use this number of threads in multi-threaded applications\
569
+ (set to 0 to disable multi-threading).
570
+ config: temporarily set the value of an MRtrix config file entry.
571
+ help_: display this information page and exit.
572
+ version: display version information and exit.
573
+ Returns:
574
+ Parameter dictionary
575
+ """
576
+ params = {
577
+ "__STYXTYPE__": "5ttgen",
578
+ "algorithm": algorithm,
579
+ "nocrop": nocrop,
580
+ "sgm_amyg_hipp": sgm_amyg_hipp,
581
+ "nocleanup": nocleanup,
582
+ "info": info,
583
+ "quiet": quiet,
584
+ "debug": debug,
585
+ "force": force,
586
+ "help": help_,
587
+ "version": version,
588
+ }
589
+ if scratch is not None:
590
+ params["scratch"] = scratch
591
+ if continue_ is not None:
592
+ params["continue"] = continue_
593
+ if nthreads is not None:
594
+ params["nthreads"] = nthreads
595
+ if config is not None:
596
+ params["config"] = config
597
+ return params
598
+
599
+
600
+ def v_5ttgen_cargs(
601
+ params: V5ttgenParameters,
602
+ execution: Execution,
603
+ ) -> list[str]:
604
+ """
605
+ Build command-line arguments from parameters.
606
+
607
+ Args:
608
+ params: The parameters.
609
+ execution: The execution object for resolving input paths.
610
+ Returns:
611
+ Command-line arguments.
612
+ """
613
+ cargs = []
614
+ cargs.append("5ttgen")
615
+ cargs.extend(dyn_cargs(params.get("algorithm")["__STYXTYPE__"])(params.get("algorithm"), execution))
616
+ if params.get("nocrop"):
617
+ cargs.append("-nocrop")
618
+ if params.get("sgm_amyg_hipp"):
619
+ cargs.append("-sgm_amyg_hipp")
620
+ if params.get("nocleanup"):
621
+ cargs.append("-nocleanup")
622
+ if params.get("scratch") is not None:
623
+ cargs.extend([
624
+ "-scratch",
625
+ params.get("scratch")
626
+ ])
627
+ if params.get("continue") is not None:
628
+ cargs.extend([
629
+ "-continue",
630
+ params.get("continue")
631
+ ])
632
+ if params.get("info"):
633
+ cargs.append("-info")
634
+ if params.get("quiet"):
635
+ cargs.append("-quiet")
636
+ if params.get("debug"):
637
+ cargs.append("-debug")
638
+ if params.get("force"):
639
+ cargs.append("-force")
640
+ if params.get("nthreads") is not None:
641
+ cargs.extend([
642
+ "-nthreads",
643
+ str(params.get("nthreads"))
644
+ ])
645
+ if params.get("config") is not None:
646
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
647
+ if params.get("help"):
648
+ cargs.append("-help")
649
+ if params.get("version"):
650
+ cargs.append("-version")
651
+ return cargs
652
+
653
+
654
+ def v_5ttgen_outputs(
655
+ params: V5ttgenParameters,
656
+ execution: Execution,
657
+ ) -> V5ttgenOutputs:
658
+ """
659
+ Build outputs object containing output file paths and possibly stdout/stderr.
660
+
661
+ Args:
662
+ params: The parameters.
663
+ execution: The execution object for resolving input paths.
664
+ Returns:
665
+ Outputs object.
666
+ """
667
+ ret = V5ttgenOutputs(
668
+ root=execution.output_file("."),
669
+ algorithm=dyn_outputs(params.get("algorithm")["__STYXTYPE__"])(params.get("algorithm"), execution),
670
+ )
671
+ return ret
672
+
673
+
674
+ def v_5ttgen_execute(
675
+ params: V5ttgenParameters,
676
+ execution: Execution,
677
+ ) -> V5ttgenOutputs:
678
+ """
679
+ Generate a 5TT image suitable for ACT.
680
+
681
+ 5ttgen acts as a 'master' script for generating a five-tissue-type (5TT)
682
+ segmented tissue image suitable for use in Anatomically-Constrained
683
+ Tractography (ACT). A range of different algorithms are available for
684
+ completing this task. When using this script, the name of the algorithm to
685
+ be used must appear as the first argument on the command-line after
686
+ '5ttgen'. The subsequent compulsory arguments and options available depend
687
+ on the particular algorithm being invoked.
688
+ Each algorithm available also has its own help page, including necessary
689
+ references; e.g. to see the help page of the 'fsl' algorithm, type '5ttgen
690
+ fsl'.
691
+
692
+ Author: MRTrix3 Developers
693
+
694
+ URL: https://www.mrtrix.org/
695
+
696
+ Args:
697
+ params: The parameters.
698
+ execution: The execution object.
699
+ Returns:
700
+ NamedTuple of outputs (described in `V5ttgenOutputs`).
701
+ """
702
+ params = execution.params(params)
703
+ cargs = v_5ttgen_cargs(params, execution)
704
+ ret = v_5ttgen_outputs(params, execution)
705
+ execution.run(cargs)
706
+ return ret
707
+
708
+
709
+ def v_5ttgen(
710
+ algorithm: typing.Union[V5ttgenFreesurferParameters, V5ttgenFslParameters, V5ttgenGifParameters, V5ttgenHsvsParameters],
711
+ nocrop: bool = False,
712
+ sgm_amyg_hipp: bool = False,
713
+ nocleanup: bool = False,
714
+ scratch: str | None = None,
715
+ continue_: str | None = None,
716
+ info: bool = False,
717
+ quiet: bool = False,
718
+ debug: bool = False,
719
+ force: bool = False,
720
+ nthreads: int | None = None,
721
+ config: list[V5ttgenConfigParameters] | None = None,
722
+ help_: bool = False,
723
+ version: bool = False,
724
+ runner: Runner | None = None,
725
+ ) -> V5ttgenOutputs:
726
+ """
727
+ Generate a 5TT image suitable for ACT.
728
+
729
+ 5ttgen acts as a 'master' script for generating a five-tissue-type (5TT)
730
+ segmented tissue image suitable for use in Anatomically-Constrained
731
+ Tractography (ACT). A range of different algorithms are available for
732
+ completing this task. When using this script, the name of the algorithm to
733
+ be used must appear as the first argument on the command-line after
734
+ '5ttgen'. The subsequent compulsory arguments and options available depend
735
+ on the particular algorithm being invoked.
736
+ Each algorithm available also has its own help page, including necessary
737
+ references; e.g. to see the help page of the 'fsl' algorithm, type '5ttgen
738
+ fsl'.
739
+
740
+ Author: MRTrix3 Developers
741
+
742
+ URL: https://www.mrtrix.org/
743
+
744
+ Args:
745
+ algorithm: Select the algorithm to be used to complete the script\
746
+ operation; additional details and options become available once an\
747
+ algorithm is nominated. Options are: freesurfer, fsl, gif, hsvs.
748
+ nocrop: Do NOT crop the resulting 5TT image to reduce its size (keep\
749
+ the same dimensions as the input image).
750
+ sgm_amyg_hipp: Represent the amygdalae and hippocampi as sub-cortical\
751
+ grey matter in the 5TT image.
752
+ nocleanup: do not delete intermediate files during script execution,\
753
+ and do not delete scratch directory at script completion.
754
+ scratch: manually specify the path in which to generate the scratch\
755
+ directory.
756
+ continue_: continue the script from a previous execution; must provide\
757
+ the scratch directory path, and the name of the last\
758
+ successfully-generated file.
759
+ info: display information messages.
760
+ quiet: do not display information messages or progress status;\
761
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
762
+ environment variable to a non-empty string.
763
+ debug: display debugging messages.
764
+ force: force overwrite of output files (caution: using the same file as\
765
+ input and output might cause unexpected behaviour).
766
+ nthreads: use this number of threads in multi-threaded applications\
767
+ (set to 0 to disable multi-threading).
768
+ config: temporarily set the value of an MRtrix config file entry.
769
+ help_: display this information page and exit.
770
+ version: display version information and exit.
771
+ runner: Command runner.
772
+ Returns:
773
+ NamedTuple of outputs (described in `V5ttgenOutputs`).
774
+ """
775
+ runner = runner or get_global_runner()
776
+ execution = runner.start_execution(V_5TTGEN_METADATA)
777
+ params = v_5ttgen_params(
778
+ algorithm=algorithm,
779
+ nocrop=nocrop,
780
+ sgm_amyg_hipp=sgm_amyg_hipp,
781
+ nocleanup=nocleanup,
782
+ scratch=scratch,
783
+ continue_=continue_,
784
+ info=info,
785
+ quiet=quiet,
786
+ debug=debug,
787
+ force=force,
788
+ nthreads=nthreads,
789
+ config=config,
790
+ help_=help_,
791
+ version=version,
792
+ )
793
+ return v_5ttgen_execute(params, execution)
794
+
795
+
796
+ __all__ = [
797
+ "V5ttgenConfigParameters",
798
+ "V5ttgenFreesurferOutputs",
799
+ "V5ttgenFreesurferParameters",
800
+ "V5ttgenFslOutputs",
801
+ "V5ttgenFslParameters",
802
+ "V5ttgenGifOutputs",
803
+ "V5ttgenGifParameters",
804
+ "V5ttgenHsvsOutputs",
805
+ "V5ttgenHsvsParameters",
806
+ "V5ttgenOutputs",
807
+ "V5ttgenParameters",
808
+ "V_5TTGEN_METADATA",
809
+ "v_5ttgen",
810
+ "v_5ttgen_config_params",
811
+ "v_5ttgen_freesurfer_params",
812
+ "v_5ttgen_fsl_params",
813
+ "v_5ttgen_gif_params",
814
+ "v_5ttgen_hsvs_params",
815
+ "v_5ttgen_params",
816
+ ]