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,902 @@
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
+ TCKSIFT2_METADATA = Metadata(
9
+ id="14aaf15fab77274145a9c252945d1e6493faa9d5.boutiques",
10
+ name="tcksift2",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _Tcksift2ConfigParamsDictNoTag = typing.TypedDict('_Tcksift2ConfigParamsDictNoTag', {
17
+ "key": str,
18
+ "value": str,
19
+ })
20
+ Tcksift2ConfigParamsDictTagged = typing.TypedDict('Tcksift2ConfigParamsDictTagged', {
21
+ "@type": typing.Literal["config"],
22
+ "key": str,
23
+ "value": str,
24
+ })
25
+ Tcksift2ConfigParamsDict = _Tcksift2ConfigParamsDictNoTag | Tcksift2ConfigParamsDictTagged
26
+
27
+
28
+ _Tcksift2ParamsDictNoTag = typing.TypedDict('_Tcksift2ParamsDictNoTag', {
29
+ "proc_mask": typing.NotRequired[InputPathType | None],
30
+ "act": typing.NotRequired[InputPathType | None],
31
+ "fd_scale_gm": bool,
32
+ "no_dilate_lut": bool,
33
+ "make_null_lobes": bool,
34
+ "remove_untracked": bool,
35
+ "fd_thresh": typing.NotRequired[float | None],
36
+ "csv": typing.NotRequired[str | None],
37
+ "out_mu": typing.NotRequired[str | None],
38
+ "output_debug": bool,
39
+ "out_coeffs": typing.NotRequired[str | None],
40
+ "reg_tikhonov": typing.NotRequired[float | None],
41
+ "reg_tv": typing.NotRequired[float | None],
42
+ "min_td_frac": typing.NotRequired[float | None],
43
+ "min_iters": typing.NotRequired[int | None],
44
+ "max_iters": typing.NotRequired[int | None],
45
+ "min_factor": typing.NotRequired[float | None],
46
+ "min_coeff": typing.NotRequired[float | None],
47
+ "max_factor": typing.NotRequired[float | None],
48
+ "max_coeff": typing.NotRequired[float | None],
49
+ "max_coeff_step": typing.NotRequired[float | None],
50
+ "min_cf_decrease": typing.NotRequired[float | None],
51
+ "linear": bool,
52
+ "info": bool,
53
+ "quiet": bool,
54
+ "debug": bool,
55
+ "force": bool,
56
+ "nthreads": typing.NotRequired[int | None],
57
+ "config": typing.NotRequired[list[Tcksift2ConfigParamsDict] | None],
58
+ "help": bool,
59
+ "version": bool,
60
+ "in_tracks": InputPathType,
61
+ "in_fod": InputPathType,
62
+ "out_weights": str,
63
+ })
64
+ Tcksift2ParamsDictTagged = typing.TypedDict('Tcksift2ParamsDictTagged', {
65
+ "@type": typing.Literal["mrtrix/tcksift2"],
66
+ "proc_mask": typing.NotRequired[InputPathType | None],
67
+ "act": typing.NotRequired[InputPathType | None],
68
+ "fd_scale_gm": bool,
69
+ "no_dilate_lut": bool,
70
+ "make_null_lobes": bool,
71
+ "remove_untracked": bool,
72
+ "fd_thresh": typing.NotRequired[float | None],
73
+ "csv": typing.NotRequired[str | None],
74
+ "out_mu": typing.NotRequired[str | None],
75
+ "output_debug": bool,
76
+ "out_coeffs": typing.NotRequired[str | None],
77
+ "reg_tikhonov": typing.NotRequired[float | None],
78
+ "reg_tv": typing.NotRequired[float | None],
79
+ "min_td_frac": typing.NotRequired[float | None],
80
+ "min_iters": typing.NotRequired[int | None],
81
+ "max_iters": typing.NotRequired[int | None],
82
+ "min_factor": typing.NotRequired[float | None],
83
+ "min_coeff": typing.NotRequired[float | None],
84
+ "max_factor": typing.NotRequired[float | None],
85
+ "max_coeff": typing.NotRequired[float | None],
86
+ "max_coeff_step": typing.NotRequired[float | None],
87
+ "min_cf_decrease": typing.NotRequired[float | None],
88
+ "linear": bool,
89
+ "info": bool,
90
+ "quiet": bool,
91
+ "debug": bool,
92
+ "force": bool,
93
+ "nthreads": typing.NotRequired[int | None],
94
+ "config": typing.NotRequired[list[Tcksift2ConfigParamsDict] | None],
95
+ "help": bool,
96
+ "version": bool,
97
+ "in_tracks": InputPathType,
98
+ "in_fod": InputPathType,
99
+ "out_weights": str,
100
+ })
101
+ Tcksift2ParamsDict = _Tcksift2ParamsDictNoTag | Tcksift2ParamsDictTagged
102
+
103
+
104
+ def tcksift2_config(
105
+ key: str,
106
+ value: str,
107
+ ) -> Tcksift2ConfigParamsDictTagged:
108
+ """
109
+ Build parameters.
110
+
111
+ Args:
112
+ key: temporarily set the value of an MRtrix config file entry.
113
+ value: temporarily set the value of an MRtrix config file entry.
114
+ Returns:
115
+ Parameter dictionary
116
+ """
117
+ params = {
118
+ "@type": "config",
119
+ "key": key,
120
+ "value": value,
121
+ }
122
+ return params
123
+
124
+
125
+ def tcksift2_config_validate(
126
+ params: typing.Any,
127
+ ) -> None:
128
+ """
129
+ Validate parameters. Throws an error if `params` is not a valid
130
+ `Tcksift2ConfigParamsDict` object.
131
+
132
+ Args:
133
+ params: The parameters object to validate.
134
+ """
135
+ if params is None or not isinstance(params, dict):
136
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
137
+ if params.get("key", None) is None:
138
+ raise StyxValidationError("`key` must not be None")
139
+ if not isinstance(params["key"], str):
140
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
141
+ if params.get("value", None) is None:
142
+ raise StyxValidationError("`value` must not be None")
143
+ if not isinstance(params["value"], str):
144
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
145
+
146
+
147
+ def tcksift2_config_cargs(
148
+ params: Tcksift2ConfigParamsDict,
149
+ execution: Execution,
150
+ ) -> list[str]:
151
+ """
152
+ Build command-line arguments from parameters.
153
+
154
+ Args:
155
+ params: The parameters.
156
+ execution: The execution object for resolving input paths.
157
+ Returns:
158
+ Command-line arguments.
159
+ """
160
+ cargs = []
161
+ cargs.append("-config")
162
+ cargs.append(params.get("key", None))
163
+ cargs.append(params.get("value", None))
164
+ return cargs
165
+
166
+
167
+ class Tcksift2Outputs(typing.NamedTuple):
168
+ """
169
+ Output object returned when calling `Tcksift2ParamsDict(...)`.
170
+ """
171
+ root: OutputPathType
172
+ """Output root folder. This is the root folder for all outputs."""
173
+ out_weights: OutputPathType
174
+ """output text file containing the weighting factor for each streamline"""
175
+ csv_: OutputPathType | None
176
+ """output statistics of execution per iteration to a .csv file """
177
+ out_mu: OutputPathType | None
178
+ """output the final value of SIFT proportionality coefficient mu to a text
179
+ file """
180
+ out_coeffs: OutputPathType | None
181
+ """output text file containing the weighting coefficient for each streamline
182
+ """
183
+
184
+
185
+ def tcksift2_params(
186
+ in_tracks: InputPathType,
187
+ in_fod: InputPathType,
188
+ out_weights: str,
189
+ proc_mask: InputPathType | None = None,
190
+ act: InputPathType | None = None,
191
+ fd_scale_gm: bool = False,
192
+ no_dilate_lut: bool = False,
193
+ make_null_lobes: bool = False,
194
+ remove_untracked: bool = False,
195
+ fd_thresh: float | None = None,
196
+ csv_: str | None = None,
197
+ out_mu: str | None = None,
198
+ output_debug: bool = False,
199
+ out_coeffs: str | None = None,
200
+ reg_tikhonov: float | None = None,
201
+ reg_tv: float | None = None,
202
+ min_td_frac: float | None = None,
203
+ min_iters: int | None = None,
204
+ max_iters: int | None = None,
205
+ min_factor: float | None = None,
206
+ min_coeff: float | None = None,
207
+ max_factor: float | None = None,
208
+ max_coeff: float | None = None,
209
+ max_coeff_step: float | None = None,
210
+ min_cf_decrease: float | None = None,
211
+ linear: bool = False,
212
+ info: bool = False,
213
+ quiet: bool = False,
214
+ debug: bool = False,
215
+ force: bool = False,
216
+ nthreads: int | None = None,
217
+ config: list[Tcksift2ConfigParamsDict] | None = None,
218
+ help_: bool = False,
219
+ version: bool = False,
220
+ ) -> Tcksift2ParamsDictTagged:
221
+ """
222
+ Build parameters.
223
+
224
+ Args:
225
+ in_tracks: the input track file.
226
+ in_fod: input image containing the spherical harmonics of the fibre\
227
+ orientation distributions.
228
+ out_weights: output text file containing the weighting factor for each\
229
+ streamline.
230
+ proc_mask: provide an image containing the processing mask weights for\
231
+ the model; image spatial dimensions must match the fixel image.
232
+ act: use an ACT five-tissue-type segmented anatomical image to derive\
233
+ the processing mask.
234
+ fd_scale_gm: provide this option (in conjunction with -act) to\
235
+ heuristically downsize the fibre density estimates based on the\
236
+ presence of GM in the voxel. This can assist in reducing tissue\
237
+ interface effects when using a single-tissue deconvolution algorithm.
238
+ no_dilate_lut: do NOT dilate FOD lobe lookup tables; only map\
239
+ streamlines to FOD lobes if the precise tangent lies within the angular\
240
+ spread of that lobe.
241
+ make_null_lobes: add an additional FOD lobe to each voxel, with zero\
242
+ integral, that covers all directions with zero / negative FOD\
243
+ amplitudes.
244
+ remove_untracked: remove FOD lobes that do not have any streamline\
245
+ density attributed to them; this improves filtering slightly, at the\
246
+ expense of longer computation time (and you can no longer do\
247
+ quantitative comparisons between reconstructions if this is enabled).
248
+ fd_thresh: fibre density threshold; exclude an FOD lobe from filtering\
249
+ processing if its integral is less than this amount (streamlines will\
250
+ still be mapped to it, but it will not contribute to the cost function\
251
+ or the filtering).
252
+ csv_: output statistics of execution per iteration to a .csv file.
253
+ out_mu: output the final value of SIFT proportionality coefficient mu\
254
+ to a text file.
255
+ output_debug: provide various output images for assessing & debugging\
256
+ performance etc.
257
+ out_coeffs: output text file containing the weighting coefficient for\
258
+ each streamline.
259
+ reg_tikhonov: provide coefficient for regularising streamline weighting\
260
+ coefficients (Tikhonov regularisation) (default: 0).
261
+ reg_tv: provide coefficient for regularising variance of streamline\
262
+ weighting coefficient to fixels along its length (Total Variation\
263
+ regularisation) (default: 0.1).
264
+ min_td_frac: minimum fraction of the FOD integral reconstructed by\
265
+ streamlines; if the reconstructed streamline density is below this\
266
+ fraction, the fixel is excluded from optimisation (default: 0.1).
267
+ min_iters: minimum number of iterations to run before testing for\
268
+ convergence; this can prevent premature termination at early iterations\
269
+ if the cost function increases slightly (default: 10).
270
+ max_iters: maximum number of iterations to run before terminating\
271
+ program.
272
+ min_factor: minimum weighting factor for an individual streamline; if\
273
+ the factor falls below this number the streamline will be rejected\
274
+ entirely (factor set to zero) (default: 0).
275
+ min_coeff: minimum weighting coefficient for an individual streamline;\
276
+ similar to the '-min_factor' option, but using the exponential\
277
+ coefficient basis of the SIFT2 model; these parameters are related as:\
278
+ factor = e^(coeff). Note that the -min_factor and -min_coeff options\
279
+ are mutually exclusive - you can only provide one. (default: -inf).
280
+ max_factor: maximum weighting factor that can be assigned to any one\
281
+ streamline (default: inf).
282
+ max_coeff: maximum weighting coefficient for an individual streamline;\
283
+ similar to the '-max_factor' option, but using the exponential\
284
+ coefficient basis of the SIFT2 model; these parameters are related as:\
285
+ factor = e^(coeff). Note that the -max_factor and -max_coeff options\
286
+ are mutually exclusive - you can only provide one. (default: inf).
287
+ max_coeff_step: maximum change to a streamline's weighting coefficient\
288
+ in a single iteration (default: 1).
289
+ min_cf_decrease: minimum decrease in the cost function (as a fraction\
290
+ of the initial value) that must occur each iteration for the algorithm\
291
+ to continue (default: 2.5e-05).
292
+ linear: perform a linear estimation of streamline weights, rather than\
293
+ the standard non-linear optimisation (typically does not provide as\
294
+ accurate a model fit; but only requires a single pass).
295
+ info: display information messages.
296
+ quiet: do not display information messages or progress status;\
297
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
298
+ environment variable to a non-empty string.
299
+ debug: display debugging messages.
300
+ force: force overwrite of output files (caution: using the same file as\
301
+ input and output might cause unexpected behaviour).
302
+ nthreads: use this number of threads in multi-threaded applications\
303
+ (set to 0 to disable multi-threading).
304
+ config: temporarily set the value of an MRtrix config file entry.
305
+ help_: display this information page and exit.
306
+ version: display version information and exit.
307
+ Returns:
308
+ Parameter dictionary
309
+ """
310
+ params = {
311
+ "@type": "mrtrix/tcksift2",
312
+ "fd_scale_gm": fd_scale_gm,
313
+ "no_dilate_lut": no_dilate_lut,
314
+ "make_null_lobes": make_null_lobes,
315
+ "remove_untracked": remove_untracked,
316
+ "output_debug": output_debug,
317
+ "linear": linear,
318
+ "info": info,
319
+ "quiet": quiet,
320
+ "debug": debug,
321
+ "force": force,
322
+ "help": help_,
323
+ "version": version,
324
+ "in_tracks": in_tracks,
325
+ "in_fod": in_fod,
326
+ "out_weights": out_weights,
327
+ }
328
+ if proc_mask is not None:
329
+ params["proc_mask"] = proc_mask
330
+ if act is not None:
331
+ params["act"] = act
332
+ if fd_thresh is not None:
333
+ params["fd_thresh"] = fd_thresh
334
+ if csv_ is not None:
335
+ params["csv"] = csv_
336
+ if out_mu is not None:
337
+ params["out_mu"] = out_mu
338
+ if out_coeffs is not None:
339
+ params["out_coeffs"] = out_coeffs
340
+ if reg_tikhonov is not None:
341
+ params["reg_tikhonov"] = reg_tikhonov
342
+ if reg_tv is not None:
343
+ params["reg_tv"] = reg_tv
344
+ if min_td_frac is not None:
345
+ params["min_td_frac"] = min_td_frac
346
+ if min_iters is not None:
347
+ params["min_iters"] = min_iters
348
+ if max_iters is not None:
349
+ params["max_iters"] = max_iters
350
+ if min_factor is not None:
351
+ params["min_factor"] = min_factor
352
+ if min_coeff is not None:
353
+ params["min_coeff"] = min_coeff
354
+ if max_factor is not None:
355
+ params["max_factor"] = max_factor
356
+ if max_coeff is not None:
357
+ params["max_coeff"] = max_coeff
358
+ if max_coeff_step is not None:
359
+ params["max_coeff_step"] = max_coeff_step
360
+ if min_cf_decrease is not None:
361
+ params["min_cf_decrease"] = min_cf_decrease
362
+ if nthreads is not None:
363
+ params["nthreads"] = nthreads
364
+ if config is not None:
365
+ params["config"] = config
366
+ return params
367
+
368
+
369
+ def tcksift2_validate(
370
+ params: typing.Any,
371
+ ) -> None:
372
+ """
373
+ Validate parameters. Throws an error if `params` is not a valid
374
+ `Tcksift2ParamsDict` object.
375
+
376
+ Args:
377
+ params: The parameters object to validate.
378
+ """
379
+ if params is None or not isinstance(params, dict):
380
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
381
+ if params.get("proc_mask", None) is not None:
382
+ if not isinstance(params["proc_mask"], (pathlib.Path, str)):
383
+ raise StyxValidationError(f'`proc_mask` has the wrong type: Received `{type(params.get("proc_mask", None))}` expected `InputPathType | None`')
384
+ if params.get("act", None) is not None:
385
+ if not isinstance(params["act"], (pathlib.Path, str)):
386
+ raise StyxValidationError(f'`act` has the wrong type: Received `{type(params.get("act", None))}` expected `InputPathType | None`')
387
+ if params.get("fd_scale_gm", False) is None:
388
+ raise StyxValidationError("`fd_scale_gm` must not be None")
389
+ if not isinstance(params["fd_scale_gm"], bool):
390
+ raise StyxValidationError(f'`fd_scale_gm` has the wrong type: Received `{type(params.get("fd_scale_gm", False))}` expected `bool`')
391
+ if params.get("no_dilate_lut", False) is None:
392
+ raise StyxValidationError("`no_dilate_lut` must not be None")
393
+ if not isinstance(params["no_dilate_lut"], bool):
394
+ raise StyxValidationError(f'`no_dilate_lut` has the wrong type: Received `{type(params.get("no_dilate_lut", False))}` expected `bool`')
395
+ if params.get("make_null_lobes", False) is None:
396
+ raise StyxValidationError("`make_null_lobes` must not be None")
397
+ if not isinstance(params["make_null_lobes"], bool):
398
+ raise StyxValidationError(f'`make_null_lobes` has the wrong type: Received `{type(params.get("make_null_lobes", False))}` expected `bool`')
399
+ if params.get("remove_untracked", False) is None:
400
+ raise StyxValidationError("`remove_untracked` must not be None")
401
+ if not isinstance(params["remove_untracked"], bool):
402
+ raise StyxValidationError(f'`remove_untracked` has the wrong type: Received `{type(params.get("remove_untracked", False))}` expected `bool`')
403
+ if params.get("fd_thresh", None) is not None:
404
+ if not isinstance(params["fd_thresh"], (float, int)):
405
+ raise StyxValidationError(f'`fd_thresh` has the wrong type: Received `{type(params.get("fd_thresh", None))}` expected `float | None`')
406
+ if params.get("csv", None) is not None:
407
+ if not isinstance(params["csv"], str):
408
+ raise StyxValidationError(f'`csv` has the wrong type: Received `{type(params.get("csv", None))}` expected `str | None`')
409
+ if params.get("out_mu", None) is not None:
410
+ if not isinstance(params["out_mu"], str):
411
+ raise StyxValidationError(f'`out_mu` has the wrong type: Received `{type(params.get("out_mu", None))}` expected `str | None`')
412
+ if params.get("output_debug", False) is None:
413
+ raise StyxValidationError("`output_debug` must not be None")
414
+ if not isinstance(params["output_debug"], bool):
415
+ raise StyxValidationError(f'`output_debug` has the wrong type: Received `{type(params.get("output_debug", False))}` expected `bool`')
416
+ if params.get("out_coeffs", None) is not None:
417
+ if not isinstance(params["out_coeffs"], str):
418
+ raise StyxValidationError(f'`out_coeffs` has the wrong type: Received `{type(params.get("out_coeffs", None))}` expected `str | None`')
419
+ if params.get("reg_tikhonov", None) is not None:
420
+ if not isinstance(params["reg_tikhonov"], (float, int)):
421
+ raise StyxValidationError(f'`reg_tikhonov` has the wrong type: Received `{type(params.get("reg_tikhonov", None))}` expected `float | None`')
422
+ if params.get("reg_tv", None) is not None:
423
+ if not isinstance(params["reg_tv"], (float, int)):
424
+ raise StyxValidationError(f'`reg_tv` has the wrong type: Received `{type(params.get("reg_tv", None))}` expected `float | None`')
425
+ if params.get("min_td_frac", None) is not None:
426
+ if not isinstance(params["min_td_frac"], (float, int)):
427
+ raise StyxValidationError(f'`min_td_frac` has the wrong type: Received `{type(params.get("min_td_frac", None))}` expected `float | None`')
428
+ if params.get("min_iters", None) is not None:
429
+ if not isinstance(params["min_iters"], int):
430
+ raise StyxValidationError(f'`min_iters` has the wrong type: Received `{type(params.get("min_iters", None))}` expected `int | None`')
431
+ if params.get("max_iters", None) is not None:
432
+ if not isinstance(params["max_iters"], int):
433
+ raise StyxValidationError(f'`max_iters` has the wrong type: Received `{type(params.get("max_iters", None))}` expected `int | None`')
434
+ if params.get("min_factor", None) is not None:
435
+ if not isinstance(params["min_factor"], (float, int)):
436
+ raise StyxValidationError(f'`min_factor` has the wrong type: Received `{type(params.get("min_factor", None))}` expected `float | None`')
437
+ if params.get("min_coeff", None) is not None:
438
+ if not isinstance(params["min_coeff"], (float, int)):
439
+ raise StyxValidationError(f'`min_coeff` has the wrong type: Received `{type(params.get("min_coeff", None))}` expected `float | None`')
440
+ if params.get("max_factor", None) is not None:
441
+ if not isinstance(params["max_factor"], (float, int)):
442
+ raise StyxValidationError(f'`max_factor` has the wrong type: Received `{type(params.get("max_factor", None))}` expected `float | None`')
443
+ if params.get("max_coeff", None) is not None:
444
+ if not isinstance(params["max_coeff"], (float, int)):
445
+ raise StyxValidationError(f'`max_coeff` has the wrong type: Received `{type(params.get("max_coeff", None))}` expected `float | None`')
446
+ if params.get("max_coeff_step", None) is not None:
447
+ if not isinstance(params["max_coeff_step"], (float, int)):
448
+ raise StyxValidationError(f'`max_coeff_step` has the wrong type: Received `{type(params.get("max_coeff_step", None))}` expected `float | None`')
449
+ if params.get("min_cf_decrease", None) is not None:
450
+ if not isinstance(params["min_cf_decrease"], (float, int)):
451
+ raise StyxValidationError(f'`min_cf_decrease` has the wrong type: Received `{type(params.get("min_cf_decrease", None))}` expected `float | None`')
452
+ if params.get("linear", False) is None:
453
+ raise StyxValidationError("`linear` must not be None")
454
+ if not isinstance(params["linear"], bool):
455
+ raise StyxValidationError(f'`linear` has the wrong type: Received `{type(params.get("linear", False))}` expected `bool`')
456
+ if params.get("info", False) is None:
457
+ raise StyxValidationError("`info` must not be None")
458
+ if not isinstance(params["info"], bool):
459
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
460
+ if params.get("quiet", False) is None:
461
+ raise StyxValidationError("`quiet` must not be None")
462
+ if not isinstance(params["quiet"], bool):
463
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
464
+ if params.get("debug", False) is None:
465
+ raise StyxValidationError("`debug` must not be None")
466
+ if not isinstance(params["debug"], bool):
467
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
468
+ if params.get("force", False) is None:
469
+ raise StyxValidationError("`force` must not be None")
470
+ if not isinstance(params["force"], bool):
471
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
472
+ if params.get("nthreads", None) is not None:
473
+ if not isinstance(params["nthreads"], int):
474
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
475
+ if params.get("config", None) is not None:
476
+ if not isinstance(params["config"], list):
477
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[Tcksift2ConfigParamsDict] | None`')
478
+ for e in params["config"]:
479
+ tcksift2_config_validate(e)
480
+ if params.get("help", False) is None:
481
+ raise StyxValidationError("`help` must not be None")
482
+ if not isinstance(params["help"], bool):
483
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
484
+ if params.get("version", False) is None:
485
+ raise StyxValidationError("`version` must not be None")
486
+ if not isinstance(params["version"], bool):
487
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
488
+ if params.get("in_tracks", None) is None:
489
+ raise StyxValidationError("`in_tracks` must not be None")
490
+ if not isinstance(params["in_tracks"], (pathlib.Path, str)):
491
+ raise StyxValidationError(f'`in_tracks` has the wrong type: Received `{type(params.get("in_tracks", None))}` expected `InputPathType`')
492
+ if params.get("in_fod", None) is None:
493
+ raise StyxValidationError("`in_fod` must not be None")
494
+ if not isinstance(params["in_fod"], (pathlib.Path, str)):
495
+ raise StyxValidationError(f'`in_fod` has the wrong type: Received `{type(params.get("in_fod", None))}` expected `InputPathType`')
496
+ if params.get("out_weights", None) is None:
497
+ raise StyxValidationError("`out_weights` must not be None")
498
+ if not isinstance(params["out_weights"], str):
499
+ raise StyxValidationError(f'`out_weights` has the wrong type: Received `{type(params.get("out_weights", None))}` expected `str`')
500
+
501
+
502
+ def tcksift2_cargs(
503
+ params: Tcksift2ParamsDict,
504
+ execution: Execution,
505
+ ) -> list[str]:
506
+ """
507
+ Build command-line arguments from parameters.
508
+
509
+ Args:
510
+ params: The parameters.
511
+ execution: The execution object for resolving input paths.
512
+ Returns:
513
+ Command-line arguments.
514
+ """
515
+ cargs = []
516
+ cargs.append("tcksift2")
517
+ if params.get("proc_mask", None) is not None:
518
+ cargs.extend([
519
+ "-proc_mask",
520
+ execution.input_file(params.get("proc_mask", None))
521
+ ])
522
+ if params.get("act", None) is not None:
523
+ cargs.extend([
524
+ "-act",
525
+ execution.input_file(params.get("act", None))
526
+ ])
527
+ if params.get("fd_scale_gm", False):
528
+ cargs.append("-fd_scale_gm")
529
+ if params.get("no_dilate_lut", False):
530
+ cargs.append("-no_dilate_lut")
531
+ if params.get("make_null_lobes", False):
532
+ cargs.append("-make_null_lobes")
533
+ if params.get("remove_untracked", False):
534
+ cargs.append("-remove_untracked")
535
+ if params.get("fd_thresh", None) is not None:
536
+ cargs.extend([
537
+ "-fd_thresh",
538
+ str(params.get("fd_thresh", None))
539
+ ])
540
+ if params.get("csv", None) is not None:
541
+ cargs.extend([
542
+ "-csv",
543
+ params.get("csv", None)
544
+ ])
545
+ if params.get("out_mu", None) is not None:
546
+ cargs.extend([
547
+ "-out_mu",
548
+ params.get("out_mu", None)
549
+ ])
550
+ if params.get("output_debug", False):
551
+ cargs.append("-output_debug")
552
+ if params.get("out_coeffs", None) is not None:
553
+ cargs.extend([
554
+ "-out_coeffs",
555
+ params.get("out_coeffs", None)
556
+ ])
557
+ if params.get("reg_tikhonov", None) is not None:
558
+ cargs.extend([
559
+ "-reg_tikhonov",
560
+ str(params.get("reg_tikhonov", None))
561
+ ])
562
+ if params.get("reg_tv", None) is not None:
563
+ cargs.extend([
564
+ "-reg_tv",
565
+ str(params.get("reg_tv", None))
566
+ ])
567
+ if params.get("min_td_frac", None) is not None:
568
+ cargs.extend([
569
+ "-min_td_frac",
570
+ str(params.get("min_td_frac", None))
571
+ ])
572
+ if params.get("min_iters", None) is not None:
573
+ cargs.extend([
574
+ "-min_iters",
575
+ str(params.get("min_iters", None))
576
+ ])
577
+ if params.get("max_iters", None) is not None:
578
+ cargs.extend([
579
+ "-max_iters",
580
+ str(params.get("max_iters", None))
581
+ ])
582
+ if params.get("min_factor", None) is not None:
583
+ cargs.extend([
584
+ "-min_factor",
585
+ str(params.get("min_factor", None))
586
+ ])
587
+ if params.get("min_coeff", None) is not None:
588
+ cargs.extend([
589
+ "-min_coeff",
590
+ str(params.get("min_coeff", None))
591
+ ])
592
+ if params.get("max_factor", None) is not None:
593
+ cargs.extend([
594
+ "-max_factor",
595
+ str(params.get("max_factor", None))
596
+ ])
597
+ if params.get("max_coeff", None) is not None:
598
+ cargs.extend([
599
+ "-max_coeff",
600
+ str(params.get("max_coeff", None))
601
+ ])
602
+ if params.get("max_coeff_step", None) is not None:
603
+ cargs.extend([
604
+ "-max_coeff_step",
605
+ str(params.get("max_coeff_step", None))
606
+ ])
607
+ if params.get("min_cf_decrease", None) is not None:
608
+ cargs.extend([
609
+ "-min_cf_decrease",
610
+ str(params.get("min_cf_decrease", None))
611
+ ])
612
+ if params.get("linear", False):
613
+ cargs.append("-linear")
614
+ if params.get("info", False):
615
+ cargs.append("-info")
616
+ if params.get("quiet", False):
617
+ cargs.append("-quiet")
618
+ if params.get("debug", False):
619
+ cargs.append("-debug")
620
+ if params.get("force", False):
621
+ cargs.append("-force")
622
+ if params.get("nthreads", None) is not None:
623
+ cargs.extend([
624
+ "-nthreads",
625
+ str(params.get("nthreads", None))
626
+ ])
627
+ if params.get("config", None) is not None:
628
+ cargs.extend([a for c in [tcksift2_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
629
+ if params.get("help", False):
630
+ cargs.append("-help")
631
+ if params.get("version", False):
632
+ cargs.append("-version")
633
+ cargs.append(execution.input_file(params.get("in_tracks", None)))
634
+ cargs.append(execution.input_file(params.get("in_fod", None)))
635
+ cargs.append(params.get("out_weights", None))
636
+ return cargs
637
+
638
+
639
+ def tcksift2_outputs(
640
+ params: Tcksift2ParamsDict,
641
+ execution: Execution,
642
+ ) -> Tcksift2Outputs:
643
+ """
644
+ Build outputs object containing output file paths and possibly stdout/stderr.
645
+
646
+ Args:
647
+ params: The parameters.
648
+ execution: The execution object for resolving input paths.
649
+ Returns:
650
+ Outputs object.
651
+ """
652
+ ret = Tcksift2Outputs(
653
+ root=execution.output_file("."),
654
+ out_weights=execution.output_file(params.get("out_weights", None)),
655
+ csv_=execution.output_file(params.get("csv", None)) if (params.get("csv") is not None) else None,
656
+ out_mu=execution.output_file(params.get("out_mu", None)) if (params.get("out_mu") is not None) else None,
657
+ out_coeffs=execution.output_file(params.get("out_coeffs", None)) if (params.get("out_coeffs") is not None) else None,
658
+ )
659
+ return ret
660
+
661
+
662
+ def tcksift2_execute(
663
+ params: Tcksift2ParamsDict,
664
+ runner: Runner | None = None,
665
+ ) -> Tcksift2Outputs:
666
+ """
667
+ tcksift2
668
+
669
+ Optimise per-streamline cross-section multipliers to match a whole-brain
670
+ tractogram to fixel-wise fibre densities.
671
+
672
+
673
+
674
+ References:
675
+
676
+ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT2: Enabling
677
+ dense quantitative assessment of brain white matter connectivity using
678
+ streamlines tractography. NeuroImage, 2015, 119, 338-351
679
+
680
+ * If using the -linear option:
681
+ Smith, RE; Raffelt, D; Tournier, J-D; Connelly, A. Quantitative Streamlines
682
+ Tractography: Methods and Inter-Subject Normalisation. Open Science
683
+ Framework, https://doi.org/10.31219/osf.io/c67kn.
684
+
685
+ Author: MRTrix3 Developers
686
+
687
+ URL: https://www.mrtrix.org/
688
+
689
+ Args:
690
+ params: The parameters.
691
+ runner: Command runner.
692
+ Returns:
693
+ NamedTuple of outputs (described in `Tcksift2Outputs`).
694
+ """
695
+ tcksift2_validate(params)
696
+ runner = runner or get_global_runner()
697
+ execution = runner.start_execution(TCKSIFT2_METADATA)
698
+ params = execution.params(params)
699
+ cargs = tcksift2_cargs(params, execution)
700
+ ret = tcksift2_outputs(params, execution)
701
+ execution.run(cargs)
702
+ return ret
703
+
704
+
705
+ def tcksift2(
706
+ in_tracks: InputPathType,
707
+ in_fod: InputPathType,
708
+ out_weights: str,
709
+ proc_mask: InputPathType | None = None,
710
+ act: InputPathType | None = None,
711
+ fd_scale_gm: bool = False,
712
+ no_dilate_lut: bool = False,
713
+ make_null_lobes: bool = False,
714
+ remove_untracked: bool = False,
715
+ fd_thresh: float | None = None,
716
+ csv_: str | None = None,
717
+ out_mu: str | None = None,
718
+ output_debug: bool = False,
719
+ out_coeffs: str | None = None,
720
+ reg_tikhonov: float | None = None,
721
+ reg_tv: float | None = None,
722
+ min_td_frac: float | None = None,
723
+ min_iters: int | None = None,
724
+ max_iters: int | None = None,
725
+ min_factor: float | None = None,
726
+ min_coeff: float | None = None,
727
+ max_factor: float | None = None,
728
+ max_coeff: float | None = None,
729
+ max_coeff_step: float | None = None,
730
+ min_cf_decrease: float | None = None,
731
+ linear: bool = False,
732
+ info: bool = False,
733
+ quiet: bool = False,
734
+ debug: bool = False,
735
+ force: bool = False,
736
+ nthreads: int | None = None,
737
+ config: list[Tcksift2ConfigParamsDict] | None = None,
738
+ help_: bool = False,
739
+ version: bool = False,
740
+ runner: Runner | None = None,
741
+ ) -> Tcksift2Outputs:
742
+ """
743
+ tcksift2
744
+
745
+ Optimise per-streamline cross-section multipliers to match a whole-brain
746
+ tractogram to fixel-wise fibre densities.
747
+
748
+
749
+
750
+ References:
751
+
752
+ Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT2: Enabling
753
+ dense quantitative assessment of brain white matter connectivity using
754
+ streamlines tractography. NeuroImage, 2015, 119, 338-351
755
+
756
+ * If using the -linear option:
757
+ Smith, RE; Raffelt, D; Tournier, J-D; Connelly, A. Quantitative Streamlines
758
+ Tractography: Methods and Inter-Subject Normalisation. Open Science
759
+ Framework, https://doi.org/10.31219/osf.io/c67kn.
760
+
761
+ Author: MRTrix3 Developers
762
+
763
+ URL: https://www.mrtrix.org/
764
+
765
+ Args:
766
+ in_tracks: the input track file.
767
+ in_fod: input image containing the spherical harmonics of the fibre\
768
+ orientation distributions.
769
+ out_weights: output text file containing the weighting factor for each\
770
+ streamline.
771
+ proc_mask: provide an image containing the processing mask weights for\
772
+ the model; image spatial dimensions must match the fixel image.
773
+ act: use an ACT five-tissue-type segmented anatomical image to derive\
774
+ the processing mask.
775
+ fd_scale_gm: provide this option (in conjunction with -act) to\
776
+ heuristically downsize the fibre density estimates based on the\
777
+ presence of GM in the voxel. This can assist in reducing tissue\
778
+ interface effects when using a single-tissue deconvolution algorithm.
779
+ no_dilate_lut: do NOT dilate FOD lobe lookup tables; only map\
780
+ streamlines to FOD lobes if the precise tangent lies within the angular\
781
+ spread of that lobe.
782
+ make_null_lobes: add an additional FOD lobe to each voxel, with zero\
783
+ integral, that covers all directions with zero / negative FOD\
784
+ amplitudes.
785
+ remove_untracked: remove FOD lobes that do not have any streamline\
786
+ density attributed to them; this improves filtering slightly, at the\
787
+ expense of longer computation time (and you can no longer do\
788
+ quantitative comparisons between reconstructions if this is enabled).
789
+ fd_thresh: fibre density threshold; exclude an FOD lobe from filtering\
790
+ processing if its integral is less than this amount (streamlines will\
791
+ still be mapped to it, but it will not contribute to the cost function\
792
+ or the filtering).
793
+ csv_: output statistics of execution per iteration to a .csv file.
794
+ out_mu: output the final value of SIFT proportionality coefficient mu\
795
+ to a text file.
796
+ output_debug: provide various output images for assessing & debugging\
797
+ performance etc.
798
+ out_coeffs: output text file containing the weighting coefficient for\
799
+ each streamline.
800
+ reg_tikhonov: provide coefficient for regularising streamline weighting\
801
+ coefficients (Tikhonov regularisation) (default: 0).
802
+ reg_tv: provide coefficient for regularising variance of streamline\
803
+ weighting coefficient to fixels along its length (Total Variation\
804
+ regularisation) (default: 0.1).
805
+ min_td_frac: minimum fraction of the FOD integral reconstructed by\
806
+ streamlines; if the reconstructed streamline density is below this\
807
+ fraction, the fixel is excluded from optimisation (default: 0.1).
808
+ min_iters: minimum number of iterations to run before testing for\
809
+ convergence; this can prevent premature termination at early iterations\
810
+ if the cost function increases slightly (default: 10).
811
+ max_iters: maximum number of iterations to run before terminating\
812
+ program.
813
+ min_factor: minimum weighting factor for an individual streamline; if\
814
+ the factor falls below this number the streamline will be rejected\
815
+ entirely (factor set to zero) (default: 0).
816
+ min_coeff: minimum weighting coefficient for an individual streamline;\
817
+ similar to the '-min_factor' option, but using the exponential\
818
+ coefficient basis of the SIFT2 model; these parameters are related as:\
819
+ factor = e^(coeff). Note that the -min_factor and -min_coeff options\
820
+ are mutually exclusive - you can only provide one. (default: -inf).
821
+ max_factor: maximum weighting factor that can be assigned to any one\
822
+ streamline (default: inf).
823
+ max_coeff: maximum weighting coefficient for an individual streamline;\
824
+ similar to the '-max_factor' option, but using the exponential\
825
+ coefficient basis of the SIFT2 model; these parameters are related as:\
826
+ factor = e^(coeff). Note that the -max_factor and -max_coeff options\
827
+ are mutually exclusive - you can only provide one. (default: inf).
828
+ max_coeff_step: maximum change to a streamline's weighting coefficient\
829
+ in a single iteration (default: 1).
830
+ min_cf_decrease: minimum decrease in the cost function (as a fraction\
831
+ of the initial value) that must occur each iteration for the algorithm\
832
+ to continue (default: 2.5e-05).
833
+ linear: perform a linear estimation of streamline weights, rather than\
834
+ the standard non-linear optimisation (typically does not provide as\
835
+ accurate a model fit; but only requires a single pass).
836
+ info: display information messages.
837
+ quiet: do not display information messages or progress status;\
838
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
839
+ environment variable to a non-empty string.
840
+ debug: display debugging messages.
841
+ force: force overwrite of output files (caution: using the same file as\
842
+ input and output might cause unexpected behaviour).
843
+ nthreads: use this number of threads in multi-threaded applications\
844
+ (set to 0 to disable multi-threading).
845
+ config: temporarily set the value of an MRtrix config file entry.
846
+ help_: display this information page and exit.
847
+ version: display version information and exit.
848
+ runner: Command runner.
849
+ Returns:
850
+ NamedTuple of outputs (described in `Tcksift2Outputs`).
851
+ """
852
+ params = tcksift2_params(
853
+ proc_mask=proc_mask,
854
+ act=act,
855
+ fd_scale_gm=fd_scale_gm,
856
+ no_dilate_lut=no_dilate_lut,
857
+ make_null_lobes=make_null_lobes,
858
+ remove_untracked=remove_untracked,
859
+ fd_thresh=fd_thresh,
860
+ csv_=csv_,
861
+ out_mu=out_mu,
862
+ output_debug=output_debug,
863
+ out_coeffs=out_coeffs,
864
+ reg_tikhonov=reg_tikhonov,
865
+ reg_tv=reg_tv,
866
+ min_td_frac=min_td_frac,
867
+ min_iters=min_iters,
868
+ max_iters=max_iters,
869
+ min_factor=min_factor,
870
+ min_coeff=min_coeff,
871
+ max_factor=max_factor,
872
+ max_coeff=max_coeff,
873
+ max_coeff_step=max_coeff_step,
874
+ min_cf_decrease=min_cf_decrease,
875
+ linear=linear,
876
+ info=info,
877
+ quiet=quiet,
878
+ debug=debug,
879
+ force=force,
880
+ nthreads=nthreads,
881
+ config=config,
882
+ help_=help_,
883
+ version=version,
884
+ in_tracks=in_tracks,
885
+ in_fod=in_fod,
886
+ out_weights=out_weights,
887
+ )
888
+ return tcksift2_execute(params, runner)
889
+
890
+
891
+ __all__ = [
892
+ "TCKSIFT2_METADATA",
893
+ "Tcksift2ConfigParamsDict",
894
+ "Tcksift2ConfigParamsDictTagged",
895
+ "Tcksift2Outputs",
896
+ "Tcksift2ParamsDict",
897
+ "Tcksift2ParamsDictTagged",
898
+ "tcksift2",
899
+ "tcksift2_config",
900
+ "tcksift2_execute",
901
+ "tcksift2_params",
902
+ ]