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,592 @@
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
+ TCKSIFT_METADATA = Metadata(
9
+ id="156a082e7c712bee84c59b6e5b4b9d3ea89cf95f.boutiques",
10
+ name="tcksift",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ TcksiftConfigParameters = typing.TypedDict('TcksiftConfigParameters', {
17
+ "__STYX_TYPE__": typing.Literal["config"],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+
22
+
23
+ TcksiftParameters = typing.TypedDict('TcksiftParameters', {
24
+ "__STYX_TYPE__": typing.Literal["tcksift"],
25
+ "nofilter": bool,
26
+ "output_at_counts": typing.NotRequired[list[int] | None],
27
+ "proc_mask": typing.NotRequired[InputPathType | None],
28
+ "act": typing.NotRequired[InputPathType | None],
29
+ "fd_scale_gm": bool,
30
+ "no_dilate_lut": bool,
31
+ "make_null_lobes": bool,
32
+ "remove_untracked": bool,
33
+ "fd_thresh": typing.NotRequired[float | None],
34
+ "csv": typing.NotRequired[str | None],
35
+ "out_mu": typing.NotRequired[str | None],
36
+ "output_debug": bool,
37
+ "out_selection": typing.NotRequired[str | None],
38
+ "term_number": typing.NotRequired[int | None],
39
+ "term_ratio": typing.NotRequired[float | None],
40
+ "term_mu": typing.NotRequired[float | None],
41
+ "info": bool,
42
+ "quiet": bool,
43
+ "debug": bool,
44
+ "force": bool,
45
+ "nthreads": typing.NotRequired[int | None],
46
+ "config": typing.NotRequired[list[TcksiftConfigParameters] | None],
47
+ "help": bool,
48
+ "version": bool,
49
+ "in_tracks": InputPathType,
50
+ "in_fod": InputPathType,
51
+ "out_tracks": str,
52
+ })
53
+
54
+
55
+ def dyn_cargs(
56
+ t: str,
57
+ ) -> typing.Any:
58
+ """
59
+ Get build cargs function by command type.
60
+
61
+ Args:
62
+ t: Command type.
63
+ Returns:
64
+ Build cargs function.
65
+ """
66
+ return {
67
+ "tcksift": tcksift_cargs,
68
+ "config": tcksift_config_cargs,
69
+ }.get(t)
70
+
71
+
72
+ def dyn_outputs(
73
+ t: str,
74
+ ) -> typing.Any:
75
+ """
76
+ Get build outputs function by command type.
77
+
78
+ Args:
79
+ t: Command type.
80
+ Returns:
81
+ Build outputs function.
82
+ """
83
+ return {
84
+ "tcksift": tcksift_outputs,
85
+ }.get(t)
86
+
87
+
88
+ def tcksift_config_params(
89
+ key: str,
90
+ value: str,
91
+ ) -> TcksiftConfigParameters:
92
+ """
93
+ Build parameters.
94
+
95
+ Args:
96
+ key: temporarily set the value of an MRtrix config file entry.
97
+ value: temporarily set the value of an MRtrix config file entry.
98
+ Returns:
99
+ Parameter dictionary
100
+ """
101
+ params = {
102
+ "__STYXTYPE__": "config",
103
+ "key": key,
104
+ "value": value,
105
+ }
106
+ return params
107
+
108
+
109
+ def tcksift_config_cargs(
110
+ params: TcksiftConfigParameters,
111
+ execution: Execution,
112
+ ) -> list[str]:
113
+ """
114
+ Build command-line arguments from parameters.
115
+
116
+ Args:
117
+ params: The parameters.
118
+ execution: The execution object for resolving input paths.
119
+ Returns:
120
+ Command-line arguments.
121
+ """
122
+ cargs = []
123
+ cargs.append("-config")
124
+ cargs.append(params.get("key"))
125
+ cargs.append(params.get("value"))
126
+ return cargs
127
+
128
+
129
+ class TcksiftOutputs(typing.NamedTuple):
130
+ """
131
+ Output object returned when calling `tcksift(...)`.
132
+ """
133
+ root: OutputPathType
134
+ """Output root folder. This is the root folder for all outputs."""
135
+ out_tracks: OutputPathType
136
+ """the output filtered tracks file"""
137
+ csv_: OutputPathType | None
138
+ """output statistics of execution per iteration to a .csv file """
139
+ out_mu: OutputPathType | None
140
+ """output the final value of SIFT proportionality coefficient mu to a text
141
+ file """
142
+ out_selection: OutputPathType | None
143
+ """output a text file containing the binary selection of streamlines """
144
+
145
+
146
+ def tcksift_params(
147
+ in_tracks: InputPathType,
148
+ in_fod: InputPathType,
149
+ out_tracks: str,
150
+ nofilter: bool = False,
151
+ output_at_counts: list[int] | None = None,
152
+ proc_mask: InputPathType | None = None,
153
+ act: InputPathType | None = None,
154
+ fd_scale_gm: bool = False,
155
+ no_dilate_lut: bool = False,
156
+ make_null_lobes: bool = False,
157
+ remove_untracked: bool = False,
158
+ fd_thresh: float | None = None,
159
+ csv_: str | None = None,
160
+ out_mu: str | None = None,
161
+ output_debug: bool = False,
162
+ out_selection: str | None = None,
163
+ term_number: int | None = None,
164
+ term_ratio: float | None = None,
165
+ term_mu: float | None = None,
166
+ info: bool = False,
167
+ quiet: bool = False,
168
+ debug: bool = False,
169
+ force: bool = False,
170
+ nthreads: int | None = None,
171
+ config: list[TcksiftConfigParameters] | None = None,
172
+ help_: bool = False,
173
+ version: bool = False,
174
+ ) -> TcksiftParameters:
175
+ """
176
+ Build parameters.
177
+
178
+ Args:
179
+ in_tracks: the input track file.
180
+ in_fod: input image containing the spherical harmonics of the fibre\
181
+ orientation distributions.
182
+ out_tracks: the output filtered tracks file.
183
+ nofilter: do NOT perform track filtering - just construct the model in\
184
+ order to provide output debugging images.
185
+ output_at_counts: output filtered track files (and optionally debugging\
186
+ images if -output_debug is specified) at specific numbers of remaining\
187
+ streamlines; provide as comma-separated list of integers.
188
+ proc_mask: provide an image containing the processing mask weights for\
189
+ the model; image spatial dimensions must match the fixel image.
190
+ act: use an ACT five-tissue-type segmented anatomical image to derive\
191
+ the processing mask.
192
+ fd_scale_gm: provide this option (in conjunction with -act) to\
193
+ heuristically downsize the fibre density estimates based on the\
194
+ presence of GM in the voxel. This can assist in reducing tissue\
195
+ interface effects when using a single-tissue deconvolution algorithm.
196
+ no_dilate_lut: do NOT dilate FOD lobe lookup tables; only map\
197
+ streamlines to FOD lobes if the precise tangent lies within the angular\
198
+ spread of that lobe.
199
+ make_null_lobes: add an additional FOD lobe to each voxel, with zero\
200
+ integral, that covers all directions with zero / negative FOD\
201
+ amplitudes.
202
+ remove_untracked: remove FOD lobes that do not have any streamline\
203
+ density attributed to them; this improves filtering slightly, at the\
204
+ expense of longer computation time (and you can no longer do\
205
+ quantitative comparisons between reconstructions if this is enabled).
206
+ fd_thresh: fibre density threshold; exclude an FOD lobe from filtering\
207
+ processing if its integral is less than this amount (streamlines will\
208
+ still be mapped to it, but it will not contribute to the cost function\
209
+ or the filtering).
210
+ csv_: output statistics of execution per iteration to a .csv file.
211
+ out_mu: output the final value of SIFT proportionality coefficient mu\
212
+ to a text file.
213
+ output_debug: provide various output images for assessing & debugging\
214
+ performance etc.
215
+ out_selection: output a text file containing the binary selection of\
216
+ streamlines.
217
+ term_number: number of streamlines - continue filtering until this\
218
+ number of streamlines remain.
219
+ term_ratio: termination ratio - defined as the ratio between reduction\
220
+ in cost function, and reduction in density of streamlines.\
221
+ Smaller values result in more streamlines being filtered out.
222
+ term_mu: terminate filtering once the SIFT proportionality coefficient\
223
+ reaches a given value.
224
+ info: display information messages.
225
+ quiet: do not display information messages or progress status;\
226
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
227
+ environment variable to a non-empty string.
228
+ debug: display debugging messages.
229
+ force: force overwrite of output files (caution: using the same file as\
230
+ input and output might cause unexpected behaviour).
231
+ nthreads: use this number of threads in multi-threaded applications\
232
+ (set to 0 to disable multi-threading).
233
+ config: temporarily set the value of an MRtrix config file entry.
234
+ help_: display this information page and exit.
235
+ version: display version information and exit.
236
+ Returns:
237
+ Parameter dictionary
238
+ """
239
+ params = {
240
+ "__STYXTYPE__": "tcksift",
241
+ "nofilter": nofilter,
242
+ "fd_scale_gm": fd_scale_gm,
243
+ "no_dilate_lut": no_dilate_lut,
244
+ "make_null_lobes": make_null_lobes,
245
+ "remove_untracked": remove_untracked,
246
+ "output_debug": output_debug,
247
+ "info": info,
248
+ "quiet": quiet,
249
+ "debug": debug,
250
+ "force": force,
251
+ "help": help_,
252
+ "version": version,
253
+ "in_tracks": in_tracks,
254
+ "in_fod": in_fod,
255
+ "out_tracks": out_tracks,
256
+ }
257
+ if output_at_counts is not None:
258
+ params["output_at_counts"] = output_at_counts
259
+ if proc_mask is not None:
260
+ params["proc_mask"] = proc_mask
261
+ if act is not None:
262
+ params["act"] = act
263
+ if fd_thresh is not None:
264
+ params["fd_thresh"] = fd_thresh
265
+ if csv_ is not None:
266
+ params["csv"] = csv_
267
+ if out_mu is not None:
268
+ params["out_mu"] = out_mu
269
+ if out_selection is not None:
270
+ params["out_selection"] = out_selection
271
+ if term_number is not None:
272
+ params["term_number"] = term_number
273
+ if term_ratio is not None:
274
+ params["term_ratio"] = term_ratio
275
+ if term_mu is not None:
276
+ params["term_mu"] = term_mu
277
+ if nthreads is not None:
278
+ params["nthreads"] = nthreads
279
+ if config is not None:
280
+ params["config"] = config
281
+ return params
282
+
283
+
284
+ def tcksift_cargs(
285
+ params: TcksiftParameters,
286
+ execution: Execution,
287
+ ) -> list[str]:
288
+ """
289
+ Build command-line arguments from parameters.
290
+
291
+ Args:
292
+ params: The parameters.
293
+ execution: The execution object for resolving input paths.
294
+ Returns:
295
+ Command-line arguments.
296
+ """
297
+ cargs = []
298
+ cargs.append("tcksift")
299
+ if params.get("nofilter"):
300
+ cargs.append("-nofilter")
301
+ if params.get("output_at_counts") is not None:
302
+ cargs.extend([
303
+ "-output_at_counts",
304
+ ",".join(map(str, params.get("output_at_counts")))
305
+ ])
306
+ if params.get("proc_mask") is not None:
307
+ cargs.extend([
308
+ "-proc_mask",
309
+ execution.input_file(params.get("proc_mask"))
310
+ ])
311
+ if params.get("act") is not None:
312
+ cargs.extend([
313
+ "-act",
314
+ execution.input_file(params.get("act"))
315
+ ])
316
+ if params.get("fd_scale_gm"):
317
+ cargs.append("-fd_scale_gm")
318
+ if params.get("no_dilate_lut"):
319
+ cargs.append("-no_dilate_lut")
320
+ if params.get("make_null_lobes"):
321
+ cargs.append("-make_null_lobes")
322
+ if params.get("remove_untracked"):
323
+ cargs.append("-remove_untracked")
324
+ if params.get("fd_thresh") is not None:
325
+ cargs.extend([
326
+ "-fd_thresh",
327
+ str(params.get("fd_thresh"))
328
+ ])
329
+ if params.get("csv") is not None:
330
+ cargs.extend([
331
+ "-csv",
332
+ params.get("csv")
333
+ ])
334
+ if params.get("out_mu") is not None:
335
+ cargs.extend([
336
+ "-out_mu",
337
+ params.get("out_mu")
338
+ ])
339
+ if params.get("output_debug"):
340
+ cargs.append("-output_debug")
341
+ if params.get("out_selection") is not None:
342
+ cargs.extend([
343
+ "-out_selection",
344
+ params.get("out_selection")
345
+ ])
346
+ if params.get("term_number") is not None:
347
+ cargs.extend([
348
+ "-term_number",
349
+ str(params.get("term_number"))
350
+ ])
351
+ if params.get("term_ratio") is not None:
352
+ cargs.extend([
353
+ "-term_ratio",
354
+ str(params.get("term_ratio"))
355
+ ])
356
+ if params.get("term_mu") is not None:
357
+ cargs.extend([
358
+ "-term_mu",
359
+ str(params.get("term_mu"))
360
+ ])
361
+ if params.get("info"):
362
+ cargs.append("-info")
363
+ if params.get("quiet"):
364
+ cargs.append("-quiet")
365
+ if params.get("debug"):
366
+ cargs.append("-debug")
367
+ if params.get("force"):
368
+ cargs.append("-force")
369
+ if params.get("nthreads") is not None:
370
+ cargs.extend([
371
+ "-nthreads",
372
+ str(params.get("nthreads"))
373
+ ])
374
+ if params.get("config") is not None:
375
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
376
+ if params.get("help"):
377
+ cargs.append("-help")
378
+ if params.get("version"):
379
+ cargs.append("-version")
380
+ cargs.append(execution.input_file(params.get("in_tracks")))
381
+ cargs.append(execution.input_file(params.get("in_fod")))
382
+ cargs.append(params.get("out_tracks"))
383
+ return cargs
384
+
385
+
386
+ def tcksift_outputs(
387
+ params: TcksiftParameters,
388
+ execution: Execution,
389
+ ) -> TcksiftOutputs:
390
+ """
391
+ Build outputs object containing output file paths and possibly stdout/stderr.
392
+
393
+ Args:
394
+ params: The parameters.
395
+ execution: The execution object for resolving input paths.
396
+ Returns:
397
+ Outputs object.
398
+ """
399
+ ret = TcksiftOutputs(
400
+ root=execution.output_file("."),
401
+ out_tracks=execution.output_file(params.get("out_tracks")),
402
+ csv_=execution.output_file(params.get("csv")) if (params.get("csv") is not None) else None,
403
+ out_mu=execution.output_file(params.get("out_mu")) if (params.get("out_mu") is not None) else None,
404
+ out_selection=execution.output_file(params.get("out_selection")) if (params.get("out_selection") is not None) else None,
405
+ )
406
+ return ret
407
+
408
+
409
+ def tcksift_execute(
410
+ params: TcksiftParameters,
411
+ execution: Execution,
412
+ ) -> TcksiftOutputs:
413
+ """
414
+ Filter a whole-brain fibre-tracking data set such that the streamline densities
415
+ match the FOD lobe integrals.
416
+
417
+
418
+
419
+ References:
420
+
421
+ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT:
422
+ Spherical-deconvolution informed filtering of tractograms. NeuroImage, 2013,
423
+ 67, 298-312.
424
+
425
+ Author: MRTrix3 Developers
426
+
427
+ URL: https://www.mrtrix.org/
428
+
429
+ Args:
430
+ params: The parameters.
431
+ execution: The execution object.
432
+ Returns:
433
+ NamedTuple of outputs (described in `TcksiftOutputs`).
434
+ """
435
+ params = execution.params(params)
436
+ cargs = tcksift_cargs(params, execution)
437
+ ret = tcksift_outputs(params, execution)
438
+ execution.run(cargs)
439
+ return ret
440
+
441
+
442
+ def tcksift(
443
+ in_tracks: InputPathType,
444
+ in_fod: InputPathType,
445
+ out_tracks: str,
446
+ nofilter: bool = False,
447
+ output_at_counts: list[int] | None = None,
448
+ proc_mask: InputPathType | None = None,
449
+ act: InputPathType | None = None,
450
+ fd_scale_gm: bool = False,
451
+ no_dilate_lut: bool = False,
452
+ make_null_lobes: bool = False,
453
+ remove_untracked: bool = False,
454
+ fd_thresh: float | None = None,
455
+ csv_: str | None = None,
456
+ out_mu: str | None = None,
457
+ output_debug: bool = False,
458
+ out_selection: str | None = None,
459
+ term_number: int | None = None,
460
+ term_ratio: float | None = None,
461
+ term_mu: float | None = None,
462
+ info: bool = False,
463
+ quiet: bool = False,
464
+ debug: bool = False,
465
+ force: bool = False,
466
+ nthreads: int | None = None,
467
+ config: list[TcksiftConfigParameters] | None = None,
468
+ help_: bool = False,
469
+ version: bool = False,
470
+ runner: Runner | None = None,
471
+ ) -> TcksiftOutputs:
472
+ """
473
+ Filter a whole-brain fibre-tracking data set such that the streamline densities
474
+ match the FOD lobe integrals.
475
+
476
+
477
+
478
+ References:
479
+
480
+ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT:
481
+ Spherical-deconvolution informed filtering of tractograms. NeuroImage, 2013,
482
+ 67, 298-312.
483
+
484
+ Author: MRTrix3 Developers
485
+
486
+ URL: https://www.mrtrix.org/
487
+
488
+ Args:
489
+ in_tracks: the input track file.
490
+ in_fod: input image containing the spherical harmonics of the fibre\
491
+ orientation distributions.
492
+ out_tracks: the output filtered tracks file.
493
+ nofilter: do NOT perform track filtering - just construct the model in\
494
+ order to provide output debugging images.
495
+ output_at_counts: output filtered track files (and optionally debugging\
496
+ images if -output_debug is specified) at specific numbers of remaining\
497
+ streamlines; provide as comma-separated list of integers.
498
+ proc_mask: provide an image containing the processing mask weights for\
499
+ the model; image spatial dimensions must match the fixel image.
500
+ act: use an ACT five-tissue-type segmented anatomical image to derive\
501
+ the processing mask.
502
+ fd_scale_gm: provide this option (in conjunction with -act) to\
503
+ heuristically downsize the fibre density estimates based on the\
504
+ presence of GM in the voxel. This can assist in reducing tissue\
505
+ interface effects when using a single-tissue deconvolution algorithm.
506
+ no_dilate_lut: do NOT dilate FOD lobe lookup tables; only map\
507
+ streamlines to FOD lobes if the precise tangent lies within the angular\
508
+ spread of that lobe.
509
+ make_null_lobes: add an additional FOD lobe to each voxel, with zero\
510
+ integral, that covers all directions with zero / negative FOD\
511
+ amplitudes.
512
+ remove_untracked: remove FOD lobes that do not have any streamline\
513
+ density attributed to them; this improves filtering slightly, at the\
514
+ expense of longer computation time (and you can no longer do\
515
+ quantitative comparisons between reconstructions if this is enabled).
516
+ fd_thresh: fibre density threshold; exclude an FOD lobe from filtering\
517
+ processing if its integral is less than this amount (streamlines will\
518
+ still be mapped to it, but it will not contribute to the cost function\
519
+ or the filtering).
520
+ csv_: output statistics of execution per iteration to a .csv file.
521
+ out_mu: output the final value of SIFT proportionality coefficient mu\
522
+ to a text file.
523
+ output_debug: provide various output images for assessing & debugging\
524
+ performance etc.
525
+ out_selection: output a text file containing the binary selection of\
526
+ streamlines.
527
+ term_number: number of streamlines - continue filtering until this\
528
+ number of streamlines remain.
529
+ term_ratio: termination ratio - defined as the ratio between reduction\
530
+ in cost function, and reduction in density of streamlines.\
531
+ Smaller values result in more streamlines being filtered out.
532
+ term_mu: terminate filtering once the SIFT proportionality coefficient\
533
+ reaches a given value.
534
+ info: display information messages.
535
+ quiet: do not display information messages or progress status;\
536
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
537
+ environment variable to a non-empty string.
538
+ debug: display debugging messages.
539
+ force: force overwrite of output files (caution: using the same file as\
540
+ input and output might cause unexpected behaviour).
541
+ nthreads: use this number of threads in multi-threaded applications\
542
+ (set to 0 to disable multi-threading).
543
+ config: temporarily set the value of an MRtrix config file entry.
544
+ help_: display this information page and exit.
545
+ version: display version information and exit.
546
+ runner: Command runner.
547
+ Returns:
548
+ NamedTuple of outputs (described in `TcksiftOutputs`).
549
+ """
550
+ runner = runner or get_global_runner()
551
+ execution = runner.start_execution(TCKSIFT_METADATA)
552
+ params = tcksift_params(
553
+ nofilter=nofilter,
554
+ output_at_counts=output_at_counts,
555
+ proc_mask=proc_mask,
556
+ act=act,
557
+ fd_scale_gm=fd_scale_gm,
558
+ no_dilate_lut=no_dilate_lut,
559
+ make_null_lobes=make_null_lobes,
560
+ remove_untracked=remove_untracked,
561
+ fd_thresh=fd_thresh,
562
+ csv_=csv_,
563
+ out_mu=out_mu,
564
+ output_debug=output_debug,
565
+ out_selection=out_selection,
566
+ term_number=term_number,
567
+ term_ratio=term_ratio,
568
+ term_mu=term_mu,
569
+ info=info,
570
+ quiet=quiet,
571
+ debug=debug,
572
+ force=force,
573
+ nthreads=nthreads,
574
+ config=config,
575
+ help_=help_,
576
+ version=version,
577
+ in_tracks=in_tracks,
578
+ in_fod=in_fod,
579
+ out_tracks=out_tracks,
580
+ )
581
+ return tcksift_execute(params, execution)
582
+
583
+
584
+ __all__ = [
585
+ "TCKSIFT_METADATA",
586
+ "TcksiftConfigParameters",
587
+ "TcksiftOutputs",
588
+ "TcksiftParameters",
589
+ "tcksift",
590
+ "tcksift_config_params",
591
+ "tcksift_params",
592
+ ]