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,1004 @@
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
+ TCKMAP_METADATA = Metadata(
9
+ id="6c3a1a0072e37f35d493f0f168ff70a6ce77b20d.boutiques",
10
+ name="tckmap",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _TckmapVariousStringParamsDictNoTag = typing.TypedDict('_TckmapVariousStringParamsDictNoTag', {
17
+ "obj": str,
18
+ })
19
+ TckmapVariousStringParamsDictTagged = typing.TypedDict('TckmapVariousStringParamsDictTagged', {
20
+ "@type": typing.Literal["VariousString"],
21
+ "obj": str,
22
+ })
23
+ TckmapVariousStringParamsDict = _TckmapVariousStringParamsDictNoTag | TckmapVariousStringParamsDictTagged
24
+
25
+
26
+ _TckmapVariousFileParamsDictNoTag = typing.TypedDict('_TckmapVariousFileParamsDictNoTag', {
27
+ "obj": InputPathType,
28
+ })
29
+ TckmapVariousFileParamsDictTagged = typing.TypedDict('TckmapVariousFileParamsDictTagged', {
30
+ "@type": typing.Literal["VariousFile"],
31
+ "obj": InputPathType,
32
+ })
33
+ TckmapVariousFileParamsDict = _TckmapVariousFileParamsDictNoTag | TckmapVariousFileParamsDictTagged
34
+
35
+
36
+ _TckmapConfigParamsDictNoTag = typing.TypedDict('_TckmapConfigParamsDictNoTag', {
37
+ "key": str,
38
+ "value": str,
39
+ })
40
+ TckmapConfigParamsDictTagged = typing.TypedDict('TckmapConfigParamsDictTagged', {
41
+ "@type": typing.Literal["config"],
42
+ "key": str,
43
+ "value": str,
44
+ })
45
+ TckmapConfigParamsDict = _TckmapConfigParamsDictNoTag | TckmapConfigParamsDictTagged
46
+
47
+
48
+ _TckmapParamsDictNoTag = typing.TypedDict('_TckmapParamsDictNoTag', {
49
+ "template": typing.NotRequired[InputPathType | None],
50
+ "vox": typing.NotRequired[list[float] | None],
51
+ "datatype": typing.NotRequired[str | None],
52
+ "dec": bool,
53
+ "dixel": typing.NotRequired[typing.Union[TckmapVariousStringParamsDictTagged, TckmapVariousFileParamsDictTagged] | None],
54
+ "tod": typing.NotRequired[int | None],
55
+ "contrast": typing.NotRequired[str | None],
56
+ "image": typing.NotRequired[InputPathType | None],
57
+ "vector_file": typing.NotRequired[InputPathType | None],
58
+ "stat_vox": typing.NotRequired[str | None],
59
+ "stat_tck": typing.NotRequired[str | None],
60
+ "fwhm_tck": typing.NotRequired[float | None],
61
+ "map_zero": bool,
62
+ "backtrack": bool,
63
+ "upsample": typing.NotRequired[int | None],
64
+ "precise": bool,
65
+ "ends_only": bool,
66
+ "tck_weights_in": typing.NotRequired[InputPathType | None],
67
+ "info": bool,
68
+ "quiet": bool,
69
+ "debug": bool,
70
+ "force": bool,
71
+ "nthreads": typing.NotRequired[int | None],
72
+ "config": typing.NotRequired[list[TckmapConfigParamsDict] | None],
73
+ "help": bool,
74
+ "version": bool,
75
+ "tracks": InputPathType,
76
+ "output": str,
77
+ })
78
+ TckmapParamsDictTagged = typing.TypedDict('TckmapParamsDictTagged', {
79
+ "@type": typing.Literal["mrtrix/tckmap"],
80
+ "template": typing.NotRequired[InputPathType | None],
81
+ "vox": typing.NotRequired[list[float] | None],
82
+ "datatype": typing.NotRequired[str | None],
83
+ "dec": bool,
84
+ "dixel": typing.NotRequired[typing.Union[TckmapVariousStringParamsDictTagged, TckmapVariousFileParamsDictTagged] | None],
85
+ "tod": typing.NotRequired[int | None],
86
+ "contrast": typing.NotRequired[str | None],
87
+ "image": typing.NotRequired[InputPathType | None],
88
+ "vector_file": typing.NotRequired[InputPathType | None],
89
+ "stat_vox": typing.NotRequired[str | None],
90
+ "stat_tck": typing.NotRequired[str | None],
91
+ "fwhm_tck": typing.NotRequired[float | None],
92
+ "map_zero": bool,
93
+ "backtrack": bool,
94
+ "upsample": typing.NotRequired[int | None],
95
+ "precise": bool,
96
+ "ends_only": bool,
97
+ "tck_weights_in": typing.NotRequired[InputPathType | None],
98
+ "info": bool,
99
+ "quiet": bool,
100
+ "debug": bool,
101
+ "force": bool,
102
+ "nthreads": typing.NotRequired[int | None],
103
+ "config": typing.NotRequired[list[TckmapConfigParamsDict] | None],
104
+ "help": bool,
105
+ "version": bool,
106
+ "tracks": InputPathType,
107
+ "output": str,
108
+ })
109
+ TckmapParamsDict = _TckmapParamsDictNoTag | TckmapParamsDictTagged
110
+
111
+
112
+ def tckmap_dixel_cargs_dyn_fn(
113
+ t: str,
114
+ ) -> typing.Any:
115
+ """
116
+ Get build cargs function by command type.
117
+
118
+ Args:
119
+ t: Command type.
120
+ Returns:
121
+ Build cargs function.
122
+ """
123
+ return {
124
+ "VariousString": tckmap_various_string_cargs,
125
+ "VariousFile": tckmap_various_file_cargs,
126
+ }.get(t)
127
+
128
+
129
+ def tckmap_dixel_validate_dyn_fn(
130
+ t: str,
131
+ ) -> typing.Any:
132
+ """
133
+ Get validate params function by command type.
134
+
135
+ Args:
136
+ t: Command type.
137
+ Returns:
138
+ Validate params function.
139
+ """
140
+ return {
141
+ "VariousString": tckmap_various_string_validate,
142
+ "VariousFile": tckmap_various_file_validate,
143
+ }.get(t)
144
+
145
+
146
+ def tckmap_various_string(
147
+ obj: str,
148
+ ) -> TckmapVariousStringParamsDictTagged:
149
+ """
150
+ Build parameters.
151
+
152
+ Args:
153
+ obj: String object.
154
+ Returns:
155
+ Parameter dictionary
156
+ """
157
+ params = {
158
+ "@type": "VariousString",
159
+ "obj": obj,
160
+ }
161
+ return params
162
+
163
+
164
+ def tckmap_various_string_validate(
165
+ params: typing.Any,
166
+ ) -> None:
167
+ """
168
+ Validate parameters. Throws an error if `params` is not a valid
169
+ `TckmapVariousStringParamsDict` object.
170
+
171
+ Args:
172
+ params: The parameters object to validate.
173
+ """
174
+ if params is None or not isinstance(params, dict):
175
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
176
+ if params.get("obj", None) is None:
177
+ raise StyxValidationError("`obj` must not be None")
178
+ if not isinstance(params["obj"], str):
179
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `str`')
180
+
181
+
182
+ def tckmap_various_string_cargs(
183
+ params: TckmapVariousStringParamsDict,
184
+ execution: Execution,
185
+ ) -> list[str]:
186
+ """
187
+ Build command-line arguments from parameters.
188
+
189
+ Args:
190
+ params: The parameters.
191
+ execution: The execution object for resolving input paths.
192
+ Returns:
193
+ Command-line arguments.
194
+ """
195
+ cargs = []
196
+ cargs.append(params.get("obj", None))
197
+ return cargs
198
+
199
+
200
+ def tckmap_various_file(
201
+ obj: InputPathType,
202
+ ) -> TckmapVariousFileParamsDictTagged:
203
+ """
204
+ Build parameters.
205
+
206
+ Args:
207
+ obj: File object.
208
+ Returns:
209
+ Parameter dictionary
210
+ """
211
+ params = {
212
+ "@type": "VariousFile",
213
+ "obj": obj,
214
+ }
215
+ return params
216
+
217
+
218
+ def tckmap_various_file_validate(
219
+ params: typing.Any,
220
+ ) -> None:
221
+ """
222
+ Validate parameters. Throws an error if `params` is not a valid
223
+ `TckmapVariousFileParamsDict` object.
224
+
225
+ Args:
226
+ params: The parameters object to validate.
227
+ """
228
+ if params is None or not isinstance(params, dict):
229
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
230
+ if params.get("obj", None) is None:
231
+ raise StyxValidationError("`obj` must not be None")
232
+ if not isinstance(params["obj"], (pathlib.Path, str)):
233
+ raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `InputPathType`')
234
+
235
+
236
+ def tckmap_various_file_cargs(
237
+ params: TckmapVariousFileParamsDict,
238
+ execution: Execution,
239
+ ) -> list[str]:
240
+ """
241
+ Build command-line arguments from parameters.
242
+
243
+ Args:
244
+ params: The parameters.
245
+ execution: The execution object for resolving input paths.
246
+ Returns:
247
+ Command-line arguments.
248
+ """
249
+ cargs = []
250
+ cargs.append(execution.input_file(params.get("obj", None)))
251
+ return cargs
252
+
253
+
254
+ def tckmap_config(
255
+ key: str,
256
+ value: str,
257
+ ) -> TckmapConfigParamsDictTagged:
258
+ """
259
+ Build parameters.
260
+
261
+ Args:
262
+ key: temporarily set the value of an MRtrix config file entry.
263
+ value: temporarily set the value of an MRtrix config file entry.
264
+ Returns:
265
+ Parameter dictionary
266
+ """
267
+ params = {
268
+ "@type": "config",
269
+ "key": key,
270
+ "value": value,
271
+ }
272
+ return params
273
+
274
+
275
+ def tckmap_config_validate(
276
+ params: typing.Any,
277
+ ) -> None:
278
+ """
279
+ Validate parameters. Throws an error if `params` is not a valid
280
+ `TckmapConfigParamsDict` object.
281
+
282
+ Args:
283
+ params: The parameters object to validate.
284
+ """
285
+ if params is None or not isinstance(params, dict):
286
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
287
+ if params.get("key", None) is None:
288
+ raise StyxValidationError("`key` must not be None")
289
+ if not isinstance(params["key"], str):
290
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
291
+ if params.get("value", None) is None:
292
+ raise StyxValidationError("`value` must not be None")
293
+ if not isinstance(params["value"], str):
294
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
295
+
296
+
297
+ def tckmap_config_cargs(
298
+ params: TckmapConfigParamsDict,
299
+ execution: Execution,
300
+ ) -> list[str]:
301
+ """
302
+ Build command-line arguments from parameters.
303
+
304
+ Args:
305
+ params: The parameters.
306
+ execution: The execution object for resolving input paths.
307
+ Returns:
308
+ Command-line arguments.
309
+ """
310
+ cargs = []
311
+ cargs.append("-config")
312
+ cargs.append(params.get("key", None))
313
+ cargs.append(params.get("value", None))
314
+ return cargs
315
+
316
+
317
+ class TckmapOutputs(typing.NamedTuple):
318
+ """
319
+ Output object returned when calling `TckmapParamsDict(...)`.
320
+ """
321
+ root: OutputPathType
322
+ """Output root folder. This is the root folder for all outputs."""
323
+ output: OutputPathType
324
+ """the output track-weighted image"""
325
+
326
+
327
+ def tckmap_params(
328
+ tracks: InputPathType,
329
+ output: str,
330
+ template: InputPathType | None = None,
331
+ vox: list[float] | None = None,
332
+ datatype: str | None = None,
333
+ dec: bool = False,
334
+ dixel: typing.Union[TckmapVariousStringParamsDictTagged, TckmapVariousFileParamsDictTagged] | None = None,
335
+ tod: int | None = None,
336
+ contrast: str | None = None,
337
+ image: InputPathType | None = None,
338
+ vector_file: InputPathType | None = None,
339
+ stat_vox: str | None = None,
340
+ stat_tck: str | None = None,
341
+ fwhm_tck: float | None = None,
342
+ map_zero: bool = False,
343
+ backtrack: bool = False,
344
+ upsample: int | None = None,
345
+ precise: bool = False,
346
+ ends_only: bool = False,
347
+ tck_weights_in: InputPathType | None = None,
348
+ info: bool = False,
349
+ quiet: bool = False,
350
+ debug: bool = False,
351
+ force: bool = False,
352
+ nthreads: int | None = None,
353
+ config: list[TckmapConfigParamsDict] | None = None,
354
+ help_: bool = False,
355
+ version: bool = False,
356
+ ) -> TckmapParamsDictTagged:
357
+ """
358
+ Build parameters.
359
+
360
+ Args:
361
+ tracks: the input track file.
362
+ output: the output track-weighted image.
363
+ template: an image file to be used as a template for the output (the\
364
+ output image will have the same transform and field of view).
365
+ vox: provide either an isotropic voxel size (in mm), or comma-separated\
366
+ list of 3 voxel dimensions.
367
+ datatype: specify output image data type.
368
+ dec: perform track mapping in directionally-encoded colour (DEC) space.
369
+ dixel: map streamlines to dixels within each voxel; requires either a\
370
+ number of dixels (references an internal direction set), or a path to a\
371
+ text file containing a set of directions stored as azimuth/elevation\
372
+ pairs.
373
+ tod: generate a Track Orientation Distribution (TOD) in each voxel;\
374
+ need to specify the maximum spherical harmonic degree lmax to use when\
375
+ generating Apodised Point Spread Functions.
376
+ contrast: define the desired form of contrast for the output image\
377
+ Options are: tdi, length, invlength, scalar_map, scalar_map_count,\
378
+ fod_amp, curvature, vector_file (default: tdi).
379
+ image: provide the scalar image map for generating images with\
380
+ 'scalar_map' / 'scalar_map_count' contrast, or the spherical harmonics\
381
+ image for 'fod_amp' contrast.
382
+ vector_file: provide the vector data file for generating images with\
383
+ 'vector_file' contrast.
384
+ stat_vox: define the statistic for choosing the final voxel intensities\
385
+ for a given contrast type given the individual values from the tracks\
386
+ passing through each voxel.\
387
+ Options are: sum, min, mean, max (default: sum).
388
+ stat_tck: define the statistic for choosing the contribution to be made\
389
+ by each streamline as a function of the samples taken along their\
390
+ lengths.\
391
+ Only has an effect for 'scalar_map', 'fod_amp' and 'curvature'\
392
+ contrast types.\
393
+ Options are: sum, min, mean, max, median, mean_nonzero, gaussian,\
394
+ ends_min, ends_mean, ends_max, ends_prod (default: mean).
395
+ fwhm_tck: when using gaussian-smoothed per-track statistic, specify the\
396
+ desired full-width half-maximum of the Gaussian smoothing kernel (in\
397
+ mm).
398
+ map_zero: if a streamline has zero contribution based on the contrast &\
399
+ statistic, typically it is not mapped; use this option to still\
400
+ contribute to the map even if this is the case (these non-contributing\
401
+ voxels can then influence the mean value in each voxel of the map).
402
+ backtrack: when using -stat_tck ends_*, if the streamline endpoint is\
403
+ outside the FoV, backtrack along the streamline trajectory until an\
404
+ appropriate point is found.
405
+ upsample: upsample the tracks by some ratio using Hermite interpolation\
406
+ before mappping\
407
+ (If omitted, an appropriate ratio will be determined automatically).
408
+ precise: use a more precise streamline mapping strategy, that\
409
+ accurately quantifies the length through each voxel (these lengths are\
410
+ then taken into account during TWI calculation).
411
+ ends_only: only map the streamline endpoints to the image.
412
+ tck_weights_in: specify a text scalar file containing the streamline\
413
+ weights.
414
+ info: display information messages.
415
+ quiet: do not display information messages or progress status;\
416
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
417
+ environment variable to a non-empty string.
418
+ debug: display debugging messages.
419
+ force: force overwrite of output files (caution: using the same file as\
420
+ input and output might cause unexpected behaviour).
421
+ nthreads: use this number of threads in multi-threaded applications\
422
+ (set to 0 to disable multi-threading).
423
+ config: temporarily set the value of an MRtrix config file entry.
424
+ help_: display this information page and exit.
425
+ version: display version information and exit.
426
+ Returns:
427
+ Parameter dictionary
428
+ """
429
+ params = {
430
+ "@type": "mrtrix/tckmap",
431
+ "dec": dec,
432
+ "map_zero": map_zero,
433
+ "backtrack": backtrack,
434
+ "precise": precise,
435
+ "ends_only": ends_only,
436
+ "info": info,
437
+ "quiet": quiet,
438
+ "debug": debug,
439
+ "force": force,
440
+ "help": help_,
441
+ "version": version,
442
+ "tracks": tracks,
443
+ "output": output,
444
+ }
445
+ if template is not None:
446
+ params["template"] = template
447
+ if vox is not None:
448
+ params["vox"] = vox
449
+ if datatype is not None:
450
+ params["datatype"] = datatype
451
+ if dixel is not None:
452
+ params["dixel"] = dixel
453
+ if tod is not None:
454
+ params["tod"] = tod
455
+ if contrast is not None:
456
+ params["contrast"] = contrast
457
+ if image is not None:
458
+ params["image"] = image
459
+ if vector_file is not None:
460
+ params["vector_file"] = vector_file
461
+ if stat_vox is not None:
462
+ params["stat_vox"] = stat_vox
463
+ if stat_tck is not None:
464
+ params["stat_tck"] = stat_tck
465
+ if fwhm_tck is not None:
466
+ params["fwhm_tck"] = fwhm_tck
467
+ if upsample is not None:
468
+ params["upsample"] = upsample
469
+ if tck_weights_in is not None:
470
+ params["tck_weights_in"] = tck_weights_in
471
+ if nthreads is not None:
472
+ params["nthreads"] = nthreads
473
+ if config is not None:
474
+ params["config"] = config
475
+ return params
476
+
477
+
478
+ def tckmap_validate(
479
+ params: typing.Any,
480
+ ) -> None:
481
+ """
482
+ Validate parameters. Throws an error if `params` is not a valid
483
+ `TckmapParamsDict` object.
484
+
485
+ Args:
486
+ params: The parameters object to validate.
487
+ """
488
+ if params is None or not isinstance(params, dict):
489
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
490
+ if params.get("template", None) is not None:
491
+ if not isinstance(params["template"], (pathlib.Path, str)):
492
+ raise StyxValidationError(f'`template` has the wrong type: Received `{type(params.get("template", None))}` expected `InputPathType | None`')
493
+ if params.get("vox", None) is not None:
494
+ if not isinstance(params["vox"], list):
495
+ raise StyxValidationError(f'`vox` has the wrong type: Received `{type(params.get("vox", None))}` expected `list[float] | None`')
496
+ for e in params["vox"]:
497
+ if not isinstance(e, (float, int)):
498
+ raise StyxValidationError(f'`vox` has the wrong type: Received `{type(params.get("vox", None))}` expected `list[float] | None`')
499
+ if params.get("datatype", None) is not None:
500
+ if not isinstance(params["datatype"], str):
501
+ raise StyxValidationError(f'`datatype` has the wrong type: Received `{type(params.get("datatype", None))}` expected `str | None`')
502
+ if params.get("dec", False) is None:
503
+ raise StyxValidationError("`dec` must not be None")
504
+ if not isinstance(params["dec"], bool):
505
+ raise StyxValidationError(f'`dec` has the wrong type: Received `{type(params.get("dec", False))}` expected `bool`')
506
+ if params.get("dixel", None) is not None:
507
+ if not isinstance(params["dixel"], dict):
508
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params["dixel"])}\'')
509
+ if "@type" not in params["dixel"]:
510
+ raise StyxValidationError("Params object is missing `@type`")
511
+ if params["dixel"]["@type"] not in ["VariousString", "VariousFile"]:
512
+ raise StyxValidationError("Parameter `dixel`s `@type` must be one of [\"VariousString\", \"VariousFile\"]")
513
+ tckmap_dixel_validate_dyn_fn(params["dixel"]["@type"])(params["dixel"])
514
+ if params.get("tod", None) is not None:
515
+ if not isinstance(params["tod"], int):
516
+ raise StyxValidationError(f'`tod` has the wrong type: Received `{type(params.get("tod", None))}` expected `int | None`')
517
+ if params.get("contrast", None) is not None:
518
+ if not isinstance(params["contrast"], str):
519
+ raise StyxValidationError(f'`contrast` has the wrong type: Received `{type(params.get("contrast", None))}` expected `str | None`')
520
+ if params.get("image", None) is not None:
521
+ if not isinstance(params["image"], (pathlib.Path, str)):
522
+ raise StyxValidationError(f'`image` has the wrong type: Received `{type(params.get("image", None))}` expected `InputPathType | None`')
523
+ if params.get("vector_file", None) is not None:
524
+ if not isinstance(params["vector_file"], (pathlib.Path, str)):
525
+ raise StyxValidationError(f'`vector_file` has the wrong type: Received `{type(params.get("vector_file", None))}` expected `InputPathType | None`')
526
+ if params.get("stat_vox", None) is not None:
527
+ if not isinstance(params["stat_vox"], str):
528
+ raise StyxValidationError(f'`stat_vox` has the wrong type: Received `{type(params.get("stat_vox", None))}` expected `str | None`')
529
+ if params.get("stat_tck", None) is not None:
530
+ if not isinstance(params["stat_tck"], str):
531
+ raise StyxValidationError(f'`stat_tck` has the wrong type: Received `{type(params.get("stat_tck", None))}` expected `str | None`')
532
+ if params.get("fwhm_tck", None) is not None:
533
+ if not isinstance(params["fwhm_tck"], (float, int)):
534
+ raise StyxValidationError(f'`fwhm_tck` has the wrong type: Received `{type(params.get("fwhm_tck", None))}` expected `float | None`')
535
+ if params.get("map_zero", False) is None:
536
+ raise StyxValidationError("`map_zero` must not be None")
537
+ if not isinstance(params["map_zero"], bool):
538
+ raise StyxValidationError(f'`map_zero` has the wrong type: Received `{type(params.get("map_zero", False))}` expected `bool`')
539
+ if params.get("backtrack", False) is None:
540
+ raise StyxValidationError("`backtrack` must not be None")
541
+ if not isinstance(params["backtrack"], bool):
542
+ raise StyxValidationError(f'`backtrack` has the wrong type: Received `{type(params.get("backtrack", False))}` expected `bool`')
543
+ if params.get("upsample", None) is not None:
544
+ if not isinstance(params["upsample"], int):
545
+ raise StyxValidationError(f'`upsample` has the wrong type: Received `{type(params.get("upsample", None))}` expected `int | None`')
546
+ if params.get("precise", False) is None:
547
+ raise StyxValidationError("`precise` must not be None")
548
+ if not isinstance(params["precise"], bool):
549
+ raise StyxValidationError(f'`precise` has the wrong type: Received `{type(params.get("precise", False))}` expected `bool`')
550
+ if params.get("ends_only", False) is None:
551
+ raise StyxValidationError("`ends_only` must not be None")
552
+ if not isinstance(params["ends_only"], bool):
553
+ raise StyxValidationError(f'`ends_only` has the wrong type: Received `{type(params.get("ends_only", False))}` expected `bool`')
554
+ if params.get("tck_weights_in", None) is not None:
555
+ if not isinstance(params["tck_weights_in"], (pathlib.Path, str)):
556
+ raise StyxValidationError(f'`tck_weights_in` has the wrong type: Received `{type(params.get("tck_weights_in", None))}` expected `InputPathType | None`')
557
+ if params.get("info", False) is None:
558
+ raise StyxValidationError("`info` must not be None")
559
+ if not isinstance(params["info"], bool):
560
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
561
+ if params.get("quiet", False) is None:
562
+ raise StyxValidationError("`quiet` must not be None")
563
+ if not isinstance(params["quiet"], bool):
564
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
565
+ if params.get("debug", False) is None:
566
+ raise StyxValidationError("`debug` must not be None")
567
+ if not isinstance(params["debug"], bool):
568
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
569
+ if params.get("force", False) is None:
570
+ raise StyxValidationError("`force` must not be None")
571
+ if not isinstance(params["force"], bool):
572
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
573
+ if params.get("nthreads", None) is not None:
574
+ if not isinstance(params["nthreads"], int):
575
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
576
+ if params.get("config", None) is not None:
577
+ if not isinstance(params["config"], list):
578
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[TckmapConfigParamsDict] | None`')
579
+ for e in params["config"]:
580
+ tckmap_config_validate(e)
581
+ if params.get("help", False) is None:
582
+ raise StyxValidationError("`help` must not be None")
583
+ if not isinstance(params["help"], bool):
584
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
585
+ if params.get("version", False) is None:
586
+ raise StyxValidationError("`version` must not be None")
587
+ if not isinstance(params["version"], bool):
588
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
589
+ if params.get("tracks", None) is None:
590
+ raise StyxValidationError("`tracks` must not be None")
591
+ if not isinstance(params["tracks"], (pathlib.Path, str)):
592
+ raise StyxValidationError(f'`tracks` has the wrong type: Received `{type(params.get("tracks", None))}` expected `InputPathType`')
593
+ if params.get("output", None) is None:
594
+ raise StyxValidationError("`output` must not be None")
595
+ if not isinstance(params["output"], str):
596
+ raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `str`')
597
+
598
+
599
+ def tckmap_cargs(
600
+ params: TckmapParamsDict,
601
+ execution: Execution,
602
+ ) -> list[str]:
603
+ """
604
+ Build command-line arguments from parameters.
605
+
606
+ Args:
607
+ params: The parameters.
608
+ execution: The execution object for resolving input paths.
609
+ Returns:
610
+ Command-line arguments.
611
+ """
612
+ cargs = []
613
+ cargs.append("tckmap")
614
+ if params.get("template", None) is not None:
615
+ cargs.extend([
616
+ "-template",
617
+ execution.input_file(params.get("template", None))
618
+ ])
619
+ if params.get("vox", None) is not None:
620
+ cargs.extend([
621
+ "-vox",
622
+ ",".join(map(str, params.get("vox", None)))
623
+ ])
624
+ if params.get("datatype", None) is not None:
625
+ cargs.extend([
626
+ "-datatype",
627
+ params.get("datatype", None)
628
+ ])
629
+ if params.get("dec", False):
630
+ cargs.append("-dec")
631
+ if params.get("dixel", None) is not None:
632
+ cargs.extend([
633
+ "-dixel",
634
+ *tckmap_dixel_cargs_dyn_fn(params.get("dixel", None)["@type"])(params.get("dixel", None), execution)
635
+ ])
636
+ if params.get("tod", None) is not None:
637
+ cargs.extend([
638
+ "-tod",
639
+ str(params.get("tod", None))
640
+ ])
641
+ if params.get("contrast", None) is not None:
642
+ cargs.extend([
643
+ "-contrast",
644
+ params.get("contrast", None)
645
+ ])
646
+ if params.get("image", None) is not None:
647
+ cargs.extend([
648
+ "-image",
649
+ execution.input_file(params.get("image", None))
650
+ ])
651
+ if params.get("vector_file", None) is not None:
652
+ cargs.extend([
653
+ "-vector_file",
654
+ execution.input_file(params.get("vector_file", None))
655
+ ])
656
+ if params.get("stat_vox", None) is not None:
657
+ cargs.extend([
658
+ "-stat_vox",
659
+ params.get("stat_vox", None)
660
+ ])
661
+ if params.get("stat_tck", None) is not None:
662
+ cargs.extend([
663
+ "-stat_tck",
664
+ params.get("stat_tck", None)
665
+ ])
666
+ if params.get("fwhm_tck", None) is not None:
667
+ cargs.extend([
668
+ "-fwhm_tck",
669
+ str(params.get("fwhm_tck", None))
670
+ ])
671
+ if params.get("map_zero", False):
672
+ cargs.append("-map_zero")
673
+ if params.get("backtrack", False):
674
+ cargs.append("-backtrack")
675
+ if params.get("upsample", None) is not None:
676
+ cargs.extend([
677
+ "-upsample",
678
+ str(params.get("upsample", None))
679
+ ])
680
+ if params.get("precise", False):
681
+ cargs.append("-precise")
682
+ if params.get("ends_only", False):
683
+ cargs.append("-ends_only")
684
+ if params.get("tck_weights_in", None) is not None:
685
+ cargs.extend([
686
+ "-tck_weights_in",
687
+ execution.input_file(params.get("tck_weights_in", None))
688
+ ])
689
+ if params.get("info", False):
690
+ cargs.append("-info")
691
+ if params.get("quiet", False):
692
+ cargs.append("-quiet")
693
+ if params.get("debug", False):
694
+ cargs.append("-debug")
695
+ if params.get("force", False):
696
+ cargs.append("-force")
697
+ if params.get("nthreads", None) is not None:
698
+ cargs.extend([
699
+ "-nthreads",
700
+ str(params.get("nthreads", None))
701
+ ])
702
+ if params.get("config", None) is not None:
703
+ cargs.extend([a for c in [tckmap_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
704
+ if params.get("help", False):
705
+ cargs.append("-help")
706
+ if params.get("version", False):
707
+ cargs.append("-version")
708
+ cargs.append(execution.input_file(params.get("tracks", None)))
709
+ cargs.append(params.get("output", None))
710
+ return cargs
711
+
712
+
713
+ def tckmap_outputs(
714
+ params: TckmapParamsDict,
715
+ execution: Execution,
716
+ ) -> TckmapOutputs:
717
+ """
718
+ Build outputs object containing output file paths and possibly stdout/stderr.
719
+
720
+ Args:
721
+ params: The parameters.
722
+ execution: The execution object for resolving input paths.
723
+ Returns:
724
+ Outputs object.
725
+ """
726
+ ret = TckmapOutputs(
727
+ root=execution.output_file("."),
728
+ output=execution.output_file(params.get("output", None)),
729
+ )
730
+ return ret
731
+
732
+
733
+ def tckmap_execute(
734
+ params: TckmapParamsDict,
735
+ runner: Runner | None = None,
736
+ ) -> TckmapOutputs:
737
+ """
738
+ tckmap
739
+
740
+ Use track data as a form of contrast for producing a high-resolution image.
741
+
742
+ Note: if you run into limitations with RAM usage, make sure you output the
743
+ results to a .mif file or .mih / .dat file pair - this will avoid the
744
+ allocation of an additional buffer to store the output for write-out.
745
+
746
+ References:
747
+
748
+ * For TDI or DEC TDI:
749
+ Calamante, F.; Tournier, J.-D.; Jackson, G. D. & Connelly, A. Track-density
750
+ imaging (TDI): Super-resolution white matter imaging using whole-brain
751
+ track-density mapping. NeuroImage, 2010, 53, 1233-1243
752
+
753
+ * If using -contrast length and -stat_vox mean:
754
+ Pannek, K.; Mathias, J. L.; Bigler, E. D.; Brown, G.; Taylor, J. D. & Rose,
755
+ S. E. The average pathlength map: A diffusion MRI tractography-derived index
756
+ for studying brain pathology. NeuroImage, 2011, 55, 133-141
757
+
758
+ * If using -dixel option with TDI contrast only:
759
+ Smith, R.E., Tournier, J-D., Calamante, F., Connelly, A. A novel paradigm
760
+ for automated segmentation of very large whole-brain probabilistic
761
+ tractography data sets. In proc. ISMRM, 2011, 19, 673
762
+
763
+ * If using -dixel option with any other contrast:
764
+ Pannek, K., Raffelt, D., Salvado, O., Rose, S. Incorporating directional
765
+ information in diffusion tractography derived maps: angular track imaging
766
+ (ATI). In Proc. ISMRM, 2012, 20, 1912
767
+
768
+ * If using -tod option:
769
+ Dhollander, T., Emsell, L., Van Hecke, W., Maes, F., Sunaert, S., Suetens,
770
+ P. Track Orientation Density Imaging (TODI) and Track Orientation
771
+ Distribution (TOD) based tractography. NeuroImage, 2014, 94, 312-336
772
+
773
+ * If using other contrasts / statistics:
774
+ Calamante, F.; Tournier, J.-D.; Smith, R. E. & Connelly, A. A generalised
775
+ framework for super-resolution track-weighted imaging. NeuroImage, 2012, 59,
776
+ 2494-2503
777
+
778
+ * If using -precise mapping option:
779
+ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT:
780
+ Spherical-deconvolution informed filtering of tractograms. NeuroImage, 2013,
781
+ 67, 298-312 (Appendix 3).
782
+
783
+ Author: MRTrix3 Developers
784
+
785
+ URL: https://www.mrtrix.org/
786
+
787
+ Args:
788
+ params: The parameters.
789
+ runner: Command runner.
790
+ Returns:
791
+ NamedTuple of outputs (described in `TckmapOutputs`).
792
+ """
793
+ tckmap_validate(params)
794
+ runner = runner or get_global_runner()
795
+ execution = runner.start_execution(TCKMAP_METADATA)
796
+ params = execution.params(params)
797
+ cargs = tckmap_cargs(params, execution)
798
+ ret = tckmap_outputs(params, execution)
799
+ execution.run(cargs)
800
+ return ret
801
+
802
+
803
+ def tckmap(
804
+ tracks: InputPathType,
805
+ output: str,
806
+ template: InputPathType | None = None,
807
+ vox: list[float] | None = None,
808
+ datatype: str | None = None,
809
+ dec: bool = False,
810
+ dixel: typing.Union[TckmapVariousStringParamsDictTagged, TckmapVariousFileParamsDictTagged] | None = None,
811
+ tod: int | None = None,
812
+ contrast: str | None = None,
813
+ image: InputPathType | None = None,
814
+ vector_file: InputPathType | None = None,
815
+ stat_vox: str | None = None,
816
+ stat_tck: str | None = None,
817
+ fwhm_tck: float | None = None,
818
+ map_zero: bool = False,
819
+ backtrack: bool = False,
820
+ upsample: int | None = None,
821
+ precise: bool = False,
822
+ ends_only: bool = False,
823
+ tck_weights_in: InputPathType | None = None,
824
+ info: bool = False,
825
+ quiet: bool = False,
826
+ debug: bool = False,
827
+ force: bool = False,
828
+ nthreads: int | None = None,
829
+ config: list[TckmapConfigParamsDict] | None = None,
830
+ help_: bool = False,
831
+ version: bool = False,
832
+ runner: Runner | None = None,
833
+ ) -> TckmapOutputs:
834
+ """
835
+ tckmap
836
+
837
+ Use track data as a form of contrast for producing a high-resolution image.
838
+
839
+ Note: if you run into limitations with RAM usage, make sure you output the
840
+ results to a .mif file or .mih / .dat file pair - this will avoid the
841
+ allocation of an additional buffer to store the output for write-out.
842
+
843
+ References:
844
+
845
+ * For TDI or DEC TDI:
846
+ Calamante, F.; Tournier, J.-D.; Jackson, G. D. & Connelly, A. Track-density
847
+ imaging (TDI): Super-resolution white matter imaging using whole-brain
848
+ track-density mapping. NeuroImage, 2010, 53, 1233-1243
849
+
850
+ * If using -contrast length and -stat_vox mean:
851
+ Pannek, K.; Mathias, J. L.; Bigler, E. D.; Brown, G.; Taylor, J. D. & Rose,
852
+ S. E. The average pathlength map: A diffusion MRI tractography-derived index
853
+ for studying brain pathology. NeuroImage, 2011, 55, 133-141
854
+
855
+ * If using -dixel option with TDI contrast only:
856
+ Smith, R.E., Tournier, J-D., Calamante, F., Connelly, A. A novel paradigm
857
+ for automated segmentation of very large whole-brain probabilistic
858
+ tractography data sets. In proc. ISMRM, 2011, 19, 673
859
+
860
+ * If using -dixel option with any other contrast:
861
+ Pannek, K., Raffelt, D., Salvado, O., Rose, S. Incorporating directional
862
+ information in diffusion tractography derived maps: angular track imaging
863
+ (ATI). In Proc. ISMRM, 2012, 20, 1912
864
+
865
+ * If using -tod option:
866
+ Dhollander, T., Emsell, L., Van Hecke, W., Maes, F., Sunaert, S., Suetens,
867
+ P. Track Orientation Density Imaging (TODI) and Track Orientation
868
+ Distribution (TOD) based tractography. NeuroImage, 2014, 94, 312-336
869
+
870
+ * If using other contrasts / statistics:
871
+ Calamante, F.; Tournier, J.-D.; Smith, R. E. & Connelly, A. A generalised
872
+ framework for super-resolution track-weighted imaging. NeuroImage, 2012, 59,
873
+ 2494-2503
874
+
875
+ * If using -precise mapping option:
876
+ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT:
877
+ Spherical-deconvolution informed filtering of tractograms. NeuroImage, 2013,
878
+ 67, 298-312 (Appendix 3).
879
+
880
+ Author: MRTrix3 Developers
881
+
882
+ URL: https://www.mrtrix.org/
883
+
884
+ Args:
885
+ tracks: the input track file.
886
+ output: the output track-weighted image.
887
+ template: an image file to be used as a template for the output (the\
888
+ output image will have the same transform and field of view).
889
+ vox: provide either an isotropic voxel size (in mm), or comma-separated\
890
+ list of 3 voxel dimensions.
891
+ datatype: specify output image data type.
892
+ dec: perform track mapping in directionally-encoded colour (DEC) space.
893
+ dixel: map streamlines to dixels within each voxel; requires either a\
894
+ number of dixels (references an internal direction set), or a path to a\
895
+ text file containing a set of directions stored as azimuth/elevation\
896
+ pairs.
897
+ tod: generate a Track Orientation Distribution (TOD) in each voxel;\
898
+ need to specify the maximum spherical harmonic degree lmax to use when\
899
+ generating Apodised Point Spread Functions.
900
+ contrast: define the desired form of contrast for the output image\
901
+ Options are: tdi, length, invlength, scalar_map, scalar_map_count,\
902
+ fod_amp, curvature, vector_file (default: tdi).
903
+ image: provide the scalar image map for generating images with\
904
+ 'scalar_map' / 'scalar_map_count' contrast, or the spherical harmonics\
905
+ image for 'fod_amp' contrast.
906
+ vector_file: provide the vector data file for generating images with\
907
+ 'vector_file' contrast.
908
+ stat_vox: define the statistic for choosing the final voxel intensities\
909
+ for a given contrast type given the individual values from the tracks\
910
+ passing through each voxel.\
911
+ Options are: sum, min, mean, max (default: sum).
912
+ stat_tck: define the statistic for choosing the contribution to be made\
913
+ by each streamline as a function of the samples taken along their\
914
+ lengths.\
915
+ Only has an effect for 'scalar_map', 'fod_amp' and 'curvature'\
916
+ contrast types.\
917
+ Options are: sum, min, mean, max, median, mean_nonzero, gaussian,\
918
+ ends_min, ends_mean, ends_max, ends_prod (default: mean).
919
+ fwhm_tck: when using gaussian-smoothed per-track statistic, specify the\
920
+ desired full-width half-maximum of the Gaussian smoothing kernel (in\
921
+ mm).
922
+ map_zero: if a streamline has zero contribution based on the contrast &\
923
+ statistic, typically it is not mapped; use this option to still\
924
+ contribute to the map even if this is the case (these non-contributing\
925
+ voxels can then influence the mean value in each voxel of the map).
926
+ backtrack: when using -stat_tck ends_*, if the streamline endpoint is\
927
+ outside the FoV, backtrack along the streamline trajectory until an\
928
+ appropriate point is found.
929
+ upsample: upsample the tracks by some ratio using Hermite interpolation\
930
+ before mappping\
931
+ (If omitted, an appropriate ratio will be determined automatically).
932
+ precise: use a more precise streamline mapping strategy, that\
933
+ accurately quantifies the length through each voxel (these lengths are\
934
+ then taken into account during TWI calculation).
935
+ ends_only: only map the streamline endpoints to the image.
936
+ tck_weights_in: specify a text scalar file containing the streamline\
937
+ weights.
938
+ info: display information messages.
939
+ quiet: do not display information messages or progress status;\
940
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
941
+ environment variable to a non-empty string.
942
+ debug: display debugging messages.
943
+ force: force overwrite of output files (caution: using the same file as\
944
+ input and output might cause unexpected behaviour).
945
+ nthreads: use this number of threads in multi-threaded applications\
946
+ (set to 0 to disable multi-threading).
947
+ config: temporarily set the value of an MRtrix config file entry.
948
+ help_: display this information page and exit.
949
+ version: display version information and exit.
950
+ runner: Command runner.
951
+ Returns:
952
+ NamedTuple of outputs (described in `TckmapOutputs`).
953
+ """
954
+ params = tckmap_params(
955
+ template=template,
956
+ vox=vox,
957
+ datatype=datatype,
958
+ dec=dec,
959
+ dixel=dixel,
960
+ tod=tod,
961
+ contrast=contrast,
962
+ image=image,
963
+ vector_file=vector_file,
964
+ stat_vox=stat_vox,
965
+ stat_tck=stat_tck,
966
+ fwhm_tck=fwhm_tck,
967
+ map_zero=map_zero,
968
+ backtrack=backtrack,
969
+ upsample=upsample,
970
+ precise=precise,
971
+ ends_only=ends_only,
972
+ tck_weights_in=tck_weights_in,
973
+ info=info,
974
+ quiet=quiet,
975
+ debug=debug,
976
+ force=force,
977
+ nthreads=nthreads,
978
+ config=config,
979
+ help_=help_,
980
+ version=version,
981
+ tracks=tracks,
982
+ output=output,
983
+ )
984
+ return tckmap_execute(params, runner)
985
+
986
+
987
+ __all__ = [
988
+ "TCKMAP_METADATA",
989
+ "TckmapConfigParamsDict",
990
+ "TckmapConfigParamsDictTagged",
991
+ "TckmapOutputs",
992
+ "TckmapParamsDict",
993
+ "TckmapParamsDictTagged",
994
+ "TckmapVariousFileParamsDict",
995
+ "TckmapVariousFileParamsDictTagged",
996
+ "TckmapVariousStringParamsDict",
997
+ "TckmapVariousStringParamsDictTagged",
998
+ "tckmap",
999
+ "tckmap_config",
1000
+ "tckmap_execute",
1001
+ "tckmap_params",
1002
+ "tckmap_various_file",
1003
+ "tckmap_various_string",
1004
+ ]