niwrap-mrtrix 0.6.3__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.3.dist-info/METADATA +0 -8
- niwrap_mrtrix-0.6.3.dist-info/RECORD +0 -119
- niwrap_mrtrix-0.6.3.dist-info/WHEEL +0 -4
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
TENSOR2METRIC_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="27f4e9c1379c830bcec96cfb3c8b321a7c99c245.boutiques",
|
|
10
10
|
name="tensor2metric",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,43 @@ TENSOR2METRIC_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Tensor2metricConfigParameters = typing.TypedDict('Tensor2metricConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
Tensor2metricConfigParametersTagged = typing.TypedDict('Tensor2metricConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
Tensor2metricParameters = typing.TypedDict('Tensor2metricParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/tensor2metric"]],
|
|
30
|
+
"adc": typing.NotRequired[str | None],
|
|
31
|
+
"fa": typing.NotRequired[str | None],
|
|
32
|
+
"ad": typing.NotRequired[str | None],
|
|
33
|
+
"rd": typing.NotRequired[str | None],
|
|
34
|
+
"cl": typing.NotRequired[str | None],
|
|
35
|
+
"cp": typing.NotRequired[str | None],
|
|
36
|
+
"cs": typing.NotRequired[str | None],
|
|
37
|
+
"value": typing.NotRequired[str | None],
|
|
38
|
+
"vector": typing.NotRequired[str | None],
|
|
39
|
+
"num": typing.NotRequired[list[int] | None],
|
|
40
|
+
"modulate": typing.NotRequired[str | None],
|
|
41
|
+
"mask": typing.NotRequired[InputPathType | None],
|
|
42
|
+
"info": bool,
|
|
43
|
+
"quiet": bool,
|
|
44
|
+
"debug": bool,
|
|
45
|
+
"force": bool,
|
|
46
|
+
"nthreads": typing.NotRequired[int | None],
|
|
47
|
+
"config": typing.NotRequired[list[Tensor2metricConfigParameters] | None],
|
|
48
|
+
"help": bool,
|
|
49
|
+
"version": bool,
|
|
50
|
+
"tensor": InputPathType,
|
|
51
|
+
})
|
|
52
|
+
Tensor2metricParametersTagged = typing.TypedDict('Tensor2metricParametersTagged', {
|
|
53
|
+
"@type": typing.Literal["mrtrix/tensor2metric"],
|
|
25
54
|
"adc": typing.NotRequired[str | None],
|
|
26
55
|
"fa": typing.NotRequired[str | None],
|
|
27
56
|
"ad": typing.NotRequired[str | None],
|
|
@@ -44,45 +73,12 @@ Tensor2metricParameters = typing.TypedDict('Tensor2metricParameters', {
|
|
|
44
73
|
"version": bool,
|
|
45
74
|
"tensor": InputPathType,
|
|
46
75
|
})
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def dyn_cargs(
|
|
50
|
-
t: str,
|
|
51
|
-
) -> typing.Any:
|
|
52
|
-
"""
|
|
53
|
-
Get build cargs function by command type.
|
|
54
|
-
|
|
55
|
-
Args:
|
|
56
|
-
t: Command type.
|
|
57
|
-
Returns:
|
|
58
|
-
Build cargs function.
|
|
59
|
-
"""
|
|
60
|
-
return {
|
|
61
|
-
"tensor2metric": tensor2metric_cargs,
|
|
62
|
-
"config": tensor2metric_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
|
-
"tensor2metric": tensor2metric_outputs,
|
|
79
|
-
}.get(t)
|
|
80
76
|
|
|
81
77
|
|
|
82
78
|
def tensor2metric_config_params(
|
|
83
79
|
key: str,
|
|
84
80
|
value: str,
|
|
85
|
-
) ->
|
|
81
|
+
) -> Tensor2metricConfigParametersTagged:
|
|
86
82
|
"""
|
|
87
83
|
Build parameters.
|
|
88
84
|
|
|
@@ -93,7 +89,7 @@ def tensor2metric_config_params(
|
|
|
93
89
|
Parameter dictionary
|
|
94
90
|
"""
|
|
95
91
|
params = {
|
|
96
|
-
"
|
|
92
|
+
"@type": "config",
|
|
97
93
|
"key": key,
|
|
98
94
|
"value": value,
|
|
99
95
|
}
|
|
@@ -115,14 +111,14 @@ def tensor2metric_config_cargs(
|
|
|
115
111
|
"""
|
|
116
112
|
cargs = []
|
|
117
113
|
cargs.append("-config")
|
|
118
|
-
cargs.append(params.get("key"))
|
|
119
|
-
cargs.append(params.get("value"))
|
|
114
|
+
cargs.append(params.get("key", None))
|
|
115
|
+
cargs.append(params.get("value", None))
|
|
120
116
|
return cargs
|
|
121
117
|
|
|
122
118
|
|
|
123
119
|
class Tensor2metricOutputs(typing.NamedTuple):
|
|
124
120
|
"""
|
|
125
|
-
Output object returned when calling `
|
|
121
|
+
Output object returned when calling `Tensor2metricParameters(...)`.
|
|
126
122
|
"""
|
|
127
123
|
root: OutputPathType
|
|
128
124
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -174,7 +170,7 @@ def tensor2metric_params(
|
|
|
174
170
|
config: list[Tensor2metricConfigParameters] | None = None,
|
|
175
171
|
help_: bool = False,
|
|
176
172
|
version: bool = False,
|
|
177
|
-
) ->
|
|
173
|
+
) -> Tensor2metricParametersTagged:
|
|
178
174
|
"""
|
|
179
175
|
Build parameters.
|
|
180
176
|
|
|
@@ -220,7 +216,7 @@ def tensor2metric_params(
|
|
|
220
216
|
Parameter dictionary
|
|
221
217
|
"""
|
|
222
218
|
params = {
|
|
223
|
-
"
|
|
219
|
+
"@type": "mrtrix/tensor2metric",
|
|
224
220
|
"info": info,
|
|
225
221
|
"quiet": quiet,
|
|
226
222
|
"debug": debug,
|
|
@@ -275,86 +271,86 @@ def tensor2metric_cargs(
|
|
|
275
271
|
"""
|
|
276
272
|
cargs = []
|
|
277
273
|
cargs.append("tensor2metric")
|
|
278
|
-
if params.get("adc") is not None:
|
|
274
|
+
if params.get("adc", None) is not None:
|
|
279
275
|
cargs.extend([
|
|
280
276
|
"-adc",
|
|
281
|
-
params.get("adc")
|
|
277
|
+
params.get("adc", None)
|
|
282
278
|
])
|
|
283
|
-
if params.get("fa") is not None:
|
|
279
|
+
if params.get("fa", None) is not None:
|
|
284
280
|
cargs.extend([
|
|
285
281
|
"-fa",
|
|
286
|
-
params.get("fa")
|
|
282
|
+
params.get("fa", None)
|
|
287
283
|
])
|
|
288
|
-
if params.get("ad") is not None:
|
|
284
|
+
if params.get("ad", None) is not None:
|
|
289
285
|
cargs.extend([
|
|
290
286
|
"-ad",
|
|
291
|
-
params.get("ad")
|
|
287
|
+
params.get("ad", None)
|
|
292
288
|
])
|
|
293
|
-
if params.get("rd") is not None:
|
|
289
|
+
if params.get("rd", None) is not None:
|
|
294
290
|
cargs.extend([
|
|
295
291
|
"-rd",
|
|
296
|
-
params.get("rd")
|
|
292
|
+
params.get("rd", None)
|
|
297
293
|
])
|
|
298
|
-
if params.get("cl") is not None:
|
|
294
|
+
if params.get("cl", None) is not None:
|
|
299
295
|
cargs.extend([
|
|
300
296
|
"-cl",
|
|
301
|
-
params.get("cl")
|
|
297
|
+
params.get("cl", None)
|
|
302
298
|
])
|
|
303
|
-
if params.get("cp") is not None:
|
|
299
|
+
if params.get("cp", None) is not None:
|
|
304
300
|
cargs.extend([
|
|
305
301
|
"-cp",
|
|
306
|
-
params.get("cp")
|
|
302
|
+
params.get("cp", None)
|
|
307
303
|
])
|
|
308
|
-
if params.get("cs") is not None:
|
|
304
|
+
if params.get("cs", None) is not None:
|
|
309
305
|
cargs.extend([
|
|
310
306
|
"-cs",
|
|
311
|
-
params.get("cs")
|
|
307
|
+
params.get("cs", None)
|
|
312
308
|
])
|
|
313
|
-
if params.get("value") is not None:
|
|
309
|
+
if params.get("value", None) is not None:
|
|
314
310
|
cargs.extend([
|
|
315
311
|
"-value",
|
|
316
|
-
params.get("value")
|
|
312
|
+
params.get("value", None)
|
|
317
313
|
])
|
|
318
|
-
if params.get("vector") is not None:
|
|
314
|
+
if params.get("vector", None) is not None:
|
|
319
315
|
cargs.extend([
|
|
320
316
|
"-vector",
|
|
321
|
-
params.get("vector")
|
|
317
|
+
params.get("vector", None)
|
|
322
318
|
])
|
|
323
|
-
if params.get("num") is not None:
|
|
319
|
+
if params.get("num", None) is not None:
|
|
324
320
|
cargs.extend([
|
|
325
321
|
"-num",
|
|
326
|
-
*map(str, params.get("num"))
|
|
322
|
+
*map(str, params.get("num", None))
|
|
327
323
|
])
|
|
328
|
-
if params.get("modulate") is not None:
|
|
324
|
+
if params.get("modulate", None) is not None:
|
|
329
325
|
cargs.extend([
|
|
330
326
|
"-modulate",
|
|
331
|
-
params.get("modulate")
|
|
327
|
+
params.get("modulate", None)
|
|
332
328
|
])
|
|
333
|
-
if params.get("mask") is not None:
|
|
329
|
+
if params.get("mask", None) is not None:
|
|
334
330
|
cargs.extend([
|
|
335
331
|
"-mask",
|
|
336
|
-
execution.input_file(params.get("mask"))
|
|
332
|
+
execution.input_file(params.get("mask", None))
|
|
337
333
|
])
|
|
338
|
-
if params.get("info"):
|
|
334
|
+
if params.get("info", False):
|
|
339
335
|
cargs.append("-info")
|
|
340
|
-
if params.get("quiet"):
|
|
336
|
+
if params.get("quiet", False):
|
|
341
337
|
cargs.append("-quiet")
|
|
342
|
-
if params.get("debug"):
|
|
338
|
+
if params.get("debug", False):
|
|
343
339
|
cargs.append("-debug")
|
|
344
|
-
if params.get("force"):
|
|
340
|
+
if params.get("force", False):
|
|
345
341
|
cargs.append("-force")
|
|
346
|
-
if params.get("nthreads") is not None:
|
|
342
|
+
if params.get("nthreads", None) is not None:
|
|
347
343
|
cargs.extend([
|
|
348
344
|
"-nthreads",
|
|
349
|
-
str(params.get("nthreads"))
|
|
345
|
+
str(params.get("nthreads", None))
|
|
350
346
|
])
|
|
351
|
-
if params.get("config") is not None:
|
|
352
|
-
cargs.extend([a for c in [
|
|
353
|
-
if params.get("help"):
|
|
347
|
+
if params.get("config", None) is not None:
|
|
348
|
+
cargs.extend([a for c in [tensor2metric_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
349
|
+
if params.get("help", False):
|
|
354
350
|
cargs.append("-help")
|
|
355
|
-
if params.get("version"):
|
|
351
|
+
if params.get("version", False):
|
|
356
352
|
cargs.append("-version")
|
|
357
|
-
cargs.append(execution.input_file(params.get("tensor")))
|
|
353
|
+
cargs.append(execution.input_file(params.get("tensor", None)))
|
|
358
354
|
return cargs
|
|
359
355
|
|
|
360
356
|
|
|
@@ -373,24 +369,26 @@ def tensor2metric_outputs(
|
|
|
373
369
|
"""
|
|
374
370
|
ret = Tensor2metricOutputs(
|
|
375
371
|
root=execution.output_file("."),
|
|
376
|
-
adc=execution.output_file(params.get("adc")) if (params.get("adc") is not None) else None,
|
|
377
|
-
fa=execution.output_file(params.get("fa")) if (params.get("fa") is not None) else None,
|
|
378
|
-
ad=execution.output_file(params.get("ad")) if (params.get("ad") is not None) else None,
|
|
379
|
-
rd=execution.output_file(params.get("rd")) if (params.get("rd") is not None) else None,
|
|
380
|
-
cl=execution.output_file(params.get("cl")) if (params.get("cl") is not None) else None,
|
|
381
|
-
cp=execution.output_file(params.get("cp")) if (params.get("cp") is not None) else None,
|
|
382
|
-
cs=execution.output_file(params.get("cs")) if (params.get("cs") is not None) else None,
|
|
383
|
-
value=execution.output_file(params.get("value")) if (params.get("value") is not None) else None,
|
|
384
|
-
vector=execution.output_file(params.get("vector")) if (params.get("vector") is not None) else None,
|
|
372
|
+
adc=execution.output_file(params.get("adc", None)) if (params.get("adc") is not None) else None,
|
|
373
|
+
fa=execution.output_file(params.get("fa", None)) if (params.get("fa") is not None) else None,
|
|
374
|
+
ad=execution.output_file(params.get("ad", None)) if (params.get("ad") is not None) else None,
|
|
375
|
+
rd=execution.output_file(params.get("rd", None)) if (params.get("rd") is not None) else None,
|
|
376
|
+
cl=execution.output_file(params.get("cl", None)) if (params.get("cl") is not None) else None,
|
|
377
|
+
cp=execution.output_file(params.get("cp", None)) if (params.get("cp") is not None) else None,
|
|
378
|
+
cs=execution.output_file(params.get("cs", None)) if (params.get("cs") is not None) else None,
|
|
379
|
+
value=execution.output_file(params.get("value", None)) if (params.get("value") is not None) else None,
|
|
380
|
+
vector=execution.output_file(params.get("vector", None)) if (params.get("vector") is not None) else None,
|
|
385
381
|
)
|
|
386
382
|
return ret
|
|
387
383
|
|
|
388
384
|
|
|
389
385
|
def tensor2metric_execute(
|
|
390
386
|
params: Tensor2metricParameters,
|
|
391
|
-
|
|
387
|
+
runner: Runner | None = None,
|
|
392
388
|
) -> Tensor2metricOutputs:
|
|
393
389
|
"""
|
|
390
|
+
tensor2metric
|
|
391
|
+
|
|
394
392
|
Generate maps of tensor-derived parameters.
|
|
395
393
|
|
|
396
394
|
|
|
@@ -410,10 +408,12 @@ def tensor2metric_execute(
|
|
|
410
408
|
|
|
411
409
|
Args:
|
|
412
410
|
params: The parameters.
|
|
413
|
-
|
|
411
|
+
runner: Command runner.
|
|
414
412
|
Returns:
|
|
415
413
|
NamedTuple of outputs (described in `Tensor2metricOutputs`).
|
|
416
414
|
"""
|
|
415
|
+
runner = runner or get_global_runner()
|
|
416
|
+
execution = runner.start_execution(TENSOR2METRIC_METADATA)
|
|
417
417
|
params = execution.params(params)
|
|
418
418
|
cargs = tensor2metric_cargs(params, execution)
|
|
419
419
|
ret = tensor2metric_outputs(params, execution)
|
|
@@ -446,6 +446,8 @@ def tensor2metric(
|
|
|
446
446
|
runner: Runner | None = None,
|
|
447
447
|
) -> Tensor2metricOutputs:
|
|
448
448
|
"""
|
|
449
|
+
tensor2metric
|
|
450
|
+
|
|
449
451
|
Generate maps of tensor-derived parameters.
|
|
450
452
|
|
|
451
453
|
|
|
@@ -505,8 +507,6 @@ def tensor2metric(
|
|
|
505
507
|
Returns:
|
|
506
508
|
NamedTuple of outputs (described in `Tensor2metricOutputs`).
|
|
507
509
|
"""
|
|
508
|
-
runner = runner or get_global_runner()
|
|
509
|
-
execution = runner.start_execution(TENSOR2METRIC_METADATA)
|
|
510
510
|
params = tensor2metric_params(
|
|
511
511
|
adc=adc,
|
|
512
512
|
fa=fa,
|
|
@@ -530,15 +530,14 @@ def tensor2metric(
|
|
|
530
530
|
version=version,
|
|
531
531
|
tensor=tensor,
|
|
532
532
|
)
|
|
533
|
-
return tensor2metric_execute(params,
|
|
533
|
+
return tensor2metric_execute(params, runner)
|
|
534
534
|
|
|
535
535
|
|
|
536
536
|
__all__ = [
|
|
537
537
|
"TENSOR2METRIC_METADATA",
|
|
538
|
-
"Tensor2metricConfigParameters",
|
|
539
538
|
"Tensor2metricOutputs",
|
|
540
|
-
"Tensor2metricParameters",
|
|
541
539
|
"tensor2metric",
|
|
542
540
|
"tensor2metric_config_params",
|
|
541
|
+
"tensor2metric_execute",
|
|
543
542
|
"tensor2metric_params",
|
|
544
543
|
]
|
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
TRANSFORMCALC_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="d2f8232c6e9c988505f10fe7dd480d7a028ccfc2.boutiques",
|
|
10
10
|
name="transformcalc",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,33 @@ TRANSFORMCALC_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
TransformcalcConfigParameters = typing.TypedDict('TransformcalcConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
TransformcalcConfigParametersTagged = typing.TypedDict('TransformcalcConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
TransformcalcParameters = typing.TypedDict('TransformcalcParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/transformcalc"]],
|
|
30
|
+
"info": bool,
|
|
31
|
+
"quiet": bool,
|
|
32
|
+
"debug": bool,
|
|
33
|
+
"force": bool,
|
|
34
|
+
"nthreads": typing.NotRequired[int | None],
|
|
35
|
+
"config": typing.NotRequired[list[TransformcalcConfigParameters] | None],
|
|
36
|
+
"help": bool,
|
|
37
|
+
"version": bool,
|
|
38
|
+
"inputs": list[str],
|
|
39
|
+
"operation": str,
|
|
40
|
+
"output": str,
|
|
41
|
+
})
|
|
42
|
+
TransformcalcParametersTagged = typing.TypedDict('TransformcalcParametersTagged', {
|
|
43
|
+
"@type": typing.Literal["mrtrix/transformcalc"],
|
|
25
44
|
"info": bool,
|
|
26
45
|
"quiet": bool,
|
|
27
46
|
"debug": bool,
|
|
@@ -34,45 +53,12 @@ TransformcalcParameters = typing.TypedDict('TransformcalcParameters', {
|
|
|
34
53
|
"operation": str,
|
|
35
54
|
"output": str,
|
|
36
55
|
})
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def dyn_cargs(
|
|
40
|
-
t: str,
|
|
41
|
-
) -> typing.Any:
|
|
42
|
-
"""
|
|
43
|
-
Get build cargs function by command type.
|
|
44
|
-
|
|
45
|
-
Args:
|
|
46
|
-
t: Command type.
|
|
47
|
-
Returns:
|
|
48
|
-
Build cargs function.
|
|
49
|
-
"""
|
|
50
|
-
return {
|
|
51
|
-
"transformcalc": transformcalc_cargs,
|
|
52
|
-
"config": transformcalc_config_cargs,
|
|
53
|
-
}.get(t)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def dyn_outputs(
|
|
57
|
-
t: str,
|
|
58
|
-
) -> typing.Any:
|
|
59
|
-
"""
|
|
60
|
-
Get build outputs function by command type.
|
|
61
|
-
|
|
62
|
-
Args:
|
|
63
|
-
t: Command type.
|
|
64
|
-
Returns:
|
|
65
|
-
Build outputs function.
|
|
66
|
-
"""
|
|
67
|
-
return {
|
|
68
|
-
"transformcalc": transformcalc_outputs,
|
|
69
|
-
}.get(t)
|
|
70
56
|
|
|
71
57
|
|
|
72
58
|
def transformcalc_config_params(
|
|
73
59
|
key: str,
|
|
74
60
|
value: str,
|
|
75
|
-
) ->
|
|
61
|
+
) -> TransformcalcConfigParametersTagged:
|
|
76
62
|
"""
|
|
77
63
|
Build parameters.
|
|
78
64
|
|
|
@@ -83,7 +69,7 @@ def transformcalc_config_params(
|
|
|
83
69
|
Parameter dictionary
|
|
84
70
|
"""
|
|
85
71
|
params = {
|
|
86
|
-
"
|
|
72
|
+
"@type": "config",
|
|
87
73
|
"key": key,
|
|
88
74
|
"value": value,
|
|
89
75
|
}
|
|
@@ -105,14 +91,14 @@ def transformcalc_config_cargs(
|
|
|
105
91
|
"""
|
|
106
92
|
cargs = []
|
|
107
93
|
cargs.append("-config")
|
|
108
|
-
cargs.append(params.get("key"))
|
|
109
|
-
cargs.append(params.get("value"))
|
|
94
|
+
cargs.append(params.get("key", None))
|
|
95
|
+
cargs.append(params.get("value", None))
|
|
110
96
|
return cargs
|
|
111
97
|
|
|
112
98
|
|
|
113
99
|
class TransformcalcOutputs(typing.NamedTuple):
|
|
114
100
|
"""
|
|
115
|
-
Output object returned when calling `
|
|
101
|
+
Output object returned when calling `TransformcalcParameters(...)`.
|
|
116
102
|
"""
|
|
117
103
|
root: OutputPathType
|
|
118
104
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -132,7 +118,7 @@ def transformcalc_params(
|
|
|
132
118
|
config: list[TransformcalcConfigParameters] | None = None,
|
|
133
119
|
help_: bool = False,
|
|
134
120
|
version: bool = False,
|
|
135
|
-
) ->
|
|
121
|
+
) -> TransformcalcParametersTagged:
|
|
136
122
|
"""
|
|
137
123
|
Build parameters.
|
|
138
124
|
|
|
@@ -158,7 +144,7 @@ def transformcalc_params(
|
|
|
158
144
|
Parameter dictionary
|
|
159
145
|
"""
|
|
160
146
|
params = {
|
|
161
|
-
"
|
|
147
|
+
"@type": "mrtrix/transformcalc",
|
|
162
148
|
"info": info,
|
|
163
149
|
"quiet": quiet,
|
|
164
150
|
"debug": debug,
|
|
@@ -191,28 +177,28 @@ def transformcalc_cargs(
|
|
|
191
177
|
"""
|
|
192
178
|
cargs = []
|
|
193
179
|
cargs.append("transformcalc")
|
|
194
|
-
if params.get("info"):
|
|
180
|
+
if params.get("info", False):
|
|
195
181
|
cargs.append("-info")
|
|
196
|
-
if params.get("quiet"):
|
|
182
|
+
if params.get("quiet", False):
|
|
197
183
|
cargs.append("-quiet")
|
|
198
|
-
if params.get("debug"):
|
|
184
|
+
if params.get("debug", False):
|
|
199
185
|
cargs.append("-debug")
|
|
200
|
-
if params.get("force"):
|
|
186
|
+
if params.get("force", False):
|
|
201
187
|
cargs.append("-force")
|
|
202
|
-
if params.get("nthreads") is not None:
|
|
188
|
+
if params.get("nthreads", None) is not None:
|
|
203
189
|
cargs.extend([
|
|
204
190
|
"-nthreads",
|
|
205
|
-
str(params.get("nthreads"))
|
|
191
|
+
str(params.get("nthreads", None))
|
|
206
192
|
])
|
|
207
|
-
if params.get("config") is not None:
|
|
208
|
-
cargs.extend([a for c in [
|
|
209
|
-
if params.get("help"):
|
|
193
|
+
if params.get("config", None) is not None:
|
|
194
|
+
cargs.extend([a for c in [transformcalc_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
195
|
+
if params.get("help", False):
|
|
210
196
|
cargs.append("-help")
|
|
211
|
-
if params.get("version"):
|
|
197
|
+
if params.get("version", False):
|
|
212
198
|
cargs.append("-version")
|
|
213
|
-
cargs.extend(params.get("inputs"))
|
|
214
|
-
cargs.append(params.get("operation"))
|
|
215
|
-
cargs.append(params.get("output"))
|
|
199
|
+
cargs.extend(params.get("inputs", None))
|
|
200
|
+
cargs.append(params.get("operation", None))
|
|
201
|
+
cargs.append(params.get("output", None))
|
|
216
202
|
return cargs
|
|
217
203
|
|
|
218
204
|
|
|
@@ -231,16 +217,18 @@ def transformcalc_outputs(
|
|
|
231
217
|
"""
|
|
232
218
|
ret = TransformcalcOutputs(
|
|
233
219
|
root=execution.output_file("."),
|
|
234
|
-
output=execution.output_file(params.get("output")),
|
|
220
|
+
output=execution.output_file(params.get("output", None)),
|
|
235
221
|
)
|
|
236
222
|
return ret
|
|
237
223
|
|
|
238
224
|
|
|
239
225
|
def transformcalc_execute(
|
|
240
226
|
params: TransformcalcParameters,
|
|
241
|
-
|
|
227
|
+
runner: Runner | None = None,
|
|
242
228
|
) -> TransformcalcOutputs:
|
|
243
229
|
"""
|
|
230
|
+
transformcalc
|
|
231
|
+
|
|
244
232
|
Perform calculations on linear transformation matrices.
|
|
245
233
|
|
|
246
234
|
|
|
@@ -255,10 +243,12 @@ def transformcalc_execute(
|
|
|
255
243
|
|
|
256
244
|
Args:
|
|
257
245
|
params: The parameters.
|
|
258
|
-
|
|
246
|
+
runner: Command runner.
|
|
259
247
|
Returns:
|
|
260
248
|
NamedTuple of outputs (described in `TransformcalcOutputs`).
|
|
261
249
|
"""
|
|
250
|
+
runner = runner or get_global_runner()
|
|
251
|
+
execution = runner.start_execution(TRANSFORMCALC_METADATA)
|
|
262
252
|
params = execution.params(params)
|
|
263
253
|
cargs = transformcalc_cargs(params, execution)
|
|
264
254
|
ret = transformcalc_outputs(params, execution)
|
|
@@ -281,6 +271,8 @@ def transformcalc(
|
|
|
281
271
|
runner: Runner | None = None,
|
|
282
272
|
) -> TransformcalcOutputs:
|
|
283
273
|
"""
|
|
274
|
+
transformcalc
|
|
275
|
+
|
|
284
276
|
Perform calculations on linear transformation matrices.
|
|
285
277
|
|
|
286
278
|
|
|
@@ -315,8 +307,6 @@ def transformcalc(
|
|
|
315
307
|
Returns:
|
|
316
308
|
NamedTuple of outputs (described in `TransformcalcOutputs`).
|
|
317
309
|
"""
|
|
318
|
-
runner = runner or get_global_runner()
|
|
319
|
-
execution = runner.start_execution(TRANSFORMCALC_METADATA)
|
|
320
310
|
params = transformcalc_params(
|
|
321
311
|
info=info,
|
|
322
312
|
quiet=quiet,
|
|
@@ -330,15 +320,14 @@ def transformcalc(
|
|
|
330
320
|
operation=operation,
|
|
331
321
|
output=output,
|
|
332
322
|
)
|
|
333
|
-
return transformcalc_execute(params,
|
|
323
|
+
return transformcalc_execute(params, runner)
|
|
334
324
|
|
|
335
325
|
|
|
336
326
|
__all__ = [
|
|
337
327
|
"TRANSFORMCALC_METADATA",
|
|
338
|
-
"TransformcalcConfigParameters",
|
|
339
328
|
"TransformcalcOutputs",
|
|
340
|
-
"TransformcalcParameters",
|
|
341
329
|
"transformcalc",
|
|
342
330
|
"transformcalc_config_params",
|
|
331
|
+
"transformcalc_execute",
|
|
343
332
|
"transformcalc_params",
|
|
344
333
|
]
|