niwrap-mrtrix 0.5.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.

Potentially problematic release.


This version of niwrap-mrtrix might be problematic. Click here for more details.

Files changed (119) hide show
  1. niwrap_mrtrix/mrtrix/__init__.py +130 -0
  2. niwrap_mrtrix/mrtrix/afdconnectivity.py +445 -0
  3. niwrap_mrtrix/mrtrix/amp2response.py +453 -0
  4. niwrap_mrtrix/mrtrix/amp2sh.py +656 -0
  5. niwrap_mrtrix/mrtrix/connectome2tck.py +470 -0
  6. niwrap_mrtrix/mrtrix/connectomeedit.py +338 -0
  7. niwrap_mrtrix/mrtrix/connectomestats.py +767 -0
  8. niwrap_mrtrix/mrtrix/dcmedit.py +440 -0
  9. niwrap_mrtrix/mrtrix/dcminfo.py +416 -0
  10. niwrap_mrtrix/mrtrix/dirflip.py +362 -0
  11. niwrap_mrtrix/mrtrix/dirgen.py +423 -0
  12. niwrap_mrtrix/mrtrix/dirmerge.py +365 -0
  13. niwrap_mrtrix/mrtrix/dirorder.py +347 -0
  14. niwrap_mrtrix/mrtrix/dirsplit.py +358 -0
  15. niwrap_mrtrix/mrtrix/dirstat.py +530 -0
  16. niwrap_mrtrix/mrtrix/dwi2adc.py +428 -0
  17. niwrap_mrtrix/mrtrix/dwi2fod.py +879 -0
  18. niwrap_mrtrix/mrtrix/dwi2mask.py +463 -0
  19. niwrap_mrtrix/mrtrix/dwi2response.py +1295 -0
  20. niwrap_mrtrix/mrtrix/dwi2tensor.py +587 -0
  21. niwrap_mrtrix/mrtrix/dwibiascorrect.py +467 -0
  22. niwrap_mrtrix/mrtrix/dwidenoise.py +478 -0
  23. niwrap_mrtrix/mrtrix/dwiextract.py +825 -0
  24. niwrap_mrtrix/mrtrix/dwigradcheck.py +534 -0
  25. niwrap_mrtrix/mrtrix/fixel2peaks.py +452 -0
  26. niwrap_mrtrix/mrtrix/fixel2sh.py +357 -0
  27. niwrap_mrtrix/mrtrix/fixel2tsf.py +357 -0
  28. niwrap_mrtrix/mrtrix/fixel2voxel.py +437 -0
  29. niwrap_mrtrix/mrtrix/fixelcfestats.py +893 -0
  30. niwrap_mrtrix/mrtrix/fixelconnectivity.py +391 -0
  31. niwrap_mrtrix/mrtrix/fixelconvert.py +588 -0
  32. niwrap_mrtrix/mrtrix/fixelcorrespondence.py +371 -0
  33. niwrap_mrtrix/mrtrix/fixelcrop.py +348 -0
  34. niwrap_mrtrix/mrtrix/fixelfilter.py +616 -0
  35. niwrap_mrtrix/mrtrix/fixelreorient.py +361 -0
  36. niwrap_mrtrix/mrtrix/fod2dec.py +469 -0
  37. niwrap_mrtrix/mrtrix/fod2fixel.py +530 -0
  38. niwrap_mrtrix/mrtrix/label2colour.py +351 -0
  39. niwrap_mrtrix/mrtrix/label2mesh.py +343 -0
  40. niwrap_mrtrix/mrtrix/labelconvert.py +377 -0
  41. niwrap_mrtrix/mrtrix/labelstats.py +344 -0
  42. niwrap_mrtrix/mrtrix/maskdump.py +336 -0
  43. niwrap_mrtrix/mrtrix/maskfilter.py +537 -0
  44. niwrap_mrtrix/mrtrix/mesh2voxel.py +348 -0
  45. niwrap_mrtrix/mrtrix/meshconvert.py +410 -0
  46. niwrap_mrtrix/mrtrix/meshfilter.py +370 -0
  47. niwrap_mrtrix/mrtrix/mraverageheader.py +396 -0
  48. niwrap_mrtrix/mrtrix/mrcalc.py +3047 -0
  49. niwrap_mrtrix/mrtrix/mrcat.py +382 -0
  50. niwrap_mrtrix/mrtrix/mrcentroid.py +344 -0
  51. niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +363 -0
  52. niwrap_mrtrix/mrtrix/mrclusterstats.py +736 -0
  53. niwrap_mrtrix/mrtrix/mrcolour.py +401 -0
  54. niwrap_mrtrix/mrtrix/mrconvert.py +1423 -0
  55. niwrap_mrtrix/mrtrix/mrdegibbs.py +443 -0
  56. niwrap_mrtrix/mrtrix/mrdump.py +351 -0
  57. niwrap_mrtrix/mrtrix/mredit.py +546 -0
  58. niwrap_mrtrix/mrtrix/mrfilter.py +716 -0
  59. niwrap_mrtrix/mrtrix/mrgrid.py +819 -0
  60. niwrap_mrtrix/mrtrix/mrhistmatch.py +403 -0
  61. niwrap_mrtrix/mrtrix/mrhistogram.py +393 -0
  62. niwrap_mrtrix/mrtrix/mrinfo.py +990 -0
  63. niwrap_mrtrix/mrtrix/mrmath.py +413 -0
  64. niwrap_mrtrix/mrtrix/mrmetric.py +425 -0
  65. niwrap_mrtrix/mrtrix/mrregister.py +1676 -0
  66. niwrap_mrtrix/mrtrix/mrstats.py +427 -0
  67. niwrap_mrtrix/mrtrix/mrthreshold.py +549 -0
  68. niwrap_mrtrix/mrtrix/mrtransform.py +1061 -0
  69. niwrap_mrtrix/mrtrix/mtnormalise.py +596 -0
  70. niwrap_mrtrix/mrtrix/peaks2amp.py +334 -0
  71. niwrap_mrtrix/mrtrix/peaks2fixel.py +349 -0
  72. niwrap_mrtrix/mrtrix/responsemean.py +316 -0
  73. niwrap_mrtrix/mrtrix/sh2amp.py +640 -0
  74. niwrap_mrtrix/mrtrix/sh2peaks.py +505 -0
  75. niwrap_mrtrix/mrtrix/sh2power.py +353 -0
  76. niwrap_mrtrix/mrtrix/sh2response.py +394 -0
  77. niwrap_mrtrix/mrtrix/shbasis.py +373 -0
  78. niwrap_mrtrix/mrtrix/shconv.py +498 -0
  79. niwrap_mrtrix/mrtrix/tck2connectome.py +580 -0
  80. niwrap_mrtrix/mrtrix/tck2fixel.py +363 -0
  81. niwrap_mrtrix/mrtrix/tckconvert.py +580 -0
  82. niwrap_mrtrix/mrtrix/tckdfc.py +551 -0
  83. niwrap_mrtrix/mrtrix/tckedit.py +1003 -0
  84. niwrap_mrtrix/mrtrix/tckgen.py +1983 -0
  85. niwrap_mrtrix/mrtrix/tckglobal.py +758 -0
  86. niwrap_mrtrix/mrtrix/tckinfo.py +329 -0
  87. niwrap_mrtrix/mrtrix/tckmap.py +772 -0
  88. niwrap_mrtrix/mrtrix/tckresample.py +580 -0
  89. niwrap_mrtrix/mrtrix/tcksample.py +404 -0
  90. niwrap_mrtrix/mrtrix/tcksift.py +592 -0
  91. niwrap_mrtrix/mrtrix/tcksift2.py +730 -0
  92. niwrap_mrtrix/mrtrix/tckstats.py +441 -0
  93. niwrap_mrtrix/mrtrix/tcktransform.py +340 -0
  94. niwrap_mrtrix/mrtrix/tensor2metric.py +544 -0
  95. niwrap_mrtrix/mrtrix/transformcalc.py +344 -0
  96. niwrap_mrtrix/mrtrix/transformcompose.py +465 -0
  97. niwrap_mrtrix/mrtrix/transformconvert.py +346 -0
  98. niwrap_mrtrix/mrtrix/tsfdivide.py +340 -0
  99. niwrap_mrtrix/mrtrix/tsfinfo.py +344 -0
  100. niwrap_mrtrix/mrtrix/tsfmult.py +340 -0
  101. niwrap_mrtrix/mrtrix/tsfsmooth.py +347 -0
  102. niwrap_mrtrix/mrtrix/tsfthreshold.py +349 -0
  103. niwrap_mrtrix/mrtrix/tsfvalidate.py +328 -0
  104. niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +359 -0
  105. niwrap_mrtrix/mrtrix/v_5tt2vis.py +412 -0
  106. niwrap_mrtrix/mrtrix/v_5ttcheck.py +337 -0
  107. niwrap_mrtrix/mrtrix/v_5ttedit.py +420 -0
  108. niwrap_mrtrix/mrtrix/v_5ttgen.py +816 -0
  109. niwrap_mrtrix/mrtrix/vectorstats.py +585 -0
  110. niwrap_mrtrix/mrtrix/voxel2fixel.py +350 -0
  111. niwrap_mrtrix/mrtrix/voxel2mesh.py +376 -0
  112. niwrap_mrtrix/mrtrix/warp2metric.py +449 -0
  113. niwrap_mrtrix/mrtrix/warpconvert.py +411 -0
  114. niwrap_mrtrix/mrtrix/warpcorrect.py +368 -0
  115. niwrap_mrtrix/mrtrix/warpinit.py +356 -0
  116. niwrap_mrtrix/mrtrix/warpinvert.py +370 -0
  117. niwrap_mrtrix-0.5.0.dist-info/METADATA +8 -0
  118. niwrap_mrtrix-0.5.0.dist-info/RECORD +119 -0
  119. niwrap_mrtrix-0.5.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,772 @@
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="20fc0eb1cf1e5881a0131f8a9755f1e2d22946f9.boutiques",
10
+ name="tckmap",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ TckmapVariousStringParameters = typing.TypedDict('TckmapVariousStringParameters', {
17
+ "__STYX_TYPE__": typing.Literal["VariousString"],
18
+ "obj": str,
19
+ })
20
+
21
+
22
+ TckmapVariousFileParameters = typing.TypedDict('TckmapVariousFileParameters', {
23
+ "__STYX_TYPE__": typing.Literal["VariousFile"],
24
+ "obj": InputPathType,
25
+ })
26
+
27
+
28
+ TckmapConfigParameters = typing.TypedDict('TckmapConfigParameters', {
29
+ "__STYX_TYPE__": typing.Literal["config"],
30
+ "key": str,
31
+ "value": str,
32
+ })
33
+
34
+
35
+ TckmapParameters = typing.TypedDict('TckmapParameters', {
36
+ "__STYX_TYPE__": typing.Literal["tckmap"],
37
+ "template": typing.NotRequired[InputPathType | None],
38
+ "vox": typing.NotRequired[list[float] | None],
39
+ "datatype": typing.NotRequired[str | None],
40
+ "dec": bool,
41
+ "dixel": typing.NotRequired[typing.Union[TckmapVariousStringParameters, TckmapVariousFileParameters] | None],
42
+ "tod": typing.NotRequired[int | None],
43
+ "contrast": typing.NotRequired[str | None],
44
+ "image": typing.NotRequired[InputPathType | None],
45
+ "vector_file": typing.NotRequired[InputPathType | None],
46
+ "stat_vox": typing.NotRequired[str | None],
47
+ "stat_tck": typing.NotRequired[str | None],
48
+ "fwhm_tck": typing.NotRequired[float | None],
49
+ "map_zero": bool,
50
+ "backtrack": bool,
51
+ "upsample": typing.NotRequired[int | None],
52
+ "precise": bool,
53
+ "ends_only": bool,
54
+ "tck_weights_in": typing.NotRequired[InputPathType | None],
55
+ "info": bool,
56
+ "quiet": bool,
57
+ "debug": bool,
58
+ "force": bool,
59
+ "nthreads": typing.NotRequired[int | None],
60
+ "config": typing.NotRequired[list[TckmapConfigParameters] | None],
61
+ "help": bool,
62
+ "version": bool,
63
+ "tracks": InputPathType,
64
+ "output": str,
65
+ })
66
+
67
+
68
+ def dyn_cargs(
69
+ t: str,
70
+ ) -> typing.Any:
71
+ """
72
+ Get build cargs function by command type.
73
+
74
+ Args:
75
+ t: Command type.
76
+ Returns:
77
+ Build cargs function.
78
+ """
79
+ return {
80
+ "tckmap": tckmap_cargs,
81
+ "VariousString": tckmap_various_string_cargs,
82
+ "VariousFile": tckmap_various_file_cargs,
83
+ "config": tckmap_config_cargs,
84
+ }.get(t)
85
+
86
+
87
+ def dyn_outputs(
88
+ t: str,
89
+ ) -> typing.Any:
90
+ """
91
+ Get build outputs function by command type.
92
+
93
+ Args:
94
+ t: Command type.
95
+ Returns:
96
+ Build outputs function.
97
+ """
98
+ return {
99
+ "tckmap": tckmap_outputs,
100
+ }.get(t)
101
+
102
+
103
+ def tckmap_various_string_params(
104
+ obj: str,
105
+ ) -> TckmapVariousStringParameters:
106
+ """
107
+ Build parameters.
108
+
109
+ Args:
110
+ obj: String object.
111
+ Returns:
112
+ Parameter dictionary
113
+ """
114
+ params = {
115
+ "__STYXTYPE__": "VariousString",
116
+ "obj": obj,
117
+ }
118
+ return params
119
+
120
+
121
+ def tckmap_various_string_cargs(
122
+ params: TckmapVariousStringParameters,
123
+ execution: Execution,
124
+ ) -> list[str]:
125
+ """
126
+ Build command-line arguments from parameters.
127
+
128
+ Args:
129
+ params: The parameters.
130
+ execution: The execution object for resolving input paths.
131
+ Returns:
132
+ Command-line arguments.
133
+ """
134
+ cargs = []
135
+ cargs.append(params.get("obj"))
136
+ return cargs
137
+
138
+
139
+ def tckmap_various_file_params(
140
+ obj: InputPathType,
141
+ ) -> TckmapVariousFileParameters:
142
+ """
143
+ Build parameters.
144
+
145
+ Args:
146
+ obj: File object.
147
+ Returns:
148
+ Parameter dictionary
149
+ """
150
+ params = {
151
+ "__STYXTYPE__": "VariousFile",
152
+ "obj": obj,
153
+ }
154
+ return params
155
+
156
+
157
+ def tckmap_various_file_cargs(
158
+ params: TckmapVariousFileParameters,
159
+ execution: Execution,
160
+ ) -> list[str]:
161
+ """
162
+ Build command-line arguments from parameters.
163
+
164
+ Args:
165
+ params: The parameters.
166
+ execution: The execution object for resolving input paths.
167
+ Returns:
168
+ Command-line arguments.
169
+ """
170
+ cargs = []
171
+ cargs.append(execution.input_file(params.get("obj")))
172
+ return cargs
173
+
174
+
175
+ def tckmap_config_params(
176
+ key: str,
177
+ value: str,
178
+ ) -> TckmapConfigParameters:
179
+ """
180
+ Build parameters.
181
+
182
+ Args:
183
+ key: temporarily set the value of an MRtrix config file entry.
184
+ value: temporarily set the value of an MRtrix config file entry.
185
+ Returns:
186
+ Parameter dictionary
187
+ """
188
+ params = {
189
+ "__STYXTYPE__": "config",
190
+ "key": key,
191
+ "value": value,
192
+ }
193
+ return params
194
+
195
+
196
+ def tckmap_config_cargs(
197
+ params: TckmapConfigParameters,
198
+ execution: Execution,
199
+ ) -> list[str]:
200
+ """
201
+ Build command-line arguments from parameters.
202
+
203
+ Args:
204
+ params: The parameters.
205
+ execution: The execution object for resolving input paths.
206
+ Returns:
207
+ Command-line arguments.
208
+ """
209
+ cargs = []
210
+ cargs.append("-config")
211
+ cargs.append(params.get("key"))
212
+ cargs.append(params.get("value"))
213
+ return cargs
214
+
215
+
216
+ class TckmapOutputs(typing.NamedTuple):
217
+ """
218
+ Output object returned when calling `tckmap(...)`.
219
+ """
220
+ root: OutputPathType
221
+ """Output root folder. This is the root folder for all outputs."""
222
+ output: OutputPathType
223
+ """the output track-weighted image"""
224
+
225
+
226
+ def tckmap_params(
227
+ tracks: InputPathType,
228
+ output: str,
229
+ template: InputPathType | None = None,
230
+ vox: list[float] | None = None,
231
+ datatype: str | None = None,
232
+ dec: bool = False,
233
+ dixel: typing.Union[TckmapVariousStringParameters, TckmapVariousFileParameters] | None = None,
234
+ tod: int | None = None,
235
+ contrast: str | None = None,
236
+ image: InputPathType | None = None,
237
+ vector_file: InputPathType | None = None,
238
+ stat_vox: str | None = None,
239
+ stat_tck: str | None = None,
240
+ fwhm_tck: float | None = None,
241
+ map_zero: bool = False,
242
+ backtrack: bool = False,
243
+ upsample: int | None = None,
244
+ precise: bool = False,
245
+ ends_only: bool = False,
246
+ tck_weights_in: InputPathType | None = None,
247
+ info: bool = False,
248
+ quiet: bool = False,
249
+ debug: bool = False,
250
+ force: bool = False,
251
+ nthreads: int | None = None,
252
+ config: list[TckmapConfigParameters] | None = None,
253
+ help_: bool = False,
254
+ version: bool = False,
255
+ ) -> TckmapParameters:
256
+ """
257
+ Build parameters.
258
+
259
+ Args:
260
+ tracks: the input track file.
261
+ output: the output track-weighted image.
262
+ template: an image file to be used as a template for the output (the\
263
+ output image will have the same transform and field of view).
264
+ vox: provide either an isotropic voxel size (in mm), or comma-separated\
265
+ list of 3 voxel dimensions.
266
+ datatype: specify output image data type.
267
+ dec: perform track mapping in directionally-encoded colour (DEC) space.
268
+ dixel: map streamlines to dixels within each voxel; requires either a\
269
+ number of dixels (references an internal direction set), or a path to a\
270
+ text file containing a set of directions stored as azimuth/elevation\
271
+ pairs.
272
+ tod: generate a Track Orientation Distribution (TOD) in each voxel;\
273
+ need to specify the maximum spherical harmonic degree lmax to use when\
274
+ generating Apodised Point Spread Functions.
275
+ contrast: define the desired form of contrast for the output image\
276
+ Options are: tdi, length, invlength, scalar_map, scalar_map_count,\
277
+ fod_amp, curvature, vector_file (default: tdi).
278
+ image: provide the scalar image map for generating images with\
279
+ 'scalar_map' / 'scalar_map_count' contrast, or the spherical harmonics\
280
+ image for 'fod_amp' contrast.
281
+ vector_file: provide the vector data file for generating images with\
282
+ 'vector_file' contrast.
283
+ stat_vox: define the statistic for choosing the final voxel intensities\
284
+ for a given contrast type given the individual values from the tracks\
285
+ passing through each voxel.\
286
+ Options are: sum, min, mean, max (default: sum).
287
+ stat_tck: define the statistic for choosing the contribution to be made\
288
+ by each streamline as a function of the samples taken along their\
289
+ lengths.\
290
+ Only has an effect for 'scalar_map', 'fod_amp' and 'curvature'\
291
+ contrast types.\
292
+ Options are: sum, min, mean, max, median, mean_nonzero, gaussian,\
293
+ ends_min, ends_mean, ends_max, ends_prod (default: mean).
294
+ fwhm_tck: when using gaussian-smoothed per-track statistic, specify the\
295
+ desired full-width half-maximum of the Gaussian smoothing kernel (in\
296
+ mm).
297
+ map_zero: if a streamline has zero contribution based on the contrast &\
298
+ statistic, typically it is not mapped; use this option to still\
299
+ contribute to the map even if this is the case (these non-contributing\
300
+ voxels can then influence the mean value in each voxel of the map).
301
+ backtrack: when using -stat_tck ends_*, if the streamline endpoint is\
302
+ outside the FoV, backtrack along the streamline trajectory until an\
303
+ appropriate point is found.
304
+ upsample: upsample the tracks by some ratio using Hermite interpolation\
305
+ before mappping\
306
+ (If omitted, an appropriate ratio will be determined automatically).
307
+ precise: use a more precise streamline mapping strategy, that\
308
+ accurately quantifies the length through each voxel (these lengths are\
309
+ then taken into account during TWI calculation).
310
+ ends_only: only map the streamline endpoints to the image.
311
+ tck_weights_in: specify a text scalar file containing the streamline\
312
+ weights.
313
+ info: display information messages.
314
+ quiet: do not display information messages or progress status;\
315
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
316
+ environment variable to a non-empty string.
317
+ debug: display debugging messages.
318
+ force: force overwrite of output files (caution: using the same file as\
319
+ input and output might cause unexpected behaviour).
320
+ nthreads: use this number of threads in multi-threaded applications\
321
+ (set to 0 to disable multi-threading).
322
+ config: temporarily set the value of an MRtrix config file entry.
323
+ help_: display this information page and exit.
324
+ version: display version information and exit.
325
+ Returns:
326
+ Parameter dictionary
327
+ """
328
+ params = {
329
+ "__STYXTYPE__": "tckmap",
330
+ "dec": dec,
331
+ "map_zero": map_zero,
332
+ "backtrack": backtrack,
333
+ "precise": precise,
334
+ "ends_only": ends_only,
335
+ "info": info,
336
+ "quiet": quiet,
337
+ "debug": debug,
338
+ "force": force,
339
+ "help": help_,
340
+ "version": version,
341
+ "tracks": tracks,
342
+ "output": output,
343
+ }
344
+ if template is not None:
345
+ params["template"] = template
346
+ if vox is not None:
347
+ params["vox"] = vox
348
+ if datatype is not None:
349
+ params["datatype"] = datatype
350
+ if dixel is not None:
351
+ params["dixel"] = dixel
352
+ if tod is not None:
353
+ params["tod"] = tod
354
+ if contrast is not None:
355
+ params["contrast"] = contrast
356
+ if image is not None:
357
+ params["image"] = image
358
+ if vector_file is not None:
359
+ params["vector_file"] = vector_file
360
+ if stat_vox is not None:
361
+ params["stat_vox"] = stat_vox
362
+ if stat_tck is not None:
363
+ params["stat_tck"] = stat_tck
364
+ if fwhm_tck is not None:
365
+ params["fwhm_tck"] = fwhm_tck
366
+ if upsample is not None:
367
+ params["upsample"] = upsample
368
+ if tck_weights_in is not None:
369
+ params["tck_weights_in"] = tck_weights_in
370
+ if nthreads is not None:
371
+ params["nthreads"] = nthreads
372
+ if config is not None:
373
+ params["config"] = config
374
+ return params
375
+
376
+
377
+ def tckmap_cargs(
378
+ params: TckmapParameters,
379
+ execution: Execution,
380
+ ) -> list[str]:
381
+ """
382
+ Build command-line arguments from parameters.
383
+
384
+ Args:
385
+ params: The parameters.
386
+ execution: The execution object for resolving input paths.
387
+ Returns:
388
+ Command-line arguments.
389
+ """
390
+ cargs = []
391
+ cargs.append("tckmap")
392
+ if params.get("template") is not None:
393
+ cargs.extend([
394
+ "-template",
395
+ execution.input_file(params.get("template"))
396
+ ])
397
+ if params.get("vox") is not None:
398
+ cargs.extend([
399
+ "-vox",
400
+ ",".join(map(str, params.get("vox")))
401
+ ])
402
+ if params.get("datatype") is not None:
403
+ cargs.extend([
404
+ "-datatype",
405
+ params.get("datatype")
406
+ ])
407
+ if params.get("dec"):
408
+ cargs.append("-dec")
409
+ if params.get("dixel") is not None:
410
+ cargs.extend([
411
+ "-dixel",
412
+ *dyn_cargs(params.get("dixel")["__STYXTYPE__"])(params.get("dixel"), execution)
413
+ ])
414
+ if params.get("tod") is not None:
415
+ cargs.extend([
416
+ "-tod",
417
+ str(params.get("tod"))
418
+ ])
419
+ if params.get("contrast") is not None:
420
+ cargs.extend([
421
+ "-contrast",
422
+ params.get("contrast")
423
+ ])
424
+ if params.get("image") is not None:
425
+ cargs.extend([
426
+ "-image",
427
+ execution.input_file(params.get("image"))
428
+ ])
429
+ if params.get("vector_file") is not None:
430
+ cargs.extend([
431
+ "-vector_file",
432
+ execution.input_file(params.get("vector_file"))
433
+ ])
434
+ if params.get("stat_vox") is not None:
435
+ cargs.extend([
436
+ "-stat_vox",
437
+ params.get("stat_vox")
438
+ ])
439
+ if params.get("stat_tck") is not None:
440
+ cargs.extend([
441
+ "-stat_tck",
442
+ params.get("stat_tck")
443
+ ])
444
+ if params.get("fwhm_tck") is not None:
445
+ cargs.extend([
446
+ "-fwhm_tck",
447
+ str(params.get("fwhm_tck"))
448
+ ])
449
+ if params.get("map_zero"):
450
+ cargs.append("-map_zero")
451
+ if params.get("backtrack"):
452
+ cargs.append("-backtrack")
453
+ if params.get("upsample") is not None:
454
+ cargs.extend([
455
+ "-upsample",
456
+ str(params.get("upsample"))
457
+ ])
458
+ if params.get("precise"):
459
+ cargs.append("-precise")
460
+ if params.get("ends_only"):
461
+ cargs.append("-ends_only")
462
+ if params.get("tck_weights_in") is not None:
463
+ cargs.extend([
464
+ "-tck_weights_in",
465
+ execution.input_file(params.get("tck_weights_in"))
466
+ ])
467
+ if params.get("info"):
468
+ cargs.append("-info")
469
+ if params.get("quiet"):
470
+ cargs.append("-quiet")
471
+ if params.get("debug"):
472
+ cargs.append("-debug")
473
+ if params.get("force"):
474
+ cargs.append("-force")
475
+ if params.get("nthreads") is not None:
476
+ cargs.extend([
477
+ "-nthreads",
478
+ str(params.get("nthreads"))
479
+ ])
480
+ if params.get("config") is not None:
481
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
482
+ if params.get("help"):
483
+ cargs.append("-help")
484
+ if params.get("version"):
485
+ cargs.append("-version")
486
+ cargs.append(execution.input_file(params.get("tracks")))
487
+ cargs.append(params.get("output"))
488
+ return cargs
489
+
490
+
491
+ def tckmap_outputs(
492
+ params: TckmapParameters,
493
+ execution: Execution,
494
+ ) -> TckmapOutputs:
495
+ """
496
+ Build outputs object containing output file paths and possibly stdout/stderr.
497
+
498
+ Args:
499
+ params: The parameters.
500
+ execution: The execution object for resolving input paths.
501
+ Returns:
502
+ Outputs object.
503
+ """
504
+ ret = TckmapOutputs(
505
+ root=execution.output_file("."),
506
+ output=execution.output_file(params.get("output")),
507
+ )
508
+ return ret
509
+
510
+
511
+ def tckmap_execute(
512
+ params: TckmapParameters,
513
+ execution: Execution,
514
+ ) -> TckmapOutputs:
515
+ """
516
+ Use track data as a form of contrast for producing a high-resolution image.
517
+
518
+ Note: if you run into limitations with RAM usage, make sure you output the
519
+ results to a .mif file or .mih / .dat file pair - this will avoid the
520
+ allocation of an additional buffer to store the output for write-out.
521
+
522
+ References:
523
+
524
+ * For TDI or DEC TDI:
525
+ Calamante, F.; Tournier, J.-D.; Jackson, G. D. & Connelly, A. Track-density
526
+ imaging (TDI): Super-resolution white matter imaging using whole-brain
527
+ track-density mapping. NeuroImage, 2010, 53, 1233-1243
528
+
529
+ * If using -contrast length and -stat_vox mean:
530
+ Pannek, K.; Mathias, J. L.; Bigler, E. D.; Brown, G.; Taylor, J. D. & Rose,
531
+ S. E. The average pathlength map: A diffusion MRI tractography-derived index
532
+ for studying brain pathology. NeuroImage, 2011, 55, 133-141
533
+
534
+ * If using -dixel option with TDI contrast only:
535
+ Smith, R.E., Tournier, J-D., Calamante, F., Connelly, A. A novel paradigm
536
+ for automated segmentation of very large whole-brain probabilistic
537
+ tractography data sets. In proc. ISMRM, 2011, 19, 673
538
+
539
+ * If using -dixel option with any other contrast:
540
+ Pannek, K., Raffelt, D., Salvado, O., Rose, S. Incorporating directional
541
+ information in diffusion tractography derived maps: angular track imaging
542
+ (ATI). In Proc. ISMRM, 2012, 20, 1912
543
+
544
+ * If using -tod option:
545
+ Dhollander, T., Emsell, L., Van Hecke, W., Maes, F., Sunaert, S., Suetens,
546
+ P. Track Orientation Density Imaging (TODI) and Track Orientation
547
+ Distribution (TOD) based tractography. NeuroImage, 2014, 94, 312-336
548
+
549
+ * If using other contrasts / statistics:
550
+ Calamante, F.; Tournier, J.-D.; Smith, R. E. & Connelly, A. A generalised
551
+ framework for super-resolution track-weighted imaging. NeuroImage, 2012, 59,
552
+ 2494-2503
553
+
554
+ * If using -precise mapping option:
555
+ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT:
556
+ Spherical-deconvolution informed filtering of tractograms. NeuroImage, 2013,
557
+ 67, 298-312 (Appendix 3).
558
+
559
+ Author: MRTrix3 Developers
560
+
561
+ URL: https://www.mrtrix.org/
562
+
563
+ Args:
564
+ params: The parameters.
565
+ execution: The execution object.
566
+ Returns:
567
+ NamedTuple of outputs (described in `TckmapOutputs`).
568
+ """
569
+ params = execution.params(params)
570
+ cargs = tckmap_cargs(params, execution)
571
+ ret = tckmap_outputs(params, execution)
572
+ execution.run(cargs)
573
+ return ret
574
+
575
+
576
+ def tckmap(
577
+ tracks: InputPathType,
578
+ output: str,
579
+ template: InputPathType | None = None,
580
+ vox: list[float] | None = None,
581
+ datatype: str | None = None,
582
+ dec: bool = False,
583
+ dixel: typing.Union[TckmapVariousStringParameters, TckmapVariousFileParameters] | None = None,
584
+ tod: int | None = None,
585
+ contrast: str | None = None,
586
+ image: InputPathType | None = None,
587
+ vector_file: InputPathType | None = None,
588
+ stat_vox: str | None = None,
589
+ stat_tck: str | None = None,
590
+ fwhm_tck: float | None = None,
591
+ map_zero: bool = False,
592
+ backtrack: bool = False,
593
+ upsample: int | None = None,
594
+ precise: bool = False,
595
+ ends_only: bool = False,
596
+ tck_weights_in: InputPathType | None = None,
597
+ info: bool = False,
598
+ quiet: bool = False,
599
+ debug: bool = False,
600
+ force: bool = False,
601
+ nthreads: int | None = None,
602
+ config: list[TckmapConfigParameters] | None = None,
603
+ help_: bool = False,
604
+ version: bool = False,
605
+ runner: Runner | None = None,
606
+ ) -> TckmapOutputs:
607
+ """
608
+ Use track data as a form of contrast for producing a high-resolution image.
609
+
610
+ Note: if you run into limitations with RAM usage, make sure you output the
611
+ results to a .mif file or .mih / .dat file pair - this will avoid the
612
+ allocation of an additional buffer to store the output for write-out.
613
+
614
+ References:
615
+
616
+ * For TDI or DEC TDI:
617
+ Calamante, F.; Tournier, J.-D.; Jackson, G. D. & Connelly, A. Track-density
618
+ imaging (TDI): Super-resolution white matter imaging using whole-brain
619
+ track-density mapping. NeuroImage, 2010, 53, 1233-1243
620
+
621
+ * If using -contrast length and -stat_vox mean:
622
+ Pannek, K.; Mathias, J. L.; Bigler, E. D.; Brown, G.; Taylor, J. D. & Rose,
623
+ S. E. The average pathlength map: A diffusion MRI tractography-derived index
624
+ for studying brain pathology. NeuroImage, 2011, 55, 133-141
625
+
626
+ * If using -dixel option with TDI contrast only:
627
+ Smith, R.E., Tournier, J-D., Calamante, F., Connelly, A. A novel paradigm
628
+ for automated segmentation of very large whole-brain probabilistic
629
+ tractography data sets. In proc. ISMRM, 2011, 19, 673
630
+
631
+ * If using -dixel option with any other contrast:
632
+ Pannek, K., Raffelt, D., Salvado, O., Rose, S. Incorporating directional
633
+ information in diffusion tractography derived maps: angular track imaging
634
+ (ATI). In Proc. ISMRM, 2012, 20, 1912
635
+
636
+ * If using -tod option:
637
+ Dhollander, T., Emsell, L., Van Hecke, W., Maes, F., Sunaert, S., Suetens,
638
+ P. Track Orientation Density Imaging (TODI) and Track Orientation
639
+ Distribution (TOD) based tractography. NeuroImage, 2014, 94, 312-336
640
+
641
+ * If using other contrasts / statistics:
642
+ Calamante, F.; Tournier, J.-D.; Smith, R. E. & Connelly, A. A generalised
643
+ framework for super-resolution track-weighted imaging. NeuroImage, 2012, 59,
644
+ 2494-2503
645
+
646
+ * If using -precise mapping option:
647
+ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT:
648
+ Spherical-deconvolution informed filtering of tractograms. NeuroImage, 2013,
649
+ 67, 298-312 (Appendix 3).
650
+
651
+ Author: MRTrix3 Developers
652
+
653
+ URL: https://www.mrtrix.org/
654
+
655
+ Args:
656
+ tracks: the input track file.
657
+ output: the output track-weighted image.
658
+ template: an image file to be used as a template for the output (the\
659
+ output image will have the same transform and field of view).
660
+ vox: provide either an isotropic voxel size (in mm), or comma-separated\
661
+ list of 3 voxel dimensions.
662
+ datatype: specify output image data type.
663
+ dec: perform track mapping in directionally-encoded colour (DEC) space.
664
+ dixel: map streamlines to dixels within each voxel; requires either a\
665
+ number of dixels (references an internal direction set), or a path to a\
666
+ text file containing a set of directions stored as azimuth/elevation\
667
+ pairs.
668
+ tod: generate a Track Orientation Distribution (TOD) in each voxel;\
669
+ need to specify the maximum spherical harmonic degree lmax to use when\
670
+ generating Apodised Point Spread Functions.
671
+ contrast: define the desired form of contrast for the output image\
672
+ Options are: tdi, length, invlength, scalar_map, scalar_map_count,\
673
+ fod_amp, curvature, vector_file (default: tdi).
674
+ image: provide the scalar image map for generating images with\
675
+ 'scalar_map' / 'scalar_map_count' contrast, or the spherical harmonics\
676
+ image for 'fod_amp' contrast.
677
+ vector_file: provide the vector data file for generating images with\
678
+ 'vector_file' contrast.
679
+ stat_vox: define the statistic for choosing the final voxel intensities\
680
+ for a given contrast type given the individual values from the tracks\
681
+ passing through each voxel.\
682
+ Options are: sum, min, mean, max (default: sum).
683
+ stat_tck: define the statistic for choosing the contribution to be made\
684
+ by each streamline as a function of the samples taken along their\
685
+ lengths.\
686
+ Only has an effect for 'scalar_map', 'fod_amp' and 'curvature'\
687
+ contrast types.\
688
+ Options are: sum, min, mean, max, median, mean_nonzero, gaussian,\
689
+ ends_min, ends_mean, ends_max, ends_prod (default: mean).
690
+ fwhm_tck: when using gaussian-smoothed per-track statistic, specify the\
691
+ desired full-width half-maximum of the Gaussian smoothing kernel (in\
692
+ mm).
693
+ map_zero: if a streamline has zero contribution based on the contrast &\
694
+ statistic, typically it is not mapped; use this option to still\
695
+ contribute to the map even if this is the case (these non-contributing\
696
+ voxels can then influence the mean value in each voxel of the map).
697
+ backtrack: when using -stat_tck ends_*, if the streamline endpoint is\
698
+ outside the FoV, backtrack along the streamline trajectory until an\
699
+ appropriate point is found.
700
+ upsample: upsample the tracks by some ratio using Hermite interpolation\
701
+ before mappping\
702
+ (If omitted, an appropriate ratio will be determined automatically).
703
+ precise: use a more precise streamline mapping strategy, that\
704
+ accurately quantifies the length through each voxel (these lengths are\
705
+ then taken into account during TWI calculation).
706
+ ends_only: only map the streamline endpoints to the image.
707
+ tck_weights_in: specify a text scalar file containing the streamline\
708
+ weights.
709
+ info: display information messages.
710
+ quiet: do not display information messages or progress status;\
711
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
712
+ environment variable to a non-empty string.
713
+ debug: display debugging messages.
714
+ force: force overwrite of output files (caution: using the same file as\
715
+ input and output might cause unexpected behaviour).
716
+ nthreads: use this number of threads in multi-threaded applications\
717
+ (set to 0 to disable multi-threading).
718
+ config: temporarily set the value of an MRtrix config file entry.
719
+ help_: display this information page and exit.
720
+ version: display version information and exit.
721
+ runner: Command runner.
722
+ Returns:
723
+ NamedTuple of outputs (described in `TckmapOutputs`).
724
+ """
725
+ runner = runner or get_global_runner()
726
+ execution = runner.start_execution(TCKMAP_METADATA)
727
+ params = tckmap_params(
728
+ template=template,
729
+ vox=vox,
730
+ datatype=datatype,
731
+ dec=dec,
732
+ dixel=dixel,
733
+ tod=tod,
734
+ contrast=contrast,
735
+ image=image,
736
+ vector_file=vector_file,
737
+ stat_vox=stat_vox,
738
+ stat_tck=stat_tck,
739
+ fwhm_tck=fwhm_tck,
740
+ map_zero=map_zero,
741
+ backtrack=backtrack,
742
+ upsample=upsample,
743
+ precise=precise,
744
+ ends_only=ends_only,
745
+ tck_weights_in=tck_weights_in,
746
+ info=info,
747
+ quiet=quiet,
748
+ debug=debug,
749
+ force=force,
750
+ nthreads=nthreads,
751
+ config=config,
752
+ help_=help_,
753
+ version=version,
754
+ tracks=tracks,
755
+ output=output,
756
+ )
757
+ return tckmap_execute(params, execution)
758
+
759
+
760
+ __all__ = [
761
+ "TCKMAP_METADATA",
762
+ "TckmapConfigParameters",
763
+ "TckmapOutputs",
764
+ "TckmapParameters",
765
+ "TckmapVariousFileParameters",
766
+ "TckmapVariousStringParameters",
767
+ "tckmap",
768
+ "tckmap_config_params",
769
+ "tckmap_params",
770
+ "tckmap_various_file_params",
771
+ "tckmap_various_string_params",
772
+ ]