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
niwrap_mrtrix/mrtrix/v_5ttgen.py
CHANGED
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
V_5TTGEN_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="213c8cb30d8d1a68c488abbf08a42cf6809dc622.boutiques",
|
|
10
10
|
name="5ttgen",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,7 +14,13 @@ V_5TTGEN_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
V5ttgenFreesurferParameters = typing.TypedDict('V5ttgenFreesurferParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["freesurfer"]],
|
|
18
|
+
"input": InputPathType,
|
|
19
|
+
"output": str,
|
|
20
|
+
"lut": typing.NotRequired[InputPathType | None],
|
|
21
|
+
})
|
|
22
|
+
V5ttgenFreesurferParametersTagged = typing.TypedDict('V5ttgenFreesurferParametersTagged', {
|
|
23
|
+
"@type": typing.Literal["freesurfer"],
|
|
18
24
|
"input": InputPathType,
|
|
19
25
|
"output": str,
|
|
20
26
|
"lut": typing.NotRequired[InputPathType | None],
|
|
@@ -22,7 +28,15 @@ V5ttgenFreesurferParameters = typing.TypedDict('V5ttgenFreesurferParameters', {
|
|
|
22
28
|
|
|
23
29
|
|
|
24
30
|
V5ttgenFslParameters = typing.TypedDict('V5ttgenFslParameters', {
|
|
25
|
-
"
|
|
31
|
+
"@type": typing.NotRequired[typing.Literal["fsl"]],
|
|
32
|
+
"input": InputPathType,
|
|
33
|
+
"output": str,
|
|
34
|
+
"t2": typing.NotRequired[InputPathType | None],
|
|
35
|
+
"mask": typing.NotRequired[InputPathType | None],
|
|
36
|
+
"premasked": bool,
|
|
37
|
+
})
|
|
38
|
+
V5ttgenFslParametersTagged = typing.TypedDict('V5ttgenFslParametersTagged', {
|
|
39
|
+
"@type": typing.Literal["fsl"],
|
|
26
40
|
"input": InputPathType,
|
|
27
41
|
"output": str,
|
|
28
42
|
"t2": typing.NotRequired[InputPathType | None],
|
|
@@ -32,14 +46,28 @@ V5ttgenFslParameters = typing.TypedDict('V5ttgenFslParameters', {
|
|
|
32
46
|
|
|
33
47
|
|
|
34
48
|
V5ttgenGifParameters = typing.TypedDict('V5ttgenGifParameters', {
|
|
35
|
-
"
|
|
49
|
+
"@type": typing.NotRequired[typing.Literal["gif"]],
|
|
50
|
+
"input": InputPathType,
|
|
51
|
+
"output": str,
|
|
52
|
+
})
|
|
53
|
+
V5ttgenGifParametersTagged = typing.TypedDict('V5ttgenGifParametersTagged', {
|
|
54
|
+
"@type": typing.Literal["gif"],
|
|
36
55
|
"input": InputPathType,
|
|
37
56
|
"output": str,
|
|
38
57
|
})
|
|
39
58
|
|
|
40
59
|
|
|
41
60
|
V5ttgenHsvsParameters = typing.TypedDict('V5ttgenHsvsParameters', {
|
|
42
|
-
"
|
|
61
|
+
"@type": typing.NotRequired[typing.Literal["hsvs"]],
|
|
62
|
+
"input": InputPathType,
|
|
63
|
+
"output": str,
|
|
64
|
+
"template": typing.NotRequired[InputPathType | None],
|
|
65
|
+
"hippocampi": typing.NotRequired[typing.Literal["subfields", "first", "aseg"] | None],
|
|
66
|
+
"thalami": typing.NotRequired[typing.Literal["nuclei", "first", "aseg"] | None],
|
|
67
|
+
"white_stem": bool,
|
|
68
|
+
})
|
|
69
|
+
V5ttgenHsvsParametersTagged = typing.TypedDict('V5ttgenHsvsParametersTagged', {
|
|
70
|
+
"@type": typing.Literal["hsvs"],
|
|
43
71
|
"input": InputPathType,
|
|
44
72
|
"output": str,
|
|
45
73
|
"template": typing.NotRequired[InputPathType | None],
|
|
@@ -50,15 +78,37 @@ V5ttgenHsvsParameters = typing.TypedDict('V5ttgenHsvsParameters', {
|
|
|
50
78
|
|
|
51
79
|
|
|
52
80
|
V5ttgenConfigParameters = typing.TypedDict('V5ttgenConfigParameters', {
|
|
53
|
-
"
|
|
81
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
82
|
+
"key": str,
|
|
83
|
+
"value": str,
|
|
84
|
+
})
|
|
85
|
+
V5ttgenConfigParametersTagged = typing.TypedDict('V5ttgenConfigParametersTagged', {
|
|
86
|
+
"@type": typing.Literal["config"],
|
|
54
87
|
"key": str,
|
|
55
88
|
"value": str,
|
|
56
89
|
})
|
|
57
90
|
|
|
58
91
|
|
|
59
92
|
V5ttgenParameters = typing.TypedDict('V5ttgenParameters', {
|
|
60
|
-
"
|
|
61
|
-
"algorithm": typing.Union[
|
|
93
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/5ttgen"]],
|
|
94
|
+
"algorithm": typing.Union[V5ttgenFreesurferParametersTagged, V5ttgenFslParametersTagged, V5ttgenGifParametersTagged, V5ttgenHsvsParametersTagged],
|
|
95
|
+
"nocrop": bool,
|
|
96
|
+
"sgm_amyg_hipp": bool,
|
|
97
|
+
"nocleanup": bool,
|
|
98
|
+
"scratch": typing.NotRequired[str | None],
|
|
99
|
+
"continue": typing.NotRequired[str | None],
|
|
100
|
+
"info": bool,
|
|
101
|
+
"quiet": bool,
|
|
102
|
+
"debug": bool,
|
|
103
|
+
"force": bool,
|
|
104
|
+
"nthreads": typing.NotRequired[int | None],
|
|
105
|
+
"config": typing.NotRequired[list[V5ttgenConfigParameters] | None],
|
|
106
|
+
"help": bool,
|
|
107
|
+
"version": bool,
|
|
108
|
+
})
|
|
109
|
+
V5ttgenParametersTagged = typing.TypedDict('V5ttgenParametersTagged', {
|
|
110
|
+
"@type": typing.Literal["mrtrix/5ttgen"],
|
|
111
|
+
"algorithm": typing.Union[V5ttgenFreesurferParametersTagged, V5ttgenFslParametersTagged, V5ttgenGifParametersTagged, V5ttgenHsvsParametersTagged],
|
|
62
112
|
"nocrop": bool,
|
|
63
113
|
"sgm_amyg_hipp": bool,
|
|
64
114
|
"nocleanup": bool,
|
|
@@ -75,7 +125,7 @@ V5ttgenParameters = typing.TypedDict('V5ttgenParameters', {
|
|
|
75
125
|
})
|
|
76
126
|
|
|
77
127
|
|
|
78
|
-
def
|
|
128
|
+
def v_5ttgen_algorithm_cargs_dyn_fn(
|
|
79
129
|
t: str,
|
|
80
130
|
) -> typing.Any:
|
|
81
131
|
"""
|
|
@@ -87,16 +137,14 @@ def dyn_cargs(
|
|
|
87
137
|
Build cargs function.
|
|
88
138
|
"""
|
|
89
139
|
return {
|
|
90
|
-
"5ttgen": v_5ttgen_cargs,
|
|
91
140
|
"freesurfer": v_5ttgen_freesurfer_cargs,
|
|
92
141
|
"fsl": v_5ttgen_fsl_cargs,
|
|
93
142
|
"gif": v_5ttgen_gif_cargs,
|
|
94
143
|
"hsvs": v_5ttgen_hsvs_cargs,
|
|
95
|
-
"config": v_5ttgen_config_cargs,
|
|
96
144
|
}.get(t)
|
|
97
145
|
|
|
98
146
|
|
|
99
|
-
def
|
|
147
|
+
def v_5ttgen_algorithm_outputs_dyn_fn(
|
|
100
148
|
t: str,
|
|
101
149
|
) -> typing.Any:
|
|
102
150
|
"""
|
|
@@ -108,7 +156,6 @@ def dyn_outputs(
|
|
|
108
156
|
Build outputs function.
|
|
109
157
|
"""
|
|
110
158
|
return {
|
|
111
|
-
"5ttgen": v_5ttgen_outputs,
|
|
112
159
|
"freesurfer": v_5ttgen_freesurfer_outputs,
|
|
113
160
|
"fsl": v_5ttgen_fsl_outputs,
|
|
114
161
|
"gif": v_5ttgen_gif_outputs,
|
|
@@ -130,7 +177,7 @@ def v_5ttgen_freesurfer_params(
|
|
|
130
177
|
input_: InputPathType,
|
|
131
178
|
output: str,
|
|
132
179
|
lut: InputPathType | None = None,
|
|
133
|
-
) ->
|
|
180
|
+
) -> V5ttgenFreesurferParametersTagged:
|
|
134
181
|
"""
|
|
135
182
|
Build parameters.
|
|
136
183
|
|
|
@@ -144,7 +191,7 @@ def v_5ttgen_freesurfer_params(
|
|
|
144
191
|
Parameter dictionary
|
|
145
192
|
"""
|
|
146
193
|
params = {
|
|
147
|
-
"
|
|
194
|
+
"@type": "freesurfer",
|
|
148
195
|
"input": input_,
|
|
149
196
|
"output": output,
|
|
150
197
|
}
|
|
@@ -168,12 +215,12 @@ def v_5ttgen_freesurfer_cargs(
|
|
|
168
215
|
"""
|
|
169
216
|
cargs = []
|
|
170
217
|
cargs.append("freesurfer")
|
|
171
|
-
cargs.append(execution.input_file(params.get("input")))
|
|
172
|
-
cargs.append(params.get("output"))
|
|
173
|
-
if params.get("lut") is not None:
|
|
218
|
+
cargs.append(execution.input_file(params.get("input", None)))
|
|
219
|
+
cargs.append(params.get("output", None))
|
|
220
|
+
if params.get("lut", None) is not None:
|
|
174
221
|
cargs.extend([
|
|
175
222
|
"-lut",
|
|
176
|
-
execution.input_file(params.get("lut"))
|
|
223
|
+
execution.input_file(params.get("lut", None))
|
|
177
224
|
])
|
|
178
225
|
return cargs
|
|
179
226
|
|
|
@@ -193,7 +240,7 @@ def v_5ttgen_freesurfer_outputs(
|
|
|
193
240
|
"""
|
|
194
241
|
ret = V5ttgenFreesurferOutputs(
|
|
195
242
|
root=execution.output_file("."),
|
|
196
|
-
output=execution.output_file(params.get("output")),
|
|
243
|
+
output=execution.output_file(params.get("output", None)),
|
|
197
244
|
)
|
|
198
245
|
return ret
|
|
199
246
|
|
|
@@ -214,7 +261,7 @@ def v_5ttgen_fsl_params(
|
|
|
214
261
|
t2: InputPathType | None = None,
|
|
215
262
|
mask: InputPathType | None = None,
|
|
216
263
|
premasked: bool = False,
|
|
217
|
-
) ->
|
|
264
|
+
) -> V5ttgenFslParametersTagged:
|
|
218
265
|
"""
|
|
219
266
|
Build parameters.
|
|
220
267
|
|
|
@@ -231,7 +278,7 @@ def v_5ttgen_fsl_params(
|
|
|
231
278
|
Parameter dictionary
|
|
232
279
|
"""
|
|
233
280
|
params = {
|
|
234
|
-
"
|
|
281
|
+
"@type": "fsl",
|
|
235
282
|
"input": input_,
|
|
236
283
|
"output": output,
|
|
237
284
|
"premasked": premasked,
|
|
@@ -258,19 +305,19 @@ def v_5ttgen_fsl_cargs(
|
|
|
258
305
|
"""
|
|
259
306
|
cargs = []
|
|
260
307
|
cargs.append("fsl")
|
|
261
|
-
cargs.append(execution.input_file(params.get("input")))
|
|
262
|
-
cargs.append(params.get("output"))
|
|
263
|
-
if params.get("t2") is not None:
|
|
308
|
+
cargs.append(execution.input_file(params.get("input", None)))
|
|
309
|
+
cargs.append(params.get("output", None))
|
|
310
|
+
if params.get("t2", None) is not None:
|
|
264
311
|
cargs.extend([
|
|
265
312
|
"-t2",
|
|
266
|
-
execution.input_file(params.get("t2"))
|
|
313
|
+
execution.input_file(params.get("t2", None))
|
|
267
314
|
])
|
|
268
|
-
if params.get("mask") is not None:
|
|
315
|
+
if params.get("mask", None) is not None:
|
|
269
316
|
cargs.extend([
|
|
270
317
|
"-mask",
|
|
271
|
-
execution.input_file(params.get("mask"))
|
|
318
|
+
execution.input_file(params.get("mask", None))
|
|
272
319
|
])
|
|
273
|
-
if params.get("premasked"):
|
|
320
|
+
if params.get("premasked", False):
|
|
274
321
|
cargs.append("-premasked")
|
|
275
322
|
return cargs
|
|
276
323
|
|
|
@@ -290,7 +337,7 @@ def v_5ttgen_fsl_outputs(
|
|
|
290
337
|
"""
|
|
291
338
|
ret = V5ttgenFslOutputs(
|
|
292
339
|
root=execution.output_file("."),
|
|
293
|
-
output=execution.output_file(params.get("output")),
|
|
340
|
+
output=execution.output_file(params.get("output", None)),
|
|
294
341
|
)
|
|
295
342
|
return ret
|
|
296
343
|
|
|
@@ -308,7 +355,7 @@ class V5ttgenGifOutputs(typing.NamedTuple):
|
|
|
308
355
|
def v_5ttgen_gif_params(
|
|
309
356
|
input_: InputPathType,
|
|
310
357
|
output: str,
|
|
311
|
-
) ->
|
|
358
|
+
) -> V5ttgenGifParametersTagged:
|
|
312
359
|
"""
|
|
313
360
|
Build parameters.
|
|
314
361
|
|
|
@@ -319,7 +366,7 @@ def v_5ttgen_gif_params(
|
|
|
319
366
|
Parameter dictionary
|
|
320
367
|
"""
|
|
321
368
|
params = {
|
|
322
|
-
"
|
|
369
|
+
"@type": "gif",
|
|
323
370
|
"input": input_,
|
|
324
371
|
"output": output,
|
|
325
372
|
}
|
|
@@ -341,8 +388,8 @@ def v_5ttgen_gif_cargs(
|
|
|
341
388
|
"""
|
|
342
389
|
cargs = []
|
|
343
390
|
cargs.append("gif")
|
|
344
|
-
cargs.append(execution.input_file(params.get("input")))
|
|
345
|
-
cargs.append(params.get("output"))
|
|
391
|
+
cargs.append(execution.input_file(params.get("input", None)))
|
|
392
|
+
cargs.append(params.get("output", None))
|
|
346
393
|
return cargs
|
|
347
394
|
|
|
348
395
|
|
|
@@ -361,7 +408,7 @@ def v_5ttgen_gif_outputs(
|
|
|
361
408
|
"""
|
|
362
409
|
ret = V5ttgenGifOutputs(
|
|
363
410
|
root=execution.output_file("."),
|
|
364
|
-
output=execution.output_file(params.get("output")),
|
|
411
|
+
output=execution.output_file(params.get("output", None)),
|
|
365
412
|
)
|
|
366
413
|
return ret
|
|
367
414
|
|
|
@@ -383,7 +430,7 @@ def v_5ttgen_hsvs_params(
|
|
|
383
430
|
hippocampi: typing.Literal["subfields", "first", "aseg"] | None = None,
|
|
384
431
|
thalami: typing.Literal["nuclei", "first", "aseg"] | None = None,
|
|
385
432
|
white_stem: bool = False,
|
|
386
|
-
) ->
|
|
433
|
+
) -> V5ttgenHsvsParametersTagged:
|
|
387
434
|
"""
|
|
388
435
|
Build parameters.
|
|
389
436
|
|
|
@@ -401,7 +448,7 @@ def v_5ttgen_hsvs_params(
|
|
|
401
448
|
Parameter dictionary
|
|
402
449
|
"""
|
|
403
450
|
params = {
|
|
404
|
-
"
|
|
451
|
+
"@type": "hsvs",
|
|
405
452
|
"input": input_,
|
|
406
453
|
"output": output,
|
|
407
454
|
"white_stem": white_stem,
|
|
@@ -430,24 +477,24 @@ def v_5ttgen_hsvs_cargs(
|
|
|
430
477
|
"""
|
|
431
478
|
cargs = []
|
|
432
479
|
cargs.append("hsvs")
|
|
433
|
-
cargs.append(execution.input_file(params.get("input")))
|
|
434
|
-
cargs.append(params.get("output"))
|
|
435
|
-
if params.get("template") is not None:
|
|
480
|
+
cargs.append(execution.input_file(params.get("input", None)))
|
|
481
|
+
cargs.append(params.get("output", None))
|
|
482
|
+
if params.get("template", None) is not None:
|
|
436
483
|
cargs.extend([
|
|
437
484
|
"-template",
|
|
438
|
-
execution.input_file(params.get("template"))
|
|
485
|
+
execution.input_file(params.get("template", None))
|
|
439
486
|
])
|
|
440
|
-
if params.get("hippocampi") is not None:
|
|
487
|
+
if params.get("hippocampi", None) is not None:
|
|
441
488
|
cargs.extend([
|
|
442
489
|
"-hippocampi",
|
|
443
|
-
params.get("hippocampi")
|
|
490
|
+
params.get("hippocampi", None)
|
|
444
491
|
])
|
|
445
|
-
if params.get("thalami") is not None:
|
|
492
|
+
if params.get("thalami", None) is not None:
|
|
446
493
|
cargs.extend([
|
|
447
494
|
"-thalami",
|
|
448
|
-
params.get("thalami")
|
|
495
|
+
params.get("thalami", None)
|
|
449
496
|
])
|
|
450
|
-
if params.get("white_stem"):
|
|
497
|
+
if params.get("white_stem", False):
|
|
451
498
|
cargs.append("-white_stem")
|
|
452
499
|
return cargs
|
|
453
500
|
|
|
@@ -467,7 +514,7 @@ def v_5ttgen_hsvs_outputs(
|
|
|
467
514
|
"""
|
|
468
515
|
ret = V5ttgenHsvsOutputs(
|
|
469
516
|
root=execution.output_file("."),
|
|
470
|
-
output=execution.output_file(params.get("output")),
|
|
517
|
+
output=execution.output_file(params.get("output", None)),
|
|
471
518
|
)
|
|
472
519
|
return ret
|
|
473
520
|
|
|
@@ -475,7 +522,7 @@ def v_5ttgen_hsvs_outputs(
|
|
|
475
522
|
def v_5ttgen_config_params(
|
|
476
523
|
key: str,
|
|
477
524
|
value: str,
|
|
478
|
-
) ->
|
|
525
|
+
) -> V5ttgenConfigParametersTagged:
|
|
479
526
|
"""
|
|
480
527
|
Build parameters.
|
|
481
528
|
|
|
@@ -486,7 +533,7 @@ def v_5ttgen_config_params(
|
|
|
486
533
|
Parameter dictionary
|
|
487
534
|
"""
|
|
488
535
|
params = {
|
|
489
|
-
"
|
|
536
|
+
"@type": "config",
|
|
490
537
|
"key": key,
|
|
491
538
|
"value": value,
|
|
492
539
|
}
|
|
@@ -508,14 +555,14 @@ def v_5ttgen_config_cargs(
|
|
|
508
555
|
"""
|
|
509
556
|
cargs = []
|
|
510
557
|
cargs.append("-config")
|
|
511
|
-
cargs.append(params.get("key"))
|
|
512
|
-
cargs.append(params.get("value"))
|
|
558
|
+
cargs.append(params.get("key", None))
|
|
559
|
+
cargs.append(params.get("value", None))
|
|
513
560
|
return cargs
|
|
514
561
|
|
|
515
562
|
|
|
516
563
|
class V5ttgenOutputs(typing.NamedTuple):
|
|
517
564
|
"""
|
|
518
|
-
Output object returned when calling `
|
|
565
|
+
Output object returned when calling `V5ttgenParameters(...)`.
|
|
519
566
|
"""
|
|
520
567
|
root: OutputPathType
|
|
521
568
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -525,7 +572,7 @@ class V5ttgenOutputs(typing.NamedTuple):
|
|
|
525
572
|
|
|
526
573
|
|
|
527
574
|
def v_5ttgen_params(
|
|
528
|
-
algorithm: typing.Union[
|
|
575
|
+
algorithm: typing.Union[V5ttgenFreesurferParametersTagged, V5ttgenFslParametersTagged, V5ttgenGifParametersTagged, V5ttgenHsvsParametersTagged],
|
|
529
576
|
nocrop: bool = False,
|
|
530
577
|
sgm_amyg_hipp: bool = False,
|
|
531
578
|
nocleanup: bool = False,
|
|
@@ -539,7 +586,7 @@ def v_5ttgen_params(
|
|
|
539
586
|
config: list[V5ttgenConfigParameters] | None = None,
|
|
540
587
|
help_: bool = False,
|
|
541
588
|
version: bool = False,
|
|
542
|
-
) ->
|
|
589
|
+
) -> V5ttgenParametersTagged:
|
|
543
590
|
"""
|
|
544
591
|
Build parameters.
|
|
545
592
|
|
|
@@ -574,7 +621,7 @@ def v_5ttgen_params(
|
|
|
574
621
|
Parameter dictionary
|
|
575
622
|
"""
|
|
576
623
|
params = {
|
|
577
|
-
"
|
|
624
|
+
"@type": "mrtrix/5ttgen",
|
|
578
625
|
"algorithm": algorithm,
|
|
579
626
|
"nocrop": nocrop,
|
|
580
627
|
"sgm_amyg_hipp": sgm_amyg_hipp,
|
|
@@ -612,41 +659,41 @@ def v_5ttgen_cargs(
|
|
|
612
659
|
"""
|
|
613
660
|
cargs = []
|
|
614
661
|
cargs.append("5ttgen")
|
|
615
|
-
cargs.extend(
|
|
616
|
-
if params.get("nocrop"):
|
|
662
|
+
cargs.extend(v_5ttgen_algorithm_cargs_dyn_fn(params.get("algorithm", None)["@type"])(params.get("algorithm", None), execution))
|
|
663
|
+
if params.get("nocrop", False):
|
|
617
664
|
cargs.append("-nocrop")
|
|
618
|
-
if params.get("sgm_amyg_hipp"):
|
|
665
|
+
if params.get("sgm_amyg_hipp", False):
|
|
619
666
|
cargs.append("-sgm_amyg_hipp")
|
|
620
|
-
if params.get("nocleanup"):
|
|
667
|
+
if params.get("nocleanup", False):
|
|
621
668
|
cargs.append("-nocleanup")
|
|
622
|
-
if params.get("scratch") is not None:
|
|
669
|
+
if params.get("scratch", None) is not None:
|
|
623
670
|
cargs.extend([
|
|
624
671
|
"-scratch",
|
|
625
|
-
params.get("scratch")
|
|
672
|
+
params.get("scratch", None)
|
|
626
673
|
])
|
|
627
|
-
if params.get("continue") is not None:
|
|
674
|
+
if params.get("continue", None) is not None:
|
|
628
675
|
cargs.extend([
|
|
629
676
|
"-continue",
|
|
630
|
-
params.get("continue")
|
|
677
|
+
params.get("continue", None)
|
|
631
678
|
])
|
|
632
|
-
if params.get("info"):
|
|
679
|
+
if params.get("info", False):
|
|
633
680
|
cargs.append("-info")
|
|
634
|
-
if params.get("quiet"):
|
|
681
|
+
if params.get("quiet", False):
|
|
635
682
|
cargs.append("-quiet")
|
|
636
|
-
if params.get("debug"):
|
|
683
|
+
if params.get("debug", False):
|
|
637
684
|
cargs.append("-debug")
|
|
638
|
-
if params.get("force"):
|
|
685
|
+
if params.get("force", False):
|
|
639
686
|
cargs.append("-force")
|
|
640
|
-
if params.get("nthreads") is not None:
|
|
687
|
+
if params.get("nthreads", None) is not None:
|
|
641
688
|
cargs.extend([
|
|
642
689
|
"-nthreads",
|
|
643
|
-
str(params.get("nthreads"))
|
|
690
|
+
str(params.get("nthreads", None))
|
|
644
691
|
])
|
|
645
|
-
if params.get("config") is not None:
|
|
646
|
-
cargs.extend([a for c in [
|
|
647
|
-
if params.get("help"):
|
|
692
|
+
if params.get("config", None) is not None:
|
|
693
|
+
cargs.extend([a for c in [v_5ttgen_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
694
|
+
if params.get("help", False):
|
|
648
695
|
cargs.append("-help")
|
|
649
|
-
if params.get("version"):
|
|
696
|
+
if params.get("version", False):
|
|
650
697
|
cargs.append("-version")
|
|
651
698
|
return cargs
|
|
652
699
|
|
|
@@ -666,16 +713,18 @@ def v_5ttgen_outputs(
|
|
|
666
713
|
"""
|
|
667
714
|
ret = V5ttgenOutputs(
|
|
668
715
|
root=execution.output_file("."),
|
|
669
|
-
algorithm=
|
|
716
|
+
algorithm=v_5ttgen_algorithm_outputs_dyn_fn(params.get("algorithm")["@type"])(params.get("algorithm"), execution),
|
|
670
717
|
)
|
|
671
718
|
return ret
|
|
672
719
|
|
|
673
720
|
|
|
674
721
|
def v_5ttgen_execute(
|
|
675
722
|
params: V5ttgenParameters,
|
|
676
|
-
|
|
723
|
+
runner: Runner | None = None,
|
|
677
724
|
) -> V5ttgenOutputs:
|
|
678
725
|
"""
|
|
726
|
+
5ttgen
|
|
727
|
+
|
|
679
728
|
Generate a 5TT image suitable for ACT.
|
|
680
729
|
|
|
681
730
|
5ttgen acts as a 'master' script for generating a five-tissue-type (5TT)
|
|
@@ -695,10 +744,12 @@ def v_5ttgen_execute(
|
|
|
695
744
|
|
|
696
745
|
Args:
|
|
697
746
|
params: The parameters.
|
|
698
|
-
|
|
747
|
+
runner: Command runner.
|
|
699
748
|
Returns:
|
|
700
749
|
NamedTuple of outputs (described in `V5ttgenOutputs`).
|
|
701
750
|
"""
|
|
751
|
+
runner = runner or get_global_runner()
|
|
752
|
+
execution = runner.start_execution(V_5TTGEN_METADATA)
|
|
702
753
|
params = execution.params(params)
|
|
703
754
|
cargs = v_5ttgen_cargs(params, execution)
|
|
704
755
|
ret = v_5ttgen_outputs(params, execution)
|
|
@@ -707,7 +758,7 @@ def v_5ttgen_execute(
|
|
|
707
758
|
|
|
708
759
|
|
|
709
760
|
def v_5ttgen(
|
|
710
|
-
algorithm: typing.Union[
|
|
761
|
+
algorithm: typing.Union[V5ttgenFreesurferParametersTagged, V5ttgenFslParametersTagged, V5ttgenGifParametersTagged, V5ttgenHsvsParametersTagged],
|
|
711
762
|
nocrop: bool = False,
|
|
712
763
|
sgm_amyg_hipp: bool = False,
|
|
713
764
|
nocleanup: bool = False,
|
|
@@ -724,6 +775,8 @@ def v_5ttgen(
|
|
|
724
775
|
runner: Runner | None = None,
|
|
725
776
|
) -> V5ttgenOutputs:
|
|
726
777
|
"""
|
|
778
|
+
5ttgen
|
|
779
|
+
|
|
727
780
|
Generate a 5TT image suitable for ACT.
|
|
728
781
|
|
|
729
782
|
5ttgen acts as a 'master' script for generating a five-tissue-type (5TT)
|
|
@@ -772,8 +825,6 @@ def v_5ttgen(
|
|
|
772
825
|
Returns:
|
|
773
826
|
NamedTuple of outputs (described in `V5ttgenOutputs`).
|
|
774
827
|
"""
|
|
775
|
-
runner = runner or get_global_runner()
|
|
776
|
-
execution = runner.start_execution(V_5TTGEN_METADATA)
|
|
777
828
|
params = v_5ttgen_params(
|
|
778
829
|
algorithm=algorithm,
|
|
779
830
|
nocrop=nocrop,
|
|
@@ -790,24 +841,19 @@ def v_5ttgen(
|
|
|
790
841
|
help_=help_,
|
|
791
842
|
version=version,
|
|
792
843
|
)
|
|
793
|
-
return v_5ttgen_execute(params,
|
|
844
|
+
return v_5ttgen_execute(params, runner)
|
|
794
845
|
|
|
795
846
|
|
|
796
847
|
__all__ = [
|
|
797
|
-
"V5ttgenConfigParameters",
|
|
798
848
|
"V5ttgenFreesurferOutputs",
|
|
799
|
-
"V5ttgenFreesurferParameters",
|
|
800
849
|
"V5ttgenFslOutputs",
|
|
801
|
-
"V5ttgenFslParameters",
|
|
802
850
|
"V5ttgenGifOutputs",
|
|
803
|
-
"V5ttgenGifParameters",
|
|
804
851
|
"V5ttgenHsvsOutputs",
|
|
805
|
-
"V5ttgenHsvsParameters",
|
|
806
852
|
"V5ttgenOutputs",
|
|
807
|
-
"V5ttgenParameters",
|
|
808
853
|
"V_5TTGEN_METADATA",
|
|
809
854
|
"v_5ttgen",
|
|
810
855
|
"v_5ttgen_config_params",
|
|
856
|
+
"v_5ttgen_execute",
|
|
811
857
|
"v_5ttgen_freesurfer_params",
|
|
812
858
|
"v_5ttgen_fsl_params",
|
|
813
859
|
"v_5ttgen_gif_params",
|