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,497 @@
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
+ TCKSAMPLE_METADATA = Metadata(
9
+ id="274c00456de615fd846529a52bdcb4684c1c52eb.boutiques",
10
+ name="tcksample",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _TcksampleConfigParamsDictNoTag = typing.TypedDict('_TcksampleConfigParamsDictNoTag', {
17
+ "key": str,
18
+ "value": str,
19
+ })
20
+ TcksampleConfigParamsDictTagged = typing.TypedDict('TcksampleConfigParamsDictTagged', {
21
+ "@type": typing.Literal["config"],
22
+ "key": str,
23
+ "value": str,
24
+ })
25
+ TcksampleConfigParamsDict = _TcksampleConfigParamsDictNoTag | TcksampleConfigParamsDictTagged
26
+
27
+
28
+ _TcksampleParamsDictNoTag = typing.TypedDict('_TcksampleParamsDictNoTag', {
29
+ "stat_tck": typing.NotRequired[str | None],
30
+ "nointerp": bool,
31
+ "precise": bool,
32
+ "use_tdi_fraction": bool,
33
+ "info": bool,
34
+ "quiet": bool,
35
+ "debug": bool,
36
+ "force": bool,
37
+ "nthreads": typing.NotRequired[int | None],
38
+ "config": typing.NotRequired[list[TcksampleConfigParamsDict] | None],
39
+ "help": bool,
40
+ "version": bool,
41
+ "tracks": InputPathType,
42
+ "image": InputPathType,
43
+ "values": str,
44
+ })
45
+ TcksampleParamsDictTagged = typing.TypedDict('TcksampleParamsDictTagged', {
46
+ "@type": typing.Literal["mrtrix/tcksample"],
47
+ "stat_tck": typing.NotRequired[str | None],
48
+ "nointerp": bool,
49
+ "precise": bool,
50
+ "use_tdi_fraction": bool,
51
+ "info": bool,
52
+ "quiet": bool,
53
+ "debug": bool,
54
+ "force": bool,
55
+ "nthreads": typing.NotRequired[int | None],
56
+ "config": typing.NotRequired[list[TcksampleConfigParamsDict] | None],
57
+ "help": bool,
58
+ "version": bool,
59
+ "tracks": InputPathType,
60
+ "image": InputPathType,
61
+ "values": str,
62
+ })
63
+ TcksampleParamsDict = _TcksampleParamsDictNoTag | TcksampleParamsDictTagged
64
+
65
+
66
+ def tcksample_config(
67
+ key: str,
68
+ value: str,
69
+ ) -> TcksampleConfigParamsDictTagged:
70
+ """
71
+ Build parameters.
72
+
73
+ Args:
74
+ key: temporarily set the value of an MRtrix config file entry.
75
+ value: temporarily set the value of an MRtrix config file entry.
76
+ Returns:
77
+ Parameter dictionary
78
+ """
79
+ params = {
80
+ "@type": "config",
81
+ "key": key,
82
+ "value": value,
83
+ }
84
+ return params
85
+
86
+
87
+ def tcksample_config_validate(
88
+ params: typing.Any,
89
+ ) -> None:
90
+ """
91
+ Validate parameters. Throws an error if `params` is not a valid
92
+ `TcksampleConfigParamsDict` object.
93
+
94
+ Args:
95
+ params: The parameters object to validate.
96
+ """
97
+ if params is None or not isinstance(params, dict):
98
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
99
+ if params.get("key", None) is None:
100
+ raise StyxValidationError("`key` must not be None")
101
+ if not isinstance(params["key"], str):
102
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
103
+ if params.get("value", None) is None:
104
+ raise StyxValidationError("`value` must not be None")
105
+ if not isinstance(params["value"], str):
106
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
107
+
108
+
109
+ def tcksample_config_cargs(
110
+ params: TcksampleConfigParamsDict,
111
+ execution: Execution,
112
+ ) -> list[str]:
113
+ """
114
+ Build command-line arguments from parameters.
115
+
116
+ Args:
117
+ params: The parameters.
118
+ execution: The execution object for resolving input paths.
119
+ Returns:
120
+ Command-line arguments.
121
+ """
122
+ cargs = []
123
+ cargs.append("-config")
124
+ cargs.append(params.get("key", None))
125
+ cargs.append(params.get("value", None))
126
+ return cargs
127
+
128
+
129
+ class TcksampleOutputs(typing.NamedTuple):
130
+ """
131
+ Output object returned when calling `TcksampleParamsDict(...)`.
132
+ """
133
+ root: OutputPathType
134
+ """Output root folder. This is the root folder for all outputs."""
135
+ values_: OutputPathType
136
+ """the output sampled values"""
137
+
138
+
139
+ def tcksample_params(
140
+ tracks: InputPathType,
141
+ image: InputPathType,
142
+ values_: str,
143
+ stat_tck: str | None = None,
144
+ nointerp: bool = False,
145
+ precise: bool = False,
146
+ use_tdi_fraction: bool = False,
147
+ info: bool = False,
148
+ quiet: bool = False,
149
+ debug: bool = False,
150
+ force: bool = False,
151
+ nthreads: int | None = None,
152
+ config: list[TcksampleConfigParamsDict] | None = None,
153
+ help_: bool = False,
154
+ version: bool = False,
155
+ ) -> TcksampleParamsDictTagged:
156
+ """
157
+ Build parameters.
158
+
159
+ Args:
160
+ tracks: the input track file.
161
+ image: the image to be sampled.
162
+ values_: the output sampled values.
163
+ stat_tck: compute some statistic from the values along each streamline\
164
+ (options are: mean,median,min,max).
165
+ nointerp: do not use trilinear interpolation when sampling image values.
166
+ precise: use the precise mechanism for mapping streamlines to voxels\
167
+ (obviates the need for trilinear interpolation) (only applicable if\
168
+ some per-streamline statistic is requested).
169
+ use_tdi_fraction: each streamline is assigned a fraction of the image\
170
+ intensity in each voxel based on the fraction of the track density\
171
+ contributed by that streamline (this is only appropriate for processing\
172
+ a whole-brain tractogram, and images for which the quantiative\
173
+ parameter is additive).
174
+ info: display information messages.
175
+ quiet: do not display information messages or progress status;\
176
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
177
+ environment variable to a non-empty string.
178
+ debug: display debugging messages.
179
+ force: force overwrite of output files (caution: using the same file as\
180
+ input and output might cause unexpected behaviour).
181
+ nthreads: use this number of threads in multi-threaded applications\
182
+ (set to 0 to disable multi-threading).
183
+ config: temporarily set the value of an MRtrix config file entry.
184
+ help_: display this information page and exit.
185
+ version: display version information and exit.
186
+ Returns:
187
+ Parameter dictionary
188
+ """
189
+ params = {
190
+ "@type": "mrtrix/tcksample",
191
+ "nointerp": nointerp,
192
+ "precise": precise,
193
+ "use_tdi_fraction": use_tdi_fraction,
194
+ "info": info,
195
+ "quiet": quiet,
196
+ "debug": debug,
197
+ "force": force,
198
+ "help": help_,
199
+ "version": version,
200
+ "tracks": tracks,
201
+ "image": image,
202
+ "values": values_,
203
+ }
204
+ if stat_tck is not None:
205
+ params["stat_tck"] = stat_tck
206
+ if nthreads is not None:
207
+ params["nthreads"] = nthreads
208
+ if config is not None:
209
+ params["config"] = config
210
+ return params
211
+
212
+
213
+ def tcksample_validate(
214
+ params: typing.Any,
215
+ ) -> None:
216
+ """
217
+ Validate parameters. Throws an error if `params` is not a valid
218
+ `TcksampleParamsDict` object.
219
+
220
+ Args:
221
+ params: The parameters object to validate.
222
+ """
223
+ if params is None or not isinstance(params, dict):
224
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
225
+ if params.get("stat_tck", None) is not None:
226
+ if not isinstance(params["stat_tck"], str):
227
+ raise StyxValidationError(f'`stat_tck` has the wrong type: Received `{type(params.get("stat_tck", None))}` expected `str | None`')
228
+ if params.get("nointerp", False) is None:
229
+ raise StyxValidationError("`nointerp` must not be None")
230
+ if not isinstance(params["nointerp"], bool):
231
+ raise StyxValidationError(f'`nointerp` has the wrong type: Received `{type(params.get("nointerp", False))}` expected `bool`')
232
+ if params.get("precise", False) is None:
233
+ raise StyxValidationError("`precise` must not be None")
234
+ if not isinstance(params["precise"], bool):
235
+ raise StyxValidationError(f'`precise` has the wrong type: Received `{type(params.get("precise", False))}` expected `bool`')
236
+ if params.get("use_tdi_fraction", False) is None:
237
+ raise StyxValidationError("`use_tdi_fraction` must not be None")
238
+ if not isinstance(params["use_tdi_fraction"], bool):
239
+ raise StyxValidationError(f'`use_tdi_fraction` has the wrong type: Received `{type(params.get("use_tdi_fraction", False))}` expected `bool`')
240
+ if params.get("info", False) is None:
241
+ raise StyxValidationError("`info` must not be None")
242
+ if not isinstance(params["info"], bool):
243
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
244
+ if params.get("quiet", False) is None:
245
+ raise StyxValidationError("`quiet` must not be None")
246
+ if not isinstance(params["quiet"], bool):
247
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
248
+ if params.get("debug", False) is None:
249
+ raise StyxValidationError("`debug` must not be None")
250
+ if not isinstance(params["debug"], bool):
251
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
252
+ if params.get("force", False) is None:
253
+ raise StyxValidationError("`force` must not be None")
254
+ if not isinstance(params["force"], bool):
255
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
256
+ if params.get("nthreads", None) is not None:
257
+ if not isinstance(params["nthreads"], int):
258
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
259
+ if params.get("config", None) is not None:
260
+ if not isinstance(params["config"], list):
261
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[TcksampleConfigParamsDict] | None`')
262
+ for e in params["config"]:
263
+ tcksample_config_validate(e)
264
+ if params.get("help", False) is None:
265
+ raise StyxValidationError("`help` must not be None")
266
+ if not isinstance(params["help"], bool):
267
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
268
+ if params.get("version", False) is None:
269
+ raise StyxValidationError("`version` must not be None")
270
+ if not isinstance(params["version"], bool):
271
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
272
+ if params.get("tracks", None) is None:
273
+ raise StyxValidationError("`tracks` must not be None")
274
+ if not isinstance(params["tracks"], (pathlib.Path, str)):
275
+ raise StyxValidationError(f'`tracks` has the wrong type: Received `{type(params.get("tracks", None))}` expected `InputPathType`')
276
+ if params.get("image", None) is None:
277
+ raise StyxValidationError("`image` must not be None")
278
+ if not isinstance(params["image"], (pathlib.Path, str)):
279
+ raise StyxValidationError(f'`image` has the wrong type: Received `{type(params.get("image", None))}` expected `InputPathType`')
280
+ if params.get("values", None) is None:
281
+ raise StyxValidationError("`values` must not be None")
282
+ if not isinstance(params["values"], str):
283
+ raise StyxValidationError(f'`values` has the wrong type: Received `{type(params.get("values", None))}` expected `str`')
284
+
285
+
286
+ def tcksample_cargs(
287
+ params: TcksampleParamsDict,
288
+ execution: Execution,
289
+ ) -> list[str]:
290
+ """
291
+ Build command-line arguments from parameters.
292
+
293
+ Args:
294
+ params: The parameters.
295
+ execution: The execution object for resolving input paths.
296
+ Returns:
297
+ Command-line arguments.
298
+ """
299
+ cargs = []
300
+ cargs.append("tcksample")
301
+ if params.get("stat_tck", None) is not None:
302
+ cargs.extend([
303
+ "-stat_tck",
304
+ params.get("stat_tck", None)
305
+ ])
306
+ if params.get("nointerp", False):
307
+ cargs.append("-nointerp")
308
+ if params.get("precise", False):
309
+ cargs.append("-precise")
310
+ if params.get("use_tdi_fraction", False):
311
+ cargs.append("-use_tdi_fraction")
312
+ if params.get("info", False):
313
+ cargs.append("-info")
314
+ if params.get("quiet", False):
315
+ cargs.append("-quiet")
316
+ if params.get("debug", False):
317
+ cargs.append("-debug")
318
+ if params.get("force", False):
319
+ cargs.append("-force")
320
+ if params.get("nthreads", None) is not None:
321
+ cargs.extend([
322
+ "-nthreads",
323
+ str(params.get("nthreads", None))
324
+ ])
325
+ if params.get("config", None) is not None:
326
+ cargs.extend([a for c in [tcksample_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
327
+ if params.get("help", False):
328
+ cargs.append("-help")
329
+ if params.get("version", False):
330
+ cargs.append("-version")
331
+ cargs.append(execution.input_file(params.get("tracks", None)))
332
+ cargs.append(execution.input_file(params.get("image", None)))
333
+ cargs.append(params.get("values", None))
334
+ return cargs
335
+
336
+
337
+ def tcksample_outputs(
338
+ params: TcksampleParamsDict,
339
+ execution: Execution,
340
+ ) -> TcksampleOutputs:
341
+ """
342
+ Build outputs object containing output file paths and possibly stdout/stderr.
343
+
344
+ Args:
345
+ params: The parameters.
346
+ execution: The execution object for resolving input paths.
347
+ Returns:
348
+ Outputs object.
349
+ """
350
+ ret = TcksampleOutputs(
351
+ root=execution.output_file("."),
352
+ values_=execution.output_file(params.get("values", None)),
353
+ )
354
+ return ret
355
+
356
+
357
+ def tcksample_execute(
358
+ params: TcksampleParamsDict,
359
+ runner: Runner | None = None,
360
+ ) -> TcksampleOutputs:
361
+ """
362
+ tcksample
363
+
364
+ Sample values of an associated image along tracks.
365
+
366
+ By default, the value of the underlying image at each point along the track
367
+ is written to either an ASCII file (with all values for each track on the
368
+ same line), or a track scalar file (.tsf). Alternatively, some statistic can
369
+ be taken from the values along each streamline and written to a vector file.
370
+
371
+ References:
372
+
373
+ * If using -precise option: Smith, R. E.; Tournier, J.-D.; Calamante, F. &
374
+ Connelly, A. SIFT: Spherical-deconvolution informed filtering of
375
+ tractograms. NeuroImage, 2013, 67, 298-312.
376
+
377
+ Author: MRTrix3 Developers
378
+
379
+ URL: https://www.mrtrix.org/
380
+
381
+ Args:
382
+ params: The parameters.
383
+ runner: Command runner.
384
+ Returns:
385
+ NamedTuple of outputs (described in `TcksampleOutputs`).
386
+ """
387
+ tcksample_validate(params)
388
+ runner = runner or get_global_runner()
389
+ execution = runner.start_execution(TCKSAMPLE_METADATA)
390
+ params = execution.params(params)
391
+ cargs = tcksample_cargs(params, execution)
392
+ ret = tcksample_outputs(params, execution)
393
+ execution.run(cargs)
394
+ return ret
395
+
396
+
397
+ def tcksample(
398
+ tracks: InputPathType,
399
+ image: InputPathType,
400
+ values_: str,
401
+ stat_tck: str | None = None,
402
+ nointerp: bool = False,
403
+ precise: bool = False,
404
+ use_tdi_fraction: bool = False,
405
+ info: bool = False,
406
+ quiet: bool = False,
407
+ debug: bool = False,
408
+ force: bool = False,
409
+ nthreads: int | None = None,
410
+ config: list[TcksampleConfigParamsDict] | None = None,
411
+ help_: bool = False,
412
+ version: bool = False,
413
+ runner: Runner | None = None,
414
+ ) -> TcksampleOutputs:
415
+ """
416
+ tcksample
417
+
418
+ Sample values of an associated image along tracks.
419
+
420
+ By default, the value of the underlying image at each point along the track
421
+ is written to either an ASCII file (with all values for each track on the
422
+ same line), or a track scalar file (.tsf). Alternatively, some statistic can
423
+ be taken from the values along each streamline and written to a vector file.
424
+
425
+ References:
426
+
427
+ * If using -precise option: Smith, R. E.; Tournier, J.-D.; Calamante, F. &
428
+ Connelly, A. SIFT: Spherical-deconvolution informed filtering of
429
+ tractograms. NeuroImage, 2013, 67, 298-312.
430
+
431
+ Author: MRTrix3 Developers
432
+
433
+ URL: https://www.mrtrix.org/
434
+
435
+ Args:
436
+ tracks: the input track file.
437
+ image: the image to be sampled.
438
+ values_: the output sampled values.
439
+ stat_tck: compute some statistic from the values along each streamline\
440
+ (options are: mean,median,min,max).
441
+ nointerp: do not use trilinear interpolation when sampling image values.
442
+ precise: use the precise mechanism for mapping streamlines to voxels\
443
+ (obviates the need for trilinear interpolation) (only applicable if\
444
+ some per-streamline statistic is requested).
445
+ use_tdi_fraction: each streamline is assigned a fraction of the image\
446
+ intensity in each voxel based on the fraction of the track density\
447
+ contributed by that streamline (this is only appropriate for processing\
448
+ a whole-brain tractogram, and images for which the quantiative\
449
+ parameter is additive).
450
+ info: display information messages.
451
+ quiet: do not display information messages or progress status;\
452
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
453
+ environment variable to a non-empty string.
454
+ debug: display debugging messages.
455
+ force: force overwrite of output files (caution: using the same file as\
456
+ input and output might cause unexpected behaviour).
457
+ nthreads: use this number of threads in multi-threaded applications\
458
+ (set to 0 to disable multi-threading).
459
+ config: temporarily set the value of an MRtrix config file entry.
460
+ help_: display this information page and exit.
461
+ version: display version information and exit.
462
+ runner: Command runner.
463
+ Returns:
464
+ NamedTuple of outputs (described in `TcksampleOutputs`).
465
+ """
466
+ params = tcksample_params(
467
+ stat_tck=stat_tck,
468
+ nointerp=nointerp,
469
+ precise=precise,
470
+ use_tdi_fraction=use_tdi_fraction,
471
+ info=info,
472
+ quiet=quiet,
473
+ debug=debug,
474
+ force=force,
475
+ nthreads=nthreads,
476
+ config=config,
477
+ help_=help_,
478
+ version=version,
479
+ tracks=tracks,
480
+ image=image,
481
+ values_=values_,
482
+ )
483
+ return tcksample_execute(params, runner)
484
+
485
+
486
+ __all__ = [
487
+ "TCKSAMPLE_METADATA",
488
+ "TcksampleConfigParamsDict",
489
+ "TcksampleConfigParamsDictTagged",
490
+ "TcksampleOutputs",
491
+ "TcksampleParamsDict",
492
+ "TcksampleParamsDictTagged",
493
+ "tcksample",
494
+ "tcksample_config",
495
+ "tcksample_execute",
496
+ "tcksample_params",
497
+ ]