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.
- niwrap_mrtrix/mrtrix/__init__.py +263 -0
- niwrap_mrtrix/mrtrix/afdconnectivity.py +527 -0
- niwrap_mrtrix/mrtrix/amp2response.py +560 -0
- niwrap_mrtrix/mrtrix/amp2sh.py +870 -0
- niwrap_mrtrix/mrtrix/connectome2tck.py +583 -0
- niwrap_mrtrix/mrtrix/connectomeedit.py +413 -0
- niwrap_mrtrix/mrtrix/connectomestats.py +956 -0
- niwrap_mrtrix/mrtrix/dcmedit.py +552 -0
- niwrap_mrtrix/mrtrix/dcminfo.py +529 -0
- niwrap_mrtrix/mrtrix/dirflip.py +440 -0
- niwrap_mrtrix/mrtrix/dirgen.py +514 -0
- niwrap_mrtrix/mrtrix/dirmerge.py +446 -0
- niwrap_mrtrix/mrtrix/dirorder.py +421 -0
- niwrap_mrtrix/mrtrix/dirsplit.py +436 -0
- niwrap_mrtrix/mrtrix/dirstat.py +640 -0
- niwrap_mrtrix/mrtrix/dwi2adc.py +531 -0
- niwrap_mrtrix/mrtrix/dwi2fod.py +1156 -0
- niwrap_mrtrix/mrtrix/dwi2mask.py +570 -0
- niwrap_mrtrix/mrtrix/dwi2response.py +1774 -0
- niwrap_mrtrix/mrtrix/dwi2tensor.py +715 -0
- niwrap_mrtrix/mrtrix/dwibiascorrect.py +673 -0
- niwrap_mrtrix/mrtrix/dwidenoise.py +570 -0
- niwrap_mrtrix/mrtrix/dwiextract.py +1111 -0
- niwrap_mrtrix/mrtrix/dwigradcheck.py +665 -0
- niwrap_mrtrix/mrtrix/fixel2peaks.py +613 -0
- niwrap_mrtrix/mrtrix/fixel2sh.py +430 -0
- niwrap_mrtrix/mrtrix/fixel2tsf.py +435 -0
- niwrap_mrtrix/mrtrix/fixel2voxel.py +523 -0
- niwrap_mrtrix/mrtrix/fixelcfestats.py +1179 -0
- niwrap_mrtrix/mrtrix/fixelconnectivity.py +477 -0
- niwrap_mrtrix/mrtrix/fixelconvert.py +850 -0
- niwrap_mrtrix/mrtrix/fixelcorrespondence.py +455 -0
- niwrap_mrtrix/mrtrix/fixelcrop.py +422 -0
- niwrap_mrtrix/mrtrix/fixelfilter.py +882 -0
- niwrap_mrtrix/mrtrix/fixelreorient.py +435 -0
- niwrap_mrtrix/mrtrix/fod2dec.py +571 -0
- niwrap_mrtrix/mrtrix/fod2fixel.py +646 -0
- niwrap_mrtrix/mrtrix/label2colour.py +426 -0
- niwrap_mrtrix/mrtrix/label2mesh.py +417 -0
- niwrap_mrtrix/mrtrix/labelconvert.py +460 -0
- niwrap_mrtrix/mrtrix/labelstats.py +418 -0
- niwrap_mrtrix/mrtrix/maskdump.py +404 -0
- niwrap_mrtrix/mrtrix/maskfilter.py +730 -0
- niwrap_mrtrix/mrtrix/mesh2voxel.py +422 -0
- niwrap_mrtrix/mrtrix/meshconvert.py +514 -0
- niwrap_mrtrix/mrtrix/meshfilter.py +452 -0
- niwrap_mrtrix/mrtrix/mraverageheader.py +485 -0
- niwrap_mrtrix/mrtrix/mrcalc.py +4302 -0
- niwrap_mrtrix/mrtrix/mrcat.py +467 -0
- niwrap_mrtrix/mrtrix/mrcentroid.py +418 -0
- niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +446 -0
- niwrap_mrtrix/mrtrix/mrclusterstats.py +930 -0
- niwrap_mrtrix/mrtrix/mrcolour.py +490 -0
- niwrap_mrtrix/mrtrix/mrconvert.py +1967 -0
- niwrap_mrtrix/mrtrix/mrdegibbs.py +535 -0
- niwrap_mrtrix/mrtrix/mrdump.py +423 -0
- niwrap_mrtrix/mrtrix/mredit.py +737 -0
- niwrap_mrtrix/mrtrix/mrfilter.py +971 -0
- niwrap_mrtrix/mrtrix/mrgrid.py +1079 -0
- niwrap_mrtrix/mrtrix/mrhistmatch.py +494 -0
- niwrap_mrtrix/mrtrix/mrhistogram.py +484 -0
- niwrap_mrtrix/mrtrix/mrinfo.py +1282 -0
- niwrap_mrtrix/mrtrix/mrmath.py +503 -0
- niwrap_mrtrix/mrtrix/mrmetric.py +525 -0
- niwrap_mrtrix/mrtrix/mrregister.py +2098 -0
- niwrap_mrtrix/mrtrix/mrstats.py +534 -0
- niwrap_mrtrix/mrtrix/mrthreshold.py +666 -0
- niwrap_mrtrix/mrtrix/mrtransform.py +1372 -0
- niwrap_mrtrix/mrtrix/mtnormalise.py +725 -0
- niwrap_mrtrix/mrtrix/peaks2amp.py +403 -0
- niwrap_mrtrix/mrtrix/peaks2fixel.py +422 -0
- niwrap_mrtrix/mrtrix/responsemean.py +385 -0
- niwrap_mrtrix/mrtrix/sh2amp.py +844 -0
- niwrap_mrtrix/mrtrix/sh2peaks.py +632 -0
- niwrap_mrtrix/mrtrix/sh2power.py +427 -0
- niwrap_mrtrix/mrtrix/sh2response.py +481 -0
- niwrap_mrtrix/mrtrix/shbasis.py +445 -0
- niwrap_mrtrix/mrtrix/shconv.py +661 -0
- niwrap_mrtrix/mrtrix/tck2connectome.py +727 -0
- niwrap_mrtrix/mrtrix/tck2fixel.py +447 -0
- niwrap_mrtrix/mrtrix/tckconvert.py +775 -0
- niwrap_mrtrix/mrtrix/tckdfc.py +684 -0
- niwrap_mrtrix/mrtrix/tckedit.py +1478 -0
- niwrap_mrtrix/mrtrix/tckgen.py +2733 -0
- niwrap_mrtrix/mrtrix/tckglobal.py +944 -0
- niwrap_mrtrix/mrtrix/tckinfo.py +402 -0
- niwrap_mrtrix/mrtrix/tckmap.py +1004 -0
- niwrap_mrtrix/mrtrix/tckresample.py +760 -0
- niwrap_mrtrix/mrtrix/tcksample.py +497 -0
- niwrap_mrtrix/mrtrix/tcksift.py +739 -0
- niwrap_mrtrix/mrtrix/tcksift2.py +902 -0
- niwrap_mrtrix/mrtrix/tckstats.py +550 -0
- niwrap_mrtrix/mrtrix/tcktransform.py +414 -0
- niwrap_mrtrix/mrtrix/tensor2metric.py +659 -0
- niwrap_mrtrix/mrtrix/transformcalc.py +421 -0
- niwrap_mrtrix/mrtrix/transformcompose.py +625 -0
- niwrap_mrtrix/mrtrix/transformconvert.py +423 -0
- niwrap_mrtrix/mrtrix/tsfdivide.py +414 -0
- niwrap_mrtrix/mrtrix/tsfinfo.py +421 -0
- niwrap_mrtrix/mrtrix/tsfmult.py +401 -0
- niwrap_mrtrix/mrtrix/tsfsmooth.py +420 -0
- niwrap_mrtrix/mrtrix/tsfthreshold.py +428 -0
- niwrap_mrtrix/mrtrix/tsfvalidate.py +398 -0
- niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +432 -0
- niwrap_mrtrix/mrtrix/v_5tt2vis.py +505 -0
- niwrap_mrtrix/mrtrix/v_5ttcheck.py +409 -0
- niwrap_mrtrix/mrtrix/v_5ttedit.py +513 -0
- niwrap_mrtrix/mrtrix/v_5ttgen.py +1107 -0
- niwrap_mrtrix/mrtrix/vectorstats.py +736 -0
- niwrap_mrtrix/mrtrix/voxel2fixel.py +430 -0
- niwrap_mrtrix/mrtrix/voxel2mesh.py +454 -0
- niwrap_mrtrix/mrtrix/warp2metric.py +556 -0
- niwrap_mrtrix/mrtrix/warpconvert.py +498 -0
- niwrap_mrtrix/mrtrix/warpcorrect.py +448 -0
- niwrap_mrtrix/mrtrix/warpinit.py +425 -0
- niwrap_mrtrix/mrtrix/warpinvert.py +448 -0
- niwrap_mrtrix-0.8.0.dist-info/METADATA +8 -0
- niwrap_mrtrix-0.8.0.dist-info/RECORD +119 -0
- niwrap_mrtrix-0.8.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,448 @@
|
|
|
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
|
+
WARPCORRECT_METADATA = Metadata(
|
|
9
|
+
id="d93e432b2c126575958a3ff19d36f91ad4461c2e.boutiques",
|
|
10
|
+
name="warpcorrect",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
_WarpcorrectConfigParamsDictNoTag = typing.TypedDict('_WarpcorrectConfigParamsDictNoTag', {
|
|
17
|
+
"key": str,
|
|
18
|
+
"value": str,
|
|
19
|
+
})
|
|
20
|
+
WarpcorrectConfigParamsDictTagged = typing.TypedDict('WarpcorrectConfigParamsDictTagged', {
|
|
21
|
+
"@type": typing.Literal["config"],
|
|
22
|
+
"key": str,
|
|
23
|
+
"value": str,
|
|
24
|
+
})
|
|
25
|
+
WarpcorrectConfigParamsDict = _WarpcorrectConfigParamsDictNoTag | WarpcorrectConfigParamsDictTagged
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_WarpcorrectParamsDictNoTag = typing.TypedDict('_WarpcorrectParamsDictNoTag', {
|
|
29
|
+
"marker": typing.NotRequired[list[float] | None],
|
|
30
|
+
"tolerance": typing.NotRequired[float | None],
|
|
31
|
+
"info": bool,
|
|
32
|
+
"quiet": bool,
|
|
33
|
+
"debug": bool,
|
|
34
|
+
"force": bool,
|
|
35
|
+
"nthreads": typing.NotRequired[int | None],
|
|
36
|
+
"config": typing.NotRequired[list[WarpcorrectConfigParamsDict] | None],
|
|
37
|
+
"help": bool,
|
|
38
|
+
"version": bool,
|
|
39
|
+
"in": InputPathType,
|
|
40
|
+
"out": str,
|
|
41
|
+
})
|
|
42
|
+
WarpcorrectParamsDictTagged = typing.TypedDict('WarpcorrectParamsDictTagged', {
|
|
43
|
+
"@type": typing.Literal["mrtrix/warpcorrect"],
|
|
44
|
+
"marker": typing.NotRequired[list[float] | None],
|
|
45
|
+
"tolerance": typing.NotRequired[float | None],
|
|
46
|
+
"info": bool,
|
|
47
|
+
"quiet": bool,
|
|
48
|
+
"debug": bool,
|
|
49
|
+
"force": bool,
|
|
50
|
+
"nthreads": typing.NotRequired[int | None],
|
|
51
|
+
"config": typing.NotRequired[list[WarpcorrectConfigParamsDict] | None],
|
|
52
|
+
"help": bool,
|
|
53
|
+
"version": bool,
|
|
54
|
+
"in": InputPathType,
|
|
55
|
+
"out": str,
|
|
56
|
+
})
|
|
57
|
+
WarpcorrectParamsDict = _WarpcorrectParamsDictNoTag | WarpcorrectParamsDictTagged
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def warpcorrect_config(
|
|
61
|
+
key: str,
|
|
62
|
+
value: str,
|
|
63
|
+
) -> WarpcorrectConfigParamsDictTagged:
|
|
64
|
+
"""
|
|
65
|
+
Build parameters.
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
69
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
70
|
+
Returns:
|
|
71
|
+
Parameter dictionary
|
|
72
|
+
"""
|
|
73
|
+
params = {
|
|
74
|
+
"@type": "config",
|
|
75
|
+
"key": key,
|
|
76
|
+
"value": value,
|
|
77
|
+
}
|
|
78
|
+
return params
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def warpcorrect_config_validate(
|
|
82
|
+
params: typing.Any,
|
|
83
|
+
) -> None:
|
|
84
|
+
"""
|
|
85
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
86
|
+
`WarpcorrectConfigParamsDict` object.
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
params: The parameters object to validate.
|
|
90
|
+
"""
|
|
91
|
+
if params is None or not isinstance(params, dict):
|
|
92
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
93
|
+
if params.get("key", None) is None:
|
|
94
|
+
raise StyxValidationError("`key` must not be None")
|
|
95
|
+
if not isinstance(params["key"], str):
|
|
96
|
+
raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
|
|
97
|
+
if params.get("value", None) is None:
|
|
98
|
+
raise StyxValidationError("`value` must not be None")
|
|
99
|
+
if not isinstance(params["value"], str):
|
|
100
|
+
raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def warpcorrect_config_cargs(
|
|
104
|
+
params: WarpcorrectConfigParamsDict,
|
|
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", None))
|
|
119
|
+
cargs.append(params.get("value", None))
|
|
120
|
+
return cargs
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class WarpcorrectOutputs(typing.NamedTuple):
|
|
124
|
+
"""
|
|
125
|
+
Output object returned when calling `WarpcorrectParamsDict(...)`.
|
|
126
|
+
"""
|
|
127
|
+
root: OutputPathType
|
|
128
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
129
|
+
out: OutputPathType
|
|
130
|
+
"""the output warp image."""
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def warpcorrect_params(
|
|
134
|
+
in_: InputPathType,
|
|
135
|
+
out: str,
|
|
136
|
+
marker: list[float] | None = None,
|
|
137
|
+
tolerance: float | None = None,
|
|
138
|
+
info: bool = False,
|
|
139
|
+
quiet: bool = False,
|
|
140
|
+
debug: bool = False,
|
|
141
|
+
force: bool = False,
|
|
142
|
+
nthreads: int | None = None,
|
|
143
|
+
config: list[WarpcorrectConfigParamsDict] | None = None,
|
|
144
|
+
help_: bool = False,
|
|
145
|
+
version: bool = False,
|
|
146
|
+
) -> WarpcorrectParamsDictTagged:
|
|
147
|
+
"""
|
|
148
|
+
Build parameters.
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
in_: the input warp image.
|
|
152
|
+
out: the output warp image.
|
|
153
|
+
marker: single value or a comma separated list of values that define\
|
|
154
|
+
out of bounds voxels in the input warp image. Default: (0,0,0).
|
|
155
|
+
tolerance: numerical precision used for L2 matrix norm comparison.\
|
|
156
|
+
Default: 9.99999975e-06.
|
|
157
|
+
info: display information messages.
|
|
158
|
+
quiet: do not display information messages or progress status;\
|
|
159
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
160
|
+
environment variable to a non-empty string.
|
|
161
|
+
debug: display debugging messages.
|
|
162
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
163
|
+
input and output might cause unexpected behaviour).
|
|
164
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
165
|
+
(set to 0 to disable multi-threading).
|
|
166
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
167
|
+
help_: display this information page and exit.
|
|
168
|
+
version: display version information and exit.
|
|
169
|
+
Returns:
|
|
170
|
+
Parameter dictionary
|
|
171
|
+
"""
|
|
172
|
+
params = {
|
|
173
|
+
"@type": "mrtrix/warpcorrect",
|
|
174
|
+
"info": info,
|
|
175
|
+
"quiet": quiet,
|
|
176
|
+
"debug": debug,
|
|
177
|
+
"force": force,
|
|
178
|
+
"help": help_,
|
|
179
|
+
"version": version,
|
|
180
|
+
"in": in_,
|
|
181
|
+
"out": out,
|
|
182
|
+
}
|
|
183
|
+
if marker is not None:
|
|
184
|
+
params["marker"] = marker
|
|
185
|
+
if tolerance is not None:
|
|
186
|
+
params["tolerance"] = tolerance
|
|
187
|
+
if nthreads is not None:
|
|
188
|
+
params["nthreads"] = nthreads
|
|
189
|
+
if config is not None:
|
|
190
|
+
params["config"] = config
|
|
191
|
+
return params
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def warpcorrect_validate(
|
|
195
|
+
params: typing.Any,
|
|
196
|
+
) -> None:
|
|
197
|
+
"""
|
|
198
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
199
|
+
`WarpcorrectParamsDict` object.
|
|
200
|
+
|
|
201
|
+
Args:
|
|
202
|
+
params: The parameters object to validate.
|
|
203
|
+
"""
|
|
204
|
+
if params is None or not isinstance(params, dict):
|
|
205
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
206
|
+
if params.get("marker", None) is not None:
|
|
207
|
+
if not isinstance(params["marker"], list):
|
|
208
|
+
raise StyxValidationError(f'`marker` has the wrong type: Received `{type(params.get("marker", None))}` expected `list[float] | None`')
|
|
209
|
+
for e in params["marker"]:
|
|
210
|
+
if not isinstance(e, (float, int)):
|
|
211
|
+
raise StyxValidationError(f'`marker` has the wrong type: Received `{type(params.get("marker", None))}` expected `list[float] | None`')
|
|
212
|
+
if params.get("tolerance", None) is not None:
|
|
213
|
+
if not isinstance(params["tolerance"], (float, int)):
|
|
214
|
+
raise StyxValidationError(f'`tolerance` has the wrong type: Received `{type(params.get("tolerance", None))}` expected `float | None`')
|
|
215
|
+
if params.get("info", False) is None:
|
|
216
|
+
raise StyxValidationError("`info` must not be None")
|
|
217
|
+
if not isinstance(params["info"], bool):
|
|
218
|
+
raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
|
|
219
|
+
if params.get("quiet", False) is None:
|
|
220
|
+
raise StyxValidationError("`quiet` must not be None")
|
|
221
|
+
if not isinstance(params["quiet"], bool):
|
|
222
|
+
raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
|
|
223
|
+
if params.get("debug", False) is None:
|
|
224
|
+
raise StyxValidationError("`debug` must not be None")
|
|
225
|
+
if not isinstance(params["debug"], bool):
|
|
226
|
+
raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
|
|
227
|
+
if params.get("force", False) is None:
|
|
228
|
+
raise StyxValidationError("`force` must not be None")
|
|
229
|
+
if not isinstance(params["force"], bool):
|
|
230
|
+
raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
|
|
231
|
+
if params.get("nthreads", None) is not None:
|
|
232
|
+
if not isinstance(params["nthreads"], int):
|
|
233
|
+
raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
|
|
234
|
+
if params.get("config", None) is not None:
|
|
235
|
+
if not isinstance(params["config"], list):
|
|
236
|
+
raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[WarpcorrectConfigParamsDict] | None`')
|
|
237
|
+
for e in params["config"]:
|
|
238
|
+
warpcorrect_config_validate(e)
|
|
239
|
+
if params.get("help", False) is None:
|
|
240
|
+
raise StyxValidationError("`help` must not be None")
|
|
241
|
+
if not isinstance(params["help"], bool):
|
|
242
|
+
raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
|
|
243
|
+
if params.get("version", False) is None:
|
|
244
|
+
raise StyxValidationError("`version` must not be None")
|
|
245
|
+
if not isinstance(params["version"], bool):
|
|
246
|
+
raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
|
|
247
|
+
if params.get("in", None) is None:
|
|
248
|
+
raise StyxValidationError("`in` must not be None")
|
|
249
|
+
if not isinstance(params["in"], (pathlib.Path, str)):
|
|
250
|
+
raise StyxValidationError(f'`in` has the wrong type: Received `{type(params.get("in", None))}` expected `InputPathType`')
|
|
251
|
+
if params.get("out", None) is None:
|
|
252
|
+
raise StyxValidationError("`out` must not be None")
|
|
253
|
+
if not isinstance(params["out"], str):
|
|
254
|
+
raise StyxValidationError(f'`out` has the wrong type: Received `{type(params.get("out", None))}` expected `str`')
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
def warpcorrect_cargs(
|
|
258
|
+
params: WarpcorrectParamsDict,
|
|
259
|
+
execution: Execution,
|
|
260
|
+
) -> list[str]:
|
|
261
|
+
"""
|
|
262
|
+
Build command-line arguments from parameters.
|
|
263
|
+
|
|
264
|
+
Args:
|
|
265
|
+
params: The parameters.
|
|
266
|
+
execution: The execution object for resolving input paths.
|
|
267
|
+
Returns:
|
|
268
|
+
Command-line arguments.
|
|
269
|
+
"""
|
|
270
|
+
cargs = []
|
|
271
|
+
cargs.append("warpcorrect")
|
|
272
|
+
if params.get("marker", None) is not None:
|
|
273
|
+
cargs.extend([
|
|
274
|
+
"-marker",
|
|
275
|
+
*map(str, params.get("marker", None))
|
|
276
|
+
])
|
|
277
|
+
if params.get("tolerance", None) is not None:
|
|
278
|
+
cargs.extend([
|
|
279
|
+
"-tolerance",
|
|
280
|
+
str(params.get("tolerance", None))
|
|
281
|
+
])
|
|
282
|
+
if params.get("info", False):
|
|
283
|
+
cargs.append("-info")
|
|
284
|
+
if params.get("quiet", False):
|
|
285
|
+
cargs.append("-quiet")
|
|
286
|
+
if params.get("debug", False):
|
|
287
|
+
cargs.append("-debug")
|
|
288
|
+
if params.get("force", False):
|
|
289
|
+
cargs.append("-force")
|
|
290
|
+
if params.get("nthreads", None) is not None:
|
|
291
|
+
cargs.extend([
|
|
292
|
+
"-nthreads",
|
|
293
|
+
str(params.get("nthreads", None))
|
|
294
|
+
])
|
|
295
|
+
if params.get("config", None) is not None:
|
|
296
|
+
cargs.extend([a for c in [warpcorrect_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
297
|
+
if params.get("help", False):
|
|
298
|
+
cargs.append("-help")
|
|
299
|
+
if params.get("version", False):
|
|
300
|
+
cargs.append("-version")
|
|
301
|
+
cargs.append(execution.input_file(params.get("in", None)))
|
|
302
|
+
cargs.append(params.get("out", None))
|
|
303
|
+
return cargs
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
def warpcorrect_outputs(
|
|
307
|
+
params: WarpcorrectParamsDict,
|
|
308
|
+
execution: Execution,
|
|
309
|
+
) -> WarpcorrectOutputs:
|
|
310
|
+
"""
|
|
311
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
312
|
+
|
|
313
|
+
Args:
|
|
314
|
+
params: The parameters.
|
|
315
|
+
execution: The execution object for resolving input paths.
|
|
316
|
+
Returns:
|
|
317
|
+
Outputs object.
|
|
318
|
+
"""
|
|
319
|
+
ret = WarpcorrectOutputs(
|
|
320
|
+
root=execution.output_file("."),
|
|
321
|
+
out=execution.output_file(params.get("out", None)),
|
|
322
|
+
)
|
|
323
|
+
return ret
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
def warpcorrect_execute(
|
|
327
|
+
params: WarpcorrectParamsDict,
|
|
328
|
+
runner: Runner | None = None,
|
|
329
|
+
) -> WarpcorrectOutputs:
|
|
330
|
+
"""
|
|
331
|
+
warpcorrect
|
|
332
|
+
|
|
333
|
+
Replaces voxels in a deformation field that point to a specific out of
|
|
334
|
+
bounds location with nan,nan,nan.
|
|
335
|
+
|
|
336
|
+
This can be used in conjunction with the warpinit command to compute a
|
|
337
|
+
MRtrix compatible deformation field from non-linear transformations
|
|
338
|
+
generated by any other registration package.
|
|
339
|
+
|
|
340
|
+
References:
|
|
341
|
+
|
|
342
|
+
.
|
|
343
|
+
|
|
344
|
+
Author: MRTrix3 Developers
|
|
345
|
+
|
|
346
|
+
URL: https://www.mrtrix.org/
|
|
347
|
+
|
|
348
|
+
Args:
|
|
349
|
+
params: The parameters.
|
|
350
|
+
runner: Command runner.
|
|
351
|
+
Returns:
|
|
352
|
+
NamedTuple of outputs (described in `WarpcorrectOutputs`).
|
|
353
|
+
"""
|
|
354
|
+
warpcorrect_validate(params)
|
|
355
|
+
runner = runner or get_global_runner()
|
|
356
|
+
execution = runner.start_execution(WARPCORRECT_METADATA)
|
|
357
|
+
params = execution.params(params)
|
|
358
|
+
cargs = warpcorrect_cargs(params, execution)
|
|
359
|
+
ret = warpcorrect_outputs(params, execution)
|
|
360
|
+
execution.run(cargs)
|
|
361
|
+
return ret
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
def warpcorrect(
|
|
365
|
+
in_: InputPathType,
|
|
366
|
+
out: str,
|
|
367
|
+
marker: list[float] | None = None,
|
|
368
|
+
tolerance: float | None = None,
|
|
369
|
+
info: bool = False,
|
|
370
|
+
quiet: bool = False,
|
|
371
|
+
debug: bool = False,
|
|
372
|
+
force: bool = False,
|
|
373
|
+
nthreads: int | None = None,
|
|
374
|
+
config: list[WarpcorrectConfigParamsDict] | None = None,
|
|
375
|
+
help_: bool = False,
|
|
376
|
+
version: bool = False,
|
|
377
|
+
runner: Runner | None = None,
|
|
378
|
+
) -> WarpcorrectOutputs:
|
|
379
|
+
"""
|
|
380
|
+
warpcorrect
|
|
381
|
+
|
|
382
|
+
Replaces voxels in a deformation field that point to a specific out of
|
|
383
|
+
bounds location with nan,nan,nan.
|
|
384
|
+
|
|
385
|
+
This can be used in conjunction with the warpinit command to compute a
|
|
386
|
+
MRtrix compatible deformation field from non-linear transformations
|
|
387
|
+
generated by any other registration package.
|
|
388
|
+
|
|
389
|
+
References:
|
|
390
|
+
|
|
391
|
+
.
|
|
392
|
+
|
|
393
|
+
Author: MRTrix3 Developers
|
|
394
|
+
|
|
395
|
+
URL: https://www.mrtrix.org/
|
|
396
|
+
|
|
397
|
+
Args:
|
|
398
|
+
in_: the input warp image.
|
|
399
|
+
out: the output warp image.
|
|
400
|
+
marker: single value or a comma separated list of values that define\
|
|
401
|
+
out of bounds voxels in the input warp image. Default: (0,0,0).
|
|
402
|
+
tolerance: numerical precision used for L2 matrix norm comparison.\
|
|
403
|
+
Default: 9.99999975e-06.
|
|
404
|
+
info: display information messages.
|
|
405
|
+
quiet: do not display information messages or progress status;\
|
|
406
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
407
|
+
environment variable to a non-empty string.
|
|
408
|
+
debug: display debugging messages.
|
|
409
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
410
|
+
input and output might cause unexpected behaviour).
|
|
411
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
412
|
+
(set to 0 to disable multi-threading).
|
|
413
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
414
|
+
help_: display this information page and exit.
|
|
415
|
+
version: display version information and exit.
|
|
416
|
+
runner: Command runner.
|
|
417
|
+
Returns:
|
|
418
|
+
NamedTuple of outputs (described in `WarpcorrectOutputs`).
|
|
419
|
+
"""
|
|
420
|
+
params = warpcorrect_params(
|
|
421
|
+
marker=marker,
|
|
422
|
+
tolerance=tolerance,
|
|
423
|
+
info=info,
|
|
424
|
+
quiet=quiet,
|
|
425
|
+
debug=debug,
|
|
426
|
+
force=force,
|
|
427
|
+
nthreads=nthreads,
|
|
428
|
+
config=config,
|
|
429
|
+
help_=help_,
|
|
430
|
+
version=version,
|
|
431
|
+
in_=in_,
|
|
432
|
+
out=out,
|
|
433
|
+
)
|
|
434
|
+
return warpcorrect_execute(params, runner)
|
|
435
|
+
|
|
436
|
+
|
|
437
|
+
__all__ = [
|
|
438
|
+
"WARPCORRECT_METADATA",
|
|
439
|
+
"WarpcorrectConfigParamsDict",
|
|
440
|
+
"WarpcorrectConfigParamsDictTagged",
|
|
441
|
+
"WarpcorrectOutputs",
|
|
442
|
+
"WarpcorrectParamsDict",
|
|
443
|
+
"WarpcorrectParamsDictTagged",
|
|
444
|
+
"warpcorrect",
|
|
445
|
+
"warpcorrect_config",
|
|
446
|
+
"warpcorrect_execute",
|
|
447
|
+
"warpcorrect_params",
|
|
448
|
+
]
|