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.
- niwrap_mrtrix/mrtrix/__init__.py +130 -0
- niwrap_mrtrix/mrtrix/afdconnectivity.py +445 -0
- niwrap_mrtrix/mrtrix/amp2response.py +453 -0
- niwrap_mrtrix/mrtrix/amp2sh.py +656 -0
- niwrap_mrtrix/mrtrix/connectome2tck.py +470 -0
- niwrap_mrtrix/mrtrix/connectomeedit.py +338 -0
- niwrap_mrtrix/mrtrix/connectomestats.py +767 -0
- niwrap_mrtrix/mrtrix/dcmedit.py +440 -0
- niwrap_mrtrix/mrtrix/dcminfo.py +416 -0
- niwrap_mrtrix/mrtrix/dirflip.py +362 -0
- niwrap_mrtrix/mrtrix/dirgen.py +423 -0
- niwrap_mrtrix/mrtrix/dirmerge.py +365 -0
- niwrap_mrtrix/mrtrix/dirorder.py +347 -0
- niwrap_mrtrix/mrtrix/dirsplit.py +358 -0
- niwrap_mrtrix/mrtrix/dirstat.py +530 -0
- niwrap_mrtrix/mrtrix/dwi2adc.py +428 -0
- niwrap_mrtrix/mrtrix/dwi2fod.py +879 -0
- niwrap_mrtrix/mrtrix/dwi2mask.py +463 -0
- niwrap_mrtrix/mrtrix/dwi2response.py +1295 -0
- niwrap_mrtrix/mrtrix/dwi2tensor.py +587 -0
- niwrap_mrtrix/mrtrix/dwibiascorrect.py +467 -0
- niwrap_mrtrix/mrtrix/dwidenoise.py +478 -0
- niwrap_mrtrix/mrtrix/dwiextract.py +825 -0
- niwrap_mrtrix/mrtrix/dwigradcheck.py +534 -0
- niwrap_mrtrix/mrtrix/fixel2peaks.py +452 -0
- niwrap_mrtrix/mrtrix/fixel2sh.py +357 -0
- niwrap_mrtrix/mrtrix/fixel2tsf.py +357 -0
- niwrap_mrtrix/mrtrix/fixel2voxel.py +437 -0
- niwrap_mrtrix/mrtrix/fixelcfestats.py +893 -0
- niwrap_mrtrix/mrtrix/fixelconnectivity.py +391 -0
- niwrap_mrtrix/mrtrix/fixelconvert.py +588 -0
- niwrap_mrtrix/mrtrix/fixelcorrespondence.py +371 -0
- niwrap_mrtrix/mrtrix/fixelcrop.py +348 -0
- niwrap_mrtrix/mrtrix/fixelfilter.py +616 -0
- niwrap_mrtrix/mrtrix/fixelreorient.py +361 -0
- niwrap_mrtrix/mrtrix/fod2dec.py +469 -0
- niwrap_mrtrix/mrtrix/fod2fixel.py +530 -0
- niwrap_mrtrix/mrtrix/label2colour.py +351 -0
- niwrap_mrtrix/mrtrix/label2mesh.py +343 -0
- niwrap_mrtrix/mrtrix/labelconvert.py +377 -0
- niwrap_mrtrix/mrtrix/labelstats.py +344 -0
- niwrap_mrtrix/mrtrix/maskdump.py +336 -0
- niwrap_mrtrix/mrtrix/maskfilter.py +537 -0
- niwrap_mrtrix/mrtrix/mesh2voxel.py +348 -0
- niwrap_mrtrix/mrtrix/meshconvert.py +410 -0
- niwrap_mrtrix/mrtrix/meshfilter.py +370 -0
- niwrap_mrtrix/mrtrix/mraverageheader.py +396 -0
- niwrap_mrtrix/mrtrix/mrcalc.py +3047 -0
- niwrap_mrtrix/mrtrix/mrcat.py +382 -0
- niwrap_mrtrix/mrtrix/mrcentroid.py +344 -0
- niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +363 -0
- niwrap_mrtrix/mrtrix/mrclusterstats.py +736 -0
- niwrap_mrtrix/mrtrix/mrcolour.py +401 -0
- niwrap_mrtrix/mrtrix/mrconvert.py +1423 -0
- niwrap_mrtrix/mrtrix/mrdegibbs.py +443 -0
- niwrap_mrtrix/mrtrix/mrdump.py +351 -0
- niwrap_mrtrix/mrtrix/mredit.py +546 -0
- niwrap_mrtrix/mrtrix/mrfilter.py +716 -0
- niwrap_mrtrix/mrtrix/mrgrid.py +819 -0
- niwrap_mrtrix/mrtrix/mrhistmatch.py +403 -0
- niwrap_mrtrix/mrtrix/mrhistogram.py +393 -0
- niwrap_mrtrix/mrtrix/mrinfo.py +990 -0
- niwrap_mrtrix/mrtrix/mrmath.py +413 -0
- niwrap_mrtrix/mrtrix/mrmetric.py +425 -0
- niwrap_mrtrix/mrtrix/mrregister.py +1676 -0
- niwrap_mrtrix/mrtrix/mrstats.py +427 -0
- niwrap_mrtrix/mrtrix/mrthreshold.py +549 -0
- niwrap_mrtrix/mrtrix/mrtransform.py +1061 -0
- niwrap_mrtrix/mrtrix/mtnormalise.py +596 -0
- niwrap_mrtrix/mrtrix/peaks2amp.py +334 -0
- niwrap_mrtrix/mrtrix/peaks2fixel.py +349 -0
- niwrap_mrtrix/mrtrix/responsemean.py +316 -0
- niwrap_mrtrix/mrtrix/sh2amp.py +640 -0
- niwrap_mrtrix/mrtrix/sh2peaks.py +505 -0
- niwrap_mrtrix/mrtrix/sh2power.py +353 -0
- niwrap_mrtrix/mrtrix/sh2response.py +394 -0
- niwrap_mrtrix/mrtrix/shbasis.py +373 -0
- niwrap_mrtrix/mrtrix/shconv.py +498 -0
- niwrap_mrtrix/mrtrix/tck2connectome.py +580 -0
- niwrap_mrtrix/mrtrix/tck2fixel.py +363 -0
- niwrap_mrtrix/mrtrix/tckconvert.py +580 -0
- niwrap_mrtrix/mrtrix/tckdfc.py +551 -0
- niwrap_mrtrix/mrtrix/tckedit.py +1003 -0
- niwrap_mrtrix/mrtrix/tckgen.py +1983 -0
- niwrap_mrtrix/mrtrix/tckglobal.py +758 -0
- niwrap_mrtrix/mrtrix/tckinfo.py +329 -0
- niwrap_mrtrix/mrtrix/tckmap.py +772 -0
- niwrap_mrtrix/mrtrix/tckresample.py +580 -0
- niwrap_mrtrix/mrtrix/tcksample.py +404 -0
- niwrap_mrtrix/mrtrix/tcksift.py +592 -0
- niwrap_mrtrix/mrtrix/tcksift2.py +730 -0
- niwrap_mrtrix/mrtrix/tckstats.py +441 -0
- niwrap_mrtrix/mrtrix/tcktransform.py +340 -0
- niwrap_mrtrix/mrtrix/tensor2metric.py +544 -0
- niwrap_mrtrix/mrtrix/transformcalc.py +344 -0
- niwrap_mrtrix/mrtrix/transformcompose.py +465 -0
- niwrap_mrtrix/mrtrix/transformconvert.py +346 -0
- niwrap_mrtrix/mrtrix/tsfdivide.py +340 -0
- niwrap_mrtrix/mrtrix/tsfinfo.py +344 -0
- niwrap_mrtrix/mrtrix/tsfmult.py +340 -0
- niwrap_mrtrix/mrtrix/tsfsmooth.py +347 -0
- niwrap_mrtrix/mrtrix/tsfthreshold.py +349 -0
- niwrap_mrtrix/mrtrix/tsfvalidate.py +328 -0
- niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +359 -0
- niwrap_mrtrix/mrtrix/v_5tt2vis.py +412 -0
- niwrap_mrtrix/mrtrix/v_5ttcheck.py +337 -0
- niwrap_mrtrix/mrtrix/v_5ttedit.py +420 -0
- niwrap_mrtrix/mrtrix/v_5ttgen.py +816 -0
- niwrap_mrtrix/mrtrix/vectorstats.py +585 -0
- niwrap_mrtrix/mrtrix/voxel2fixel.py +350 -0
- niwrap_mrtrix/mrtrix/voxel2mesh.py +376 -0
- niwrap_mrtrix/mrtrix/warp2metric.py +449 -0
- niwrap_mrtrix/mrtrix/warpconvert.py +411 -0
- niwrap_mrtrix/mrtrix/warpcorrect.py +368 -0
- niwrap_mrtrix/mrtrix/warpinit.py +356 -0
- niwrap_mrtrix/mrtrix/warpinvert.py +370 -0
- niwrap_mrtrix-0.5.0.dist-info/METADATA +8 -0
- niwrap_mrtrix-0.5.0.dist-info/RECORD +119 -0
- niwrap_mrtrix-0.5.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,411 @@
|
|
|
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
|
+
WARPCONVERT_METADATA = Metadata(
|
|
9
|
+
id="aa820be224a359dcdb4d3911882f1ee399c31903.boutiques",
|
|
10
|
+
name="warpconvert",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
WarpconvertConfigParameters = typing.TypedDict('WarpconvertConfigParameters', {
|
|
17
|
+
"__STYX_TYPE__": typing.Literal["config"],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
WarpconvertParameters = typing.TypedDict('WarpconvertParameters', {
|
|
24
|
+
"__STYX_TYPE__": typing.Literal["warpconvert"],
|
|
25
|
+
"template": typing.NotRequired[InputPathType | None],
|
|
26
|
+
"midway_space": bool,
|
|
27
|
+
"from": typing.NotRequired[int | None],
|
|
28
|
+
"info": bool,
|
|
29
|
+
"quiet": bool,
|
|
30
|
+
"debug": bool,
|
|
31
|
+
"force": bool,
|
|
32
|
+
"nthreads": typing.NotRequired[int | None],
|
|
33
|
+
"config": typing.NotRequired[list[WarpconvertConfigParameters] | None],
|
|
34
|
+
"help": bool,
|
|
35
|
+
"version": bool,
|
|
36
|
+
"in": InputPathType,
|
|
37
|
+
"type": str,
|
|
38
|
+
"out": str,
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def dyn_cargs(
|
|
43
|
+
t: str,
|
|
44
|
+
) -> typing.Any:
|
|
45
|
+
"""
|
|
46
|
+
Get build cargs function by command type.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
t: Command type.
|
|
50
|
+
Returns:
|
|
51
|
+
Build cargs function.
|
|
52
|
+
"""
|
|
53
|
+
return {
|
|
54
|
+
"warpconvert": warpconvert_cargs,
|
|
55
|
+
"config": warpconvert_config_cargs,
|
|
56
|
+
}.get(t)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def dyn_outputs(
|
|
60
|
+
t: str,
|
|
61
|
+
) -> typing.Any:
|
|
62
|
+
"""
|
|
63
|
+
Get build outputs function by command type.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
t: Command type.
|
|
67
|
+
Returns:
|
|
68
|
+
Build outputs function.
|
|
69
|
+
"""
|
|
70
|
+
return {
|
|
71
|
+
"warpconvert": warpconvert_outputs,
|
|
72
|
+
}.get(t)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def warpconvert_config_params(
|
|
76
|
+
key: str,
|
|
77
|
+
value: str,
|
|
78
|
+
) -> WarpconvertConfigParameters:
|
|
79
|
+
"""
|
|
80
|
+
Build parameters.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
84
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
85
|
+
Returns:
|
|
86
|
+
Parameter dictionary
|
|
87
|
+
"""
|
|
88
|
+
params = {
|
|
89
|
+
"__STYXTYPE__": "config",
|
|
90
|
+
"key": key,
|
|
91
|
+
"value": value,
|
|
92
|
+
}
|
|
93
|
+
return params
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def warpconvert_config_cargs(
|
|
97
|
+
params: WarpconvertConfigParameters,
|
|
98
|
+
execution: Execution,
|
|
99
|
+
) -> list[str]:
|
|
100
|
+
"""
|
|
101
|
+
Build command-line arguments from parameters.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
params: The parameters.
|
|
105
|
+
execution: The execution object for resolving input paths.
|
|
106
|
+
Returns:
|
|
107
|
+
Command-line arguments.
|
|
108
|
+
"""
|
|
109
|
+
cargs = []
|
|
110
|
+
cargs.append("-config")
|
|
111
|
+
cargs.append(params.get("key"))
|
|
112
|
+
cargs.append(params.get("value"))
|
|
113
|
+
return cargs
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class WarpconvertOutputs(typing.NamedTuple):
|
|
117
|
+
"""
|
|
118
|
+
Output object returned when calling `warpconvert(...)`.
|
|
119
|
+
"""
|
|
120
|
+
root: OutputPathType
|
|
121
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
122
|
+
out: OutputPathType
|
|
123
|
+
"""the output warp image."""
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def warpconvert_params(
|
|
127
|
+
in_: InputPathType,
|
|
128
|
+
type_: str,
|
|
129
|
+
out: str,
|
|
130
|
+
template: InputPathType | None = None,
|
|
131
|
+
midway_space: bool = False,
|
|
132
|
+
from_: int | None = None,
|
|
133
|
+
info: bool = False,
|
|
134
|
+
quiet: bool = False,
|
|
135
|
+
debug: bool = False,
|
|
136
|
+
force: bool = False,
|
|
137
|
+
nthreads: int | None = None,
|
|
138
|
+
config: list[WarpconvertConfigParameters] | None = None,
|
|
139
|
+
help_: bool = False,
|
|
140
|
+
version: bool = False,
|
|
141
|
+
) -> WarpconvertParameters:
|
|
142
|
+
"""
|
|
143
|
+
Build parameters.
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
in_: the input warp image.
|
|
147
|
+
type_: the conversion type required. Valid choices are:\
|
|
148
|
+
deformation2displacement, displacement2deformation,\
|
|
149
|
+
warpfull2deformation, warpfull2displacement.
|
|
150
|
+
out: the output warp image.
|
|
151
|
+
template: define a template image when converting a warpfull file\
|
|
152
|
+
(which is defined on a grid in the midway space between image 1 & 2).\
|
|
153
|
+
For example to generate the deformation field that maps image1 to\
|
|
154
|
+
image2, then supply image2 as the template image.
|
|
155
|
+
midway_space: to be used only with warpfull2deformation and\
|
|
156
|
+
warpfull2displacement conversion types. The output will only contain\
|
|
157
|
+
the non-linear warp to map an input image to the midway space (defined\
|
|
158
|
+
by the warpfull grid). If a linear transform exists in the warpfull\
|
|
159
|
+
file header then it will be composed and included in the output.
|
|
160
|
+
from_: to be used only with warpfull2deformation and\
|
|
161
|
+
warpfull2displacement conversion types. Used to define the direction of\
|
|
162
|
+
the desired output field.Use -from 1 to obtain the image1->image2 field\
|
|
163
|
+
and from 2 for image2->image1. Can be used in combination with the\
|
|
164
|
+
-midway_space option to produce a field that only maps to midway space.
|
|
165
|
+
info: display information messages.
|
|
166
|
+
quiet: do not display information messages or progress status;\
|
|
167
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
168
|
+
environment variable to a non-empty string.
|
|
169
|
+
debug: display debugging messages.
|
|
170
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
171
|
+
input and output might cause unexpected behaviour).
|
|
172
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
173
|
+
(set to 0 to disable multi-threading).
|
|
174
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
175
|
+
help_: display this information page and exit.
|
|
176
|
+
version: display version information and exit.
|
|
177
|
+
Returns:
|
|
178
|
+
Parameter dictionary
|
|
179
|
+
"""
|
|
180
|
+
params = {
|
|
181
|
+
"__STYXTYPE__": "warpconvert",
|
|
182
|
+
"midway_space": midway_space,
|
|
183
|
+
"info": info,
|
|
184
|
+
"quiet": quiet,
|
|
185
|
+
"debug": debug,
|
|
186
|
+
"force": force,
|
|
187
|
+
"help": help_,
|
|
188
|
+
"version": version,
|
|
189
|
+
"in": in_,
|
|
190
|
+
"type": type_,
|
|
191
|
+
"out": out,
|
|
192
|
+
}
|
|
193
|
+
if template is not None:
|
|
194
|
+
params["template"] = template
|
|
195
|
+
if from_ is not None:
|
|
196
|
+
params["from"] = from_
|
|
197
|
+
if nthreads is not None:
|
|
198
|
+
params["nthreads"] = nthreads
|
|
199
|
+
if config is not None:
|
|
200
|
+
params["config"] = config
|
|
201
|
+
return params
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def warpconvert_cargs(
|
|
205
|
+
params: WarpconvertParameters,
|
|
206
|
+
execution: Execution,
|
|
207
|
+
) -> list[str]:
|
|
208
|
+
"""
|
|
209
|
+
Build command-line arguments from parameters.
|
|
210
|
+
|
|
211
|
+
Args:
|
|
212
|
+
params: The parameters.
|
|
213
|
+
execution: The execution object for resolving input paths.
|
|
214
|
+
Returns:
|
|
215
|
+
Command-line arguments.
|
|
216
|
+
"""
|
|
217
|
+
cargs = []
|
|
218
|
+
cargs.append("warpconvert")
|
|
219
|
+
if params.get("template") is not None:
|
|
220
|
+
cargs.extend([
|
|
221
|
+
"-template",
|
|
222
|
+
execution.input_file(params.get("template"))
|
|
223
|
+
])
|
|
224
|
+
if params.get("midway_space"):
|
|
225
|
+
cargs.append("-midway_space")
|
|
226
|
+
if params.get("from") is not None:
|
|
227
|
+
cargs.extend([
|
|
228
|
+
"-from",
|
|
229
|
+
str(params.get("from"))
|
|
230
|
+
])
|
|
231
|
+
if params.get("info"):
|
|
232
|
+
cargs.append("-info")
|
|
233
|
+
if params.get("quiet"):
|
|
234
|
+
cargs.append("-quiet")
|
|
235
|
+
if params.get("debug"):
|
|
236
|
+
cargs.append("-debug")
|
|
237
|
+
if params.get("force"):
|
|
238
|
+
cargs.append("-force")
|
|
239
|
+
if params.get("nthreads") is not None:
|
|
240
|
+
cargs.extend([
|
|
241
|
+
"-nthreads",
|
|
242
|
+
str(params.get("nthreads"))
|
|
243
|
+
])
|
|
244
|
+
if params.get("config") is not None:
|
|
245
|
+
cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
|
|
246
|
+
if params.get("help"):
|
|
247
|
+
cargs.append("-help")
|
|
248
|
+
if params.get("version"):
|
|
249
|
+
cargs.append("-version")
|
|
250
|
+
cargs.append(execution.input_file(params.get("in")))
|
|
251
|
+
cargs.append(params.get("type"))
|
|
252
|
+
cargs.append(params.get("out"))
|
|
253
|
+
return cargs
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def warpconvert_outputs(
|
|
257
|
+
params: WarpconvertParameters,
|
|
258
|
+
execution: Execution,
|
|
259
|
+
) -> WarpconvertOutputs:
|
|
260
|
+
"""
|
|
261
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
262
|
+
|
|
263
|
+
Args:
|
|
264
|
+
params: The parameters.
|
|
265
|
+
execution: The execution object for resolving input paths.
|
|
266
|
+
Returns:
|
|
267
|
+
Outputs object.
|
|
268
|
+
"""
|
|
269
|
+
ret = WarpconvertOutputs(
|
|
270
|
+
root=execution.output_file("."),
|
|
271
|
+
out=execution.output_file(params.get("out")),
|
|
272
|
+
)
|
|
273
|
+
return ret
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
def warpconvert_execute(
|
|
277
|
+
params: WarpconvertParameters,
|
|
278
|
+
execution: Execution,
|
|
279
|
+
) -> WarpconvertOutputs:
|
|
280
|
+
"""
|
|
281
|
+
Convert between different representations of a non-linear warp.
|
|
282
|
+
|
|
283
|
+
A deformation field is defined as an image where each voxel defines the
|
|
284
|
+
corresponding position in the other image (in scanner space coordinates). A
|
|
285
|
+
displacement field stores the displacements (in mm) to the other image from
|
|
286
|
+
the each voxel's position (in scanner space). The warpfull file is the 5D
|
|
287
|
+
format output from mrregister -nl_warp_full, which contains linear
|
|
288
|
+
transforms, warps and their inverses that map each image to a midway space.
|
|
289
|
+
|
|
290
|
+
References:
|
|
291
|
+
|
|
292
|
+
.
|
|
293
|
+
|
|
294
|
+
Author: MRTrix3 Developers
|
|
295
|
+
|
|
296
|
+
URL: https://www.mrtrix.org/
|
|
297
|
+
|
|
298
|
+
Args:
|
|
299
|
+
params: The parameters.
|
|
300
|
+
execution: The execution object.
|
|
301
|
+
Returns:
|
|
302
|
+
NamedTuple of outputs (described in `WarpconvertOutputs`).
|
|
303
|
+
"""
|
|
304
|
+
params = execution.params(params)
|
|
305
|
+
cargs = warpconvert_cargs(params, execution)
|
|
306
|
+
ret = warpconvert_outputs(params, execution)
|
|
307
|
+
execution.run(cargs)
|
|
308
|
+
return ret
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
def warpconvert(
|
|
312
|
+
in_: InputPathType,
|
|
313
|
+
type_: str,
|
|
314
|
+
out: str,
|
|
315
|
+
template: InputPathType | None = None,
|
|
316
|
+
midway_space: bool = False,
|
|
317
|
+
from_: int | None = None,
|
|
318
|
+
info: bool = False,
|
|
319
|
+
quiet: bool = False,
|
|
320
|
+
debug: bool = False,
|
|
321
|
+
force: bool = False,
|
|
322
|
+
nthreads: int | None = None,
|
|
323
|
+
config: list[WarpconvertConfigParameters] | None = None,
|
|
324
|
+
help_: bool = False,
|
|
325
|
+
version: bool = False,
|
|
326
|
+
runner: Runner | None = None,
|
|
327
|
+
) -> WarpconvertOutputs:
|
|
328
|
+
"""
|
|
329
|
+
Convert between different representations of a non-linear warp.
|
|
330
|
+
|
|
331
|
+
A deformation field is defined as an image where each voxel defines the
|
|
332
|
+
corresponding position in the other image (in scanner space coordinates). A
|
|
333
|
+
displacement field stores the displacements (in mm) to the other image from
|
|
334
|
+
the each voxel's position (in scanner space). The warpfull file is the 5D
|
|
335
|
+
format output from mrregister -nl_warp_full, which contains linear
|
|
336
|
+
transforms, warps and their inverses that map each image to a midway space.
|
|
337
|
+
|
|
338
|
+
References:
|
|
339
|
+
|
|
340
|
+
.
|
|
341
|
+
|
|
342
|
+
Author: MRTrix3 Developers
|
|
343
|
+
|
|
344
|
+
URL: https://www.mrtrix.org/
|
|
345
|
+
|
|
346
|
+
Args:
|
|
347
|
+
in_: the input warp image.
|
|
348
|
+
type_: the conversion type required. Valid choices are:\
|
|
349
|
+
deformation2displacement, displacement2deformation,\
|
|
350
|
+
warpfull2deformation, warpfull2displacement.
|
|
351
|
+
out: the output warp image.
|
|
352
|
+
template: define a template image when converting a warpfull file\
|
|
353
|
+
(which is defined on a grid in the midway space between image 1 & 2).\
|
|
354
|
+
For example to generate the deformation field that maps image1 to\
|
|
355
|
+
image2, then supply image2 as the template image.
|
|
356
|
+
midway_space: to be used only with warpfull2deformation and\
|
|
357
|
+
warpfull2displacement conversion types. The output will only contain\
|
|
358
|
+
the non-linear warp to map an input image to the midway space (defined\
|
|
359
|
+
by the warpfull grid). If a linear transform exists in the warpfull\
|
|
360
|
+
file header then it will be composed and included in the output.
|
|
361
|
+
from_: to be used only with warpfull2deformation and\
|
|
362
|
+
warpfull2displacement conversion types. Used to define the direction of\
|
|
363
|
+
the desired output field.Use -from 1 to obtain the image1->image2 field\
|
|
364
|
+
and from 2 for image2->image1. Can be used in combination with the\
|
|
365
|
+
-midway_space option to produce a field that only maps to midway space.
|
|
366
|
+
info: display information messages.
|
|
367
|
+
quiet: do not display information messages or progress status;\
|
|
368
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
369
|
+
environment variable to a non-empty string.
|
|
370
|
+
debug: display debugging messages.
|
|
371
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
372
|
+
input and output might cause unexpected behaviour).
|
|
373
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
374
|
+
(set to 0 to disable multi-threading).
|
|
375
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
376
|
+
help_: display this information page and exit.
|
|
377
|
+
version: display version information and exit.
|
|
378
|
+
runner: Command runner.
|
|
379
|
+
Returns:
|
|
380
|
+
NamedTuple of outputs (described in `WarpconvertOutputs`).
|
|
381
|
+
"""
|
|
382
|
+
runner = runner or get_global_runner()
|
|
383
|
+
execution = runner.start_execution(WARPCONVERT_METADATA)
|
|
384
|
+
params = warpconvert_params(
|
|
385
|
+
template=template,
|
|
386
|
+
midway_space=midway_space,
|
|
387
|
+
from_=from_,
|
|
388
|
+
info=info,
|
|
389
|
+
quiet=quiet,
|
|
390
|
+
debug=debug,
|
|
391
|
+
force=force,
|
|
392
|
+
nthreads=nthreads,
|
|
393
|
+
config=config,
|
|
394
|
+
help_=help_,
|
|
395
|
+
version=version,
|
|
396
|
+
in_=in_,
|
|
397
|
+
type_=type_,
|
|
398
|
+
out=out,
|
|
399
|
+
)
|
|
400
|
+
return warpconvert_execute(params, execution)
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
__all__ = [
|
|
404
|
+
"WARPCONVERT_METADATA",
|
|
405
|
+
"WarpconvertConfigParameters",
|
|
406
|
+
"WarpconvertOutputs",
|
|
407
|
+
"WarpconvertParameters",
|
|
408
|
+
"warpconvert",
|
|
409
|
+
"warpconvert_config_params",
|
|
410
|
+
"warpconvert_params",
|
|
411
|
+
]
|