niwrap-mrtrix 0.6.2__py3-none-any.whl → 0.7.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 +133 -0
- niwrap_mrtrix/mrtrix/afdconnectivity.py +59 -68
- niwrap_mrtrix/mrtrix/amp2response.py +72 -77
- niwrap_mrtrix/mrtrix/amp2sh.py +109 -74
- niwrap_mrtrix/mrtrix/connectome2tck.py +77 -79
- niwrap_mrtrix/mrtrix/connectomeedit.py +52 -62
- niwrap_mrtrix/mrtrix/connectomestats.py +117 -104
- niwrap_mrtrix/mrtrix/dcmedit.py +68 -73
- niwrap_mrtrix/mrtrix/dcminfo.py +67 -72
- niwrap_mrtrix/mrtrix/dirflip.py +56 -66
- niwrap_mrtrix/mrtrix/dirgen.py +68 -75
- niwrap_mrtrix/mrtrix/dirmerge.py +56 -66
- niwrap_mrtrix/mrtrix/dirorder.py +53 -64
- niwrap_mrtrix/mrtrix/dirsplit.py +56 -66
- niwrap_mrtrix/mrtrix/dirstat.py +70 -75
- niwrap_mrtrix/mrtrix/dwi2adc.py +67 -74
- niwrap_mrtrix/mrtrix/dwi2fod.py +141 -96
- niwrap_mrtrix/mrtrix/dwi2mask.py +70 -76
- niwrap_mrtrix/mrtrix/dwi2response.py +238 -157
- niwrap_mrtrix/mrtrix/dwi2tensor.py +87 -88
- niwrap_mrtrix/mrtrix/dwibiascorrect.py +97 -95
- niwrap_mrtrix/mrtrix/dwidenoise.py +67 -74
- niwrap_mrtrix/mrtrix/dwiextract.py +143 -99
- niwrap_mrtrix/mrtrix/dwigradcheck.py +89 -91
- niwrap_mrtrix/mrtrix/fixel2peaks.py +77 -51
- niwrap_mrtrix/mrtrix/fixel2sh.py +54 -65
- niwrap_mrtrix/mrtrix/fixel2tsf.py +56 -66
- niwrap_mrtrix/mrtrix/fixel2voxel.py +62 -70
- niwrap_mrtrix/mrtrix/fixelcfestats.py +145 -93
- niwrap_mrtrix/mrtrix/fixelconnectivity.py +62 -70
- niwrap_mrtrix/mrtrix/fixelconvert.py +136 -69
- niwrap_mrtrix/mrtrix/fixelcorrespondence.py +61 -69
- niwrap_mrtrix/mrtrix/fixelcrop.py +53 -64
- niwrap_mrtrix/mrtrix/fixelfilter.py +139 -71
- niwrap_mrtrix/mrtrix/fixelreorient.py +53 -64
- niwrap_mrtrix/mrtrix/fod2dec.py +70 -75
- niwrap_mrtrix/mrtrix/fod2fixel.py +84 -85
- niwrap_mrtrix/mrtrix/label2colour.py +58 -67
- niwrap_mrtrix/mrtrix/label2mesh.py +53 -64
- niwrap_mrtrix/mrtrix/labelconvert.py +58 -67
- niwrap_mrtrix/mrtrix/labelstats.py +53 -63
- niwrap_mrtrix/mrtrix/maskdump.py +52 -64
- niwrap_mrtrix/mrtrix/maskfilter.py +93 -61
- niwrap_mrtrix/mrtrix/mesh2voxel.py +53 -64
- niwrap_mrtrix/mrtrix/meshconvert.py +66 -73
- niwrap_mrtrix/mrtrix/meshfilter.py +59 -68
- niwrap_mrtrix/mrtrix/mraverageheader.py +62 -70
- niwrap_mrtrix/mrtrix/mrcalc.py +522 -397
- niwrap_mrtrix/mrtrix/mrcat.py +59 -68
- niwrap_mrtrix/mrtrix/mrcentroid.py +53 -63
- niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +58 -67
- niwrap_mrtrix/mrtrix/mrclusterstats.py +119 -105
- niwrap_mrtrix/mrtrix/mrcolour.py +62 -70
- niwrap_mrtrix/mrtrix/mrconvert.py +275 -173
- niwrap_mrtrix/mrtrix/mrdegibbs.py +66 -73
- niwrap_mrtrix/mrtrix/mrdump.py +55 -66
- niwrap_mrtrix/mrtrix/mredit.py +97 -94
- niwrap_mrtrix/mrtrix/mrfilter.py +124 -81
- niwrap_mrtrix/mrtrix/mrgrid.py +131 -88
- niwrap_mrtrix/mrtrix/mrhistmatch.py +64 -71
- niwrap_mrtrix/mrtrix/mrhistogram.py +64 -71
- niwrap_mrtrix/mrtrix/mrinfo.py +160 -137
- niwrap_mrtrix/mrtrix/mrmath.py +65 -73
- niwrap_mrtrix/mrtrix/mrmetric.py +69 -73
- niwrap_mrtrix/mrtrix/mrregister.py +263 -212
- niwrap_mrtrix/mrtrix/mrstats.py +66 -72
- niwrap_mrtrix/mrtrix/mrthreshold.py +80 -81
- niwrap_mrtrix/mrtrix/mrtransform.py +162 -109
- niwrap_mrtrix/mrtrix/mtnormalise.py +85 -88
- niwrap_mrtrix/mrtrix/peaks2amp.py +51 -63
- niwrap_mrtrix/mrtrix/peaks2fixel.py +54 -65
- niwrap_mrtrix/mrtrix/responsemean.py +51 -62
- niwrap_mrtrix/mrtrix/sh2amp.py +98 -65
- niwrap_mrtrix/mrtrix/sh2peaks.py +81 -83
- niwrap_mrtrix/mrtrix/sh2power.py +53 -64
- niwrap_mrtrix/mrtrix/sh2response.py +62 -70
- niwrap_mrtrix/mrtrix/shbasis.py +51 -62
- niwrap_mrtrix/mrtrix/shconv.py +78 -52
- niwrap_mrtrix/mrtrix/tck2connectome.py +93 -88
- niwrap_mrtrix/mrtrix/tck2fixel.py +57 -65
- niwrap_mrtrix/mrtrix/tckconvert.py +99 -65
- niwrap_mrtrix/mrtrix/tckdfc.py +82 -83
- niwrap_mrtrix/mrtrix/tckedit.py +240 -122
- niwrap_mrtrix/mrtrix/tckgen.py +364 -207
- niwrap_mrtrix/mrtrix/tckglobal.py +127 -115
- niwrap_mrtrix/mrtrix/tckinfo.py +50 -61
- niwrap_mrtrix/mrtrix/tckmap.py +121 -79
- niwrap_mrtrix/mrtrix/tckresample.py +97 -93
- niwrap_mrtrix/mrtrix/tcksample.py +62 -69
- niwrap_mrtrix/mrtrix/tcksift.py +102 -97
- niwrap_mrtrix/mrtrix/tcksift2.py +119 -107
- niwrap_mrtrix/mrtrix/tckstats.py +72 -78
- niwrap_mrtrix/mrtrix/tcktransform.py +53 -64
- niwrap_mrtrix/mrtrix/tensor2metric.py +93 -94
- niwrap_mrtrix/mrtrix/transformcalc.py +53 -64
- niwrap_mrtrix/mrtrix/transformcompose.py +74 -48
- niwrap_mrtrix/mrtrix/transformconvert.py +53 -64
- niwrap_mrtrix/mrtrix/tsfdivide.py +53 -64
- niwrap_mrtrix/mrtrix/tsfinfo.py +53 -63
- niwrap_mrtrix/mrtrix/tsfmult.py +51 -63
- niwrap_mrtrix/mrtrix/tsfsmooth.py +54 -65
- niwrap_mrtrix/mrtrix/tsfthreshold.py +55 -65
- niwrap_mrtrix/mrtrix/tsfvalidate.py +50 -61
- niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +54 -65
- niwrap_mrtrix/mrtrix/v_5tt2vis.py +69 -75
- niwrap_mrtrix/mrtrix/v_5ttcheck.py +51 -62
- niwrap_mrtrix/mrtrix/v_5ttedit.py +73 -79
- niwrap_mrtrix/mrtrix/v_5ttgen.py +132 -86
- niwrap_mrtrix/mrtrix/vectorstats.py +92 -88
- niwrap_mrtrix/mrtrix/voxel2fixel.py +54 -63
- niwrap_mrtrix/mrtrix/voxel2mesh.py +56 -66
- niwrap_mrtrix/mrtrix/warp2metric.py +71 -77
- niwrap_mrtrix/mrtrix/warpconvert.py +61 -69
- niwrap_mrtrix/mrtrix/warpcorrect.py +61 -71
- niwrap_mrtrix/mrtrix/warpinit.py +51 -63
- niwrap_mrtrix/mrtrix/warpinvert.py +56 -66
- niwrap_mrtrix-0.7.0.dist-info/METADATA +8 -0
- niwrap_mrtrix-0.7.0.dist-info/RECORD +119 -0
- niwrap_mrtrix-0.7.0.dist-info/WHEEL +4 -0
- niwrap_mrtrix-0.6.2.dist-info/METADATA +0 -8
- niwrap_mrtrix-0.6.2.dist-info/RECORD +0 -119
- niwrap_mrtrix-0.6.2.dist-info/WHEEL +0 -4
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
VOXEL2MESH_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="85ff2c9f04efcbe2d5484d2e2ccd18c1577521ed.boutiques",
|
|
10
10
|
name="voxel2mesh",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,34 @@ VOXEL2MESH_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Voxel2meshConfigParameters = typing.TypedDict('Voxel2meshConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
Voxel2meshConfigParametersTagged = typing.TypedDict('Voxel2meshConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
Voxel2meshParameters = typing.TypedDict('Voxel2meshParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/voxel2mesh"]],
|
|
30
|
+
"blocky": bool,
|
|
31
|
+
"threshold": typing.NotRequired[float | None],
|
|
32
|
+
"info": bool,
|
|
33
|
+
"quiet": bool,
|
|
34
|
+
"debug": bool,
|
|
35
|
+
"force": bool,
|
|
36
|
+
"nthreads": typing.NotRequired[int | None],
|
|
37
|
+
"config": typing.NotRequired[list[Voxel2meshConfigParameters] | None],
|
|
38
|
+
"help": bool,
|
|
39
|
+
"version": bool,
|
|
40
|
+
"input": InputPathType,
|
|
41
|
+
"output": str,
|
|
42
|
+
})
|
|
43
|
+
Voxel2meshParametersTagged = typing.TypedDict('Voxel2meshParametersTagged', {
|
|
44
|
+
"@type": typing.Literal["mrtrix/voxel2mesh"],
|
|
25
45
|
"blocky": bool,
|
|
26
46
|
"threshold": typing.NotRequired[float | None],
|
|
27
47
|
"info": bool,
|
|
@@ -35,45 +55,12 @@ Voxel2meshParameters = typing.TypedDict('Voxel2meshParameters', {
|
|
|
35
55
|
"input": InputPathType,
|
|
36
56
|
"output": str,
|
|
37
57
|
})
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def dyn_cargs(
|
|
41
|
-
t: str,
|
|
42
|
-
) -> typing.Any:
|
|
43
|
-
"""
|
|
44
|
-
Get build cargs function by command type.
|
|
45
|
-
|
|
46
|
-
Args:
|
|
47
|
-
t: Command type.
|
|
48
|
-
Returns:
|
|
49
|
-
Build cargs function.
|
|
50
|
-
"""
|
|
51
|
-
return {
|
|
52
|
-
"voxel2mesh": voxel2mesh_cargs,
|
|
53
|
-
"config": voxel2mesh_config_cargs,
|
|
54
|
-
}.get(t)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def dyn_outputs(
|
|
58
|
-
t: str,
|
|
59
|
-
) -> typing.Any:
|
|
60
|
-
"""
|
|
61
|
-
Get build outputs function by command type.
|
|
62
|
-
|
|
63
|
-
Args:
|
|
64
|
-
t: Command type.
|
|
65
|
-
Returns:
|
|
66
|
-
Build outputs function.
|
|
67
|
-
"""
|
|
68
|
-
return {
|
|
69
|
-
"voxel2mesh": voxel2mesh_outputs,
|
|
70
|
-
}.get(t)
|
|
71
58
|
|
|
72
59
|
|
|
73
60
|
def voxel2mesh_config_params(
|
|
74
61
|
key: str,
|
|
75
62
|
value: str,
|
|
76
|
-
) ->
|
|
63
|
+
) -> Voxel2meshConfigParametersTagged:
|
|
77
64
|
"""
|
|
78
65
|
Build parameters.
|
|
79
66
|
|
|
@@ -84,7 +71,7 @@ def voxel2mesh_config_params(
|
|
|
84
71
|
Parameter dictionary
|
|
85
72
|
"""
|
|
86
73
|
params = {
|
|
87
|
-
"
|
|
74
|
+
"@type": "config",
|
|
88
75
|
"key": key,
|
|
89
76
|
"value": value,
|
|
90
77
|
}
|
|
@@ -106,14 +93,14 @@ def voxel2mesh_config_cargs(
|
|
|
106
93
|
"""
|
|
107
94
|
cargs = []
|
|
108
95
|
cargs.append("-config")
|
|
109
|
-
cargs.append(params.get("key"))
|
|
110
|
-
cargs.append(params.get("value"))
|
|
96
|
+
cargs.append(params.get("key", None))
|
|
97
|
+
cargs.append(params.get("value", None))
|
|
111
98
|
return cargs
|
|
112
99
|
|
|
113
100
|
|
|
114
101
|
class Voxel2meshOutputs(typing.NamedTuple):
|
|
115
102
|
"""
|
|
116
|
-
Output object returned when calling `
|
|
103
|
+
Output object returned when calling `Voxel2meshParameters(...)`.
|
|
117
104
|
"""
|
|
118
105
|
root: OutputPathType
|
|
119
106
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -134,7 +121,7 @@ def voxel2mesh_params(
|
|
|
134
121
|
config: list[Voxel2meshConfigParameters] | None = None,
|
|
135
122
|
help_: bool = False,
|
|
136
123
|
version: bool = False,
|
|
137
|
-
) ->
|
|
124
|
+
) -> Voxel2meshParametersTagged:
|
|
138
125
|
"""
|
|
139
126
|
Build parameters.
|
|
140
127
|
|
|
@@ -161,7 +148,7 @@ def voxel2mesh_params(
|
|
|
161
148
|
Parameter dictionary
|
|
162
149
|
"""
|
|
163
150
|
params = {
|
|
164
|
-
"
|
|
151
|
+
"@type": "mrtrix/voxel2mesh",
|
|
165
152
|
"blocky": blocky,
|
|
166
153
|
"info": info,
|
|
167
154
|
"quiet": quiet,
|
|
@@ -196,34 +183,34 @@ def voxel2mesh_cargs(
|
|
|
196
183
|
"""
|
|
197
184
|
cargs = []
|
|
198
185
|
cargs.append("voxel2mesh")
|
|
199
|
-
if params.get("blocky"):
|
|
186
|
+
if params.get("blocky", False):
|
|
200
187
|
cargs.append("-blocky")
|
|
201
|
-
if params.get("threshold") is not None:
|
|
188
|
+
if params.get("threshold", None) is not None:
|
|
202
189
|
cargs.extend([
|
|
203
190
|
"-threshold",
|
|
204
|
-
str(params.get("threshold"))
|
|
191
|
+
str(params.get("threshold", None))
|
|
205
192
|
])
|
|
206
|
-
if params.get("info"):
|
|
193
|
+
if params.get("info", False):
|
|
207
194
|
cargs.append("-info")
|
|
208
|
-
if params.get("quiet"):
|
|
195
|
+
if params.get("quiet", False):
|
|
209
196
|
cargs.append("-quiet")
|
|
210
|
-
if params.get("debug"):
|
|
197
|
+
if params.get("debug", False):
|
|
211
198
|
cargs.append("-debug")
|
|
212
|
-
if params.get("force"):
|
|
199
|
+
if params.get("force", False):
|
|
213
200
|
cargs.append("-force")
|
|
214
|
-
if params.get("nthreads") is not None:
|
|
201
|
+
if params.get("nthreads", None) is not None:
|
|
215
202
|
cargs.extend([
|
|
216
203
|
"-nthreads",
|
|
217
|
-
str(params.get("nthreads"))
|
|
204
|
+
str(params.get("nthreads", None))
|
|
218
205
|
])
|
|
219
|
-
if params.get("config") is not None:
|
|
220
|
-
cargs.extend([a for c in [
|
|
221
|
-
if params.get("help"):
|
|
206
|
+
if params.get("config", None) is not None:
|
|
207
|
+
cargs.extend([a for c in [voxel2mesh_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
208
|
+
if params.get("help", False):
|
|
222
209
|
cargs.append("-help")
|
|
223
|
-
if params.get("version"):
|
|
210
|
+
if params.get("version", False):
|
|
224
211
|
cargs.append("-version")
|
|
225
|
-
cargs.append(execution.input_file(params.get("input")))
|
|
226
|
-
cargs.append(params.get("output"))
|
|
212
|
+
cargs.append(execution.input_file(params.get("input", None)))
|
|
213
|
+
cargs.append(params.get("output", None))
|
|
227
214
|
return cargs
|
|
228
215
|
|
|
229
216
|
|
|
@@ -242,16 +229,18 @@ def voxel2mesh_outputs(
|
|
|
242
229
|
"""
|
|
243
230
|
ret = Voxel2meshOutputs(
|
|
244
231
|
root=execution.output_file("."),
|
|
245
|
-
output=execution.output_file(params.get("output")),
|
|
232
|
+
output=execution.output_file(params.get("output", None)),
|
|
246
233
|
)
|
|
247
234
|
return ret
|
|
248
235
|
|
|
249
236
|
|
|
250
237
|
def voxel2mesh_execute(
|
|
251
238
|
params: Voxel2meshParameters,
|
|
252
|
-
|
|
239
|
+
runner: Runner | None = None,
|
|
253
240
|
) -> Voxel2meshOutputs:
|
|
254
241
|
"""
|
|
242
|
+
voxel2mesh
|
|
243
|
+
|
|
255
244
|
Generate a surface mesh representation from a voxel image.
|
|
256
245
|
|
|
257
246
|
This command utilises the Marching Cubes algorithm to generate a polygonal
|
|
@@ -275,10 +264,12 @@ def voxel2mesh_execute(
|
|
|
275
264
|
|
|
276
265
|
Args:
|
|
277
266
|
params: The parameters.
|
|
278
|
-
|
|
267
|
+
runner: Command runner.
|
|
279
268
|
Returns:
|
|
280
269
|
NamedTuple of outputs (described in `Voxel2meshOutputs`).
|
|
281
270
|
"""
|
|
271
|
+
runner = runner or get_global_runner()
|
|
272
|
+
execution = runner.start_execution(VOXEL2MESH_METADATA)
|
|
282
273
|
params = execution.params(params)
|
|
283
274
|
cargs = voxel2mesh_cargs(params, execution)
|
|
284
275
|
ret = voxel2mesh_outputs(params, execution)
|
|
@@ -302,6 +293,8 @@ def voxel2mesh(
|
|
|
302
293
|
runner: Runner | None = None,
|
|
303
294
|
) -> Voxel2meshOutputs:
|
|
304
295
|
"""
|
|
296
|
+
voxel2mesh
|
|
297
|
+
|
|
305
298
|
Generate a surface mesh representation from a voxel image.
|
|
306
299
|
|
|
307
300
|
This command utilises the Marching Cubes algorithm to generate a polygonal
|
|
@@ -346,8 +339,6 @@ def voxel2mesh(
|
|
|
346
339
|
Returns:
|
|
347
340
|
NamedTuple of outputs (described in `Voxel2meshOutputs`).
|
|
348
341
|
"""
|
|
349
|
-
runner = runner or get_global_runner()
|
|
350
|
-
execution = runner.start_execution(VOXEL2MESH_METADATA)
|
|
351
342
|
params = voxel2mesh_params(
|
|
352
343
|
blocky=blocky,
|
|
353
344
|
threshold=threshold,
|
|
@@ -362,15 +353,14 @@ def voxel2mesh(
|
|
|
362
353
|
input_=input_,
|
|
363
354
|
output=output,
|
|
364
355
|
)
|
|
365
|
-
return voxel2mesh_execute(params,
|
|
356
|
+
return voxel2mesh_execute(params, runner)
|
|
366
357
|
|
|
367
358
|
|
|
368
359
|
__all__ = [
|
|
369
360
|
"VOXEL2MESH_METADATA",
|
|
370
|
-
"Voxel2meshConfigParameters",
|
|
371
361
|
"Voxel2meshOutputs",
|
|
372
|
-
"Voxel2meshParameters",
|
|
373
362
|
"voxel2mesh",
|
|
374
363
|
"voxel2mesh_config_params",
|
|
364
|
+
"voxel2mesh_execute",
|
|
375
365
|
"voxel2mesh_params",
|
|
376
366
|
]
|
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
WARP2METRIC_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="6239916d39fe990e43c4b408dab7798207712e0c.boutiques",
|
|
10
10
|
name="warp2metric",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,7 +14,13 @@ WARP2METRIC_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Warp2metricFcParameters = typing.TypedDict('Warp2metricFcParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["fc"]],
|
|
18
|
+
"template_fixel_directory": InputPathType,
|
|
19
|
+
"output_fixel_directory": str,
|
|
20
|
+
"output_fixel_data": str,
|
|
21
|
+
})
|
|
22
|
+
Warp2metricFcParametersTagged = typing.TypedDict('Warp2metricFcParametersTagged', {
|
|
23
|
+
"@type": typing.Literal["fc"],
|
|
18
24
|
"template_fixel_directory": InputPathType,
|
|
19
25
|
"output_fixel_directory": str,
|
|
20
26
|
"output_fixel_data": str,
|
|
@@ -22,14 +28,34 @@ Warp2metricFcParameters = typing.TypedDict('Warp2metricFcParameters', {
|
|
|
22
28
|
|
|
23
29
|
|
|
24
30
|
Warp2metricConfigParameters = typing.TypedDict('Warp2metricConfigParameters', {
|
|
25
|
-
"
|
|
31
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
32
|
+
"key": str,
|
|
33
|
+
"value": str,
|
|
34
|
+
})
|
|
35
|
+
Warp2metricConfigParametersTagged = typing.TypedDict('Warp2metricConfigParametersTagged', {
|
|
36
|
+
"@type": typing.Literal["config"],
|
|
26
37
|
"key": str,
|
|
27
38
|
"value": str,
|
|
28
39
|
})
|
|
29
40
|
|
|
30
41
|
|
|
31
42
|
Warp2metricParameters = typing.TypedDict('Warp2metricParameters', {
|
|
32
|
-
"
|
|
43
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/warp2metric"]],
|
|
44
|
+
"fc": typing.NotRequired[Warp2metricFcParameters | None],
|
|
45
|
+
"jmat": typing.NotRequired[str | None],
|
|
46
|
+
"jdet": typing.NotRequired[str | None],
|
|
47
|
+
"info": bool,
|
|
48
|
+
"quiet": bool,
|
|
49
|
+
"debug": bool,
|
|
50
|
+
"force": bool,
|
|
51
|
+
"nthreads": typing.NotRequired[int | None],
|
|
52
|
+
"config": typing.NotRequired[list[Warp2metricConfigParameters] | None],
|
|
53
|
+
"help": bool,
|
|
54
|
+
"version": bool,
|
|
55
|
+
"in": InputPathType,
|
|
56
|
+
})
|
|
57
|
+
Warp2metricParametersTagged = typing.TypedDict('Warp2metricParametersTagged', {
|
|
58
|
+
"@type": typing.Literal["mrtrix/warp2metric"],
|
|
33
59
|
"fc": typing.NotRequired[Warp2metricFcParameters | None],
|
|
34
60
|
"jmat": typing.NotRequired[str | None],
|
|
35
61
|
"jdet": typing.NotRequired[str | None],
|
|
@@ -43,47 +69,13 @@ Warp2metricParameters = typing.TypedDict('Warp2metricParameters', {
|
|
|
43
69
|
"version": bool,
|
|
44
70
|
"in": InputPathType,
|
|
45
71
|
})
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def dyn_cargs(
|
|
49
|
-
t: str,
|
|
50
|
-
) -> typing.Any:
|
|
51
|
-
"""
|
|
52
|
-
Get build cargs function by command type.
|
|
53
|
-
|
|
54
|
-
Args:
|
|
55
|
-
t: Command type.
|
|
56
|
-
Returns:
|
|
57
|
-
Build cargs function.
|
|
58
|
-
"""
|
|
59
|
-
return {
|
|
60
|
-
"warp2metric": warp2metric_cargs,
|
|
61
|
-
"fc": warp2metric_fc_cargs,
|
|
62
|
-
"config": warp2metric_config_cargs,
|
|
63
|
-
}.get(t)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
def dyn_outputs(
|
|
67
|
-
t: str,
|
|
68
|
-
) -> typing.Any:
|
|
69
|
-
"""
|
|
70
|
-
Get build outputs function by command type.
|
|
71
|
-
|
|
72
|
-
Args:
|
|
73
|
-
t: Command type.
|
|
74
|
-
Returns:
|
|
75
|
-
Build outputs function.
|
|
76
|
-
"""
|
|
77
|
-
return {
|
|
78
|
-
"warp2metric": warp2metric_outputs,
|
|
79
|
-
}.get(t)
|
|
80
72
|
|
|
81
73
|
|
|
82
74
|
def warp2metric_fc_params(
|
|
83
75
|
template_fixel_directory: InputPathType,
|
|
84
76
|
output_fixel_directory: str,
|
|
85
77
|
output_fixel_data: str,
|
|
86
|
-
) ->
|
|
78
|
+
) -> Warp2metricFcParametersTagged:
|
|
87
79
|
"""
|
|
88
80
|
Build parameters.
|
|
89
81
|
|
|
@@ -107,7 +99,7 @@ def warp2metric_fc_params(
|
|
|
107
99
|
Parameter dictionary
|
|
108
100
|
"""
|
|
109
101
|
params = {
|
|
110
|
-
"
|
|
102
|
+
"@type": "fc",
|
|
111
103
|
"template_fixel_directory": template_fixel_directory,
|
|
112
104
|
"output_fixel_directory": output_fixel_directory,
|
|
113
105
|
"output_fixel_data": output_fixel_data,
|
|
@@ -130,16 +122,16 @@ def warp2metric_fc_cargs(
|
|
|
130
122
|
"""
|
|
131
123
|
cargs = []
|
|
132
124
|
cargs.append("-fc")
|
|
133
|
-
cargs.append(execution.input_file(params.get("template_fixel_directory")))
|
|
134
|
-
cargs.append(params.get("output_fixel_directory"))
|
|
135
|
-
cargs.append(params.get("output_fixel_data"))
|
|
125
|
+
cargs.append(execution.input_file(params.get("template_fixel_directory", None)))
|
|
126
|
+
cargs.append(params.get("output_fixel_directory", None))
|
|
127
|
+
cargs.append(params.get("output_fixel_data", None))
|
|
136
128
|
return cargs
|
|
137
129
|
|
|
138
130
|
|
|
139
131
|
def warp2metric_config_params(
|
|
140
132
|
key: str,
|
|
141
133
|
value: str,
|
|
142
|
-
) ->
|
|
134
|
+
) -> Warp2metricConfigParametersTagged:
|
|
143
135
|
"""
|
|
144
136
|
Build parameters.
|
|
145
137
|
|
|
@@ -150,7 +142,7 @@ def warp2metric_config_params(
|
|
|
150
142
|
Parameter dictionary
|
|
151
143
|
"""
|
|
152
144
|
params = {
|
|
153
|
-
"
|
|
145
|
+
"@type": "config",
|
|
154
146
|
"key": key,
|
|
155
147
|
"value": value,
|
|
156
148
|
}
|
|
@@ -172,14 +164,14 @@ def warp2metric_config_cargs(
|
|
|
172
164
|
"""
|
|
173
165
|
cargs = []
|
|
174
166
|
cargs.append("-config")
|
|
175
|
-
cargs.append(params.get("key"))
|
|
176
|
-
cargs.append(params.get("value"))
|
|
167
|
+
cargs.append(params.get("key", None))
|
|
168
|
+
cargs.append(params.get("value", None))
|
|
177
169
|
return cargs
|
|
178
170
|
|
|
179
171
|
|
|
180
172
|
class Warp2metricOutputs(typing.NamedTuple):
|
|
181
173
|
"""
|
|
182
|
-
Output object returned when calling `
|
|
174
|
+
Output object returned when calling `Warp2metricParameters(...)`.
|
|
183
175
|
"""
|
|
184
176
|
root: OutputPathType
|
|
185
177
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -204,7 +196,7 @@ def warp2metric_params(
|
|
|
204
196
|
config: list[Warp2metricConfigParameters] | None = None,
|
|
205
197
|
help_: bool = False,
|
|
206
198
|
version: bool = False,
|
|
207
|
-
) ->
|
|
199
|
+
) -> Warp2metricParametersTagged:
|
|
208
200
|
"""
|
|
209
201
|
Build parameters.
|
|
210
202
|
|
|
@@ -234,7 +226,7 @@ def warp2metric_params(
|
|
|
234
226
|
Parameter dictionary
|
|
235
227
|
"""
|
|
236
228
|
params = {
|
|
237
|
-
"
|
|
229
|
+
"@type": "mrtrix/warp2metric",
|
|
238
230
|
"info": info,
|
|
239
231
|
"quiet": quiet,
|
|
240
232
|
"debug": debug,
|
|
@@ -271,38 +263,38 @@ def warp2metric_cargs(
|
|
|
271
263
|
"""
|
|
272
264
|
cargs = []
|
|
273
265
|
cargs.append("warp2metric")
|
|
274
|
-
if params.get("fc") is not None:
|
|
275
|
-
cargs.extend(
|
|
276
|
-
if params.get("jmat") is not None:
|
|
266
|
+
if params.get("fc", None) is not None:
|
|
267
|
+
cargs.extend(warp2metric_fc_cargs(params.get("fc", None), execution))
|
|
268
|
+
if params.get("jmat", None) is not None:
|
|
277
269
|
cargs.extend([
|
|
278
270
|
"-jmat",
|
|
279
|
-
params.get("jmat")
|
|
271
|
+
params.get("jmat", None)
|
|
280
272
|
])
|
|
281
|
-
if params.get("jdet") is not None:
|
|
273
|
+
if params.get("jdet", None) is not None:
|
|
282
274
|
cargs.extend([
|
|
283
275
|
"-jdet",
|
|
284
|
-
params.get("jdet")
|
|
276
|
+
params.get("jdet", None)
|
|
285
277
|
])
|
|
286
|
-
if params.get("info"):
|
|
278
|
+
if params.get("info", False):
|
|
287
279
|
cargs.append("-info")
|
|
288
|
-
if params.get("quiet"):
|
|
280
|
+
if params.get("quiet", False):
|
|
289
281
|
cargs.append("-quiet")
|
|
290
|
-
if params.get("debug"):
|
|
282
|
+
if params.get("debug", False):
|
|
291
283
|
cargs.append("-debug")
|
|
292
|
-
if params.get("force"):
|
|
284
|
+
if params.get("force", False):
|
|
293
285
|
cargs.append("-force")
|
|
294
|
-
if params.get("nthreads") is not None:
|
|
286
|
+
if params.get("nthreads", None) is not None:
|
|
295
287
|
cargs.extend([
|
|
296
288
|
"-nthreads",
|
|
297
|
-
str(params.get("nthreads"))
|
|
289
|
+
str(params.get("nthreads", None))
|
|
298
290
|
])
|
|
299
|
-
if params.get("config") is not None:
|
|
300
|
-
cargs.extend([a for c in [
|
|
301
|
-
if params.get("help"):
|
|
291
|
+
if params.get("config", None) is not None:
|
|
292
|
+
cargs.extend([a for c in [warp2metric_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
293
|
+
if params.get("help", False):
|
|
302
294
|
cargs.append("-help")
|
|
303
|
-
if params.get("version"):
|
|
295
|
+
if params.get("version", False):
|
|
304
296
|
cargs.append("-version")
|
|
305
|
-
cargs.append(execution.input_file(params.get("in")))
|
|
297
|
+
cargs.append(execution.input_file(params.get("in", None)))
|
|
306
298
|
return cargs
|
|
307
299
|
|
|
308
300
|
|
|
@@ -321,17 +313,19 @@ def warp2metric_outputs(
|
|
|
321
313
|
"""
|
|
322
314
|
ret = Warp2metricOutputs(
|
|
323
315
|
root=execution.output_file("."),
|
|
324
|
-
jmat=execution.output_file(params.get("jmat")) if (params.get("jmat") is not None) else None,
|
|
325
|
-
jdet=execution.output_file(params.get("jdet")) if (params.get("jdet") is not None) else None,
|
|
316
|
+
jmat=execution.output_file(params.get("jmat", None)) if (params.get("jmat") is not None) else None,
|
|
317
|
+
jdet=execution.output_file(params.get("jdet", None)) if (params.get("jdet") is not None) else None,
|
|
326
318
|
)
|
|
327
319
|
return ret
|
|
328
320
|
|
|
329
321
|
|
|
330
322
|
def warp2metric_execute(
|
|
331
323
|
params: Warp2metricParameters,
|
|
332
|
-
|
|
324
|
+
runner: Runner | None = None,
|
|
333
325
|
) -> Warp2metricOutputs:
|
|
334
326
|
"""
|
|
327
|
+
warp2metric
|
|
328
|
+
|
|
335
329
|
Compute fixel-wise or voxel-wise metrics from a 4D deformation field.
|
|
336
330
|
|
|
337
331
|
|
|
@@ -349,10 +343,12 @@ def warp2metric_execute(
|
|
|
349
343
|
|
|
350
344
|
Args:
|
|
351
345
|
params: The parameters.
|
|
352
|
-
|
|
346
|
+
runner: Command runner.
|
|
353
347
|
Returns:
|
|
354
348
|
NamedTuple of outputs (described in `Warp2metricOutputs`).
|
|
355
349
|
"""
|
|
350
|
+
runner = runner or get_global_runner()
|
|
351
|
+
execution = runner.start_execution(WARP2METRIC_METADATA)
|
|
356
352
|
params = execution.params(params)
|
|
357
353
|
cargs = warp2metric_cargs(params, execution)
|
|
358
354
|
ret = warp2metric_outputs(params, execution)
|
|
@@ -376,6 +372,8 @@ def warp2metric(
|
|
|
376
372
|
runner: Runner | None = None,
|
|
377
373
|
) -> Warp2metricOutputs:
|
|
378
374
|
"""
|
|
375
|
+
warp2metric
|
|
376
|
+
|
|
379
377
|
Compute fixel-wise or voxel-wise metrics from a 4D deformation field.
|
|
380
378
|
|
|
381
379
|
|
|
@@ -417,8 +415,6 @@ def warp2metric(
|
|
|
417
415
|
Returns:
|
|
418
416
|
NamedTuple of outputs (described in `Warp2metricOutputs`).
|
|
419
417
|
"""
|
|
420
|
-
runner = runner or get_global_runner()
|
|
421
|
-
execution = runner.start_execution(WARP2METRIC_METADATA)
|
|
422
418
|
params = warp2metric_params(
|
|
423
419
|
fc=fc,
|
|
424
420
|
jmat=jmat,
|
|
@@ -433,17 +429,15 @@ def warp2metric(
|
|
|
433
429
|
version=version,
|
|
434
430
|
in_=in_,
|
|
435
431
|
)
|
|
436
|
-
return warp2metric_execute(params,
|
|
432
|
+
return warp2metric_execute(params, runner)
|
|
437
433
|
|
|
438
434
|
|
|
439
435
|
__all__ = [
|
|
440
436
|
"WARP2METRIC_METADATA",
|
|
441
|
-
"Warp2metricConfigParameters",
|
|
442
|
-
"Warp2metricFcParameters",
|
|
443
437
|
"Warp2metricOutputs",
|
|
444
|
-
"Warp2metricParameters",
|
|
445
438
|
"warp2metric",
|
|
446
439
|
"warp2metric_config_params",
|
|
440
|
+
"warp2metric_execute",
|
|
447
441
|
"warp2metric_fc_params",
|
|
448
442
|
"warp2metric_params",
|
|
449
443
|
]
|