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,625 @@
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
+ TRANSFORMCOMPOSE_METADATA = Metadata(
9
+ id="00dff5d1cb74f969e2ad40f5dbeaedf75a029491.boutiques",
10
+ name="transformcompose",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _TransformcomposeConfigParamsDictNoTag = typing.TypedDict('_TransformcomposeConfigParamsDictNoTag', {
17
+ "key": str,
18
+ "value": str,
19
+ })
20
+ TransformcomposeConfigParamsDictTagged = typing.TypedDict('TransformcomposeConfigParamsDictTagged', {
21
+ "@type": typing.Literal["config"],
22
+ "key": str,
23
+ "value": str,
24
+ })
25
+ TransformcomposeConfigParamsDict = _TransformcomposeConfigParamsDictNoTag | TransformcomposeConfigParamsDictTagged
26
+
27
+
28
+ _TransformcomposeVariousStringParamsDictNoTag = typing.TypedDict('_TransformcomposeVariousStringParamsDictNoTag', {
29
+ "obj": str,
30
+ })
31
+ TransformcomposeVariousStringParamsDictTagged = typing.TypedDict('TransformcomposeVariousStringParamsDictTagged', {
32
+ "@type": typing.Literal["VariousString"],
33
+ "obj": str,
34
+ })
35
+ TransformcomposeVariousStringParamsDict = _TransformcomposeVariousStringParamsDictNoTag | TransformcomposeVariousStringParamsDictTagged
36
+
37
+
38
+ _TransformcomposeVariousFileParamsDictNoTag = typing.TypedDict('_TransformcomposeVariousFileParamsDictNoTag', {
39
+ "obj": InputPathType,
40
+ })
41
+ TransformcomposeVariousFileParamsDictTagged = typing.TypedDict('TransformcomposeVariousFileParamsDictTagged', {
42
+ "@type": typing.Literal["VariousFile"],
43
+ "obj": InputPathType,
44
+ })
45
+ TransformcomposeVariousFileParamsDict = _TransformcomposeVariousFileParamsDictNoTag | TransformcomposeVariousFileParamsDictTagged
46
+
47
+
48
+ _TransformcomposeParamsDictNoTag = typing.TypedDict('_TransformcomposeParamsDictNoTag', {
49
+ "template": typing.NotRequired[InputPathType | None],
50
+ "info": bool,
51
+ "quiet": bool,
52
+ "debug": bool,
53
+ "force": bool,
54
+ "nthreads": typing.NotRequired[int | None],
55
+ "config": typing.NotRequired[list[TransformcomposeConfigParamsDict] | None],
56
+ "help": bool,
57
+ "version": bool,
58
+ "input": list[InputPathType],
59
+ "output": typing.Union[TransformcomposeVariousStringParamsDictTagged, TransformcomposeVariousFileParamsDictTagged],
60
+ })
61
+ TransformcomposeParamsDictTagged = typing.TypedDict('TransformcomposeParamsDictTagged', {
62
+ "@type": typing.Literal["mrtrix/transformcompose"],
63
+ "template": typing.NotRequired[InputPathType | None],
64
+ "info": bool,
65
+ "quiet": bool,
66
+ "debug": bool,
67
+ "force": bool,
68
+ "nthreads": typing.NotRequired[int | None],
69
+ "config": typing.NotRequired[list[TransformcomposeConfigParamsDict] | None],
70
+ "help": bool,
71
+ "version": bool,
72
+ "input": list[InputPathType],
73
+ "output": typing.Union[TransformcomposeVariousStringParamsDictTagged, TransformcomposeVariousFileParamsDictTagged],
74
+ })
75
+ TransformcomposeParamsDict = _TransformcomposeParamsDictNoTag | TransformcomposeParamsDictTagged
76
+
77
+
78
+ def transformcompose_output_cargs_dyn_fn(
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
+ "VariousString": transformcompose_various_string_cargs,
91
+ "VariousFile": transformcompose_various_file_cargs,
92
+ }.get(t)
93
+
94
+
95
+ def transformcompose_output_validate_dyn_fn(
96
+ t: str,
97
+ ) -> typing.Any:
98
+ """
99
+ Get validate params function by command type.
100
+
101
+ Args:
102
+ t: Command type.
103
+ Returns:
104
+ Validate params function.
105
+ """
106
+ return {
107
+ "VariousString": transformcompose_various_string_validate,
108
+ "VariousFile": transformcompose_various_file_validate,
109
+ }.get(t)
110
+
111
+
112
+ def transformcompose_config(
113
+ key: str,
114
+ value: str,
115
+ ) -> TransformcomposeConfigParamsDictTagged:
116
+ """
117
+ Build parameters.
118
+
119
+ Args:
120
+ key: temporarily set the value of an MRtrix config file entry.
121
+ value: temporarily set the value of an MRtrix config file entry.
122
+ Returns:
123
+ Parameter dictionary
124
+ """
125
+ params = {
126
+ "@type": "config",
127
+ "key": key,
128
+ "value": value,
129
+ }
130
+ return params
131
+
132
+
133
+ def transformcompose_config_validate(
134
+ params: typing.Any,
135
+ ) -> None:
136
+ """
137
+ Validate parameters. Throws an error if `params` is not a valid
138
+ `TransformcomposeConfigParamsDict` object.
139
+
140
+ Args:
141
+ params: The parameters object to validate.
142
+ """
143
+ if params is None or not isinstance(params, dict):
144
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
145
+ if params.get("key", None) is None:
146
+ raise StyxValidationError("`key` must not be None")
147
+ if not isinstance(params["key"], str):
148
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
149
+ if params.get("value", None) is None:
150
+ raise StyxValidationError("`value` must not be None")
151
+ if not isinstance(params["value"], str):
152
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
153
+
154
+
155
+ def transformcompose_config_cargs(
156
+ params: TransformcomposeConfigParamsDict,
157
+ execution: Execution,
158
+ ) -> list[str]:
159
+ """
160
+ Build command-line arguments from parameters.
161
+
162
+ Args:
163
+ params: The parameters.
164
+ execution: The execution object for resolving input paths.
165
+ Returns:
166
+ Command-line arguments.
167
+ """
168
+ cargs = []
169
+ cargs.append("-config")
170
+ cargs.append(params.get("key", None))
171
+ cargs.append(params.get("value", None))
172
+ return cargs
173
+
174
+
175
+ def transformcompose_various_string(
176
+ obj: str,
177
+ ) -> TransformcomposeVariousStringParamsDictTagged:
178
+ """
179
+ Build parameters.
180
+
181
+ Args:
182
+ obj: String object.
183
+ Returns:
184
+ Parameter dictionary
185
+ """
186
+ params = {
187
+ "@type": "VariousString",
188
+ "obj": obj,
189
+ }
190
+ return params
191
+
192
+
193
+ def transformcompose_various_string_validate(
194
+ params: typing.Any,
195
+ ) -> None:
196
+ """
197
+ Validate parameters. Throws an error if `params` is not a valid
198
+ `TransformcomposeVariousStringParamsDict` object.
199
+
200
+ Args:
201
+ params: The parameters object to validate.
202
+ """
203
+ if params is None or not isinstance(params, dict):
204
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
205
+ if params.get("obj", None) is None:
206
+ raise StyxValidationError("`obj` must not be None")
207
+ if not isinstance(params["obj"], str):
208
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `str`')
209
+
210
+
211
+ def transformcompose_various_string_cargs(
212
+ params: TransformcomposeVariousStringParamsDict,
213
+ execution: Execution,
214
+ ) -> list[str]:
215
+ """
216
+ Build command-line arguments from parameters.
217
+
218
+ Args:
219
+ params: The parameters.
220
+ execution: The execution object for resolving input paths.
221
+ Returns:
222
+ Command-line arguments.
223
+ """
224
+ cargs = []
225
+ cargs.append(params.get("obj", None))
226
+ return cargs
227
+
228
+
229
+ def transformcompose_various_file(
230
+ obj: InputPathType,
231
+ ) -> TransformcomposeVariousFileParamsDictTagged:
232
+ """
233
+ Build parameters.
234
+
235
+ Args:
236
+ obj: File object.
237
+ Returns:
238
+ Parameter dictionary
239
+ """
240
+ params = {
241
+ "@type": "VariousFile",
242
+ "obj": obj,
243
+ }
244
+ return params
245
+
246
+
247
+ def transformcompose_various_file_validate(
248
+ params: typing.Any,
249
+ ) -> None:
250
+ """
251
+ Validate parameters. Throws an error if `params` is not a valid
252
+ `TransformcomposeVariousFileParamsDict` object.
253
+
254
+ Args:
255
+ params: The parameters object to validate.
256
+ """
257
+ if params is None or not isinstance(params, dict):
258
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
259
+ if params.get("obj", None) is None:
260
+ raise StyxValidationError("`obj` must not be None")
261
+ if not isinstance(params["obj"], (pathlib.Path, str)):
262
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `InputPathType`')
263
+
264
+
265
+ def transformcompose_various_file_cargs(
266
+ params: TransformcomposeVariousFileParamsDict,
267
+ execution: Execution,
268
+ ) -> list[str]:
269
+ """
270
+ Build command-line arguments from parameters.
271
+
272
+ Args:
273
+ params: The parameters.
274
+ execution: The execution object for resolving input paths.
275
+ Returns:
276
+ Command-line arguments.
277
+ """
278
+ cargs = []
279
+ cargs.append(execution.input_file(params.get("obj", None)))
280
+ return cargs
281
+
282
+
283
+ class TransformcomposeOutputs(typing.NamedTuple):
284
+ """
285
+ Output object returned when calling `TransformcomposeParamsDict(...)`.
286
+ """
287
+ root: OutputPathType
288
+ """Output root folder. This is the root folder for all outputs."""
289
+
290
+
291
+ def transformcompose_params(
292
+ input_: list[InputPathType],
293
+ output: typing.Union[TransformcomposeVariousStringParamsDictTagged, TransformcomposeVariousFileParamsDictTagged],
294
+ template: InputPathType | None = None,
295
+ info: bool = False,
296
+ quiet: bool = False,
297
+ debug: bool = False,
298
+ force: bool = False,
299
+ nthreads: int | None = None,
300
+ config: list[TransformcomposeConfigParamsDict] | None = None,
301
+ help_: bool = False,
302
+ version: bool = False,
303
+ ) -> TransformcomposeParamsDictTagged:
304
+ """
305
+ Build parameters.
306
+
307
+ Args:
308
+ input_: the input transforms (either linear or non-linear warps).
309
+ output: the output file (may be a linear transformation text file, or a\
310
+ deformation warp field image, depending on usage).
311
+ template: define the output grid defined by a template image.
312
+ info: display information messages.
313
+ quiet: do not display information messages or progress status;\
314
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
315
+ environment variable to a non-empty string.
316
+ debug: display debugging messages.
317
+ force: force overwrite of output files (caution: using the same file as\
318
+ input and output might cause unexpected behaviour).
319
+ nthreads: use this number of threads in multi-threaded applications\
320
+ (set to 0 to disable multi-threading).
321
+ config: temporarily set the value of an MRtrix config file entry.
322
+ help_: display this information page and exit.
323
+ version: display version information and exit.
324
+ Returns:
325
+ Parameter dictionary
326
+ """
327
+ params = {
328
+ "@type": "mrtrix/transformcompose",
329
+ "info": info,
330
+ "quiet": quiet,
331
+ "debug": debug,
332
+ "force": force,
333
+ "help": help_,
334
+ "version": version,
335
+ "input": input_,
336
+ "output": output,
337
+ }
338
+ if template is not None:
339
+ params["template"] = template
340
+ if nthreads is not None:
341
+ params["nthreads"] = nthreads
342
+ if config is not None:
343
+ params["config"] = config
344
+ return params
345
+
346
+
347
+ def transformcompose_validate(
348
+ params: typing.Any,
349
+ ) -> None:
350
+ """
351
+ Validate parameters. Throws an error if `params` is not a valid
352
+ `TransformcomposeParamsDict` object.
353
+
354
+ Args:
355
+ params: The parameters object to validate.
356
+ """
357
+ if params is None or not isinstance(params, dict):
358
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
359
+ if params.get("template", None) is not None:
360
+ if not isinstance(params["template"], (pathlib.Path, str)):
361
+ raise StyxValidationError(f'`template` has the wrong type: Received `{type(params.get("template", None))}` expected `InputPathType | None`')
362
+ if params.get("info", False) is None:
363
+ raise StyxValidationError("`info` must not be None")
364
+ if not isinstance(params["info"], bool):
365
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
366
+ if params.get("quiet", False) is None:
367
+ raise StyxValidationError("`quiet` must not be None")
368
+ if not isinstance(params["quiet"], bool):
369
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
370
+ if params.get("debug", False) is None:
371
+ raise StyxValidationError("`debug` must not be None")
372
+ if not isinstance(params["debug"], bool):
373
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
374
+ if params.get("force", False) is None:
375
+ raise StyxValidationError("`force` must not be None")
376
+ if not isinstance(params["force"], bool):
377
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
378
+ if params.get("nthreads", None) is not None:
379
+ if not isinstance(params["nthreads"], int):
380
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
381
+ if params.get("config", None) is not None:
382
+ if not isinstance(params["config"], list):
383
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[TransformcomposeConfigParamsDict] | None`')
384
+ for e in params["config"]:
385
+ transformcompose_config_validate(e)
386
+ if params.get("help", False) is None:
387
+ raise StyxValidationError("`help` must not be None")
388
+ if not isinstance(params["help"], bool):
389
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
390
+ if params.get("version", False) is None:
391
+ raise StyxValidationError("`version` must not be None")
392
+ if not isinstance(params["version"], bool):
393
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
394
+ if params.get("input", None) is None:
395
+ raise StyxValidationError("`input` must not be None")
396
+ if not isinstance(params["input"], list):
397
+ raise StyxValidationError(f'`input` has the wrong type: Received `{type(params.get("input", None))}` expected `list[InputPathType]`')
398
+ for e in params["input"]:
399
+ if not isinstance(e, (pathlib.Path, str)):
400
+ raise StyxValidationError(f'`input` has the wrong type: Received `{type(params.get("input", None))}` expected `list[InputPathType]`')
401
+ if params.get("output", None) is None:
402
+ raise StyxValidationError("`output` must not be None")
403
+ if not isinstance(params["output"], dict):
404
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params["output"])}\'')
405
+ if "@type" not in params["output"]:
406
+ raise StyxValidationError("Params object is missing `@type`")
407
+ if params["output"]["@type"] not in ["VariousString", "VariousFile"]:
408
+ raise StyxValidationError("Parameter `output`s `@type` must be one of [\"VariousString\", \"VariousFile\"]")
409
+ transformcompose_output_validate_dyn_fn(params["output"]["@type"])(params["output"])
410
+
411
+
412
+ def transformcompose_cargs(
413
+ params: TransformcomposeParamsDict,
414
+ execution: Execution,
415
+ ) -> list[str]:
416
+ """
417
+ Build command-line arguments from parameters.
418
+
419
+ Args:
420
+ params: The parameters.
421
+ execution: The execution object for resolving input paths.
422
+ Returns:
423
+ Command-line arguments.
424
+ """
425
+ cargs = []
426
+ cargs.append("transformcompose")
427
+ if params.get("template", None) is not None:
428
+ cargs.extend([
429
+ "-template",
430
+ execution.input_file(params.get("template", None))
431
+ ])
432
+ if params.get("info", False):
433
+ cargs.append("-info")
434
+ if params.get("quiet", False):
435
+ cargs.append("-quiet")
436
+ if params.get("debug", False):
437
+ cargs.append("-debug")
438
+ if params.get("force", False):
439
+ cargs.append("-force")
440
+ if params.get("nthreads", None) is not None:
441
+ cargs.extend([
442
+ "-nthreads",
443
+ str(params.get("nthreads", None))
444
+ ])
445
+ if params.get("config", None) is not None:
446
+ cargs.extend([a for c in [transformcompose_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
447
+ if params.get("help", False):
448
+ cargs.append("-help")
449
+ if params.get("version", False):
450
+ cargs.append("-version")
451
+ cargs.extend([execution.input_file(f) for f in params.get("input", None)])
452
+ cargs.extend(transformcompose_output_cargs_dyn_fn(params.get("output", None)["@type"])(params.get("output", None), execution))
453
+ return cargs
454
+
455
+
456
+ def transformcompose_outputs(
457
+ params: TransformcomposeParamsDict,
458
+ execution: Execution,
459
+ ) -> TransformcomposeOutputs:
460
+ """
461
+ Build outputs object containing output file paths and possibly stdout/stderr.
462
+
463
+ Args:
464
+ params: The parameters.
465
+ execution: The execution object for resolving input paths.
466
+ Returns:
467
+ Outputs object.
468
+ """
469
+ ret = TransformcomposeOutputs(
470
+ root=execution.output_file("."),
471
+ )
472
+ return ret
473
+
474
+
475
+ def transformcompose_execute(
476
+ params: TransformcomposeParamsDict,
477
+ runner: Runner | None = None,
478
+ ) -> TransformcomposeOutputs:
479
+ """
480
+ transformcompose
481
+
482
+ Compose any number of linear transformations and/or warps into a single
483
+ transformation.
484
+
485
+ Any linear transforms must be supplied as a 4x4 matrix in a text file (e.g.
486
+ as per the output of mrregister). Any warp fields must be supplied as a 4D
487
+ image representing a deformation field (e.g. as output from mrrregister
488
+ -nl_warp).
489
+
490
+ Input transformations should be provided to the command in the order in
491
+ which they would be applied to an image if they were to be applied
492
+ individually.
493
+
494
+ If all input transformations are linear, and the -template option is not
495
+ provided, then the file output by the command will also be a linear
496
+ transformation saved as a 4x4 matrix in a text file. If a template image is
497
+ supplied, then the output will always be a deformation field. If at least
498
+ one of the inputs is a warp field, then the output will be a deformation
499
+ field, which will be defined on the grid of the last input warp image
500
+ supplied if the -template option is not used.
501
+
502
+ References:
503
+
504
+ .
505
+
506
+ Author: MRTrix3 Developers
507
+
508
+ URL: https://www.mrtrix.org/
509
+
510
+ Args:
511
+ params: The parameters.
512
+ runner: Command runner.
513
+ Returns:
514
+ NamedTuple of outputs (described in `TransformcomposeOutputs`).
515
+ """
516
+ transformcompose_validate(params)
517
+ runner = runner or get_global_runner()
518
+ execution = runner.start_execution(TRANSFORMCOMPOSE_METADATA)
519
+ params = execution.params(params)
520
+ cargs = transformcompose_cargs(params, execution)
521
+ ret = transformcompose_outputs(params, execution)
522
+ execution.run(cargs)
523
+ return ret
524
+
525
+
526
+ def transformcompose(
527
+ input_: list[InputPathType],
528
+ output: typing.Union[TransformcomposeVariousStringParamsDictTagged, TransformcomposeVariousFileParamsDictTagged],
529
+ template: InputPathType | None = None,
530
+ info: bool = False,
531
+ quiet: bool = False,
532
+ debug: bool = False,
533
+ force: bool = False,
534
+ nthreads: int | None = None,
535
+ config: list[TransformcomposeConfigParamsDict] | None = None,
536
+ help_: bool = False,
537
+ version: bool = False,
538
+ runner: Runner | None = None,
539
+ ) -> TransformcomposeOutputs:
540
+ """
541
+ transformcompose
542
+
543
+ Compose any number of linear transformations and/or warps into a single
544
+ transformation.
545
+
546
+ Any linear transforms must be supplied as a 4x4 matrix in a text file (e.g.
547
+ as per the output of mrregister). Any warp fields must be supplied as a 4D
548
+ image representing a deformation field (e.g. as output from mrrregister
549
+ -nl_warp).
550
+
551
+ Input transformations should be provided to the command in the order in
552
+ which they would be applied to an image if they were to be applied
553
+ individually.
554
+
555
+ If all input transformations are linear, and the -template option is not
556
+ provided, then the file output by the command will also be a linear
557
+ transformation saved as a 4x4 matrix in a text file. If a template image is
558
+ supplied, then the output will always be a deformation field. If at least
559
+ one of the inputs is a warp field, then the output will be a deformation
560
+ field, which will be defined on the grid of the last input warp image
561
+ supplied if the -template option is not used.
562
+
563
+ References:
564
+
565
+ .
566
+
567
+ Author: MRTrix3 Developers
568
+
569
+ URL: https://www.mrtrix.org/
570
+
571
+ Args:
572
+ input_: the input transforms (either linear or non-linear warps).
573
+ output: the output file (may be a linear transformation text file, or a\
574
+ deformation warp field image, depending on usage).
575
+ template: define the output grid defined by a template image.
576
+ info: display information messages.
577
+ quiet: do not display information messages or progress status;\
578
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
579
+ environment variable to a non-empty string.
580
+ debug: display debugging messages.
581
+ force: force overwrite of output files (caution: using the same file as\
582
+ input and output might cause unexpected behaviour).
583
+ nthreads: use this number of threads in multi-threaded applications\
584
+ (set to 0 to disable multi-threading).
585
+ config: temporarily set the value of an MRtrix config file entry.
586
+ help_: display this information page and exit.
587
+ version: display version information and exit.
588
+ runner: Command runner.
589
+ Returns:
590
+ NamedTuple of outputs (described in `TransformcomposeOutputs`).
591
+ """
592
+ params = transformcompose_params(
593
+ template=template,
594
+ info=info,
595
+ quiet=quiet,
596
+ debug=debug,
597
+ force=force,
598
+ nthreads=nthreads,
599
+ config=config,
600
+ help_=help_,
601
+ version=version,
602
+ input_=input_,
603
+ output=output,
604
+ )
605
+ return transformcompose_execute(params, runner)
606
+
607
+
608
+ __all__ = [
609
+ "TRANSFORMCOMPOSE_METADATA",
610
+ "TransformcomposeConfigParamsDict",
611
+ "TransformcomposeConfigParamsDictTagged",
612
+ "TransformcomposeOutputs",
613
+ "TransformcomposeParamsDict",
614
+ "TransformcomposeParamsDictTagged",
615
+ "TransformcomposeVariousFileParamsDict",
616
+ "TransformcomposeVariousFileParamsDictTagged",
617
+ "TransformcomposeVariousStringParamsDict",
618
+ "TransformcomposeVariousStringParamsDictTagged",
619
+ "transformcompose",
620
+ "transformcompose_config",
621
+ "transformcompose_execute",
622
+ "transformcompose_params",
623
+ "transformcompose_various_file",
624
+ "transformcompose_various_string",
625
+ ]