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,550 @@
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
+ TCKSTATS_METADATA = Metadata(
9
+ id="1c376e03915b6fa825105cf6a3a1f00bd7cafd03.boutiques",
10
+ name="tckstats",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _TckstatsOutputParamsDictNoTag = typing.TypedDict('_TckstatsOutputParamsDictNoTag', {
17
+ "field": str,
18
+ })
19
+ TckstatsOutputParamsDictTagged = typing.TypedDict('TckstatsOutputParamsDictTagged', {
20
+ "@type": typing.Literal["output"],
21
+ "field": str,
22
+ })
23
+ TckstatsOutputParamsDict = _TckstatsOutputParamsDictNoTag | TckstatsOutputParamsDictTagged
24
+
25
+
26
+ _TckstatsConfigParamsDictNoTag = typing.TypedDict('_TckstatsConfigParamsDictNoTag', {
27
+ "key": str,
28
+ "value": str,
29
+ })
30
+ TckstatsConfigParamsDictTagged = typing.TypedDict('TckstatsConfigParamsDictTagged', {
31
+ "@type": typing.Literal["config"],
32
+ "key": str,
33
+ "value": str,
34
+ })
35
+ TckstatsConfigParamsDict = _TckstatsConfigParamsDictNoTag | TckstatsConfigParamsDictTagged
36
+
37
+
38
+ _TckstatsParamsDictNoTag = typing.TypedDict('_TckstatsParamsDictNoTag', {
39
+ "output": typing.NotRequired[list[TckstatsOutputParamsDict] | None],
40
+ "histogram": typing.NotRequired[str | None],
41
+ "dump": typing.NotRequired[str | None],
42
+ "ignorezero": bool,
43
+ "tck_weights_in": typing.NotRequired[InputPathType | None],
44
+ "info": bool,
45
+ "quiet": bool,
46
+ "debug": bool,
47
+ "force": bool,
48
+ "nthreads": typing.NotRequired[int | None],
49
+ "config": typing.NotRequired[list[TckstatsConfigParamsDict] | None],
50
+ "help": bool,
51
+ "version": bool,
52
+ "tracks_in": InputPathType,
53
+ })
54
+ TckstatsParamsDictTagged = typing.TypedDict('TckstatsParamsDictTagged', {
55
+ "@type": typing.Literal["mrtrix/tckstats"],
56
+ "output": typing.NotRequired[list[TckstatsOutputParamsDict] | None],
57
+ "histogram": typing.NotRequired[str | None],
58
+ "dump": typing.NotRequired[str | None],
59
+ "ignorezero": bool,
60
+ "tck_weights_in": typing.NotRequired[InputPathType | None],
61
+ "info": bool,
62
+ "quiet": bool,
63
+ "debug": bool,
64
+ "force": bool,
65
+ "nthreads": typing.NotRequired[int | None],
66
+ "config": typing.NotRequired[list[TckstatsConfigParamsDict] | None],
67
+ "help": bool,
68
+ "version": bool,
69
+ "tracks_in": InputPathType,
70
+ })
71
+ TckstatsParamsDict = _TckstatsParamsDictNoTag | TckstatsParamsDictTagged
72
+
73
+
74
+ def tckstats_output(
75
+ field: str,
76
+ ) -> TckstatsOutputParamsDictTagged:
77
+ """
78
+ Build parameters.
79
+
80
+ Args:
81
+ field: output only the field specified. Multiple such options can be\
82
+ supplied if required. Choices are: mean, median, std, min, max, count.\
83
+ Useful for use in scripts.
84
+ Returns:
85
+ Parameter dictionary
86
+ """
87
+ params = {
88
+ "@type": "output",
89
+ "field": field,
90
+ }
91
+ return params
92
+
93
+
94
+ def tckstats_output_validate(
95
+ params: typing.Any,
96
+ ) -> None:
97
+ """
98
+ Validate parameters. Throws an error if `params` is not a valid
99
+ `TckstatsOutputParamsDict` object.
100
+
101
+ Args:
102
+ params: The parameters object to validate.
103
+ """
104
+ if params is None or not isinstance(params, dict):
105
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
106
+ if params.get("field", None) is None:
107
+ raise StyxValidationError("`field` must not be None")
108
+ if not isinstance(params["field"], str):
109
+ raise StyxValidationError(f'`field` has the wrong type: Received `{type(params.get("field", None))}` expected `str`')
110
+
111
+
112
+ def tckstats_output_cargs(
113
+ params: TckstatsOutputParamsDict,
114
+ execution: Execution,
115
+ ) -> list[str]:
116
+ """
117
+ Build command-line arguments from parameters.
118
+
119
+ Args:
120
+ params: The parameters.
121
+ execution: The execution object for resolving input paths.
122
+ Returns:
123
+ Command-line arguments.
124
+ """
125
+ cargs = []
126
+ cargs.append("-output")
127
+ cargs.append(params.get("field", None))
128
+ return cargs
129
+
130
+
131
+ def tckstats_config(
132
+ key: str,
133
+ value: str,
134
+ ) -> TckstatsConfigParamsDictTagged:
135
+ """
136
+ Build parameters.
137
+
138
+ Args:
139
+ key: temporarily set the value of an MRtrix config file entry.
140
+ value: temporarily set the value of an MRtrix config file entry.
141
+ Returns:
142
+ Parameter dictionary
143
+ """
144
+ params = {
145
+ "@type": "config",
146
+ "key": key,
147
+ "value": value,
148
+ }
149
+ return params
150
+
151
+
152
+ def tckstats_config_validate(
153
+ params: typing.Any,
154
+ ) -> None:
155
+ """
156
+ Validate parameters. Throws an error if `params` is not a valid
157
+ `TckstatsConfigParamsDict` object.
158
+
159
+ Args:
160
+ params: The parameters object to validate.
161
+ """
162
+ if params is None or not isinstance(params, dict):
163
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
164
+ if params.get("key", None) is None:
165
+ raise StyxValidationError("`key` must not be None")
166
+ if not isinstance(params["key"], str):
167
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
168
+ if params.get("value", None) is None:
169
+ raise StyxValidationError("`value` must not be None")
170
+ if not isinstance(params["value"], str):
171
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
172
+
173
+
174
+ def tckstats_config_cargs(
175
+ params: TckstatsConfigParamsDict,
176
+ execution: Execution,
177
+ ) -> list[str]:
178
+ """
179
+ Build command-line arguments from parameters.
180
+
181
+ Args:
182
+ params: The parameters.
183
+ execution: The execution object for resolving input paths.
184
+ Returns:
185
+ Command-line arguments.
186
+ """
187
+ cargs = []
188
+ cargs.append("-config")
189
+ cargs.append(params.get("key", None))
190
+ cargs.append(params.get("value", None))
191
+ return cargs
192
+
193
+
194
+ class TckstatsOutputs(typing.NamedTuple):
195
+ """
196
+ Output object returned when calling `TckstatsParamsDict(...)`.
197
+ """
198
+ root: OutputPathType
199
+ """Output root folder. This is the root folder for all outputs."""
200
+ histogram: OutputPathType | None
201
+ """output a histogram of streamline lengths """
202
+ dump: OutputPathType | None
203
+ """dump the streamlines lengths to a text file """
204
+
205
+
206
+ def tckstats_params(
207
+ tracks_in: InputPathType,
208
+ output: list[TckstatsOutputParamsDict] | None = None,
209
+ histogram: str | None = None,
210
+ dump: str | None = None,
211
+ ignorezero: bool = False,
212
+ tck_weights_in: InputPathType | None = None,
213
+ info: bool = False,
214
+ quiet: bool = False,
215
+ debug: bool = False,
216
+ force: bool = False,
217
+ nthreads: int | None = None,
218
+ config: list[TckstatsConfigParamsDict] | None = None,
219
+ help_: bool = False,
220
+ version: bool = False,
221
+ ) -> TckstatsParamsDictTagged:
222
+ """
223
+ Build parameters.
224
+
225
+ Args:
226
+ tracks_in: the input track file.
227
+ output: output only the field specified. Multiple such options can be\
228
+ supplied if required. Choices are: mean, median, std, min, max, count.\
229
+ Useful for use in scripts.
230
+ histogram: output a histogram of streamline lengths.
231
+ dump: dump the streamlines lengths to a text file.
232
+ ignorezero: do not generate a warning if the track file contains\
233
+ streamlines with zero length.
234
+ tck_weights_in: specify a text scalar file containing the streamline\
235
+ weights.
236
+ info: display information messages.
237
+ quiet: do not display information messages or progress status;\
238
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
239
+ environment variable to a non-empty string.
240
+ debug: display debugging messages.
241
+ force: force overwrite of output files (caution: using the same file as\
242
+ input and output might cause unexpected behaviour).
243
+ nthreads: use this number of threads in multi-threaded applications\
244
+ (set to 0 to disable multi-threading).
245
+ config: temporarily set the value of an MRtrix config file entry.
246
+ help_: display this information page and exit.
247
+ version: display version information and exit.
248
+ Returns:
249
+ Parameter dictionary
250
+ """
251
+ params = {
252
+ "@type": "mrtrix/tckstats",
253
+ "ignorezero": ignorezero,
254
+ "info": info,
255
+ "quiet": quiet,
256
+ "debug": debug,
257
+ "force": force,
258
+ "help": help_,
259
+ "version": version,
260
+ "tracks_in": tracks_in,
261
+ }
262
+ if output is not None:
263
+ params["output"] = output
264
+ if histogram is not None:
265
+ params["histogram"] = histogram
266
+ if dump is not None:
267
+ params["dump"] = dump
268
+ if tck_weights_in is not None:
269
+ params["tck_weights_in"] = tck_weights_in
270
+ if nthreads is not None:
271
+ params["nthreads"] = nthreads
272
+ if config is not None:
273
+ params["config"] = config
274
+ return params
275
+
276
+
277
+ def tckstats_validate(
278
+ params: typing.Any,
279
+ ) -> None:
280
+ """
281
+ Validate parameters. Throws an error if `params` is not a valid
282
+ `TckstatsParamsDict` object.
283
+
284
+ Args:
285
+ params: The parameters object to validate.
286
+ """
287
+ if params is None or not isinstance(params, dict):
288
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
289
+ if params.get("output", None) is not None:
290
+ if not isinstance(params["output"], list):
291
+ raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `list[TckstatsOutputParamsDict] | None`')
292
+ for e in params["output"]:
293
+ tckstats_output_validate(e)
294
+ if params.get("histogram", None) is not None:
295
+ if not isinstance(params["histogram"], str):
296
+ raise StyxValidationError(f'`histogram` has the wrong type: Received `{type(params.get("histogram", None))}` expected `str | None`')
297
+ if params.get("dump", None) is not None:
298
+ if not isinstance(params["dump"], str):
299
+ raise StyxValidationError(f'`dump` has the wrong type: Received `{type(params.get("dump", None))}` expected `str | None`')
300
+ if params.get("ignorezero", False) is None:
301
+ raise StyxValidationError("`ignorezero` must not be None")
302
+ if not isinstance(params["ignorezero"], bool):
303
+ raise StyxValidationError(f'`ignorezero` has the wrong type: Received `{type(params.get("ignorezero", False))}` expected `bool`')
304
+ if params.get("tck_weights_in", None) is not None:
305
+ if not isinstance(params["tck_weights_in"], (pathlib.Path, str)):
306
+ raise StyxValidationError(f'`tck_weights_in` has the wrong type: Received `{type(params.get("tck_weights_in", None))}` expected `InputPathType | None`')
307
+ if params.get("info", False) is None:
308
+ raise StyxValidationError("`info` must not be None")
309
+ if not isinstance(params["info"], bool):
310
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
311
+ if params.get("quiet", False) is None:
312
+ raise StyxValidationError("`quiet` must not be None")
313
+ if not isinstance(params["quiet"], bool):
314
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
315
+ if params.get("debug", False) is None:
316
+ raise StyxValidationError("`debug` must not be None")
317
+ if not isinstance(params["debug"], bool):
318
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
319
+ if params.get("force", False) is None:
320
+ raise StyxValidationError("`force` must not be None")
321
+ if not isinstance(params["force"], bool):
322
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
323
+ if params.get("nthreads", None) is not None:
324
+ if not isinstance(params["nthreads"], int):
325
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
326
+ if params.get("config", None) is not None:
327
+ if not isinstance(params["config"], list):
328
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[TckstatsConfigParamsDict] | None`')
329
+ for e in params["config"]:
330
+ tckstats_config_validate(e)
331
+ if params.get("help", False) is None:
332
+ raise StyxValidationError("`help` must not be None")
333
+ if not isinstance(params["help"], bool):
334
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
335
+ if params.get("version", False) is None:
336
+ raise StyxValidationError("`version` must not be None")
337
+ if not isinstance(params["version"], bool):
338
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
339
+ if params.get("tracks_in", None) is None:
340
+ raise StyxValidationError("`tracks_in` must not be None")
341
+ if not isinstance(params["tracks_in"], (pathlib.Path, str)):
342
+ raise StyxValidationError(f'`tracks_in` has the wrong type: Received `{type(params.get("tracks_in", None))}` expected `InputPathType`')
343
+
344
+
345
+ def tckstats_cargs(
346
+ params: TckstatsParamsDict,
347
+ execution: Execution,
348
+ ) -> list[str]:
349
+ """
350
+ Build command-line arguments from parameters.
351
+
352
+ Args:
353
+ params: The parameters.
354
+ execution: The execution object for resolving input paths.
355
+ Returns:
356
+ Command-line arguments.
357
+ """
358
+ cargs = []
359
+ cargs.append("tckstats")
360
+ if params.get("output", None) is not None:
361
+ cargs.extend([a for c in [tckstats_output_cargs(s, execution) for s in params.get("output", None)] for a in c])
362
+ if params.get("histogram", None) is not None:
363
+ cargs.extend([
364
+ "-histogram",
365
+ params.get("histogram", None)
366
+ ])
367
+ if params.get("dump", None) is not None:
368
+ cargs.extend([
369
+ "-dump",
370
+ params.get("dump", None)
371
+ ])
372
+ if params.get("ignorezero", False):
373
+ cargs.append("-ignorezero")
374
+ if params.get("tck_weights_in", None) is not None:
375
+ cargs.extend([
376
+ "-tck_weights_in",
377
+ execution.input_file(params.get("tck_weights_in", None))
378
+ ])
379
+ if params.get("info", False):
380
+ cargs.append("-info")
381
+ if params.get("quiet", False):
382
+ cargs.append("-quiet")
383
+ if params.get("debug", False):
384
+ cargs.append("-debug")
385
+ if params.get("force", False):
386
+ cargs.append("-force")
387
+ if params.get("nthreads", None) is not None:
388
+ cargs.extend([
389
+ "-nthreads",
390
+ str(params.get("nthreads", None))
391
+ ])
392
+ if params.get("config", None) is not None:
393
+ cargs.extend([a for c in [tckstats_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
394
+ if params.get("help", False):
395
+ cargs.append("-help")
396
+ if params.get("version", False):
397
+ cargs.append("-version")
398
+ cargs.append(execution.input_file(params.get("tracks_in", None)))
399
+ return cargs
400
+
401
+
402
+ def tckstats_outputs(
403
+ params: TckstatsParamsDict,
404
+ execution: Execution,
405
+ ) -> TckstatsOutputs:
406
+ """
407
+ Build outputs object containing output file paths and possibly stdout/stderr.
408
+
409
+ Args:
410
+ params: The parameters.
411
+ execution: The execution object for resolving input paths.
412
+ Returns:
413
+ Outputs object.
414
+ """
415
+ ret = TckstatsOutputs(
416
+ root=execution.output_file("."),
417
+ histogram=execution.output_file(params.get("histogram", None)) if (params.get("histogram") is not None) else None,
418
+ dump=execution.output_file(params.get("dump", None)) if (params.get("dump") is not None) else None,
419
+ )
420
+ return ret
421
+
422
+
423
+ def tckstats_execute(
424
+ params: TckstatsParamsDict,
425
+ runner: Runner | None = None,
426
+ ) -> TckstatsOutputs:
427
+ """
428
+ tckstats
429
+
430
+ Calculate statistics on streamlines lengths.
431
+
432
+
433
+
434
+ References:
435
+
436
+ .
437
+
438
+ Author: MRTrix3 Developers
439
+
440
+ URL: https://www.mrtrix.org/
441
+
442
+ Args:
443
+ params: The parameters.
444
+ runner: Command runner.
445
+ Returns:
446
+ NamedTuple of outputs (described in `TckstatsOutputs`).
447
+ """
448
+ tckstats_validate(params)
449
+ runner = runner or get_global_runner()
450
+ execution = runner.start_execution(TCKSTATS_METADATA)
451
+ params = execution.params(params)
452
+ cargs = tckstats_cargs(params, execution)
453
+ ret = tckstats_outputs(params, execution)
454
+ execution.run(cargs)
455
+ return ret
456
+
457
+
458
+ def tckstats(
459
+ tracks_in: InputPathType,
460
+ output: list[TckstatsOutputParamsDict] | None = None,
461
+ histogram: str | None = None,
462
+ dump: str | None = None,
463
+ ignorezero: bool = False,
464
+ tck_weights_in: InputPathType | None = None,
465
+ info: bool = False,
466
+ quiet: bool = False,
467
+ debug: bool = False,
468
+ force: bool = False,
469
+ nthreads: int | None = None,
470
+ config: list[TckstatsConfigParamsDict] | None = None,
471
+ help_: bool = False,
472
+ version: bool = False,
473
+ runner: Runner | None = None,
474
+ ) -> TckstatsOutputs:
475
+ """
476
+ tckstats
477
+
478
+ Calculate statistics on streamlines lengths.
479
+
480
+
481
+
482
+ References:
483
+
484
+ .
485
+
486
+ Author: MRTrix3 Developers
487
+
488
+ URL: https://www.mrtrix.org/
489
+
490
+ Args:
491
+ tracks_in: the input track file.
492
+ output: output only the field specified. Multiple such options can be\
493
+ supplied if required. Choices are: mean, median, std, min, max, count.\
494
+ Useful for use in scripts.
495
+ histogram: output a histogram of streamline lengths.
496
+ dump: dump the streamlines lengths to a text file.
497
+ ignorezero: do not generate a warning if the track file contains\
498
+ streamlines with zero length.
499
+ tck_weights_in: specify a text scalar file containing the streamline\
500
+ weights.
501
+ info: display information messages.
502
+ quiet: do not display information messages or progress status;\
503
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
504
+ environment variable to a non-empty string.
505
+ debug: display debugging messages.
506
+ force: force overwrite of output files (caution: using the same file as\
507
+ input and output might cause unexpected behaviour).
508
+ nthreads: use this number of threads in multi-threaded applications\
509
+ (set to 0 to disable multi-threading).
510
+ config: temporarily set the value of an MRtrix config file entry.
511
+ help_: display this information page and exit.
512
+ version: display version information and exit.
513
+ runner: Command runner.
514
+ Returns:
515
+ NamedTuple of outputs (described in `TckstatsOutputs`).
516
+ """
517
+ params = tckstats_params(
518
+ output=output,
519
+ histogram=histogram,
520
+ dump=dump,
521
+ ignorezero=ignorezero,
522
+ tck_weights_in=tck_weights_in,
523
+ info=info,
524
+ quiet=quiet,
525
+ debug=debug,
526
+ force=force,
527
+ nthreads=nthreads,
528
+ config=config,
529
+ help_=help_,
530
+ version=version,
531
+ tracks_in=tracks_in,
532
+ )
533
+ return tckstats_execute(params, runner)
534
+
535
+
536
+ __all__ = [
537
+ "TCKSTATS_METADATA",
538
+ "TckstatsConfigParamsDict",
539
+ "TckstatsConfigParamsDictTagged",
540
+ "TckstatsOutputParamsDict",
541
+ "TckstatsOutputParamsDictTagged",
542
+ "TckstatsOutputs",
543
+ "TckstatsParamsDict",
544
+ "TckstatsParamsDictTagged",
545
+ "tckstats",
546
+ "tckstats_config",
547
+ "tckstats_execute",
548
+ "tckstats_output",
549
+ "tckstats_params",
550
+ ]