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,425 @@
|
|
|
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
|
+
MRMETRIC_METADATA = Metadata(
|
|
9
|
+
id="68993bab707571cc9c043c8d06d2a16330445585.boutiques",
|
|
10
|
+
name="mrmetric",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
MrmetricConfigParameters = typing.TypedDict('MrmetricConfigParameters', {
|
|
17
|
+
"__STYX_TYPE__": typing.Literal["config"],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
MrmetricParameters = typing.TypedDict('MrmetricParameters', {
|
|
24
|
+
"__STYX_TYPE__": typing.Literal["mrmetric"],
|
|
25
|
+
"space": typing.NotRequired[str | None],
|
|
26
|
+
"interp": typing.NotRequired[str | None],
|
|
27
|
+
"metric": typing.NotRequired[str | None],
|
|
28
|
+
"mask1": typing.NotRequired[InputPathType | None],
|
|
29
|
+
"mask2": typing.NotRequired[InputPathType | None],
|
|
30
|
+
"nonormalisation": bool,
|
|
31
|
+
"overlap": bool,
|
|
32
|
+
"info": bool,
|
|
33
|
+
"quiet": bool,
|
|
34
|
+
"debug": bool,
|
|
35
|
+
"force": bool,
|
|
36
|
+
"nthreads": typing.NotRequired[int | None],
|
|
37
|
+
"config": typing.NotRequired[list[MrmetricConfigParameters] | None],
|
|
38
|
+
"help": bool,
|
|
39
|
+
"version": bool,
|
|
40
|
+
"image1": InputPathType,
|
|
41
|
+
"image2": InputPathType,
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def dyn_cargs(
|
|
46
|
+
t: str,
|
|
47
|
+
) -> typing.Any:
|
|
48
|
+
"""
|
|
49
|
+
Get build cargs function by command type.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
t: Command type.
|
|
53
|
+
Returns:
|
|
54
|
+
Build cargs function.
|
|
55
|
+
"""
|
|
56
|
+
return {
|
|
57
|
+
"mrmetric": mrmetric_cargs,
|
|
58
|
+
"config": mrmetric_config_cargs,
|
|
59
|
+
}.get(t)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def dyn_outputs(
|
|
63
|
+
t: str,
|
|
64
|
+
) -> typing.Any:
|
|
65
|
+
"""
|
|
66
|
+
Get build outputs function by command type.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
t: Command type.
|
|
70
|
+
Returns:
|
|
71
|
+
Build outputs function.
|
|
72
|
+
"""
|
|
73
|
+
return {
|
|
74
|
+
}.get(t)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def mrmetric_config_params(
|
|
78
|
+
key: str,
|
|
79
|
+
value: str,
|
|
80
|
+
) -> MrmetricConfigParameters:
|
|
81
|
+
"""
|
|
82
|
+
Build parameters.
|
|
83
|
+
|
|
84
|
+
Args:
|
|
85
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
86
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
87
|
+
Returns:
|
|
88
|
+
Parameter dictionary
|
|
89
|
+
"""
|
|
90
|
+
params = {
|
|
91
|
+
"__STYXTYPE__": "config",
|
|
92
|
+
"key": key,
|
|
93
|
+
"value": value,
|
|
94
|
+
}
|
|
95
|
+
return params
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
def mrmetric_config_cargs(
|
|
99
|
+
params: MrmetricConfigParameters,
|
|
100
|
+
execution: Execution,
|
|
101
|
+
) -> list[str]:
|
|
102
|
+
"""
|
|
103
|
+
Build command-line arguments from parameters.
|
|
104
|
+
|
|
105
|
+
Args:
|
|
106
|
+
params: The parameters.
|
|
107
|
+
execution: The execution object for resolving input paths.
|
|
108
|
+
Returns:
|
|
109
|
+
Command-line arguments.
|
|
110
|
+
"""
|
|
111
|
+
cargs = []
|
|
112
|
+
cargs.append("-config")
|
|
113
|
+
cargs.append(params.get("key"))
|
|
114
|
+
cargs.append(params.get("value"))
|
|
115
|
+
return cargs
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class MrmetricOutputs(typing.NamedTuple):
|
|
119
|
+
"""
|
|
120
|
+
Output object returned when calling `mrmetric(...)`.
|
|
121
|
+
"""
|
|
122
|
+
root: OutputPathType
|
|
123
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def mrmetric_params(
|
|
127
|
+
image1: InputPathType,
|
|
128
|
+
image2: InputPathType,
|
|
129
|
+
space: str | None = None,
|
|
130
|
+
interp: str | None = None,
|
|
131
|
+
metric: str | None = None,
|
|
132
|
+
mask1: InputPathType | None = None,
|
|
133
|
+
mask2: InputPathType | None = None,
|
|
134
|
+
nonormalisation: bool = False,
|
|
135
|
+
overlap: bool = False,
|
|
136
|
+
info: bool = False,
|
|
137
|
+
quiet: bool = False,
|
|
138
|
+
debug: bool = False,
|
|
139
|
+
force: bool = False,
|
|
140
|
+
nthreads: int | None = None,
|
|
141
|
+
config: list[MrmetricConfigParameters] | None = None,
|
|
142
|
+
help_: bool = False,
|
|
143
|
+
version: bool = False,
|
|
144
|
+
) -> MrmetricParameters:
|
|
145
|
+
"""
|
|
146
|
+
Build parameters.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
image1: the first input image.
|
|
150
|
+
image2: the second input image.
|
|
151
|
+
space: voxel (default): per voxel image1: scanner space of image 1\
|
|
152
|
+
image2: scanner space of image 2 average: scanner space of the average\
|
|
153
|
+
affine transformation of image 1 and 2.
|
|
154
|
+
interp: set the interpolation method to use when reslicing (choices:\
|
|
155
|
+
nearest, linear, cubic, sinc. Default: linear).
|
|
156
|
+
metric: define the dissimilarity metric used to calculate the cost.\
|
|
157
|
+
Choices: diff (squared differences), cc (non-normalised negative cross\
|
|
158
|
+
correlation aka negative cross covariance). Default: diff). cc is only\
|
|
159
|
+
implemented for -space average and -interp linear and cubic.
|
|
160
|
+
mask1: mask for image 1.
|
|
161
|
+
mask2: mask for image 2.
|
|
162
|
+
nonormalisation: do not normalise the dissimilarity metric to the\
|
|
163
|
+
number of voxels.
|
|
164
|
+
overlap: output number of voxels that were used.
|
|
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__": "mrmetric",
|
|
182
|
+
"nonormalisation": nonormalisation,
|
|
183
|
+
"overlap": overlap,
|
|
184
|
+
"info": info,
|
|
185
|
+
"quiet": quiet,
|
|
186
|
+
"debug": debug,
|
|
187
|
+
"force": force,
|
|
188
|
+
"help": help_,
|
|
189
|
+
"version": version,
|
|
190
|
+
"image1": image1,
|
|
191
|
+
"image2": image2,
|
|
192
|
+
}
|
|
193
|
+
if space is not None:
|
|
194
|
+
params["space"] = space
|
|
195
|
+
if interp is not None:
|
|
196
|
+
params["interp"] = interp
|
|
197
|
+
if metric is not None:
|
|
198
|
+
params["metric"] = metric
|
|
199
|
+
if mask1 is not None:
|
|
200
|
+
params["mask1"] = mask1
|
|
201
|
+
if mask2 is not None:
|
|
202
|
+
params["mask2"] = mask2
|
|
203
|
+
if nthreads is not None:
|
|
204
|
+
params["nthreads"] = nthreads
|
|
205
|
+
if config is not None:
|
|
206
|
+
params["config"] = config
|
|
207
|
+
return params
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def mrmetric_cargs(
|
|
211
|
+
params: MrmetricParameters,
|
|
212
|
+
execution: Execution,
|
|
213
|
+
) -> list[str]:
|
|
214
|
+
"""
|
|
215
|
+
Build command-line arguments from parameters.
|
|
216
|
+
|
|
217
|
+
Args:
|
|
218
|
+
params: The parameters.
|
|
219
|
+
execution: The execution object for resolving input paths.
|
|
220
|
+
Returns:
|
|
221
|
+
Command-line arguments.
|
|
222
|
+
"""
|
|
223
|
+
cargs = []
|
|
224
|
+
cargs.append("mrmetric")
|
|
225
|
+
if params.get("space") is not None:
|
|
226
|
+
cargs.extend([
|
|
227
|
+
"-space",
|
|
228
|
+
params.get("space")
|
|
229
|
+
])
|
|
230
|
+
if params.get("interp") is not None:
|
|
231
|
+
cargs.extend([
|
|
232
|
+
"-interp",
|
|
233
|
+
params.get("interp")
|
|
234
|
+
])
|
|
235
|
+
if params.get("metric") is not None:
|
|
236
|
+
cargs.extend([
|
|
237
|
+
"-metric",
|
|
238
|
+
params.get("metric")
|
|
239
|
+
])
|
|
240
|
+
if params.get("mask1") is not None:
|
|
241
|
+
cargs.extend([
|
|
242
|
+
"-mask1",
|
|
243
|
+
execution.input_file(params.get("mask1"))
|
|
244
|
+
])
|
|
245
|
+
if params.get("mask2") is not None:
|
|
246
|
+
cargs.extend([
|
|
247
|
+
"-mask2",
|
|
248
|
+
execution.input_file(params.get("mask2"))
|
|
249
|
+
])
|
|
250
|
+
if params.get("nonormalisation"):
|
|
251
|
+
cargs.append("-nonormalisation")
|
|
252
|
+
if params.get("overlap"):
|
|
253
|
+
cargs.append("-overlap")
|
|
254
|
+
if params.get("info"):
|
|
255
|
+
cargs.append("-info")
|
|
256
|
+
if params.get("quiet"):
|
|
257
|
+
cargs.append("-quiet")
|
|
258
|
+
if params.get("debug"):
|
|
259
|
+
cargs.append("-debug")
|
|
260
|
+
if params.get("force"):
|
|
261
|
+
cargs.append("-force")
|
|
262
|
+
if params.get("nthreads") is not None:
|
|
263
|
+
cargs.extend([
|
|
264
|
+
"-nthreads",
|
|
265
|
+
str(params.get("nthreads"))
|
|
266
|
+
])
|
|
267
|
+
if params.get("config") is not None:
|
|
268
|
+
cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
|
|
269
|
+
if params.get("help"):
|
|
270
|
+
cargs.append("-help")
|
|
271
|
+
if params.get("version"):
|
|
272
|
+
cargs.append("-version")
|
|
273
|
+
cargs.append(execution.input_file(params.get("image1")))
|
|
274
|
+
cargs.append(execution.input_file(params.get("image2")))
|
|
275
|
+
return cargs
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
def mrmetric_outputs(
|
|
279
|
+
params: MrmetricParameters,
|
|
280
|
+
execution: Execution,
|
|
281
|
+
) -> MrmetricOutputs:
|
|
282
|
+
"""
|
|
283
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
284
|
+
|
|
285
|
+
Args:
|
|
286
|
+
params: The parameters.
|
|
287
|
+
execution: The execution object for resolving input paths.
|
|
288
|
+
Returns:
|
|
289
|
+
Outputs object.
|
|
290
|
+
"""
|
|
291
|
+
ret = MrmetricOutputs(
|
|
292
|
+
root=execution.output_file("."),
|
|
293
|
+
)
|
|
294
|
+
return ret
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
def mrmetric_execute(
|
|
298
|
+
params: MrmetricParameters,
|
|
299
|
+
execution: Execution,
|
|
300
|
+
) -> MrmetricOutputs:
|
|
301
|
+
"""
|
|
302
|
+
Computes a dissimilarity metric between two images.
|
|
303
|
+
|
|
304
|
+
Currently only the mean squared difference is fully implemented.
|
|
305
|
+
|
|
306
|
+
References:
|
|
307
|
+
|
|
308
|
+
.
|
|
309
|
+
|
|
310
|
+
Author: MRTrix3 Developers
|
|
311
|
+
|
|
312
|
+
URL: https://www.mrtrix.org/
|
|
313
|
+
|
|
314
|
+
Args:
|
|
315
|
+
params: The parameters.
|
|
316
|
+
execution: The execution object.
|
|
317
|
+
Returns:
|
|
318
|
+
NamedTuple of outputs (described in `MrmetricOutputs`).
|
|
319
|
+
"""
|
|
320
|
+
params = execution.params(params)
|
|
321
|
+
cargs = mrmetric_cargs(params, execution)
|
|
322
|
+
ret = mrmetric_outputs(params, execution)
|
|
323
|
+
execution.run(cargs)
|
|
324
|
+
return ret
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
def mrmetric(
|
|
328
|
+
image1: InputPathType,
|
|
329
|
+
image2: InputPathType,
|
|
330
|
+
space: str | None = None,
|
|
331
|
+
interp: str | None = None,
|
|
332
|
+
metric: str | None = None,
|
|
333
|
+
mask1: InputPathType | None = None,
|
|
334
|
+
mask2: InputPathType | None = None,
|
|
335
|
+
nonormalisation: bool = False,
|
|
336
|
+
overlap: bool = False,
|
|
337
|
+
info: bool = False,
|
|
338
|
+
quiet: bool = False,
|
|
339
|
+
debug: bool = False,
|
|
340
|
+
force: bool = False,
|
|
341
|
+
nthreads: int | None = None,
|
|
342
|
+
config: list[MrmetricConfigParameters] | None = None,
|
|
343
|
+
help_: bool = False,
|
|
344
|
+
version: bool = False,
|
|
345
|
+
runner: Runner | None = None,
|
|
346
|
+
) -> MrmetricOutputs:
|
|
347
|
+
"""
|
|
348
|
+
Computes a dissimilarity metric between two images.
|
|
349
|
+
|
|
350
|
+
Currently only the mean squared difference is fully implemented.
|
|
351
|
+
|
|
352
|
+
References:
|
|
353
|
+
|
|
354
|
+
.
|
|
355
|
+
|
|
356
|
+
Author: MRTrix3 Developers
|
|
357
|
+
|
|
358
|
+
URL: https://www.mrtrix.org/
|
|
359
|
+
|
|
360
|
+
Args:
|
|
361
|
+
image1: the first input image.
|
|
362
|
+
image2: the second input image.
|
|
363
|
+
space: voxel (default): per voxel image1: scanner space of image 1\
|
|
364
|
+
image2: scanner space of image 2 average: scanner space of the average\
|
|
365
|
+
affine transformation of image 1 and 2.
|
|
366
|
+
interp: set the interpolation method to use when reslicing (choices:\
|
|
367
|
+
nearest, linear, cubic, sinc. Default: linear).
|
|
368
|
+
metric: define the dissimilarity metric used to calculate the cost.\
|
|
369
|
+
Choices: diff (squared differences), cc (non-normalised negative cross\
|
|
370
|
+
correlation aka negative cross covariance). Default: diff). cc is only\
|
|
371
|
+
implemented for -space average and -interp linear and cubic.
|
|
372
|
+
mask1: mask for image 1.
|
|
373
|
+
mask2: mask for image 2.
|
|
374
|
+
nonormalisation: do not normalise the dissimilarity metric to the\
|
|
375
|
+
number of voxels.
|
|
376
|
+
overlap: output number of voxels that were used.
|
|
377
|
+
info: display information messages.
|
|
378
|
+
quiet: do not display information messages or progress status;\
|
|
379
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
380
|
+
environment variable to a non-empty string.
|
|
381
|
+
debug: display debugging messages.
|
|
382
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
383
|
+
input and output might cause unexpected behaviour).
|
|
384
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
385
|
+
(set to 0 to disable multi-threading).
|
|
386
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
387
|
+
help_: display this information page and exit.
|
|
388
|
+
version: display version information and exit.
|
|
389
|
+
runner: Command runner.
|
|
390
|
+
Returns:
|
|
391
|
+
NamedTuple of outputs (described in `MrmetricOutputs`).
|
|
392
|
+
"""
|
|
393
|
+
runner = runner or get_global_runner()
|
|
394
|
+
execution = runner.start_execution(MRMETRIC_METADATA)
|
|
395
|
+
params = mrmetric_params(
|
|
396
|
+
space=space,
|
|
397
|
+
interp=interp,
|
|
398
|
+
metric=metric,
|
|
399
|
+
mask1=mask1,
|
|
400
|
+
mask2=mask2,
|
|
401
|
+
nonormalisation=nonormalisation,
|
|
402
|
+
overlap=overlap,
|
|
403
|
+
info=info,
|
|
404
|
+
quiet=quiet,
|
|
405
|
+
debug=debug,
|
|
406
|
+
force=force,
|
|
407
|
+
nthreads=nthreads,
|
|
408
|
+
config=config,
|
|
409
|
+
help_=help_,
|
|
410
|
+
version=version,
|
|
411
|
+
image1=image1,
|
|
412
|
+
image2=image2,
|
|
413
|
+
)
|
|
414
|
+
return mrmetric_execute(params, execution)
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
__all__ = [
|
|
418
|
+
"MRMETRIC_METADATA",
|
|
419
|
+
"MrmetricConfigParameters",
|
|
420
|
+
"MrmetricOutputs",
|
|
421
|
+
"MrmetricParameters",
|
|
422
|
+
"mrmetric",
|
|
423
|
+
"mrmetric_config_params",
|
|
424
|
+
"mrmetric_params",
|
|
425
|
+
]
|