niwrap-mrtrix 0.8.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.
Files changed (119) hide show
  1. niwrap_mrtrix/mrtrix/__init__.py +263 -0
  2. niwrap_mrtrix/mrtrix/afdconnectivity.py +527 -0
  3. niwrap_mrtrix/mrtrix/amp2response.py +560 -0
  4. niwrap_mrtrix/mrtrix/amp2sh.py +870 -0
  5. niwrap_mrtrix/mrtrix/connectome2tck.py +583 -0
  6. niwrap_mrtrix/mrtrix/connectomeedit.py +413 -0
  7. niwrap_mrtrix/mrtrix/connectomestats.py +956 -0
  8. niwrap_mrtrix/mrtrix/dcmedit.py +552 -0
  9. niwrap_mrtrix/mrtrix/dcminfo.py +529 -0
  10. niwrap_mrtrix/mrtrix/dirflip.py +440 -0
  11. niwrap_mrtrix/mrtrix/dirgen.py +514 -0
  12. niwrap_mrtrix/mrtrix/dirmerge.py +446 -0
  13. niwrap_mrtrix/mrtrix/dirorder.py +421 -0
  14. niwrap_mrtrix/mrtrix/dirsplit.py +436 -0
  15. niwrap_mrtrix/mrtrix/dirstat.py +640 -0
  16. niwrap_mrtrix/mrtrix/dwi2adc.py +531 -0
  17. niwrap_mrtrix/mrtrix/dwi2fod.py +1156 -0
  18. niwrap_mrtrix/mrtrix/dwi2mask.py +570 -0
  19. niwrap_mrtrix/mrtrix/dwi2response.py +1774 -0
  20. niwrap_mrtrix/mrtrix/dwi2tensor.py +715 -0
  21. niwrap_mrtrix/mrtrix/dwibiascorrect.py +673 -0
  22. niwrap_mrtrix/mrtrix/dwidenoise.py +570 -0
  23. niwrap_mrtrix/mrtrix/dwiextract.py +1111 -0
  24. niwrap_mrtrix/mrtrix/dwigradcheck.py +665 -0
  25. niwrap_mrtrix/mrtrix/fixel2peaks.py +613 -0
  26. niwrap_mrtrix/mrtrix/fixel2sh.py +430 -0
  27. niwrap_mrtrix/mrtrix/fixel2tsf.py +435 -0
  28. niwrap_mrtrix/mrtrix/fixel2voxel.py +523 -0
  29. niwrap_mrtrix/mrtrix/fixelcfestats.py +1179 -0
  30. niwrap_mrtrix/mrtrix/fixelconnectivity.py +477 -0
  31. niwrap_mrtrix/mrtrix/fixelconvert.py +850 -0
  32. niwrap_mrtrix/mrtrix/fixelcorrespondence.py +455 -0
  33. niwrap_mrtrix/mrtrix/fixelcrop.py +422 -0
  34. niwrap_mrtrix/mrtrix/fixelfilter.py +882 -0
  35. niwrap_mrtrix/mrtrix/fixelreorient.py +435 -0
  36. niwrap_mrtrix/mrtrix/fod2dec.py +571 -0
  37. niwrap_mrtrix/mrtrix/fod2fixel.py +646 -0
  38. niwrap_mrtrix/mrtrix/label2colour.py +426 -0
  39. niwrap_mrtrix/mrtrix/label2mesh.py +417 -0
  40. niwrap_mrtrix/mrtrix/labelconvert.py +460 -0
  41. niwrap_mrtrix/mrtrix/labelstats.py +418 -0
  42. niwrap_mrtrix/mrtrix/maskdump.py +404 -0
  43. niwrap_mrtrix/mrtrix/maskfilter.py +730 -0
  44. niwrap_mrtrix/mrtrix/mesh2voxel.py +422 -0
  45. niwrap_mrtrix/mrtrix/meshconvert.py +514 -0
  46. niwrap_mrtrix/mrtrix/meshfilter.py +452 -0
  47. niwrap_mrtrix/mrtrix/mraverageheader.py +485 -0
  48. niwrap_mrtrix/mrtrix/mrcalc.py +4302 -0
  49. niwrap_mrtrix/mrtrix/mrcat.py +467 -0
  50. niwrap_mrtrix/mrtrix/mrcentroid.py +418 -0
  51. niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +446 -0
  52. niwrap_mrtrix/mrtrix/mrclusterstats.py +930 -0
  53. niwrap_mrtrix/mrtrix/mrcolour.py +490 -0
  54. niwrap_mrtrix/mrtrix/mrconvert.py +1967 -0
  55. niwrap_mrtrix/mrtrix/mrdegibbs.py +535 -0
  56. niwrap_mrtrix/mrtrix/mrdump.py +423 -0
  57. niwrap_mrtrix/mrtrix/mredit.py +737 -0
  58. niwrap_mrtrix/mrtrix/mrfilter.py +971 -0
  59. niwrap_mrtrix/mrtrix/mrgrid.py +1079 -0
  60. niwrap_mrtrix/mrtrix/mrhistmatch.py +494 -0
  61. niwrap_mrtrix/mrtrix/mrhistogram.py +484 -0
  62. niwrap_mrtrix/mrtrix/mrinfo.py +1282 -0
  63. niwrap_mrtrix/mrtrix/mrmath.py +503 -0
  64. niwrap_mrtrix/mrtrix/mrmetric.py +525 -0
  65. niwrap_mrtrix/mrtrix/mrregister.py +2098 -0
  66. niwrap_mrtrix/mrtrix/mrstats.py +534 -0
  67. niwrap_mrtrix/mrtrix/mrthreshold.py +666 -0
  68. niwrap_mrtrix/mrtrix/mrtransform.py +1372 -0
  69. niwrap_mrtrix/mrtrix/mtnormalise.py +725 -0
  70. niwrap_mrtrix/mrtrix/peaks2amp.py +403 -0
  71. niwrap_mrtrix/mrtrix/peaks2fixel.py +422 -0
  72. niwrap_mrtrix/mrtrix/responsemean.py +385 -0
  73. niwrap_mrtrix/mrtrix/sh2amp.py +844 -0
  74. niwrap_mrtrix/mrtrix/sh2peaks.py +632 -0
  75. niwrap_mrtrix/mrtrix/sh2power.py +427 -0
  76. niwrap_mrtrix/mrtrix/sh2response.py +481 -0
  77. niwrap_mrtrix/mrtrix/shbasis.py +445 -0
  78. niwrap_mrtrix/mrtrix/shconv.py +661 -0
  79. niwrap_mrtrix/mrtrix/tck2connectome.py +727 -0
  80. niwrap_mrtrix/mrtrix/tck2fixel.py +447 -0
  81. niwrap_mrtrix/mrtrix/tckconvert.py +775 -0
  82. niwrap_mrtrix/mrtrix/tckdfc.py +684 -0
  83. niwrap_mrtrix/mrtrix/tckedit.py +1478 -0
  84. niwrap_mrtrix/mrtrix/tckgen.py +2733 -0
  85. niwrap_mrtrix/mrtrix/tckglobal.py +944 -0
  86. niwrap_mrtrix/mrtrix/tckinfo.py +402 -0
  87. niwrap_mrtrix/mrtrix/tckmap.py +1004 -0
  88. niwrap_mrtrix/mrtrix/tckresample.py +760 -0
  89. niwrap_mrtrix/mrtrix/tcksample.py +497 -0
  90. niwrap_mrtrix/mrtrix/tcksift.py +739 -0
  91. niwrap_mrtrix/mrtrix/tcksift2.py +902 -0
  92. niwrap_mrtrix/mrtrix/tckstats.py +550 -0
  93. niwrap_mrtrix/mrtrix/tcktransform.py +414 -0
  94. niwrap_mrtrix/mrtrix/tensor2metric.py +659 -0
  95. niwrap_mrtrix/mrtrix/transformcalc.py +421 -0
  96. niwrap_mrtrix/mrtrix/transformcompose.py +625 -0
  97. niwrap_mrtrix/mrtrix/transformconvert.py +423 -0
  98. niwrap_mrtrix/mrtrix/tsfdivide.py +414 -0
  99. niwrap_mrtrix/mrtrix/tsfinfo.py +421 -0
  100. niwrap_mrtrix/mrtrix/tsfmult.py +401 -0
  101. niwrap_mrtrix/mrtrix/tsfsmooth.py +420 -0
  102. niwrap_mrtrix/mrtrix/tsfthreshold.py +428 -0
  103. niwrap_mrtrix/mrtrix/tsfvalidate.py +398 -0
  104. niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +432 -0
  105. niwrap_mrtrix/mrtrix/v_5tt2vis.py +505 -0
  106. niwrap_mrtrix/mrtrix/v_5ttcheck.py +409 -0
  107. niwrap_mrtrix/mrtrix/v_5ttedit.py +513 -0
  108. niwrap_mrtrix/mrtrix/v_5ttgen.py +1107 -0
  109. niwrap_mrtrix/mrtrix/vectorstats.py +736 -0
  110. niwrap_mrtrix/mrtrix/voxel2fixel.py +430 -0
  111. niwrap_mrtrix/mrtrix/voxel2mesh.py +454 -0
  112. niwrap_mrtrix/mrtrix/warp2metric.py +556 -0
  113. niwrap_mrtrix/mrtrix/warpconvert.py +498 -0
  114. niwrap_mrtrix/mrtrix/warpcorrect.py +448 -0
  115. niwrap_mrtrix/mrtrix/warpinit.py +425 -0
  116. niwrap_mrtrix/mrtrix/warpinvert.py +448 -0
  117. niwrap_mrtrix-0.8.0.dist-info/METADATA +8 -0
  118. niwrap_mrtrix-0.8.0.dist-info/RECORD +119 -0
  119. niwrap_mrtrix-0.8.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,1107 @@
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="213c8cb30d8d1a68c488abbf08a42cf6809dc622.boutiques",
10
+ name="5ttgen",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _V5ttgenFreesurferParamsDictNoTag = typing.TypedDict('_V5ttgenFreesurferParamsDictNoTag', {
17
+ "input": InputPathType,
18
+ "output": str,
19
+ "lut": typing.NotRequired[InputPathType | None],
20
+ })
21
+ V5ttgenFreesurferParamsDictTagged = typing.TypedDict('V5ttgenFreesurferParamsDictTagged', {
22
+ "@type": typing.Literal["freesurfer"],
23
+ "input": InputPathType,
24
+ "output": str,
25
+ "lut": typing.NotRequired[InputPathType | None],
26
+ })
27
+ V5ttgenFreesurferParamsDict = _V5ttgenFreesurferParamsDictNoTag | V5ttgenFreesurferParamsDictTagged
28
+
29
+
30
+ _V5ttgenFslParamsDictNoTag = typing.TypedDict('_V5ttgenFslParamsDictNoTag', {
31
+ "input": InputPathType,
32
+ "output": str,
33
+ "t2": typing.NotRequired[InputPathType | None],
34
+ "mask": typing.NotRequired[InputPathType | None],
35
+ "premasked": bool,
36
+ })
37
+ V5ttgenFslParamsDictTagged = typing.TypedDict('V5ttgenFslParamsDictTagged', {
38
+ "@type": typing.Literal["fsl"],
39
+ "input": InputPathType,
40
+ "output": str,
41
+ "t2": typing.NotRequired[InputPathType | None],
42
+ "mask": typing.NotRequired[InputPathType | None],
43
+ "premasked": bool,
44
+ })
45
+ V5ttgenFslParamsDict = _V5ttgenFslParamsDictNoTag | V5ttgenFslParamsDictTagged
46
+
47
+
48
+ _V5ttgenGifParamsDictNoTag = typing.TypedDict('_V5ttgenGifParamsDictNoTag', {
49
+ "input": InputPathType,
50
+ "output": str,
51
+ })
52
+ V5ttgenGifParamsDictTagged = typing.TypedDict('V5ttgenGifParamsDictTagged', {
53
+ "@type": typing.Literal["gif"],
54
+ "input": InputPathType,
55
+ "output": str,
56
+ })
57
+ V5ttgenGifParamsDict = _V5ttgenGifParamsDictNoTag | V5ttgenGifParamsDictTagged
58
+
59
+
60
+ _V5ttgenHsvsParamsDictNoTag = typing.TypedDict('_V5ttgenHsvsParamsDictNoTag', {
61
+ "input": InputPathType,
62
+ "output": str,
63
+ "template": typing.NotRequired[InputPathType | None],
64
+ "hippocampi": typing.NotRequired[typing.Literal["subfields", "first", "aseg"] | None],
65
+ "thalami": typing.NotRequired[typing.Literal["nuclei", "first", "aseg"] | None],
66
+ "white_stem": bool,
67
+ })
68
+ V5ttgenHsvsParamsDictTagged = typing.TypedDict('V5ttgenHsvsParamsDictTagged', {
69
+ "@type": typing.Literal["hsvs"],
70
+ "input": InputPathType,
71
+ "output": str,
72
+ "template": typing.NotRequired[InputPathType | None],
73
+ "hippocampi": typing.NotRequired[typing.Literal["subfields", "first", "aseg"] | None],
74
+ "thalami": typing.NotRequired[typing.Literal["nuclei", "first", "aseg"] | None],
75
+ "white_stem": bool,
76
+ })
77
+ V5ttgenHsvsParamsDict = _V5ttgenHsvsParamsDictNoTag | V5ttgenHsvsParamsDictTagged
78
+
79
+
80
+ _V5ttgenConfigParamsDictNoTag = typing.TypedDict('_V5ttgenConfigParamsDictNoTag', {
81
+ "key": str,
82
+ "value": str,
83
+ })
84
+ V5ttgenConfigParamsDictTagged = typing.TypedDict('V5ttgenConfigParamsDictTagged', {
85
+ "@type": typing.Literal["config"],
86
+ "key": str,
87
+ "value": str,
88
+ })
89
+ V5ttgenConfigParamsDict = _V5ttgenConfigParamsDictNoTag | V5ttgenConfigParamsDictTagged
90
+
91
+
92
+ _V5ttgenParamsDictNoTag = typing.TypedDict('_V5ttgenParamsDictNoTag', {
93
+ "algorithm": typing.Union[V5ttgenFreesurferParamsDictTagged, V5ttgenFslParamsDictTagged, V5ttgenGifParamsDictTagged, V5ttgenHsvsParamsDictTagged],
94
+ "nocrop": bool,
95
+ "sgm_amyg_hipp": bool,
96
+ "nocleanup": bool,
97
+ "scratch": typing.NotRequired[str | None],
98
+ "continue": typing.NotRequired[str | None],
99
+ "info": bool,
100
+ "quiet": bool,
101
+ "debug": bool,
102
+ "force": bool,
103
+ "nthreads": typing.NotRequired[int | None],
104
+ "config": typing.NotRequired[list[V5ttgenConfigParamsDict] | None],
105
+ "help": bool,
106
+ "version": bool,
107
+ })
108
+ V5ttgenParamsDictTagged = typing.TypedDict('V5ttgenParamsDictTagged', {
109
+ "@type": typing.Literal["mrtrix/5ttgen"],
110
+ "algorithm": typing.Union[V5ttgenFreesurferParamsDictTagged, V5ttgenFslParamsDictTagged, V5ttgenGifParamsDictTagged, V5ttgenHsvsParamsDictTagged],
111
+ "nocrop": bool,
112
+ "sgm_amyg_hipp": bool,
113
+ "nocleanup": bool,
114
+ "scratch": typing.NotRequired[str | None],
115
+ "continue": typing.NotRequired[str | None],
116
+ "info": bool,
117
+ "quiet": bool,
118
+ "debug": bool,
119
+ "force": bool,
120
+ "nthreads": typing.NotRequired[int | None],
121
+ "config": typing.NotRequired[list[V5ttgenConfigParamsDict] | None],
122
+ "help": bool,
123
+ "version": bool,
124
+ })
125
+ V5ttgenParamsDict = _V5ttgenParamsDictNoTag | V5ttgenParamsDictTagged
126
+
127
+
128
+ def v_5ttgen_algorithm_cargs_dyn_fn(
129
+ t: str,
130
+ ) -> typing.Any:
131
+ """
132
+ Get build cargs function by command type.
133
+
134
+ Args:
135
+ t: Command type.
136
+ Returns:
137
+ Build cargs function.
138
+ """
139
+ return {
140
+ "freesurfer": v_5ttgen_freesurfer_cargs,
141
+ "fsl": v_5ttgen_fsl_cargs,
142
+ "gif": v_5ttgen_gif_cargs,
143
+ "hsvs": v_5ttgen_hsvs_cargs,
144
+ }.get(t)
145
+
146
+
147
+ def v_5ttgen_algorithm_outputs_dyn_fn(
148
+ t: str,
149
+ ) -> typing.Any:
150
+ """
151
+ Get build outputs function by command type.
152
+
153
+ Args:
154
+ t: Command type.
155
+ Returns:
156
+ Build outputs function.
157
+ """
158
+ return {
159
+ "freesurfer": v_5ttgen_freesurfer_outputs,
160
+ "fsl": v_5ttgen_fsl_outputs,
161
+ "gif": v_5ttgen_gif_outputs,
162
+ "hsvs": v_5ttgen_hsvs_outputs,
163
+ }.get(t)
164
+
165
+
166
+ def v_5ttgen_algorithm_validate_dyn_fn(
167
+ t: str,
168
+ ) -> typing.Any:
169
+ """
170
+ Get validate params function by command type.
171
+
172
+ Args:
173
+ t: Command type.
174
+ Returns:
175
+ Validate params function.
176
+ """
177
+ return {
178
+ "freesurfer": v_5ttgen_freesurfer_validate,
179
+ "fsl": v_5ttgen_fsl_validate,
180
+ "gif": v_5ttgen_gif_validate,
181
+ "hsvs": v_5ttgen_hsvs_validate,
182
+ }.get(t)
183
+
184
+
185
+ class V5ttgenFreesurferOutputs(typing.NamedTuple):
186
+ """
187
+ Output object returned when calling `V5ttgenFreesurferParamsDict(...)`.
188
+ """
189
+ root: OutputPathType
190
+ """Output root folder. This is the root folder for all outputs."""
191
+ output: OutputPathType
192
+ """The output 5TT image"""
193
+
194
+
195
+ def v_5ttgen_freesurfer(
196
+ input_: InputPathType,
197
+ output: str,
198
+ lut: InputPathType | None = None,
199
+ ) -> V5ttgenFreesurferParamsDictTagged:
200
+ """
201
+ Build parameters.
202
+
203
+ Args:
204
+ input_: The input FreeSurfer parcellation image (any image containing\
205
+ 'aseg' in its name).
206
+ output: The output 5TT image.
207
+ lut: Manually provide path to the lookup table on which the input\
208
+ parcellation image is based (e.g. FreeSurferColorLUT.txt).
209
+ Returns:
210
+ Parameter dictionary
211
+ """
212
+ params = {
213
+ "@type": "freesurfer",
214
+ "input": input_,
215
+ "output": output,
216
+ }
217
+ if lut is not None:
218
+ params["lut"] = lut
219
+ return params
220
+
221
+
222
+ def v_5ttgen_freesurfer_validate(
223
+ params: typing.Any,
224
+ ) -> None:
225
+ """
226
+ Validate parameters. Throws an error if `params` is not a valid
227
+ `V5ttgenFreesurferParamsDict` object.
228
+
229
+ Args:
230
+ params: The parameters object to validate.
231
+ """
232
+ if params is None or not isinstance(params, dict):
233
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
234
+ if params.get("input", None) is None:
235
+ raise StyxValidationError("`input` must not be None")
236
+ if not isinstance(params["input"], (pathlib.Path, str)):
237
+ raise StyxValidationError(f'`input` has the wrong type: Received `{type(params.get("input", None))}` expected `InputPathType`')
238
+ if params.get("output", None) is None:
239
+ raise StyxValidationError("`output` must not be None")
240
+ if not isinstance(params["output"], str):
241
+ raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `str`')
242
+ if params.get("lut", None) is not None:
243
+ if not isinstance(params["lut"], (pathlib.Path, str)):
244
+ raise StyxValidationError(f'`lut` has the wrong type: Received `{type(params.get("lut", None))}` expected `InputPathType | None`')
245
+
246
+
247
+ def v_5ttgen_freesurfer_cargs(
248
+ params: V5ttgenFreesurferParamsDict,
249
+ execution: Execution,
250
+ ) -> list[str]:
251
+ """
252
+ Build command-line arguments from parameters.
253
+
254
+ Args:
255
+ params: The parameters.
256
+ execution: The execution object for resolving input paths.
257
+ Returns:
258
+ Command-line arguments.
259
+ """
260
+ cargs = []
261
+ cargs.append("freesurfer")
262
+ cargs.append(execution.input_file(params.get("input", None)))
263
+ cargs.append(params.get("output", None))
264
+ if params.get("lut", None) is not None:
265
+ cargs.extend([
266
+ "-lut",
267
+ execution.input_file(params.get("lut", None))
268
+ ])
269
+ return cargs
270
+
271
+
272
+ def v_5ttgen_freesurfer_outputs(
273
+ params: V5ttgenFreesurferParamsDict,
274
+ execution: Execution,
275
+ ) -> V5ttgenFreesurferOutputs:
276
+ """
277
+ Build outputs object containing output file paths and possibly stdout/stderr.
278
+
279
+ Args:
280
+ params: The parameters.
281
+ execution: The execution object for resolving input paths.
282
+ Returns:
283
+ Outputs object.
284
+ """
285
+ ret = V5ttgenFreesurferOutputs(
286
+ root=execution.output_file("."),
287
+ output=execution.output_file(params.get("output", None)),
288
+ )
289
+ return ret
290
+
291
+
292
+ class V5ttgenFslOutputs(typing.NamedTuple):
293
+ """
294
+ Output object returned when calling `V5ttgenFslParamsDict(...)`.
295
+ """
296
+ root: OutputPathType
297
+ """Output root folder. This is the root folder for all outputs."""
298
+ output: OutputPathType
299
+ """The output 5TT image"""
300
+
301
+
302
+ def v_5ttgen_fsl(
303
+ input_: InputPathType,
304
+ output: str,
305
+ t2: InputPathType | None = None,
306
+ mask: InputPathType | None = None,
307
+ premasked: bool = False,
308
+ ) -> V5ttgenFslParamsDictTagged:
309
+ """
310
+ Build parameters.
311
+
312
+ Args:
313
+ input_: The input T1-weighted image.
314
+ output: The output 5TT image.
315
+ t2: Provide a T2-weighted image in addition to the default T1-weighted\
316
+ image; this will be used as a second input to FSL FAST.
317
+ mask: Manually provide a brain mask, rather than deriving one in the\
318
+ script.
319
+ premasked: Indicate that brain masking has already been applied to the\
320
+ input image.
321
+ Returns:
322
+ Parameter dictionary
323
+ """
324
+ params = {
325
+ "@type": "fsl",
326
+ "input": input_,
327
+ "output": output,
328
+ "premasked": premasked,
329
+ }
330
+ if t2 is not None:
331
+ params["t2"] = t2
332
+ if mask is not None:
333
+ params["mask"] = mask
334
+ return params
335
+
336
+
337
+ def v_5ttgen_fsl_validate(
338
+ params: typing.Any,
339
+ ) -> None:
340
+ """
341
+ Validate parameters. Throws an error if `params` is not a valid
342
+ `V5ttgenFslParamsDict` object.
343
+
344
+ Args:
345
+ params: The parameters object to validate.
346
+ """
347
+ if params is None or not isinstance(params, dict):
348
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
349
+ if params.get("input", None) is None:
350
+ raise StyxValidationError("`input` must not be None")
351
+ if not isinstance(params["input"], (pathlib.Path, str)):
352
+ raise StyxValidationError(f'`input` has the wrong type: Received `{type(params.get("input", None))}` expected `InputPathType`')
353
+ if params.get("output", None) is None:
354
+ raise StyxValidationError("`output` must not be None")
355
+ if not isinstance(params["output"], str):
356
+ raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `str`')
357
+ if params.get("t2", None) is not None:
358
+ if not isinstance(params["t2"], (pathlib.Path, str)):
359
+ raise StyxValidationError(f'`t2` has the wrong type: Received `{type(params.get("t2", None))}` expected `InputPathType | None`')
360
+ if params.get("mask", None) is not None:
361
+ if not isinstance(params["mask"], (pathlib.Path, str)):
362
+ raise StyxValidationError(f'`mask` has the wrong type: Received `{type(params.get("mask", None))}` expected `InputPathType | None`')
363
+ if params.get("premasked", False) is None:
364
+ raise StyxValidationError("`premasked` must not be None")
365
+ if not isinstance(params["premasked"], bool):
366
+ raise StyxValidationError(f'`premasked` has the wrong type: Received `{type(params.get("premasked", False))}` expected `bool`')
367
+
368
+
369
+ def v_5ttgen_fsl_cargs(
370
+ params: V5ttgenFslParamsDict,
371
+ execution: Execution,
372
+ ) -> list[str]:
373
+ """
374
+ Build command-line arguments from parameters.
375
+
376
+ Args:
377
+ params: The parameters.
378
+ execution: The execution object for resolving input paths.
379
+ Returns:
380
+ Command-line arguments.
381
+ """
382
+ cargs = []
383
+ cargs.append("fsl")
384
+ cargs.append(execution.input_file(params.get("input", None)))
385
+ cargs.append(params.get("output", None))
386
+ if params.get("t2", None) is not None:
387
+ cargs.extend([
388
+ "-t2",
389
+ execution.input_file(params.get("t2", None))
390
+ ])
391
+ if params.get("mask", None) is not None:
392
+ cargs.extend([
393
+ "-mask",
394
+ execution.input_file(params.get("mask", None))
395
+ ])
396
+ if params.get("premasked", False):
397
+ cargs.append("-premasked")
398
+ return cargs
399
+
400
+
401
+ def v_5ttgen_fsl_outputs(
402
+ params: V5ttgenFslParamsDict,
403
+ execution: Execution,
404
+ ) -> V5ttgenFslOutputs:
405
+ """
406
+ Build outputs object containing output file paths and possibly stdout/stderr.
407
+
408
+ Args:
409
+ params: The parameters.
410
+ execution: The execution object for resolving input paths.
411
+ Returns:
412
+ Outputs object.
413
+ """
414
+ ret = V5ttgenFslOutputs(
415
+ root=execution.output_file("."),
416
+ output=execution.output_file(params.get("output", None)),
417
+ )
418
+ return ret
419
+
420
+
421
+ class V5ttgenGifOutputs(typing.NamedTuple):
422
+ """
423
+ Output object returned when calling `V5ttgenGifParamsDict(...)`.
424
+ """
425
+ root: OutputPathType
426
+ """Output root folder. This is the root folder for all outputs."""
427
+ output: OutputPathType
428
+ """The output 5TT image"""
429
+
430
+
431
+ def v_5ttgen_gif(
432
+ input_: InputPathType,
433
+ output: str,
434
+ ) -> V5ttgenGifParamsDictTagged:
435
+ """
436
+ Build parameters.
437
+
438
+ Args:
439
+ input_: The input Geodesic Information Flow (GIF) segmentation image.
440
+ output: The output 5TT image.
441
+ Returns:
442
+ Parameter dictionary
443
+ """
444
+ params = {
445
+ "@type": "gif",
446
+ "input": input_,
447
+ "output": output,
448
+ }
449
+ return params
450
+
451
+
452
+ def v_5ttgen_gif_validate(
453
+ params: typing.Any,
454
+ ) -> None:
455
+ """
456
+ Validate parameters. Throws an error if `params` is not a valid
457
+ `V5ttgenGifParamsDict` object.
458
+
459
+ Args:
460
+ params: The parameters object to validate.
461
+ """
462
+ if params is None or not isinstance(params, dict):
463
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
464
+ if params.get("input", None) is None:
465
+ raise StyxValidationError("`input` must not be None")
466
+ if not isinstance(params["input"], (pathlib.Path, str)):
467
+ raise StyxValidationError(f'`input` has the wrong type: Received `{type(params.get("input", None))}` expected `InputPathType`')
468
+ if params.get("output", None) is None:
469
+ raise StyxValidationError("`output` must not be None")
470
+ if not isinstance(params["output"], str):
471
+ raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `str`')
472
+
473
+
474
+ def v_5ttgen_gif_cargs(
475
+ params: V5ttgenGifParamsDict,
476
+ execution: Execution,
477
+ ) -> list[str]:
478
+ """
479
+ Build command-line arguments from parameters.
480
+
481
+ Args:
482
+ params: The parameters.
483
+ execution: The execution object for resolving input paths.
484
+ Returns:
485
+ Command-line arguments.
486
+ """
487
+ cargs = []
488
+ cargs.append("gif")
489
+ cargs.append(execution.input_file(params.get("input", None)))
490
+ cargs.append(params.get("output", None))
491
+ return cargs
492
+
493
+
494
+ def v_5ttgen_gif_outputs(
495
+ params: V5ttgenGifParamsDict,
496
+ execution: Execution,
497
+ ) -> V5ttgenGifOutputs:
498
+ """
499
+ Build outputs object containing output file paths and possibly stdout/stderr.
500
+
501
+ Args:
502
+ params: The parameters.
503
+ execution: The execution object for resolving input paths.
504
+ Returns:
505
+ Outputs object.
506
+ """
507
+ ret = V5ttgenGifOutputs(
508
+ root=execution.output_file("."),
509
+ output=execution.output_file(params.get("output", None)),
510
+ )
511
+ return ret
512
+
513
+
514
+ class V5ttgenHsvsOutputs(typing.NamedTuple):
515
+ """
516
+ Output object returned when calling `V5ttgenHsvsParamsDict(...)`.
517
+ """
518
+ root: OutputPathType
519
+ """Output root folder. This is the root folder for all outputs."""
520
+ output: OutputPathType
521
+ """The output 5TT image"""
522
+
523
+
524
+ def v_5ttgen_hsvs(
525
+ input_: InputPathType,
526
+ output: str,
527
+ template: InputPathType | None = None,
528
+ hippocampi: typing.Literal["subfields", "first", "aseg"] | None = None,
529
+ thalami: typing.Literal["nuclei", "first", "aseg"] | None = None,
530
+ white_stem: bool = False,
531
+ ) -> V5ttgenHsvsParamsDictTagged:
532
+ """
533
+ Build parameters.
534
+
535
+ Args:
536
+ input_: The input FreeSurfer subject directory.
537
+ output: The output 5TT image.
538
+ template: Provide an image that will form the template for the\
539
+ generated 5TT image.
540
+ hippocampi: Select method to be used for hippocampi (& amygdalae)\
541
+ segmentation; options are: subfields,first,aseg.
542
+ thalami: Select method to be used for thalamic segmentation; options\
543
+ are: nuclei,first,aseg.
544
+ white_stem: Classify the brainstem as white matter.
545
+ Returns:
546
+ Parameter dictionary
547
+ """
548
+ params = {
549
+ "@type": "hsvs",
550
+ "input": input_,
551
+ "output": output,
552
+ "white_stem": white_stem,
553
+ }
554
+ if template is not None:
555
+ params["template"] = template
556
+ if hippocampi is not None:
557
+ params["hippocampi"] = hippocampi
558
+ if thalami is not None:
559
+ params["thalami"] = thalami
560
+ return params
561
+
562
+
563
+ def v_5ttgen_hsvs_validate(
564
+ params: typing.Any,
565
+ ) -> None:
566
+ """
567
+ Validate parameters. Throws an error if `params` is not a valid
568
+ `V5ttgenHsvsParamsDict` object.
569
+
570
+ Args:
571
+ params: The parameters object to validate.
572
+ """
573
+ if params is None or not isinstance(params, dict):
574
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
575
+ if params.get("input", None) is None:
576
+ raise StyxValidationError("`input` must not be None")
577
+ if not isinstance(params["input"], (pathlib.Path, str)):
578
+ raise StyxValidationError(f'`input` has the wrong type: Received `{type(params.get("input", None))}` expected `InputPathType`')
579
+ if params.get("output", None) is None:
580
+ raise StyxValidationError("`output` must not be None")
581
+ if not isinstance(params["output"], str):
582
+ raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `str`')
583
+ if params.get("template", None) is not None:
584
+ if not isinstance(params["template"], (pathlib.Path, str)):
585
+ raise StyxValidationError(f'`template` has the wrong type: Received `{type(params.get("template", None))}` expected `InputPathType | None`')
586
+ if params.get("hippocampi", None) is not None:
587
+ if not isinstance(params["hippocampi"], str):
588
+ raise StyxValidationError(f'`hippocampi` has the wrong type: Received `{type(params.get("hippocampi", None))}` expected `typing.Literal["subfields", "first", "aseg"] | None`')
589
+ if params["hippocampi"] not in ["subfields", "first", "aseg"]:
590
+ raise StyxValidationError("Parameter `hippocampi` must be one of [\"subfields\", \"first\", \"aseg\"]")
591
+ if params.get("thalami", None) is not None:
592
+ if not isinstance(params["thalami"], str):
593
+ raise StyxValidationError(f'`thalami` has the wrong type: Received `{type(params.get("thalami", None))}` expected `typing.Literal["nuclei", "first", "aseg"] | None`')
594
+ if params["thalami"] not in ["nuclei", "first", "aseg"]:
595
+ raise StyxValidationError("Parameter `thalami` must be one of [\"nuclei\", \"first\", \"aseg\"]")
596
+ if params.get("white_stem", False) is None:
597
+ raise StyxValidationError("`white_stem` must not be None")
598
+ if not isinstance(params["white_stem"], bool):
599
+ raise StyxValidationError(f'`white_stem` has the wrong type: Received `{type(params.get("white_stem", False))}` expected `bool`')
600
+
601
+
602
+ def v_5ttgen_hsvs_cargs(
603
+ params: V5ttgenHsvsParamsDict,
604
+ execution: Execution,
605
+ ) -> list[str]:
606
+ """
607
+ Build command-line arguments from parameters.
608
+
609
+ Args:
610
+ params: The parameters.
611
+ execution: The execution object for resolving input paths.
612
+ Returns:
613
+ Command-line arguments.
614
+ """
615
+ cargs = []
616
+ cargs.append("hsvs")
617
+ cargs.append(execution.input_file(params.get("input", None)))
618
+ cargs.append(params.get("output", None))
619
+ if params.get("template", None) is not None:
620
+ cargs.extend([
621
+ "-template",
622
+ execution.input_file(params.get("template", None))
623
+ ])
624
+ if params.get("hippocampi", None) is not None:
625
+ cargs.extend([
626
+ "-hippocampi",
627
+ params.get("hippocampi", None)
628
+ ])
629
+ if params.get("thalami", None) is not None:
630
+ cargs.extend([
631
+ "-thalami",
632
+ params.get("thalami", None)
633
+ ])
634
+ if params.get("white_stem", False):
635
+ cargs.append("-white_stem")
636
+ return cargs
637
+
638
+
639
+ def v_5ttgen_hsvs_outputs(
640
+ params: V5ttgenHsvsParamsDict,
641
+ execution: Execution,
642
+ ) -> V5ttgenHsvsOutputs:
643
+ """
644
+ Build outputs object containing output file paths and possibly stdout/stderr.
645
+
646
+ Args:
647
+ params: The parameters.
648
+ execution: The execution object for resolving input paths.
649
+ Returns:
650
+ Outputs object.
651
+ """
652
+ ret = V5ttgenHsvsOutputs(
653
+ root=execution.output_file("."),
654
+ output=execution.output_file(params.get("output", None)),
655
+ )
656
+ return ret
657
+
658
+
659
+ def v_5ttgen_config(
660
+ key: str,
661
+ value: str,
662
+ ) -> V5ttgenConfigParamsDictTagged:
663
+ """
664
+ Build parameters.
665
+
666
+ Args:
667
+ key: temporarily set the value of an MRtrix config file entry.
668
+ value: temporarily set the value of an MRtrix config file entry.
669
+ Returns:
670
+ Parameter dictionary
671
+ """
672
+ params = {
673
+ "@type": "config",
674
+ "key": key,
675
+ "value": value,
676
+ }
677
+ return params
678
+
679
+
680
+ def v_5ttgen_config_validate(
681
+ params: typing.Any,
682
+ ) -> None:
683
+ """
684
+ Validate parameters. Throws an error if `params` is not a valid
685
+ `V5ttgenConfigParamsDict` object.
686
+
687
+ Args:
688
+ params: The parameters object to validate.
689
+ """
690
+ if params is None or not isinstance(params, dict):
691
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
692
+ if params.get("key", None) is None:
693
+ raise StyxValidationError("`key` must not be None")
694
+ if not isinstance(params["key"], str):
695
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
696
+ if params.get("value", None) is None:
697
+ raise StyxValidationError("`value` must not be None")
698
+ if not isinstance(params["value"], str):
699
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
700
+
701
+
702
+ def v_5ttgen_config_cargs(
703
+ params: V5ttgenConfigParamsDict,
704
+ execution: Execution,
705
+ ) -> list[str]:
706
+ """
707
+ Build command-line arguments from parameters.
708
+
709
+ Args:
710
+ params: The parameters.
711
+ execution: The execution object for resolving input paths.
712
+ Returns:
713
+ Command-line arguments.
714
+ """
715
+ cargs = []
716
+ cargs.append("-config")
717
+ cargs.append(params.get("key", None))
718
+ cargs.append(params.get("value", None))
719
+ return cargs
720
+
721
+
722
+ class V5ttgenOutputs(typing.NamedTuple):
723
+ """
724
+ Output object returned when calling `V5ttgenParamsDict(...)`.
725
+ """
726
+ root: OutputPathType
727
+ """Output root folder. This is the root folder for all outputs."""
728
+ algorithm: typing.Union[V5ttgenFreesurferOutputs, V5ttgenFslOutputs, V5ttgenGifOutputs, V5ttgenHsvsOutputs]
729
+ """Outputs from `V5ttgenFreesurferParamsDict` or `V5ttgenFslParamsDict` or
730
+ `V5ttgenGifParamsDict` or `V5ttgenHsvsParamsDict`."""
731
+
732
+
733
+ def v_5ttgen_params(
734
+ algorithm: typing.Union[V5ttgenFreesurferParamsDictTagged, V5ttgenFslParamsDictTagged, V5ttgenGifParamsDictTagged, V5ttgenHsvsParamsDictTagged],
735
+ nocrop: bool = False,
736
+ sgm_amyg_hipp: bool = False,
737
+ nocleanup: bool = False,
738
+ scratch: str | None = None,
739
+ continue_: str | None = None,
740
+ info: bool = False,
741
+ quiet: bool = False,
742
+ debug: bool = False,
743
+ force: bool = False,
744
+ nthreads: int | None = None,
745
+ config: list[V5ttgenConfigParamsDict] | None = None,
746
+ help_: bool = False,
747
+ version: bool = False,
748
+ ) -> V5ttgenParamsDictTagged:
749
+ """
750
+ Build parameters.
751
+
752
+ Args:
753
+ algorithm: Select the algorithm to be used to complete the script\
754
+ operation; additional details and options become available once an\
755
+ algorithm is nominated. Options are: freesurfer, fsl, gif, hsvs.
756
+ nocrop: Do NOT crop the resulting 5TT image to reduce its size (keep\
757
+ the same dimensions as the input image).
758
+ sgm_amyg_hipp: Represent the amygdalae and hippocampi as sub-cortical\
759
+ grey matter in the 5TT image.
760
+ nocleanup: do not delete intermediate files during script execution,\
761
+ and do not delete scratch directory at script completion.
762
+ scratch: manually specify the path in which to generate the scratch\
763
+ directory.
764
+ continue_: continue the script from a previous execution; must provide\
765
+ the scratch directory path, and the name of the last\
766
+ successfully-generated file.
767
+ info: display information messages.
768
+ quiet: do not display information messages or progress status;\
769
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
770
+ environment variable to a non-empty string.
771
+ debug: display debugging messages.
772
+ force: force overwrite of output files (caution: using the same file as\
773
+ input and output might cause unexpected behaviour).
774
+ nthreads: use this number of threads in multi-threaded applications\
775
+ (set to 0 to disable multi-threading).
776
+ config: temporarily set the value of an MRtrix config file entry.
777
+ help_: display this information page and exit.
778
+ version: display version information and exit.
779
+ Returns:
780
+ Parameter dictionary
781
+ """
782
+ params = {
783
+ "@type": "mrtrix/5ttgen",
784
+ "algorithm": algorithm,
785
+ "nocrop": nocrop,
786
+ "sgm_amyg_hipp": sgm_amyg_hipp,
787
+ "nocleanup": nocleanup,
788
+ "info": info,
789
+ "quiet": quiet,
790
+ "debug": debug,
791
+ "force": force,
792
+ "help": help_,
793
+ "version": version,
794
+ }
795
+ if scratch is not None:
796
+ params["scratch"] = scratch
797
+ if continue_ is not None:
798
+ params["continue"] = continue_
799
+ if nthreads is not None:
800
+ params["nthreads"] = nthreads
801
+ if config is not None:
802
+ params["config"] = config
803
+ return params
804
+
805
+
806
+ def v_5ttgen_validate(
807
+ params: typing.Any,
808
+ ) -> None:
809
+ """
810
+ Validate parameters. Throws an error if `params` is not a valid
811
+ `V5ttgenParamsDict` object.
812
+
813
+ Args:
814
+ params: The parameters object to validate.
815
+ """
816
+ if params is None or not isinstance(params, dict):
817
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
818
+ if params.get("algorithm", None) is None:
819
+ raise StyxValidationError("`algorithm` must not be None")
820
+ if not isinstance(params["algorithm"], dict):
821
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params["algorithm"])}\'')
822
+ if "@type" not in params["algorithm"]:
823
+ raise StyxValidationError("Params object is missing `@type`")
824
+ if params["algorithm"]["@type"] not in ["freesurfer", "fsl", "gif", "hsvs"]:
825
+ raise StyxValidationError("Parameter `algorithm`s `@type` must be one of [\"freesurfer\", \"fsl\", \"gif\", \"hsvs\"]")
826
+ v_5ttgen_algorithm_validate_dyn_fn(params["algorithm"]["@type"])(params["algorithm"])
827
+ if params.get("nocrop", False) is None:
828
+ raise StyxValidationError("`nocrop` must not be None")
829
+ if not isinstance(params["nocrop"], bool):
830
+ raise StyxValidationError(f'`nocrop` has the wrong type: Received `{type(params.get("nocrop", False))}` expected `bool`')
831
+ if params.get("sgm_amyg_hipp", False) is None:
832
+ raise StyxValidationError("`sgm_amyg_hipp` must not be None")
833
+ if not isinstance(params["sgm_amyg_hipp"], bool):
834
+ raise StyxValidationError(f'`sgm_amyg_hipp` has the wrong type: Received `{type(params.get("sgm_amyg_hipp", False))}` expected `bool`')
835
+ if params.get("nocleanup", False) is None:
836
+ raise StyxValidationError("`nocleanup` must not be None")
837
+ if not isinstance(params["nocleanup"], bool):
838
+ raise StyxValidationError(f'`nocleanup` has the wrong type: Received `{type(params.get("nocleanup", False))}` expected `bool`')
839
+ if params.get("scratch", None) is not None:
840
+ if not isinstance(params["scratch"], str):
841
+ raise StyxValidationError(f'`scratch` has the wrong type: Received `{type(params.get("scratch", None))}` expected `str | None`')
842
+ if params.get("continue", None) is not None:
843
+ if not isinstance(params["continue"], str):
844
+ raise StyxValidationError(f'`continue` has the wrong type: Received `{type(params.get("continue", None))}` expected `str | None`')
845
+ if params.get("info", False) is None:
846
+ raise StyxValidationError("`info` must not be None")
847
+ if not isinstance(params["info"], bool):
848
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
849
+ if params.get("quiet", False) is None:
850
+ raise StyxValidationError("`quiet` must not be None")
851
+ if not isinstance(params["quiet"], bool):
852
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
853
+ if params.get("debug", False) is None:
854
+ raise StyxValidationError("`debug` must not be None")
855
+ if not isinstance(params["debug"], bool):
856
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
857
+ if params.get("force", False) is None:
858
+ raise StyxValidationError("`force` must not be None")
859
+ if not isinstance(params["force"], bool):
860
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
861
+ if params.get("nthreads", None) is not None:
862
+ if not isinstance(params["nthreads"], int):
863
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
864
+ if params.get("config", None) is not None:
865
+ if not isinstance(params["config"], list):
866
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[V5ttgenConfigParamsDict] | None`')
867
+ for e in params["config"]:
868
+ v_5ttgen_config_validate(e)
869
+ if params.get("help", False) is None:
870
+ raise StyxValidationError("`help` must not be None")
871
+ if not isinstance(params["help"], bool):
872
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
873
+ if params.get("version", False) is None:
874
+ raise StyxValidationError("`version` must not be None")
875
+ if not isinstance(params["version"], bool):
876
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
877
+
878
+
879
+ def v_5ttgen_cargs(
880
+ params: V5ttgenParamsDict,
881
+ execution: Execution,
882
+ ) -> list[str]:
883
+ """
884
+ Build command-line arguments from parameters.
885
+
886
+ Args:
887
+ params: The parameters.
888
+ execution: The execution object for resolving input paths.
889
+ Returns:
890
+ Command-line arguments.
891
+ """
892
+ cargs = []
893
+ cargs.append("5ttgen")
894
+ cargs.extend(v_5ttgen_algorithm_cargs_dyn_fn(params.get("algorithm", None)["@type"])(params.get("algorithm", None), execution))
895
+ if params.get("nocrop", False):
896
+ cargs.append("-nocrop")
897
+ if params.get("sgm_amyg_hipp", False):
898
+ cargs.append("-sgm_amyg_hipp")
899
+ if params.get("nocleanup", False):
900
+ cargs.append("-nocleanup")
901
+ if params.get("scratch", None) is not None:
902
+ cargs.extend([
903
+ "-scratch",
904
+ params.get("scratch", None)
905
+ ])
906
+ if params.get("continue", None) is not None:
907
+ cargs.extend([
908
+ "-continue",
909
+ params.get("continue", None)
910
+ ])
911
+ if params.get("info", False):
912
+ cargs.append("-info")
913
+ if params.get("quiet", False):
914
+ cargs.append("-quiet")
915
+ if params.get("debug", False):
916
+ cargs.append("-debug")
917
+ if params.get("force", False):
918
+ cargs.append("-force")
919
+ if params.get("nthreads", None) is not None:
920
+ cargs.extend([
921
+ "-nthreads",
922
+ str(params.get("nthreads", None))
923
+ ])
924
+ if params.get("config", None) is not None:
925
+ cargs.extend([a for c in [v_5ttgen_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
926
+ if params.get("help", False):
927
+ cargs.append("-help")
928
+ if params.get("version", False):
929
+ cargs.append("-version")
930
+ return cargs
931
+
932
+
933
+ def v_5ttgen_outputs(
934
+ params: V5ttgenParamsDict,
935
+ execution: Execution,
936
+ ) -> V5ttgenOutputs:
937
+ """
938
+ Build outputs object containing output file paths and possibly stdout/stderr.
939
+
940
+ Args:
941
+ params: The parameters.
942
+ execution: The execution object for resolving input paths.
943
+ Returns:
944
+ Outputs object.
945
+ """
946
+ ret = V5ttgenOutputs(
947
+ root=execution.output_file("."),
948
+ algorithm=v_5ttgen_algorithm_outputs_dyn_fn(params.get("algorithm")["@type"])(params.get("algorithm"), execution),
949
+ )
950
+ return ret
951
+
952
+
953
+ def v_5ttgen_execute(
954
+ params: V5ttgenParamsDict,
955
+ runner: Runner | None = None,
956
+ ) -> V5ttgenOutputs:
957
+ """
958
+ 5ttgen
959
+
960
+ Generate a 5TT image suitable for ACT.
961
+
962
+ 5ttgen acts as a 'master' script for generating a five-tissue-type (5TT)
963
+ segmented tissue image suitable for use in Anatomically-Constrained
964
+ Tractography (ACT). A range of different algorithms are available for
965
+ completing this task. When using this script, the name of the algorithm to
966
+ be used must appear as the first argument on the command-line after
967
+ '5ttgen'. The subsequent compulsory arguments and options available depend
968
+ on the particular algorithm being invoked.
969
+ Each algorithm available also has its own help page, including necessary
970
+ references; e.g. to see the help page of the 'fsl' algorithm, type '5ttgen
971
+ fsl'.
972
+
973
+ Author: MRTrix3 Developers
974
+
975
+ URL: https://www.mrtrix.org/
976
+
977
+ Args:
978
+ params: The parameters.
979
+ runner: Command runner.
980
+ Returns:
981
+ NamedTuple of outputs (described in `V5ttgenOutputs`).
982
+ """
983
+ v_5ttgen_validate(params)
984
+ runner = runner or get_global_runner()
985
+ execution = runner.start_execution(V_5TTGEN_METADATA)
986
+ params = execution.params(params)
987
+ cargs = v_5ttgen_cargs(params, execution)
988
+ ret = v_5ttgen_outputs(params, execution)
989
+ execution.run(cargs)
990
+ return ret
991
+
992
+
993
+ def v_5ttgen(
994
+ algorithm: typing.Union[V5ttgenFreesurferParamsDictTagged, V5ttgenFslParamsDictTagged, V5ttgenGifParamsDictTagged, V5ttgenHsvsParamsDictTagged],
995
+ nocrop: bool = False,
996
+ sgm_amyg_hipp: bool = False,
997
+ nocleanup: bool = False,
998
+ scratch: str | None = None,
999
+ continue_: str | None = None,
1000
+ info: bool = False,
1001
+ quiet: bool = False,
1002
+ debug: bool = False,
1003
+ force: bool = False,
1004
+ nthreads: int | None = None,
1005
+ config: list[V5ttgenConfigParamsDict] | None = None,
1006
+ help_: bool = False,
1007
+ version: bool = False,
1008
+ runner: Runner | None = None,
1009
+ ) -> V5ttgenOutputs:
1010
+ """
1011
+ 5ttgen
1012
+
1013
+ Generate a 5TT image suitable for ACT.
1014
+
1015
+ 5ttgen acts as a 'master' script for generating a five-tissue-type (5TT)
1016
+ segmented tissue image suitable for use in Anatomically-Constrained
1017
+ Tractography (ACT). A range of different algorithms are available for
1018
+ completing this task. When using this script, the name of the algorithm to
1019
+ be used must appear as the first argument on the command-line after
1020
+ '5ttgen'. The subsequent compulsory arguments and options available depend
1021
+ on the particular algorithm being invoked.
1022
+ Each algorithm available also has its own help page, including necessary
1023
+ references; e.g. to see the help page of the 'fsl' algorithm, type '5ttgen
1024
+ fsl'.
1025
+
1026
+ Author: MRTrix3 Developers
1027
+
1028
+ URL: https://www.mrtrix.org/
1029
+
1030
+ Args:
1031
+ algorithm: Select the algorithm to be used to complete the script\
1032
+ operation; additional details and options become available once an\
1033
+ algorithm is nominated. Options are: freesurfer, fsl, gif, hsvs.
1034
+ nocrop: Do NOT crop the resulting 5TT image to reduce its size (keep\
1035
+ the same dimensions as the input image).
1036
+ sgm_amyg_hipp: Represent the amygdalae and hippocampi as sub-cortical\
1037
+ grey matter in the 5TT image.
1038
+ nocleanup: do not delete intermediate files during script execution,\
1039
+ and do not delete scratch directory at script completion.
1040
+ scratch: manually specify the path in which to generate the scratch\
1041
+ directory.
1042
+ continue_: continue the script from a previous execution; must provide\
1043
+ the scratch directory path, and the name of the last\
1044
+ successfully-generated file.
1045
+ info: display information messages.
1046
+ quiet: do not display information messages or progress status;\
1047
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
1048
+ environment variable to a non-empty string.
1049
+ debug: display debugging messages.
1050
+ force: force overwrite of output files (caution: using the same file as\
1051
+ input and output might cause unexpected behaviour).
1052
+ nthreads: use this number of threads in multi-threaded applications\
1053
+ (set to 0 to disable multi-threading).
1054
+ config: temporarily set the value of an MRtrix config file entry.
1055
+ help_: display this information page and exit.
1056
+ version: display version information and exit.
1057
+ runner: Command runner.
1058
+ Returns:
1059
+ NamedTuple of outputs (described in `V5ttgenOutputs`).
1060
+ """
1061
+ params = v_5ttgen_params(
1062
+ algorithm=algorithm,
1063
+ nocrop=nocrop,
1064
+ sgm_amyg_hipp=sgm_amyg_hipp,
1065
+ nocleanup=nocleanup,
1066
+ scratch=scratch,
1067
+ continue_=continue_,
1068
+ info=info,
1069
+ quiet=quiet,
1070
+ debug=debug,
1071
+ force=force,
1072
+ nthreads=nthreads,
1073
+ config=config,
1074
+ help_=help_,
1075
+ version=version,
1076
+ )
1077
+ return v_5ttgen_execute(params, runner)
1078
+
1079
+
1080
+ __all__ = [
1081
+ "V5ttgenConfigParamsDict",
1082
+ "V5ttgenConfigParamsDictTagged",
1083
+ "V5ttgenFreesurferOutputs",
1084
+ "V5ttgenFreesurferParamsDict",
1085
+ "V5ttgenFreesurferParamsDictTagged",
1086
+ "V5ttgenFslOutputs",
1087
+ "V5ttgenFslParamsDict",
1088
+ "V5ttgenFslParamsDictTagged",
1089
+ "V5ttgenGifOutputs",
1090
+ "V5ttgenGifParamsDict",
1091
+ "V5ttgenGifParamsDictTagged",
1092
+ "V5ttgenHsvsOutputs",
1093
+ "V5ttgenHsvsParamsDict",
1094
+ "V5ttgenHsvsParamsDictTagged",
1095
+ "V5ttgenOutputs",
1096
+ "V5ttgenParamsDict",
1097
+ "V5ttgenParamsDictTagged",
1098
+ "V_5TTGEN_METADATA",
1099
+ "v_5ttgen",
1100
+ "v_5ttgen_config",
1101
+ "v_5ttgen_execute",
1102
+ "v_5ttgen_freesurfer",
1103
+ "v_5ttgen_fsl",
1104
+ "v_5ttgen_gif",
1105
+ "v_5ttgen_hsvs",
1106
+ "v_5ttgen_params",
1107
+ ]