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,535 @@
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
+ MRDEGIBBS_METADATA = Metadata(
9
+ id="832d935b5fa8fdff97b78ecd355cb0d26be8033a.boutiques",
10
+ name="mrdegibbs",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _MrdegibbsConfigParamsDictNoTag = typing.TypedDict('_MrdegibbsConfigParamsDictNoTag', {
17
+ "key": str,
18
+ "value": str,
19
+ })
20
+ MrdegibbsConfigParamsDictTagged = typing.TypedDict('MrdegibbsConfigParamsDictTagged', {
21
+ "@type": typing.Literal["config"],
22
+ "key": str,
23
+ "value": str,
24
+ })
25
+ MrdegibbsConfigParamsDict = _MrdegibbsConfigParamsDictNoTag | MrdegibbsConfigParamsDictTagged
26
+
27
+
28
+ _MrdegibbsParamsDictNoTag = typing.TypedDict('_MrdegibbsParamsDictNoTag', {
29
+ "axes": typing.NotRequired[list[int] | None],
30
+ "nshifts": typing.NotRequired[int | None],
31
+ "minW": typing.NotRequired[int | None],
32
+ "maxW": typing.NotRequired[int | None],
33
+ "datatype": typing.NotRequired[str | None],
34
+ "info": bool,
35
+ "quiet": bool,
36
+ "debug": bool,
37
+ "force": bool,
38
+ "nthreads": typing.NotRequired[int | None],
39
+ "config": typing.NotRequired[list[MrdegibbsConfigParamsDict] | None],
40
+ "help": bool,
41
+ "version": bool,
42
+ "in": InputPathType,
43
+ "out": str,
44
+ })
45
+ MrdegibbsParamsDictTagged = typing.TypedDict('MrdegibbsParamsDictTagged', {
46
+ "@type": typing.Literal["mrtrix/mrdegibbs"],
47
+ "axes": typing.NotRequired[list[int] | None],
48
+ "nshifts": typing.NotRequired[int | None],
49
+ "minW": typing.NotRequired[int | None],
50
+ "maxW": typing.NotRequired[int | None],
51
+ "datatype": typing.NotRequired[str | None],
52
+ "info": bool,
53
+ "quiet": bool,
54
+ "debug": bool,
55
+ "force": bool,
56
+ "nthreads": typing.NotRequired[int | None],
57
+ "config": typing.NotRequired[list[MrdegibbsConfigParamsDict] | None],
58
+ "help": bool,
59
+ "version": bool,
60
+ "in": InputPathType,
61
+ "out": str,
62
+ })
63
+ MrdegibbsParamsDict = _MrdegibbsParamsDictNoTag | MrdegibbsParamsDictTagged
64
+
65
+
66
+ def mrdegibbs_config(
67
+ key: str,
68
+ value: str,
69
+ ) -> MrdegibbsConfigParamsDictTagged:
70
+ """
71
+ Build parameters.
72
+
73
+ Args:
74
+ key: temporarily set the value of an MRtrix config file entry.
75
+ value: temporarily set the value of an MRtrix config file entry.
76
+ Returns:
77
+ Parameter dictionary
78
+ """
79
+ params = {
80
+ "@type": "config",
81
+ "key": key,
82
+ "value": value,
83
+ }
84
+ return params
85
+
86
+
87
+ def mrdegibbs_config_validate(
88
+ params: typing.Any,
89
+ ) -> None:
90
+ """
91
+ Validate parameters. Throws an error if `params` is not a valid
92
+ `MrdegibbsConfigParamsDict` object.
93
+
94
+ Args:
95
+ params: The parameters object to validate.
96
+ """
97
+ if params is None or not isinstance(params, dict):
98
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
99
+ if params.get("key", None) is None:
100
+ raise StyxValidationError("`key` must not be None")
101
+ if not isinstance(params["key"], str):
102
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
103
+ if params.get("value", None) is None:
104
+ raise StyxValidationError("`value` must not be None")
105
+ if not isinstance(params["value"], str):
106
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
107
+
108
+
109
+ def mrdegibbs_config_cargs(
110
+ params: MrdegibbsConfigParamsDict,
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", None))
125
+ cargs.append(params.get("value", None))
126
+ return cargs
127
+
128
+
129
+ class MrdegibbsOutputs(typing.NamedTuple):
130
+ """
131
+ Output object returned when calling `MrdegibbsParamsDict(...)`.
132
+ """
133
+ root: OutputPathType
134
+ """Output root folder. This is the root folder for all outputs."""
135
+ out: OutputPathType
136
+ """the output image."""
137
+
138
+
139
+ def mrdegibbs_params(
140
+ in_: InputPathType,
141
+ out: str,
142
+ axes: list[int] | None = None,
143
+ nshifts: int | None = None,
144
+ min_w: int | None = None,
145
+ max_w: int | None = None,
146
+ datatype: str | None = None,
147
+ info: bool = False,
148
+ quiet: bool = False,
149
+ debug: bool = False,
150
+ force: bool = False,
151
+ nthreads: int | None = None,
152
+ config: list[MrdegibbsConfigParamsDict] | None = None,
153
+ help_: bool = False,
154
+ version: bool = False,
155
+ ) -> MrdegibbsParamsDictTagged:
156
+ """
157
+ Build parameters.
158
+
159
+ Args:
160
+ in_: the input image.
161
+ out: the output image.
162
+ axes: select the slice axes (default: 0,1 - i.e. x-y).
163
+ nshifts: discretization of subpixel spacing (default: 20).
164
+ min_w: left border of window used for TV computation (default: 1).
165
+ max_w: right border of window used for TV computation (default: 3).
166
+ datatype: specify output image data type. Valid choices are: float32,\
167
+ float32le, float32be, float64, float64le, float64be, int64, uint64,\
168
+ int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
169
+ int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
170
+ cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
171
+ int8, uint8, bit.
172
+ info: display information messages.
173
+ quiet: do not display information messages or progress status;\
174
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
175
+ environment variable to a non-empty string.
176
+ debug: display debugging messages.
177
+ force: force overwrite of output files (caution: using the same file as\
178
+ input and output might cause unexpected behaviour).
179
+ nthreads: use this number of threads in multi-threaded applications\
180
+ (set to 0 to disable multi-threading).
181
+ config: temporarily set the value of an MRtrix config file entry.
182
+ help_: display this information page and exit.
183
+ version: display version information and exit.
184
+ Returns:
185
+ Parameter dictionary
186
+ """
187
+ params = {
188
+ "@type": "mrtrix/mrdegibbs",
189
+ "info": info,
190
+ "quiet": quiet,
191
+ "debug": debug,
192
+ "force": force,
193
+ "help": help_,
194
+ "version": version,
195
+ "in": in_,
196
+ "out": out,
197
+ }
198
+ if axes is not None:
199
+ params["axes"] = axes
200
+ if nshifts is not None:
201
+ params["nshifts"] = nshifts
202
+ if min_w is not None:
203
+ params["minW"] = min_w
204
+ if max_w is not None:
205
+ params["maxW"] = max_w
206
+ if datatype is not None:
207
+ params["datatype"] = datatype
208
+ if nthreads is not None:
209
+ params["nthreads"] = nthreads
210
+ if config is not None:
211
+ params["config"] = config
212
+ return params
213
+
214
+
215
+ def mrdegibbs_validate(
216
+ params: typing.Any,
217
+ ) -> None:
218
+ """
219
+ Validate parameters. Throws an error if `params` is not a valid
220
+ `MrdegibbsParamsDict` object.
221
+
222
+ Args:
223
+ params: The parameters object to validate.
224
+ """
225
+ if params is None or not isinstance(params, dict):
226
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
227
+ if params.get("axes", None) is not None:
228
+ if not isinstance(params["axes"], list):
229
+ raise StyxValidationError(f'`axes` has the wrong type: Received `{type(params.get("axes", None))}` expected `list[int] | None`')
230
+ for e in params["axes"]:
231
+ if not isinstance(e, int):
232
+ raise StyxValidationError(f'`axes` has the wrong type: Received `{type(params.get("axes", None))}` expected `list[int] | None`')
233
+ if params.get("nshifts", None) is not None:
234
+ if not isinstance(params["nshifts"], int):
235
+ raise StyxValidationError(f'`nshifts` has the wrong type: Received `{type(params.get("nshifts", None))}` expected `int | None`')
236
+ if params.get("minW", None) is not None:
237
+ if not isinstance(params["minW"], int):
238
+ raise StyxValidationError(f'`minW` has the wrong type: Received `{type(params.get("minW", None))}` expected `int | None`')
239
+ if params.get("maxW", None) is not None:
240
+ if not isinstance(params["maxW"], int):
241
+ raise StyxValidationError(f'`maxW` has the wrong type: Received `{type(params.get("maxW", None))}` expected `int | None`')
242
+ if params.get("datatype", None) is not None:
243
+ if not isinstance(params["datatype"], str):
244
+ raise StyxValidationError(f'`datatype` has the wrong type: Received `{type(params.get("datatype", None))}` expected `str | None`')
245
+ if params.get("info", False) is None:
246
+ raise StyxValidationError("`info` must not be None")
247
+ if not isinstance(params["info"], bool):
248
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
249
+ if params.get("quiet", False) is None:
250
+ raise StyxValidationError("`quiet` must not be None")
251
+ if not isinstance(params["quiet"], bool):
252
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
253
+ if params.get("debug", False) is None:
254
+ raise StyxValidationError("`debug` must not be None")
255
+ if not isinstance(params["debug"], bool):
256
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
257
+ if params.get("force", False) is None:
258
+ raise StyxValidationError("`force` must not be None")
259
+ if not isinstance(params["force"], bool):
260
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
261
+ if params.get("nthreads", None) is not None:
262
+ if not isinstance(params["nthreads"], int):
263
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
264
+ if params.get("config", None) is not None:
265
+ if not isinstance(params["config"], list):
266
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[MrdegibbsConfigParamsDict] | None`')
267
+ for e in params["config"]:
268
+ mrdegibbs_config_validate(e)
269
+ if params.get("help", False) is None:
270
+ raise StyxValidationError("`help` must not be None")
271
+ if not isinstance(params["help"], bool):
272
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
273
+ if params.get("version", False) is None:
274
+ raise StyxValidationError("`version` must not be None")
275
+ if not isinstance(params["version"], bool):
276
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
277
+ if params.get("in", None) is None:
278
+ raise StyxValidationError("`in` must not be None")
279
+ if not isinstance(params["in"], (pathlib.Path, str)):
280
+ raise StyxValidationError(f'`in` has the wrong type: Received `{type(params.get("in", None))}` expected `InputPathType`')
281
+ if params.get("out", None) is None:
282
+ raise StyxValidationError("`out` must not be None")
283
+ if not isinstance(params["out"], str):
284
+ raise StyxValidationError(f'`out` has the wrong type: Received `{type(params.get("out", None))}` expected `str`')
285
+
286
+
287
+ def mrdegibbs_cargs(
288
+ params: MrdegibbsParamsDict,
289
+ execution: Execution,
290
+ ) -> list[str]:
291
+ """
292
+ Build command-line arguments from parameters.
293
+
294
+ Args:
295
+ params: The parameters.
296
+ execution: The execution object for resolving input paths.
297
+ Returns:
298
+ Command-line arguments.
299
+ """
300
+ cargs = []
301
+ cargs.append("mrdegibbs")
302
+ if params.get("axes", None) is not None:
303
+ cargs.extend([
304
+ "-axes",
305
+ *map(str, params.get("axes", None))
306
+ ])
307
+ if params.get("nshifts", None) is not None:
308
+ cargs.extend([
309
+ "-nshifts",
310
+ str(params.get("nshifts", None))
311
+ ])
312
+ if params.get("minW", None) is not None:
313
+ cargs.extend([
314
+ "-minW",
315
+ str(params.get("minW", None))
316
+ ])
317
+ if params.get("maxW", None) is not None:
318
+ cargs.extend([
319
+ "-maxW",
320
+ str(params.get("maxW", None))
321
+ ])
322
+ if params.get("datatype", None) is not None:
323
+ cargs.extend([
324
+ "-datatype",
325
+ params.get("datatype", None)
326
+ ])
327
+ if params.get("info", False):
328
+ cargs.append("-info")
329
+ if params.get("quiet", False):
330
+ cargs.append("-quiet")
331
+ if params.get("debug", False):
332
+ cargs.append("-debug")
333
+ if params.get("force", False):
334
+ cargs.append("-force")
335
+ if params.get("nthreads", None) is not None:
336
+ cargs.extend([
337
+ "-nthreads",
338
+ str(params.get("nthreads", None))
339
+ ])
340
+ if params.get("config", None) is not None:
341
+ cargs.extend([a for c in [mrdegibbs_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
342
+ if params.get("help", False):
343
+ cargs.append("-help")
344
+ if params.get("version", False):
345
+ cargs.append("-version")
346
+ cargs.append(execution.input_file(params.get("in", None)))
347
+ cargs.append(params.get("out", None))
348
+ return cargs
349
+
350
+
351
+ def mrdegibbs_outputs(
352
+ params: MrdegibbsParamsDict,
353
+ execution: Execution,
354
+ ) -> MrdegibbsOutputs:
355
+ """
356
+ Build outputs object containing output file paths and possibly stdout/stderr.
357
+
358
+ Args:
359
+ params: The parameters.
360
+ execution: The execution object for resolving input paths.
361
+ Returns:
362
+ Outputs object.
363
+ """
364
+ ret = MrdegibbsOutputs(
365
+ root=execution.output_file("."),
366
+ out=execution.output_file(params.get("out", None)),
367
+ )
368
+ return ret
369
+
370
+
371
+ def mrdegibbs_execute(
372
+ params: MrdegibbsParamsDict,
373
+ runner: Runner | None = None,
374
+ ) -> MrdegibbsOutputs:
375
+ """
376
+ mrdegibbs
377
+
378
+ Remove Gibbs Ringing Artifacts.
379
+
380
+ This application attempts to remove Gibbs ringing artefacts from MRI images
381
+ using the method of local subvoxel-shifts proposed by Kellner et al. (see
382
+ reference below for details).
383
+
384
+ This command is designed to run on data directly after it has been
385
+ reconstructed by the scanner, before any interpolation of any kind has taken
386
+ place. You should not run this command after any form of motion correction
387
+ (e.g. not after dwifslpreproc). Similarly, if you intend running dwidenoise,
388
+ you should run denoising before this command to not alter the noise
389
+ structure, which would impact on dwidenoise's performance.
390
+
391
+ Note that this method is designed to work on images acquired with full
392
+ k-space coverage. Running this method on partial Fourier ('half-scan') data
393
+ may lead to suboptimal and/or biased results, as noted in the original
394
+ reference below. There is currently no means of dealing with this; users
395
+ should exercise caution when using this method on partial Fourier data, and
396
+ inspect its output for any obvious artefacts.
397
+
398
+ References:
399
+
400
+ Kellner, E; Dhital, B; Kiselev, V.G & Reisert, M. Gibbs-ringing artifact
401
+ removal based on local subvoxel-shifts. Magnetic Resonance in Medicine,
402
+ 2016, 76, 1574–1581.
403
+
404
+ Author: MRTrix3 Developers
405
+
406
+ URL: https://www.mrtrix.org/
407
+
408
+ Args:
409
+ params: The parameters.
410
+ runner: Command runner.
411
+ Returns:
412
+ NamedTuple of outputs (described in `MrdegibbsOutputs`).
413
+ """
414
+ mrdegibbs_validate(params)
415
+ runner = runner or get_global_runner()
416
+ execution = runner.start_execution(MRDEGIBBS_METADATA)
417
+ params = execution.params(params)
418
+ cargs = mrdegibbs_cargs(params, execution)
419
+ ret = mrdegibbs_outputs(params, execution)
420
+ execution.run(cargs)
421
+ return ret
422
+
423
+
424
+ def mrdegibbs(
425
+ in_: InputPathType,
426
+ out: str,
427
+ axes: list[int] | None = None,
428
+ nshifts: int | None = None,
429
+ min_w: int | None = None,
430
+ max_w: int | None = None,
431
+ datatype: str | None = None,
432
+ info: bool = False,
433
+ quiet: bool = False,
434
+ debug: bool = False,
435
+ force: bool = False,
436
+ nthreads: int | None = None,
437
+ config: list[MrdegibbsConfigParamsDict] | None = None,
438
+ help_: bool = False,
439
+ version: bool = False,
440
+ runner: Runner | None = None,
441
+ ) -> MrdegibbsOutputs:
442
+ """
443
+ mrdegibbs
444
+
445
+ Remove Gibbs Ringing Artifacts.
446
+
447
+ This application attempts to remove Gibbs ringing artefacts from MRI images
448
+ using the method of local subvoxel-shifts proposed by Kellner et al. (see
449
+ reference below for details).
450
+
451
+ This command is designed to run on data directly after it has been
452
+ reconstructed by the scanner, before any interpolation of any kind has taken
453
+ place. You should not run this command after any form of motion correction
454
+ (e.g. not after dwifslpreproc). Similarly, if you intend running dwidenoise,
455
+ you should run denoising before this command to not alter the noise
456
+ structure, which would impact on dwidenoise's performance.
457
+
458
+ Note that this method is designed to work on images acquired with full
459
+ k-space coverage. Running this method on partial Fourier ('half-scan') data
460
+ may lead to suboptimal and/or biased results, as noted in the original
461
+ reference below. There is currently no means of dealing with this; users
462
+ should exercise caution when using this method on partial Fourier data, and
463
+ inspect its output for any obvious artefacts.
464
+
465
+ References:
466
+
467
+ Kellner, E; Dhital, B; Kiselev, V.G & Reisert, M. Gibbs-ringing artifact
468
+ removal based on local subvoxel-shifts. Magnetic Resonance in Medicine,
469
+ 2016, 76, 1574–1581.
470
+
471
+ Author: MRTrix3 Developers
472
+
473
+ URL: https://www.mrtrix.org/
474
+
475
+ Args:
476
+ in_: the input image.
477
+ out: the output image.
478
+ axes: select the slice axes (default: 0,1 - i.e. x-y).
479
+ nshifts: discretization of subpixel spacing (default: 20).
480
+ min_w: left border of window used for TV computation (default: 1).
481
+ max_w: right border of window used for TV computation (default: 3).
482
+ datatype: specify output image data type. Valid choices are: float32,\
483
+ float32le, float32be, float64, float64le, float64be, int64, uint64,\
484
+ int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
485
+ int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
486
+ cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
487
+ int8, uint8, bit.
488
+ info: display information messages.
489
+ quiet: do not display information messages or progress status;\
490
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
491
+ environment variable to a non-empty string.
492
+ debug: display debugging messages.
493
+ force: force overwrite of output files (caution: using the same file as\
494
+ input and output might cause unexpected behaviour).
495
+ nthreads: use this number of threads in multi-threaded applications\
496
+ (set to 0 to disable multi-threading).
497
+ config: temporarily set the value of an MRtrix config file entry.
498
+ help_: display this information page and exit.
499
+ version: display version information and exit.
500
+ runner: Command runner.
501
+ Returns:
502
+ NamedTuple of outputs (described in `MrdegibbsOutputs`).
503
+ """
504
+ params = mrdegibbs_params(
505
+ axes=axes,
506
+ nshifts=nshifts,
507
+ min_w=min_w,
508
+ max_w=max_w,
509
+ datatype=datatype,
510
+ info=info,
511
+ quiet=quiet,
512
+ debug=debug,
513
+ force=force,
514
+ nthreads=nthreads,
515
+ config=config,
516
+ help_=help_,
517
+ version=version,
518
+ in_=in_,
519
+ out=out,
520
+ )
521
+ return mrdegibbs_execute(params, runner)
522
+
523
+
524
+ __all__ = [
525
+ "MRDEGIBBS_METADATA",
526
+ "MrdegibbsConfigParamsDict",
527
+ "MrdegibbsConfigParamsDictTagged",
528
+ "MrdegibbsOutputs",
529
+ "MrdegibbsParamsDict",
530
+ "MrdegibbsParamsDictTagged",
531
+ "mrdegibbs",
532
+ "mrdegibbs_config",
533
+ "mrdegibbs_execute",
534
+ "mrdegibbs_params",
535
+ ]