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,551 @@
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
+ TCKDFC_METADATA = Metadata(
9
+ id="9ecab23d43de088c2cabc9280d7379293cf1dc28.boutiques",
10
+ name="tckdfc",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ TckdfcDynamicParameters = typing.TypedDict('TckdfcDynamicParameters', {
17
+ "__STYX_TYPE__": typing.Literal["dynamic"],
18
+ "shape": str,
19
+ "width": int,
20
+ })
21
+
22
+
23
+ TckdfcConfigParameters = typing.TypedDict('TckdfcConfigParameters', {
24
+ "__STYX_TYPE__": typing.Literal["config"],
25
+ "key": str,
26
+ "value": str,
27
+ })
28
+
29
+
30
+ TckdfcParameters = typing.TypedDict('TckdfcParameters', {
31
+ "__STYX_TYPE__": typing.Literal["tckdfc"],
32
+ "static": bool,
33
+ "dynamic": typing.NotRequired[TckdfcDynamicParameters | None],
34
+ "template": typing.NotRequired[InputPathType | None],
35
+ "vox": typing.NotRequired[list[float] | None],
36
+ "stat_vox": typing.NotRequired[str | None],
37
+ "backtrack": bool,
38
+ "upsample": typing.NotRequired[int | None],
39
+ "info": bool,
40
+ "quiet": bool,
41
+ "debug": bool,
42
+ "force": bool,
43
+ "nthreads": typing.NotRequired[int | None],
44
+ "config": typing.NotRequired[list[TckdfcConfigParameters] | None],
45
+ "help": bool,
46
+ "version": bool,
47
+ "tracks": InputPathType,
48
+ "fmri": InputPathType,
49
+ "output": str,
50
+ })
51
+
52
+
53
+ def dyn_cargs(
54
+ t: str,
55
+ ) -> typing.Any:
56
+ """
57
+ Get build cargs function by command type.
58
+
59
+ Args:
60
+ t: Command type.
61
+ Returns:
62
+ Build cargs function.
63
+ """
64
+ return {
65
+ "tckdfc": tckdfc_cargs,
66
+ "dynamic": tckdfc_dynamic_cargs,
67
+ "config": tckdfc_config_cargs,
68
+ }.get(t)
69
+
70
+
71
+ def dyn_outputs(
72
+ t: str,
73
+ ) -> typing.Any:
74
+ """
75
+ Get build outputs function by command type.
76
+
77
+ Args:
78
+ t: Command type.
79
+ Returns:
80
+ Build outputs function.
81
+ """
82
+ return {
83
+ "tckdfc": tckdfc_outputs,
84
+ }.get(t)
85
+
86
+
87
+ def tckdfc_dynamic_params(
88
+ shape: str,
89
+ width: int,
90
+ ) -> TckdfcDynamicParameters:
91
+ """
92
+ Build parameters.
93
+
94
+ Args:
95
+ shape: generate a "dynamic" (4D) output image; must additionally\
96
+ provide the shape and width (in volumes) of the sliding window.
97
+ width: generate a "dynamic" (4D) output image; must additionally\
98
+ provide the shape and width (in volumes) of the sliding window.
99
+ Returns:
100
+ Parameter dictionary
101
+ """
102
+ params = {
103
+ "__STYXTYPE__": "dynamic",
104
+ "shape": shape,
105
+ "width": width,
106
+ }
107
+ return params
108
+
109
+
110
+ def tckdfc_dynamic_cargs(
111
+ params: TckdfcDynamicParameters,
112
+ execution: Execution,
113
+ ) -> list[str]:
114
+ """
115
+ Build command-line arguments from parameters.
116
+
117
+ Args:
118
+ params: The parameters.
119
+ execution: The execution object for resolving input paths.
120
+ Returns:
121
+ Command-line arguments.
122
+ """
123
+ cargs = []
124
+ cargs.append("-dynamic")
125
+ cargs.append(params.get("shape"))
126
+ cargs.append(str(params.get("width")))
127
+ return cargs
128
+
129
+
130
+ def tckdfc_config_params(
131
+ key: str,
132
+ value: str,
133
+ ) -> TckdfcConfigParameters:
134
+ """
135
+ Build parameters.
136
+
137
+ Args:
138
+ key: temporarily set the value of an MRtrix config file entry.
139
+ value: temporarily set the value of an MRtrix config file entry.
140
+ Returns:
141
+ Parameter dictionary
142
+ """
143
+ params = {
144
+ "__STYXTYPE__": "config",
145
+ "key": key,
146
+ "value": value,
147
+ }
148
+ return params
149
+
150
+
151
+ def tckdfc_config_cargs(
152
+ params: TckdfcConfigParameters,
153
+ execution: Execution,
154
+ ) -> list[str]:
155
+ """
156
+ Build command-line arguments from parameters.
157
+
158
+ Args:
159
+ params: The parameters.
160
+ execution: The execution object for resolving input paths.
161
+ Returns:
162
+ Command-line arguments.
163
+ """
164
+ cargs = []
165
+ cargs.append("-config")
166
+ cargs.append(params.get("key"))
167
+ cargs.append(params.get("value"))
168
+ return cargs
169
+
170
+
171
+ class TckdfcOutputs(typing.NamedTuple):
172
+ """
173
+ Output object returned when calling `tckdfc(...)`.
174
+ """
175
+ root: OutputPathType
176
+ """Output root folder. This is the root folder for all outputs."""
177
+ output: OutputPathType
178
+ """the output TW-dFC image"""
179
+
180
+
181
+ def tckdfc_params(
182
+ tracks: InputPathType,
183
+ fmri: InputPathType,
184
+ output: str,
185
+ static: bool = False,
186
+ dynamic: TckdfcDynamicParameters | None = None,
187
+ template: InputPathType | None = None,
188
+ vox: list[float] | None = None,
189
+ stat_vox: str | None = None,
190
+ backtrack: bool = False,
191
+ upsample: int | None = None,
192
+ info: bool = False,
193
+ quiet: bool = False,
194
+ debug: bool = False,
195
+ force: bool = False,
196
+ nthreads: int | None = None,
197
+ config: list[TckdfcConfigParameters] | None = None,
198
+ help_: bool = False,
199
+ version: bool = False,
200
+ ) -> TckdfcParameters:
201
+ """
202
+ Build parameters.
203
+
204
+ Args:
205
+ tracks: the input track file.
206
+ fmri: the pre-processed fMRI time series.
207
+ output: the output TW-dFC image.
208
+ static: generate a "static" (3D) output image.
209
+ dynamic: generate a "dynamic" (4D) output image; must additionally\
210
+ provide the shape and width (in volumes) of the sliding window.
211
+ template: an image file to be used as a template for the output (the\
212
+ output image will have the same transform and field of view).
213
+ vox: provide either an isotropic voxel size (in mm), or comma-separated\
214
+ list of 3 voxel dimensions.
215
+ stat_vox: define the statistic for choosing the final voxel intensities\
216
+ for a given contrast type given the individual values from the tracks\
217
+ passing through each voxel\
218
+ Options are: sum, min, mean, max (default: mean).
219
+ backtrack: if no valid timeseries is found at the streamline endpoint,\
220
+ back-track along the streamline trajectory until a valid timeseries is\
221
+ found.
222
+ upsample: upsample the tracks by some ratio using Hermite interpolation\
223
+ before mapping (if omitted, an appropriate ratio will be determined\
224
+ automatically).
225
+ info: display information messages.
226
+ quiet: do not display information messages or progress status;\
227
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
228
+ environment variable to a non-empty string.
229
+ debug: display debugging messages.
230
+ force: force overwrite of output files (caution: using the same file as\
231
+ input and output might cause unexpected behaviour).
232
+ nthreads: use this number of threads in multi-threaded applications\
233
+ (set to 0 to disable multi-threading).
234
+ config: temporarily set the value of an MRtrix config file entry.
235
+ help_: display this information page and exit.
236
+ version: display version information and exit.
237
+ Returns:
238
+ Parameter dictionary
239
+ """
240
+ params = {
241
+ "__STYXTYPE__": "tckdfc",
242
+ "static": static,
243
+ "backtrack": backtrack,
244
+ "info": info,
245
+ "quiet": quiet,
246
+ "debug": debug,
247
+ "force": force,
248
+ "help": help_,
249
+ "version": version,
250
+ "tracks": tracks,
251
+ "fmri": fmri,
252
+ "output": output,
253
+ }
254
+ if dynamic is not None:
255
+ params["dynamic"] = dynamic
256
+ if template is not None:
257
+ params["template"] = template
258
+ if vox is not None:
259
+ params["vox"] = vox
260
+ if stat_vox is not None:
261
+ params["stat_vox"] = stat_vox
262
+ if upsample is not None:
263
+ params["upsample"] = upsample
264
+ if nthreads is not None:
265
+ params["nthreads"] = nthreads
266
+ if config is not None:
267
+ params["config"] = config
268
+ return params
269
+
270
+
271
+ def tckdfc_cargs(
272
+ params: TckdfcParameters,
273
+ execution: Execution,
274
+ ) -> list[str]:
275
+ """
276
+ Build command-line arguments from parameters.
277
+
278
+ Args:
279
+ params: The parameters.
280
+ execution: The execution object for resolving input paths.
281
+ Returns:
282
+ Command-line arguments.
283
+ """
284
+ cargs = []
285
+ cargs.append("tckdfc")
286
+ if params.get("static"):
287
+ cargs.append("-static")
288
+ if params.get("dynamic") is not None:
289
+ cargs.extend(dyn_cargs(params.get("dynamic")["__STYXTYPE__"])(params.get("dynamic"), execution))
290
+ if params.get("template") is not None:
291
+ cargs.extend([
292
+ "-template",
293
+ execution.input_file(params.get("template"))
294
+ ])
295
+ if params.get("vox") is not None:
296
+ cargs.extend([
297
+ "-vox",
298
+ ",".join(map(str, params.get("vox")))
299
+ ])
300
+ if params.get("stat_vox") is not None:
301
+ cargs.extend([
302
+ "-stat_vox",
303
+ params.get("stat_vox")
304
+ ])
305
+ if params.get("backtrack"):
306
+ cargs.append("-backtrack")
307
+ if params.get("upsample") is not None:
308
+ cargs.extend([
309
+ "-upsample",
310
+ str(params.get("upsample"))
311
+ ])
312
+ if params.get("info"):
313
+ cargs.append("-info")
314
+ if params.get("quiet"):
315
+ cargs.append("-quiet")
316
+ if params.get("debug"):
317
+ cargs.append("-debug")
318
+ if params.get("force"):
319
+ cargs.append("-force")
320
+ if params.get("nthreads") is not None:
321
+ cargs.extend([
322
+ "-nthreads",
323
+ str(params.get("nthreads"))
324
+ ])
325
+ if params.get("config") is not None:
326
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
327
+ if params.get("help"):
328
+ cargs.append("-help")
329
+ if params.get("version"):
330
+ cargs.append("-version")
331
+ cargs.append(execution.input_file(params.get("tracks")))
332
+ cargs.append(execution.input_file(params.get("fmri")))
333
+ cargs.append(params.get("output"))
334
+ return cargs
335
+
336
+
337
+ def tckdfc_outputs(
338
+ params: TckdfcParameters,
339
+ execution: Execution,
340
+ ) -> TckdfcOutputs:
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 = TckdfcOutputs(
351
+ root=execution.output_file("."),
352
+ output=execution.output_file(params.get("output")),
353
+ )
354
+ return ret
355
+
356
+
357
+ def tckdfc_execute(
358
+ params: TckdfcParameters,
359
+ execution: Execution,
360
+ ) -> TckdfcOutputs:
361
+ """
362
+ Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method.
363
+
364
+ This command generates a Track-Weighted Image (TWI), where the contribution
365
+ from each streamline to the image is the Pearson correlation between the
366
+ fMRI time series at the streamline endpoints.
367
+
368
+ The output image can be generated in one of two ways (note that one of these
369
+ two command-line options MUST be provided):
370
+
371
+ - "Static" functional connectivity (-static option): Each streamline
372
+ contributes to a static 3D output image based on the correlation between the
373
+ signals at the streamline endpoints using the entirety of the input time
374
+ series.
375
+
376
+ - "Dynamic" functional connectivity (-dynamic option): The output image is a
377
+ 4D image, with the same number of volumes as the input fMRI time series. For
378
+ each volume, the contribution from each streamline is calculated based on a
379
+ finite-width sliding time window, centred at the timepoint corresponding to
380
+ that volume.
381
+
382
+ Note that the -backtrack option in this command is similar, but not
383
+ precisely equivalent, to back-tracking as can be used with
384
+ Anatomically-Constrained Tractography (ACT) in the tckgen command. However,
385
+ here the feature does not change the streamlines trajectories in any way; it
386
+ simply enables detection of the fact that the input fMRI image may not
387
+ contain a valid timeseries underneath the streamline endpoint, and where
388
+ this occurs, searches from the streamline endpoint inwards along the
389
+ streamline trajectory in search of a valid timeseries to sample from the
390
+ input image.
391
+
392
+ References:
393
+
394
+ Calamante, F.; Smith, R.E.; Liang, X.; Zalesky, A.; Connelly, A
395
+ Track-weighted dynamic functional connectivity (TW-dFC): a new method to
396
+ study time-resolved functional connectivity. Brain Struct Funct, 2017, doi:
397
+ 10.1007/s00429-017-1431-1.
398
+
399
+ Author: MRTrix3 Developers
400
+
401
+ URL: https://www.mrtrix.org/
402
+
403
+ Args:
404
+ params: The parameters.
405
+ execution: The execution object.
406
+ Returns:
407
+ NamedTuple of outputs (described in `TckdfcOutputs`).
408
+ """
409
+ params = execution.params(params)
410
+ cargs = tckdfc_cargs(params, execution)
411
+ ret = tckdfc_outputs(params, execution)
412
+ execution.run(cargs)
413
+ return ret
414
+
415
+
416
+ def tckdfc(
417
+ tracks: InputPathType,
418
+ fmri: InputPathType,
419
+ output: str,
420
+ static: bool = False,
421
+ dynamic: TckdfcDynamicParameters | None = None,
422
+ template: InputPathType | None = None,
423
+ vox: list[float] | None = None,
424
+ stat_vox: str | None = None,
425
+ backtrack: bool = False,
426
+ upsample: int | None = None,
427
+ info: bool = False,
428
+ quiet: bool = False,
429
+ debug: bool = False,
430
+ force: bool = False,
431
+ nthreads: int | None = None,
432
+ config: list[TckdfcConfigParameters] | None = None,
433
+ help_: bool = False,
434
+ version: bool = False,
435
+ runner: Runner | None = None,
436
+ ) -> TckdfcOutputs:
437
+ """
438
+ Perform the Track-Weighted Dynamic Functional Connectivity (TW-dFC) method.
439
+
440
+ This command generates a Track-Weighted Image (TWI), where the contribution
441
+ from each streamline to the image is the Pearson correlation between the
442
+ fMRI time series at the streamline endpoints.
443
+
444
+ The output image can be generated in one of two ways (note that one of these
445
+ two command-line options MUST be provided):
446
+
447
+ - "Static" functional connectivity (-static option): Each streamline
448
+ contributes to a static 3D output image based on the correlation between the
449
+ signals at the streamline endpoints using the entirety of the input time
450
+ series.
451
+
452
+ - "Dynamic" functional connectivity (-dynamic option): The output image is a
453
+ 4D image, with the same number of volumes as the input fMRI time series. For
454
+ each volume, the contribution from each streamline is calculated based on a
455
+ finite-width sliding time window, centred at the timepoint corresponding to
456
+ that volume.
457
+
458
+ Note that the -backtrack option in this command is similar, but not
459
+ precisely equivalent, to back-tracking as can be used with
460
+ Anatomically-Constrained Tractography (ACT) in the tckgen command. However,
461
+ here the feature does not change the streamlines trajectories in any way; it
462
+ simply enables detection of the fact that the input fMRI image may not
463
+ contain a valid timeseries underneath the streamline endpoint, and where
464
+ this occurs, searches from the streamline endpoint inwards along the
465
+ streamline trajectory in search of a valid timeseries to sample from the
466
+ input image.
467
+
468
+ References:
469
+
470
+ Calamante, F.; Smith, R.E.; Liang, X.; Zalesky, A.; Connelly, A
471
+ Track-weighted dynamic functional connectivity (TW-dFC): a new method to
472
+ study time-resolved functional connectivity. Brain Struct Funct, 2017, doi:
473
+ 10.1007/s00429-017-1431-1.
474
+
475
+ Author: MRTrix3 Developers
476
+
477
+ URL: https://www.mrtrix.org/
478
+
479
+ Args:
480
+ tracks: the input track file.
481
+ fmri: the pre-processed fMRI time series.
482
+ output: the output TW-dFC image.
483
+ static: generate a "static" (3D) output image.
484
+ dynamic: generate a "dynamic" (4D) output image; must additionally\
485
+ provide the shape and width (in volumes) of the sliding window.
486
+ template: an image file to be used as a template for the output (the\
487
+ output image will have the same transform and field of view).
488
+ vox: provide either an isotropic voxel size (in mm), or comma-separated\
489
+ list of 3 voxel dimensions.
490
+ stat_vox: define the statistic for choosing the final voxel intensities\
491
+ for a given contrast type given the individual values from the tracks\
492
+ passing through each voxel\
493
+ Options are: sum, min, mean, max (default: mean).
494
+ backtrack: if no valid timeseries is found at the streamline endpoint,\
495
+ back-track along the streamline trajectory until a valid timeseries is\
496
+ found.
497
+ upsample: upsample the tracks by some ratio using Hermite interpolation\
498
+ before mapping (if omitted, an appropriate ratio will be determined\
499
+ automatically).
500
+ info: display information messages.
501
+ quiet: do not display information messages or progress status;\
502
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
503
+ environment variable to a non-empty string.
504
+ debug: display debugging messages.
505
+ force: force overwrite of output files (caution: using the same file as\
506
+ input and output might cause unexpected behaviour).
507
+ nthreads: use this number of threads in multi-threaded applications\
508
+ (set to 0 to disable multi-threading).
509
+ config: temporarily set the value of an MRtrix config file entry.
510
+ help_: display this information page and exit.
511
+ version: display version information and exit.
512
+ runner: Command runner.
513
+ Returns:
514
+ NamedTuple of outputs (described in `TckdfcOutputs`).
515
+ """
516
+ runner = runner or get_global_runner()
517
+ execution = runner.start_execution(TCKDFC_METADATA)
518
+ params = tckdfc_params(
519
+ static=static,
520
+ dynamic=dynamic,
521
+ template=template,
522
+ vox=vox,
523
+ stat_vox=stat_vox,
524
+ backtrack=backtrack,
525
+ upsample=upsample,
526
+ info=info,
527
+ quiet=quiet,
528
+ debug=debug,
529
+ force=force,
530
+ nthreads=nthreads,
531
+ config=config,
532
+ help_=help_,
533
+ version=version,
534
+ tracks=tracks,
535
+ fmri=fmri,
536
+ output=output,
537
+ )
538
+ return tckdfc_execute(params, execution)
539
+
540
+
541
+ __all__ = [
542
+ "TCKDFC_METADATA",
543
+ "TckdfcConfigParameters",
544
+ "TckdfcDynamicParameters",
545
+ "TckdfcOutputs",
546
+ "TckdfcParameters",
547
+ "tckdfc",
548
+ "tckdfc_config_params",
549
+ "tckdfc_dynamic_params",
550
+ "tckdfc_params",
551
+ ]