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,549 @@
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
+ MRTHRESHOLD_METADATA = Metadata(
9
+ id="5f0e00d650d7ff4c22350347b81985e0b496eddf.boutiques",
10
+ name="mrthreshold",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ MrthresholdConfigParameters = typing.TypedDict('MrthresholdConfigParameters', {
17
+ "__STYX_TYPE__": typing.Literal["config"],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+
22
+
23
+ MrthresholdParameters = typing.TypedDict('MrthresholdParameters', {
24
+ "__STYX_TYPE__": typing.Literal["mrthreshold"],
25
+ "abs": typing.NotRequired[float | None],
26
+ "percentile": typing.NotRequired[float | None],
27
+ "top": typing.NotRequired[int | None],
28
+ "bottom": typing.NotRequired[int | None],
29
+ "allvolumes": bool,
30
+ "ignorezero": bool,
31
+ "mask": typing.NotRequired[InputPathType | None],
32
+ "comparison": typing.NotRequired[str | None],
33
+ "invert": bool,
34
+ "out_masked": bool,
35
+ "nan": bool,
36
+ "info": bool,
37
+ "quiet": bool,
38
+ "debug": bool,
39
+ "force": bool,
40
+ "nthreads": typing.NotRequired[int | None],
41
+ "config": typing.NotRequired[list[MrthresholdConfigParameters] | None],
42
+ "help": bool,
43
+ "version": bool,
44
+ "input": InputPathType,
45
+ "output": typing.NotRequired[str | None],
46
+ })
47
+
48
+
49
+ def dyn_cargs(
50
+ t: str,
51
+ ) -> typing.Any:
52
+ """
53
+ Get build cargs function by command type.
54
+
55
+ Args:
56
+ t: Command type.
57
+ Returns:
58
+ Build cargs function.
59
+ """
60
+ return {
61
+ "mrthreshold": mrthreshold_cargs,
62
+ "config": mrthreshold_config_cargs,
63
+ }.get(t)
64
+
65
+
66
+ def dyn_outputs(
67
+ t: str,
68
+ ) -> typing.Any:
69
+ """
70
+ Get build outputs function by command type.
71
+
72
+ Args:
73
+ t: Command type.
74
+ Returns:
75
+ Build outputs function.
76
+ """
77
+ return {
78
+ "mrthreshold": mrthreshold_outputs,
79
+ }.get(t)
80
+
81
+
82
+ def mrthreshold_config_params(
83
+ key: str,
84
+ value: str,
85
+ ) -> MrthresholdConfigParameters:
86
+ """
87
+ Build parameters.
88
+
89
+ Args:
90
+ key: temporarily set the value of an MRtrix config file entry.
91
+ value: temporarily set the value of an MRtrix config file entry.
92
+ Returns:
93
+ Parameter dictionary
94
+ """
95
+ params = {
96
+ "__STYXTYPE__": "config",
97
+ "key": key,
98
+ "value": value,
99
+ }
100
+ return params
101
+
102
+
103
+ def mrthreshold_config_cargs(
104
+ params: MrthresholdConfigParameters,
105
+ execution: Execution,
106
+ ) -> list[str]:
107
+ """
108
+ Build command-line arguments from parameters.
109
+
110
+ Args:
111
+ params: The parameters.
112
+ execution: The execution object for resolving input paths.
113
+ Returns:
114
+ Command-line arguments.
115
+ """
116
+ cargs = []
117
+ cargs.append("-config")
118
+ cargs.append(params.get("key"))
119
+ cargs.append(params.get("value"))
120
+ return cargs
121
+
122
+
123
+ class MrthresholdOutputs(typing.NamedTuple):
124
+ """
125
+ Output object returned when calling `mrthreshold(...)`.
126
+ """
127
+ root: OutputPathType
128
+ """Output root folder. This is the root folder for all outputs."""
129
+ output: OutputPathType | None
130
+ """the (optional) output binary image mask"""
131
+
132
+
133
+ def mrthreshold_params(
134
+ input_: InputPathType,
135
+ abs_: float | None = None,
136
+ percentile: float | None = None,
137
+ top: int | None = None,
138
+ bottom: int | None = None,
139
+ allvolumes: bool = False,
140
+ ignorezero: bool = False,
141
+ mask: InputPathType | None = None,
142
+ comparison: str | None = None,
143
+ invert: bool = False,
144
+ out_masked: bool = False,
145
+ nan: bool = False,
146
+ info: bool = False,
147
+ quiet: bool = False,
148
+ debug: bool = False,
149
+ force: bool = False,
150
+ nthreads: int | None = None,
151
+ config: list[MrthresholdConfigParameters] | None = None,
152
+ help_: bool = False,
153
+ version: bool = False,
154
+ output: str | None = None,
155
+ ) -> MrthresholdParameters:
156
+ """
157
+ Build parameters.
158
+
159
+ Args:
160
+ input_: the input image to be thresholded.
161
+ abs_: specify threshold value as absolute intensity.
162
+ percentile: determine threshold based on some percentile of the image\
163
+ intensity distribution.
164
+ top: determine threshold that will result in selection of some number\
165
+ of top-valued voxels.
166
+ bottom: determine & apply threshold resulting in selection of some\
167
+ number of bottom-valued voxels (note: implies threshold application\
168
+ operator of "le" unless otherwise specified).
169
+ allvolumes: compute a single threshold for all image volumes, rather\
170
+ than an individual threshold per volume.
171
+ ignorezero: ignore zero-valued input values during threshold\
172
+ determination.
173
+ mask: compute the threshold based only on values within an input mask\
174
+ image.
175
+ comparison: comparison operator to use when applying the threshold;\
176
+ options are: lt,le,ge,gt (default = "le" for -bottom; "ge" otherwise).
177
+ invert: invert the output binary mask (equivalent to flipping the\
178
+ operator; provided for backwards compatibility).
179
+ out_masked: mask the output image based on the provided input mask\
180
+ image.
181
+ nan: set voxels that fail the threshold to NaN rather than zero (output\
182
+ image will be floating-point rather than binary).
183
+ info: display information messages.
184
+ quiet: do not display information messages or progress status;\
185
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
186
+ environment variable to a non-empty string.
187
+ debug: display debugging messages.
188
+ force: force overwrite of output files (caution: using the same file as\
189
+ input and output might cause unexpected behaviour).
190
+ nthreads: use this number of threads in multi-threaded applications\
191
+ (set to 0 to disable multi-threading).
192
+ config: temporarily set the value of an MRtrix config file entry.
193
+ help_: display this information page and exit.
194
+ version: display version information and exit.
195
+ output: the (optional) output binary image mask.
196
+ Returns:
197
+ Parameter dictionary
198
+ """
199
+ params = {
200
+ "__STYXTYPE__": "mrthreshold",
201
+ "allvolumes": allvolumes,
202
+ "ignorezero": ignorezero,
203
+ "invert": invert,
204
+ "out_masked": out_masked,
205
+ "nan": nan,
206
+ "info": info,
207
+ "quiet": quiet,
208
+ "debug": debug,
209
+ "force": force,
210
+ "help": help_,
211
+ "version": version,
212
+ "input": input_,
213
+ }
214
+ if abs_ is not None:
215
+ params["abs"] = abs_
216
+ if percentile is not None:
217
+ params["percentile"] = percentile
218
+ if top is not None:
219
+ params["top"] = top
220
+ if bottom is not None:
221
+ params["bottom"] = bottom
222
+ if mask is not None:
223
+ params["mask"] = mask
224
+ if comparison is not None:
225
+ params["comparison"] = comparison
226
+ if nthreads is not None:
227
+ params["nthreads"] = nthreads
228
+ if config is not None:
229
+ params["config"] = config
230
+ if output is not None:
231
+ params["output"] = output
232
+ return params
233
+
234
+
235
+ def mrthreshold_cargs(
236
+ params: MrthresholdParameters,
237
+ execution: Execution,
238
+ ) -> list[str]:
239
+ """
240
+ Build command-line arguments from parameters.
241
+
242
+ Args:
243
+ params: The parameters.
244
+ execution: The execution object for resolving input paths.
245
+ Returns:
246
+ Command-line arguments.
247
+ """
248
+ cargs = []
249
+ cargs.append("mrthreshold")
250
+ if params.get("abs") is not None:
251
+ cargs.extend([
252
+ "-abs",
253
+ str(params.get("abs"))
254
+ ])
255
+ if params.get("percentile") is not None:
256
+ cargs.extend([
257
+ "-percentile",
258
+ str(params.get("percentile"))
259
+ ])
260
+ if params.get("top") is not None:
261
+ cargs.extend([
262
+ "-top",
263
+ str(params.get("top"))
264
+ ])
265
+ if params.get("bottom") is not None:
266
+ cargs.extend([
267
+ "-bottom",
268
+ str(params.get("bottom"))
269
+ ])
270
+ if params.get("allvolumes"):
271
+ cargs.append("-allvolumes")
272
+ if params.get("ignorezero"):
273
+ cargs.append("-ignorezero")
274
+ if params.get("mask") is not None:
275
+ cargs.extend([
276
+ "-mask",
277
+ execution.input_file(params.get("mask"))
278
+ ])
279
+ if params.get("comparison") is not None:
280
+ cargs.extend([
281
+ "-comparison",
282
+ params.get("comparison")
283
+ ])
284
+ if params.get("invert"):
285
+ cargs.append("-invert")
286
+ if params.get("out_masked"):
287
+ cargs.append("-out_masked")
288
+ if params.get("nan"):
289
+ cargs.append("-nan")
290
+ if params.get("info"):
291
+ cargs.append("-info")
292
+ if params.get("quiet"):
293
+ cargs.append("-quiet")
294
+ if params.get("debug"):
295
+ cargs.append("-debug")
296
+ if params.get("force"):
297
+ cargs.append("-force")
298
+ if params.get("nthreads") is not None:
299
+ cargs.extend([
300
+ "-nthreads",
301
+ str(params.get("nthreads"))
302
+ ])
303
+ if params.get("config") is not None:
304
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
305
+ if params.get("help"):
306
+ cargs.append("-help")
307
+ if params.get("version"):
308
+ cargs.append("-version")
309
+ cargs.append(execution.input_file(params.get("input")))
310
+ if params.get("output") is not None:
311
+ cargs.append(params.get("output"))
312
+ return cargs
313
+
314
+
315
+ def mrthreshold_outputs(
316
+ params: MrthresholdParameters,
317
+ execution: Execution,
318
+ ) -> MrthresholdOutputs:
319
+ """
320
+ Build outputs object containing output file paths and possibly stdout/stderr.
321
+
322
+ Args:
323
+ params: The parameters.
324
+ execution: The execution object for resolving input paths.
325
+ Returns:
326
+ Outputs object.
327
+ """
328
+ ret = MrthresholdOutputs(
329
+ root=execution.output_file("."),
330
+ output=execution.output_file(params.get("output")) if (params.get("output") is not None) else None,
331
+ )
332
+ return ret
333
+
334
+
335
+ def mrthreshold_execute(
336
+ params: MrthresholdParameters,
337
+ execution: Execution,
338
+ ) -> MrthresholdOutputs:
339
+ """
340
+ Create bitwise image by thresholding image intensity.
341
+
342
+ The threshold value to be applied can be determined in one of a number of
343
+ ways:
344
+
345
+ - If no relevant command-line option is used, the command will automatically
346
+ determine an optimal threshold;
347
+
348
+ - The -abs option provides the threshold value explicitly;
349
+
350
+ - The -percentile, -top and -bottom options enable more fine-grained control
351
+ over how the threshold value is determined.
352
+
353
+ The -mask option only influences those image values that contribute toward
354
+ the determination of the threshold value; once the threshold is determined,
355
+ it is applied to the entire image, irrespective of use of the -mask option.
356
+ If you wish for the voxels outside of the specified mask to additionally be
357
+ excluded from the output mask, this can be achieved by providing the
358
+ -out_masked option.
359
+
360
+ The four operators available through the "-comparison" option ("lt", "le",
361
+ "ge" and "gt") correspond to "less-than" (<), "less-than-or-equal" (<=),
362
+ "greater-than-or-equal" (>=) and "greater-than" (>). This offers
363
+ fine-grained control over how the thresholding operation will behave in the
364
+ presence of values equivalent to the threshold. By default, the command will
365
+ select voxels with values greater than or equal to the determined threshold
366
+ ("ge"); unless the -bottom option is used, in which case after a threshold
367
+ is determined from the relevant lowest-valued image voxels, those voxels
368
+ with values less than or equal to that threshold ("le") are selected. This
369
+ provides more fine-grained control than the -invert option; the latter is
370
+ provided for backwards compatibility, but is equivalent to selection of the
371
+ opposite comparison within this selection.
372
+
373
+ If no output image path is specified, the command will instead write to
374
+ standard output the determined threshold value.
375
+
376
+ References:
377
+
378
+ * If not using any explicit thresholding mechanism:
379
+ Ridgway, G. R.; Omar, R.; Ourselin, S.; Hill, D. L.; Warren, J. D. & Fox, N.
380
+ C. Issues with threshold masking in voxel-based morphometry of atrophied
381
+ brains. NeuroImage, 2009, 44, 99-111.
382
+
383
+ Author: MRTrix3 Developers
384
+
385
+ URL: https://www.mrtrix.org/
386
+
387
+ Args:
388
+ params: The parameters.
389
+ execution: The execution object.
390
+ Returns:
391
+ NamedTuple of outputs (described in `MrthresholdOutputs`).
392
+ """
393
+ params = execution.params(params)
394
+ cargs = mrthreshold_cargs(params, execution)
395
+ ret = mrthreshold_outputs(params, execution)
396
+ execution.run(cargs)
397
+ return ret
398
+
399
+
400
+ def mrthreshold(
401
+ input_: InputPathType,
402
+ abs_: float | None = None,
403
+ percentile: float | None = None,
404
+ top: int | None = None,
405
+ bottom: int | None = None,
406
+ allvolumes: bool = False,
407
+ ignorezero: bool = False,
408
+ mask: InputPathType | None = None,
409
+ comparison: str | None = None,
410
+ invert: bool = False,
411
+ out_masked: bool = False,
412
+ nan: bool = False,
413
+ info: bool = False,
414
+ quiet: bool = False,
415
+ debug: bool = False,
416
+ force: bool = False,
417
+ nthreads: int | None = None,
418
+ config: list[MrthresholdConfigParameters] | None = None,
419
+ help_: bool = False,
420
+ version: bool = False,
421
+ output: str | None = None,
422
+ runner: Runner | None = None,
423
+ ) -> MrthresholdOutputs:
424
+ """
425
+ Create bitwise image by thresholding image intensity.
426
+
427
+ The threshold value to be applied can be determined in one of a number of
428
+ ways:
429
+
430
+ - If no relevant command-line option is used, the command will automatically
431
+ determine an optimal threshold;
432
+
433
+ - The -abs option provides the threshold value explicitly;
434
+
435
+ - The -percentile, -top and -bottom options enable more fine-grained control
436
+ over how the threshold value is determined.
437
+
438
+ The -mask option only influences those image values that contribute toward
439
+ the determination of the threshold value; once the threshold is determined,
440
+ it is applied to the entire image, irrespective of use of the -mask option.
441
+ If you wish for the voxels outside of the specified mask to additionally be
442
+ excluded from the output mask, this can be achieved by providing the
443
+ -out_masked option.
444
+
445
+ The four operators available through the "-comparison" option ("lt", "le",
446
+ "ge" and "gt") correspond to "less-than" (<), "less-than-or-equal" (<=),
447
+ "greater-than-or-equal" (>=) and "greater-than" (>). This offers
448
+ fine-grained control over how the thresholding operation will behave in the
449
+ presence of values equivalent to the threshold. By default, the command will
450
+ select voxels with values greater than or equal to the determined threshold
451
+ ("ge"); unless the -bottom option is used, in which case after a threshold
452
+ is determined from the relevant lowest-valued image voxels, those voxels
453
+ with values less than or equal to that threshold ("le") are selected. This
454
+ provides more fine-grained control than the -invert option; the latter is
455
+ provided for backwards compatibility, but is equivalent to selection of the
456
+ opposite comparison within this selection.
457
+
458
+ If no output image path is specified, the command will instead write to
459
+ standard output the determined threshold value.
460
+
461
+ References:
462
+
463
+ * If not using any explicit thresholding mechanism:
464
+ Ridgway, G. R.; Omar, R.; Ourselin, S.; Hill, D. L.; Warren, J. D. & Fox, N.
465
+ C. Issues with threshold masking in voxel-based morphometry of atrophied
466
+ brains. NeuroImage, 2009, 44, 99-111.
467
+
468
+ Author: MRTrix3 Developers
469
+
470
+ URL: https://www.mrtrix.org/
471
+
472
+ Args:
473
+ input_: the input image to be thresholded.
474
+ abs_: specify threshold value as absolute intensity.
475
+ percentile: determine threshold based on some percentile of the image\
476
+ intensity distribution.
477
+ top: determine threshold that will result in selection of some number\
478
+ of top-valued voxels.
479
+ bottom: determine & apply threshold resulting in selection of some\
480
+ number of bottom-valued voxels (note: implies threshold application\
481
+ operator of "le" unless otherwise specified).
482
+ allvolumes: compute a single threshold for all image volumes, rather\
483
+ than an individual threshold per volume.
484
+ ignorezero: ignore zero-valued input values during threshold\
485
+ determination.
486
+ mask: compute the threshold based only on values within an input mask\
487
+ image.
488
+ comparison: comparison operator to use when applying the threshold;\
489
+ options are: lt,le,ge,gt (default = "le" for -bottom; "ge" otherwise).
490
+ invert: invert the output binary mask (equivalent to flipping the\
491
+ operator; provided for backwards compatibility).
492
+ out_masked: mask the output image based on the provided input mask\
493
+ image.
494
+ nan: set voxels that fail the threshold to NaN rather than zero (output\
495
+ image will be floating-point rather than binary).
496
+ info: display information messages.
497
+ quiet: do not display information messages or progress status;\
498
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
499
+ environment variable to a non-empty string.
500
+ debug: display debugging messages.
501
+ force: force overwrite of output files (caution: using the same file as\
502
+ input and output might cause unexpected behaviour).
503
+ nthreads: use this number of threads in multi-threaded applications\
504
+ (set to 0 to disable multi-threading).
505
+ config: temporarily set the value of an MRtrix config file entry.
506
+ help_: display this information page and exit.
507
+ version: display version information and exit.
508
+ output: the (optional) output binary image mask.
509
+ runner: Command runner.
510
+ Returns:
511
+ NamedTuple of outputs (described in `MrthresholdOutputs`).
512
+ """
513
+ runner = runner or get_global_runner()
514
+ execution = runner.start_execution(MRTHRESHOLD_METADATA)
515
+ params = mrthreshold_params(
516
+ abs_=abs_,
517
+ percentile=percentile,
518
+ top=top,
519
+ bottom=bottom,
520
+ allvolumes=allvolumes,
521
+ ignorezero=ignorezero,
522
+ mask=mask,
523
+ comparison=comparison,
524
+ invert=invert,
525
+ out_masked=out_masked,
526
+ nan=nan,
527
+ info=info,
528
+ quiet=quiet,
529
+ debug=debug,
530
+ force=force,
531
+ nthreads=nthreads,
532
+ config=config,
533
+ help_=help_,
534
+ version=version,
535
+ input_=input_,
536
+ output=output,
537
+ )
538
+ return mrthreshold_execute(params, execution)
539
+
540
+
541
+ __all__ = [
542
+ "MRTHRESHOLD_METADATA",
543
+ "MrthresholdConfigParameters",
544
+ "MrthresholdOutputs",
545
+ "MrthresholdParameters",
546
+ "mrthreshold",
547
+ "mrthreshold_config_params",
548
+ "mrthreshold_params",
549
+ ]