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
|
FOD2FIXEL_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="789d8f209b3fdf4c5f81cd43bcf2cd1ab6e4addc.boutiques",
|
|
10
10
|
name="fod2fixel",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,43 @@ FOD2FIXEL_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Fod2fixelConfigParameters = typing.TypedDict('Fod2fixelConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
Fod2fixelConfigParametersTagged = typing.TypedDict('Fod2fixelConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
Fod2fixelParameters = typing.TypedDict('Fod2fixelParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/fod2fixel"]],
|
|
30
|
+
"afd": typing.NotRequired[str | None],
|
|
31
|
+
"peak_amp": typing.NotRequired[str | None],
|
|
32
|
+
"disp": typing.NotRequired[str | None],
|
|
33
|
+
"fmls_integral": typing.NotRequired[float | None],
|
|
34
|
+
"fmls_peak_value": typing.NotRequired[float | None],
|
|
35
|
+
"fmls_no_thresholds": bool,
|
|
36
|
+
"fmls_lobe_merge_ratio": typing.NotRequired[float | None],
|
|
37
|
+
"mask": typing.NotRequired[InputPathType | None],
|
|
38
|
+
"maxnum": typing.NotRequired[int | None],
|
|
39
|
+
"nii": bool,
|
|
40
|
+
"dirpeak": bool,
|
|
41
|
+
"info": bool,
|
|
42
|
+
"quiet": bool,
|
|
43
|
+
"debug": bool,
|
|
44
|
+
"force": bool,
|
|
45
|
+
"nthreads": typing.NotRequired[int | None],
|
|
46
|
+
"config": typing.NotRequired[list[Fod2fixelConfigParameters] | None],
|
|
47
|
+
"help": bool,
|
|
48
|
+
"version": bool,
|
|
49
|
+
"fod": InputPathType,
|
|
50
|
+
"fixel_directory": str,
|
|
51
|
+
})
|
|
52
|
+
Fod2fixelParametersTagged = typing.TypedDict('Fod2fixelParametersTagged', {
|
|
53
|
+
"@type": typing.Literal["mrtrix/fod2fixel"],
|
|
25
54
|
"afd": typing.NotRequired[str | None],
|
|
26
55
|
"peak_amp": typing.NotRequired[str | None],
|
|
27
56
|
"disp": typing.NotRequired[str | None],
|
|
@@ -44,45 +73,12 @@ Fod2fixelParameters = typing.TypedDict('Fod2fixelParameters', {
|
|
|
44
73
|
"fod": InputPathType,
|
|
45
74
|
"fixel_directory": str,
|
|
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
|
-
"fod2fixel": fod2fixel_cargs,
|
|
62
|
-
"config": fod2fixel_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
|
-
"fod2fixel": fod2fixel_outputs,
|
|
79
|
-
}.get(t)
|
|
80
76
|
|
|
81
77
|
|
|
82
78
|
def fod2fixel_config_params(
|
|
83
79
|
key: str,
|
|
84
80
|
value: str,
|
|
85
|
-
) ->
|
|
81
|
+
) -> Fod2fixelConfigParametersTagged:
|
|
86
82
|
"""
|
|
87
83
|
Build parameters.
|
|
88
84
|
|
|
@@ -93,7 +89,7 @@ def fod2fixel_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 fod2fixel_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 Fod2fixelOutputs(typing.NamedTuple):
|
|
124
120
|
"""
|
|
125
|
-
Output object returned when calling `
|
|
121
|
+
Output object returned when calling `Fod2fixelParameters(...)`.
|
|
126
122
|
"""
|
|
127
123
|
root: OutputPathType
|
|
128
124
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -160,7 +156,7 @@ def fod2fixel_params(
|
|
|
160
156
|
config: list[Fod2fixelConfigParameters] | None = None,
|
|
161
157
|
help_: bool = False,
|
|
162
158
|
version: bool = False,
|
|
163
|
-
) ->
|
|
159
|
+
) -> Fod2fixelParametersTagged:
|
|
164
160
|
"""
|
|
165
161
|
Build parameters.
|
|
166
162
|
|
|
@@ -212,7 +208,7 @@ def fod2fixel_params(
|
|
|
212
208
|
Parameter dictionary
|
|
213
209
|
"""
|
|
214
210
|
params = {
|
|
215
|
-
"
|
|
211
|
+
"@type": "mrtrix/fod2fixel",
|
|
216
212
|
"fmls_no_thresholds": fmls_no_thresholds,
|
|
217
213
|
"nii": nii,
|
|
218
214
|
"dirpeak": dirpeak,
|
|
@@ -263,73 +259,73 @@ def fod2fixel_cargs(
|
|
|
263
259
|
"""
|
|
264
260
|
cargs = []
|
|
265
261
|
cargs.append("fod2fixel")
|
|
266
|
-
if params.get("afd") is not None:
|
|
262
|
+
if params.get("afd", None) is not None:
|
|
267
263
|
cargs.extend([
|
|
268
264
|
"-afd",
|
|
269
|
-
params.get("afd")
|
|
265
|
+
params.get("afd", None)
|
|
270
266
|
])
|
|
271
|
-
if params.get("peak_amp") is not None:
|
|
267
|
+
if params.get("peak_amp", None) is not None:
|
|
272
268
|
cargs.extend([
|
|
273
269
|
"-peak_amp",
|
|
274
|
-
params.get("peak_amp")
|
|
270
|
+
params.get("peak_amp", None)
|
|
275
271
|
])
|
|
276
|
-
if params.get("disp") is not None:
|
|
272
|
+
if params.get("disp", None) is not None:
|
|
277
273
|
cargs.extend([
|
|
278
274
|
"-disp",
|
|
279
|
-
params.get("disp")
|
|
275
|
+
params.get("disp", None)
|
|
280
276
|
])
|
|
281
|
-
if params.get("fmls_integral") is not None:
|
|
277
|
+
if params.get("fmls_integral", None) is not None:
|
|
282
278
|
cargs.extend([
|
|
283
279
|
"-fmls_integral",
|
|
284
|
-
str(params.get("fmls_integral"))
|
|
280
|
+
str(params.get("fmls_integral", None))
|
|
285
281
|
])
|
|
286
|
-
if params.get("fmls_peak_value") is not None:
|
|
282
|
+
if params.get("fmls_peak_value", None) is not None:
|
|
287
283
|
cargs.extend([
|
|
288
284
|
"-fmls_peak_value",
|
|
289
|
-
str(params.get("fmls_peak_value"))
|
|
285
|
+
str(params.get("fmls_peak_value", None))
|
|
290
286
|
])
|
|
291
|
-
if params.get("fmls_no_thresholds"):
|
|
287
|
+
if params.get("fmls_no_thresholds", False):
|
|
292
288
|
cargs.append("-fmls_no_thresholds")
|
|
293
|
-
if params.get("fmls_lobe_merge_ratio") is not None:
|
|
289
|
+
if params.get("fmls_lobe_merge_ratio", None) is not None:
|
|
294
290
|
cargs.extend([
|
|
295
291
|
"-fmls_lobe_merge_ratio",
|
|
296
|
-
str(params.get("fmls_lobe_merge_ratio"))
|
|
292
|
+
str(params.get("fmls_lobe_merge_ratio", None))
|
|
297
293
|
])
|
|
298
|
-
if params.get("mask") is not None:
|
|
294
|
+
if params.get("mask", None) is not None:
|
|
299
295
|
cargs.extend([
|
|
300
296
|
"-mask",
|
|
301
|
-
execution.input_file(params.get("mask"))
|
|
297
|
+
execution.input_file(params.get("mask", None))
|
|
302
298
|
])
|
|
303
|
-
if params.get("maxnum") is not None:
|
|
299
|
+
if params.get("maxnum", None) is not None:
|
|
304
300
|
cargs.extend([
|
|
305
301
|
"-maxnum",
|
|
306
|
-
str(params.get("maxnum"))
|
|
302
|
+
str(params.get("maxnum", None))
|
|
307
303
|
])
|
|
308
|
-
if params.get("nii"):
|
|
304
|
+
if params.get("nii", False):
|
|
309
305
|
cargs.append("-nii")
|
|
310
|
-
if params.get("dirpeak"):
|
|
306
|
+
if params.get("dirpeak", False):
|
|
311
307
|
cargs.append("-dirpeak")
|
|
312
|
-
if params.get("info"):
|
|
308
|
+
if params.get("info", False):
|
|
313
309
|
cargs.append("-info")
|
|
314
|
-
if params.get("quiet"):
|
|
310
|
+
if params.get("quiet", False):
|
|
315
311
|
cargs.append("-quiet")
|
|
316
|
-
if params.get("debug"):
|
|
312
|
+
if params.get("debug", False):
|
|
317
313
|
cargs.append("-debug")
|
|
318
|
-
if params.get("force"):
|
|
314
|
+
if params.get("force", False):
|
|
319
315
|
cargs.append("-force")
|
|
320
|
-
if params.get("nthreads") is not None:
|
|
316
|
+
if params.get("nthreads", None) is not None:
|
|
321
317
|
cargs.extend([
|
|
322
318
|
"-nthreads",
|
|
323
|
-
str(params.get("nthreads"))
|
|
319
|
+
str(params.get("nthreads", None))
|
|
324
320
|
])
|
|
325
|
-
if params.get("config") is not None:
|
|
326
|
-
cargs.extend([a for c in [
|
|
327
|
-
if params.get("help"):
|
|
321
|
+
if params.get("config", None) is not None:
|
|
322
|
+
cargs.extend([a for c in [fod2fixel_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
323
|
+
if params.get("help", False):
|
|
328
324
|
cargs.append("-help")
|
|
329
|
-
if params.get("version"):
|
|
325
|
+
if params.get("version", False):
|
|
330
326
|
cargs.append("-version")
|
|
331
|
-
cargs.append(execution.input_file(params.get("fod")))
|
|
332
|
-
cargs.append(params.get("fixel_directory"))
|
|
327
|
+
cargs.append(execution.input_file(params.get("fod", None)))
|
|
328
|
+
cargs.append(params.get("fixel_directory", None))
|
|
333
329
|
return cargs
|
|
334
330
|
|
|
335
331
|
|
|
@@ -348,19 +344,21 @@ def fod2fixel_outputs(
|
|
|
348
344
|
"""
|
|
349
345
|
ret = Fod2fixelOutputs(
|
|
350
346
|
root=execution.output_file("."),
|
|
351
|
-
fixel_directory=execution.output_file(params.get("fixel_directory")),
|
|
352
|
-
afd=execution.output_file(params.get("afd")) if (params.get("afd") is not None) else None,
|
|
353
|
-
peak_amp=execution.output_file(params.get("peak_amp")) if (params.get("peak_amp") is not None) else None,
|
|
354
|
-
disp=execution.output_file(params.get("disp")) if (params.get("disp") is not None) else None,
|
|
347
|
+
fixel_directory=execution.output_file(params.get("fixel_directory", None)),
|
|
348
|
+
afd=execution.output_file(params.get("afd", None)) if (params.get("afd") is not None) else None,
|
|
349
|
+
peak_amp=execution.output_file(params.get("peak_amp", None)) if (params.get("peak_amp") is not None) else None,
|
|
350
|
+
disp=execution.output_file(params.get("disp", None)) if (params.get("disp") is not None) else None,
|
|
355
351
|
)
|
|
356
352
|
return ret
|
|
357
353
|
|
|
358
354
|
|
|
359
355
|
def fod2fixel_execute(
|
|
360
356
|
params: Fod2fixelParameters,
|
|
361
|
-
|
|
357
|
+
runner: Runner | None = None,
|
|
362
358
|
) -> Fod2fixelOutputs:
|
|
363
359
|
"""
|
|
360
|
+
fod2fixel
|
|
361
|
+
|
|
364
362
|
Perform segmentation of continuous Fibre Orientation Distributions (FODs) to
|
|
365
363
|
produce discrete fixels.
|
|
366
364
|
|
|
@@ -385,10 +383,12 @@ def fod2fixel_execute(
|
|
|
385
383
|
|
|
386
384
|
Args:
|
|
387
385
|
params: The parameters.
|
|
388
|
-
|
|
386
|
+
runner: Command runner.
|
|
389
387
|
Returns:
|
|
390
388
|
NamedTuple of outputs (described in `Fod2fixelOutputs`).
|
|
391
389
|
"""
|
|
390
|
+
runner = runner or get_global_runner()
|
|
391
|
+
execution = runner.start_execution(FOD2FIXEL_METADATA)
|
|
392
392
|
params = execution.params(params)
|
|
393
393
|
cargs = fod2fixel_cargs(params, execution)
|
|
394
394
|
ret = fod2fixel_outputs(params, execution)
|
|
@@ -421,6 +421,8 @@ def fod2fixel(
|
|
|
421
421
|
runner: Runner | None = None,
|
|
422
422
|
) -> Fod2fixelOutputs:
|
|
423
423
|
"""
|
|
424
|
+
fod2fixel
|
|
425
|
+
|
|
424
426
|
Perform segmentation of continuous Fibre Orientation Distributions (FODs) to
|
|
425
427
|
produce discrete fixels.
|
|
426
428
|
|
|
@@ -491,8 +493,6 @@ def fod2fixel(
|
|
|
491
493
|
Returns:
|
|
492
494
|
NamedTuple of outputs (described in `Fod2fixelOutputs`).
|
|
493
495
|
"""
|
|
494
|
-
runner = runner or get_global_runner()
|
|
495
|
-
execution = runner.start_execution(FOD2FIXEL_METADATA)
|
|
496
496
|
params = fod2fixel_params(
|
|
497
497
|
afd=afd,
|
|
498
498
|
peak_amp=peak_amp,
|
|
@@ -516,15 +516,14 @@ def fod2fixel(
|
|
|
516
516
|
fod=fod,
|
|
517
517
|
fixel_directory=fixel_directory,
|
|
518
518
|
)
|
|
519
|
-
return fod2fixel_execute(params,
|
|
519
|
+
return fod2fixel_execute(params, runner)
|
|
520
520
|
|
|
521
521
|
|
|
522
522
|
__all__ = [
|
|
523
523
|
"FOD2FIXEL_METADATA",
|
|
524
|
-
"Fod2fixelConfigParameters",
|
|
525
524
|
"Fod2fixelOutputs",
|
|
526
|
-
"Fod2fixelParameters",
|
|
527
525
|
"fod2fixel",
|
|
528
526
|
"fod2fixel_config_params",
|
|
527
|
+
"fod2fixel_execute",
|
|
529
528
|
"fod2fixel_params",
|
|
530
529
|
]
|
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
LABEL2COLOUR_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="9c64d87e6b80097d51226570fbf47cc009d84140.boutiques",
|
|
10
10
|
name="label2colour",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,33 @@ LABEL2COLOUR_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Label2colourConfigParameters = typing.TypedDict('Label2colourConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
Label2colourConfigParametersTagged = typing.TypedDict('Label2colourConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
Label2colourParameters = typing.TypedDict('Label2colourParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/label2colour"]],
|
|
30
|
+
"lut": typing.NotRequired[InputPathType | None],
|
|
31
|
+
"info": bool,
|
|
32
|
+
"quiet": bool,
|
|
33
|
+
"debug": bool,
|
|
34
|
+
"force": bool,
|
|
35
|
+
"nthreads": typing.NotRequired[int | None],
|
|
36
|
+
"config": typing.NotRequired[list[Label2colourConfigParameters] | None],
|
|
37
|
+
"help": bool,
|
|
38
|
+
"version": bool,
|
|
39
|
+
"nodes_in": InputPathType,
|
|
40
|
+
"colour_out": str,
|
|
41
|
+
})
|
|
42
|
+
Label2colourParametersTagged = typing.TypedDict('Label2colourParametersTagged', {
|
|
43
|
+
"@type": typing.Literal["mrtrix/label2colour"],
|
|
25
44
|
"lut": typing.NotRequired[InputPathType | None],
|
|
26
45
|
"info": bool,
|
|
27
46
|
"quiet": bool,
|
|
@@ -34,45 +53,12 @@ Label2colourParameters = typing.TypedDict('Label2colourParameters', {
|
|
|
34
53
|
"nodes_in": InputPathType,
|
|
35
54
|
"colour_out": 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
|
-
"label2colour": label2colour_cargs,
|
|
52
|
-
"config": label2colour_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
|
-
"label2colour": label2colour_outputs,
|
|
69
|
-
}.get(t)
|
|
70
56
|
|
|
71
57
|
|
|
72
58
|
def label2colour_config_params(
|
|
73
59
|
key: str,
|
|
74
60
|
value: str,
|
|
75
|
-
) ->
|
|
61
|
+
) -> Label2colourConfigParametersTagged:
|
|
76
62
|
"""
|
|
77
63
|
Build parameters.
|
|
78
64
|
|
|
@@ -83,7 +69,7 @@ def label2colour_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 label2colour_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 Label2colourOutputs(typing.NamedTuple):
|
|
114
100
|
"""
|
|
115
|
-
Output object returned when calling `
|
|
101
|
+
Output object returned when calling `Label2colourParameters(...)`.
|
|
116
102
|
"""
|
|
117
103
|
root: OutputPathType
|
|
118
104
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -132,7 +118,7 @@ def label2colour_params(
|
|
|
132
118
|
config: list[Label2colourConfigParameters] | None = None,
|
|
133
119
|
help_: bool = False,
|
|
134
120
|
version: bool = False,
|
|
135
|
-
) ->
|
|
121
|
+
) -> Label2colourParametersTagged:
|
|
136
122
|
"""
|
|
137
123
|
Build parameters.
|
|
138
124
|
|
|
@@ -157,7 +143,7 @@ def label2colour_params(
|
|
|
157
143
|
Parameter dictionary
|
|
158
144
|
"""
|
|
159
145
|
params = {
|
|
160
|
-
"
|
|
146
|
+
"@type": "mrtrix/label2colour",
|
|
161
147
|
"info": info,
|
|
162
148
|
"quiet": quiet,
|
|
163
149
|
"debug": debug,
|
|
@@ -191,32 +177,32 @@ def label2colour_cargs(
|
|
|
191
177
|
"""
|
|
192
178
|
cargs = []
|
|
193
179
|
cargs.append("label2colour")
|
|
194
|
-
if params.get("lut") is not None:
|
|
180
|
+
if params.get("lut", None) is not None:
|
|
195
181
|
cargs.extend([
|
|
196
182
|
"-lut",
|
|
197
|
-
execution.input_file(params.get("lut"))
|
|
183
|
+
execution.input_file(params.get("lut", None))
|
|
198
184
|
])
|
|
199
|
-
if params.get("info"):
|
|
185
|
+
if params.get("info", False):
|
|
200
186
|
cargs.append("-info")
|
|
201
|
-
if params.get("quiet"):
|
|
187
|
+
if params.get("quiet", False):
|
|
202
188
|
cargs.append("-quiet")
|
|
203
|
-
if params.get("debug"):
|
|
189
|
+
if params.get("debug", False):
|
|
204
190
|
cargs.append("-debug")
|
|
205
|
-
if params.get("force"):
|
|
191
|
+
if params.get("force", False):
|
|
206
192
|
cargs.append("-force")
|
|
207
|
-
if params.get("nthreads") is not None:
|
|
193
|
+
if params.get("nthreads", None) is not None:
|
|
208
194
|
cargs.extend([
|
|
209
195
|
"-nthreads",
|
|
210
|
-
str(params.get("nthreads"))
|
|
196
|
+
str(params.get("nthreads", None))
|
|
211
197
|
])
|
|
212
|
-
if params.get("config") is not None:
|
|
213
|
-
cargs.extend([a for c in [
|
|
214
|
-
if params.get("help"):
|
|
198
|
+
if params.get("config", None) is not None:
|
|
199
|
+
cargs.extend([a for c in [label2colour_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
200
|
+
if params.get("help", False):
|
|
215
201
|
cargs.append("-help")
|
|
216
|
-
if params.get("version"):
|
|
202
|
+
if params.get("version", False):
|
|
217
203
|
cargs.append("-version")
|
|
218
|
-
cargs.append(execution.input_file(params.get("nodes_in")))
|
|
219
|
-
cargs.append(params.get("colour_out"))
|
|
204
|
+
cargs.append(execution.input_file(params.get("nodes_in", None)))
|
|
205
|
+
cargs.append(params.get("colour_out", None))
|
|
220
206
|
return cargs
|
|
221
207
|
|
|
222
208
|
|
|
@@ -235,17 +221,20 @@ def label2colour_outputs(
|
|
|
235
221
|
"""
|
|
236
222
|
ret = Label2colourOutputs(
|
|
237
223
|
root=execution.output_file("."),
|
|
238
|
-
colour_out=execution.output_file(params.get("colour_out")),
|
|
224
|
+
colour_out=execution.output_file(params.get("colour_out", None)),
|
|
239
225
|
)
|
|
240
226
|
return ret
|
|
241
227
|
|
|
242
228
|
|
|
243
229
|
def label2colour_execute(
|
|
244
230
|
params: Label2colourParameters,
|
|
245
|
-
|
|
231
|
+
runner: Runner | None = None,
|
|
246
232
|
) -> Label2colourOutputs:
|
|
247
233
|
"""
|
|
248
|
-
|
|
234
|
+
label2colour
|
|
235
|
+
|
|
236
|
+
Convert a parcellated image (where values are node indices) into a colour
|
|
237
|
+
image.
|
|
249
238
|
|
|
250
239
|
Many software packages handle this colouring internally within their viewer
|
|
251
240
|
program; this binary explicitly converts a parcellation image into a colour
|
|
@@ -261,10 +250,12 @@ def label2colour_execute(
|
|
|
261
250
|
|
|
262
251
|
Args:
|
|
263
252
|
params: The parameters.
|
|
264
|
-
|
|
253
|
+
runner: Command runner.
|
|
265
254
|
Returns:
|
|
266
255
|
NamedTuple of outputs (described in `Label2colourOutputs`).
|
|
267
256
|
"""
|
|
257
|
+
runner = runner or get_global_runner()
|
|
258
|
+
execution = runner.start_execution(LABEL2COLOUR_METADATA)
|
|
268
259
|
params = execution.params(params)
|
|
269
260
|
cargs = label2colour_cargs(params, execution)
|
|
270
261
|
ret = label2colour_outputs(params, execution)
|
|
@@ -287,7 +278,10 @@ def label2colour(
|
|
|
287
278
|
runner: Runner | None = None,
|
|
288
279
|
) -> Label2colourOutputs:
|
|
289
280
|
"""
|
|
290
|
-
|
|
281
|
+
label2colour
|
|
282
|
+
|
|
283
|
+
Convert a parcellated image (where values are node indices) into a colour
|
|
284
|
+
image.
|
|
291
285
|
|
|
292
286
|
Many software packages handle this colouring internally within their viewer
|
|
293
287
|
program; this binary explicitly converts a parcellation image into a colour
|
|
@@ -322,8 +316,6 @@ def label2colour(
|
|
|
322
316
|
Returns:
|
|
323
317
|
NamedTuple of outputs (described in `Label2colourOutputs`).
|
|
324
318
|
"""
|
|
325
|
-
runner = runner or get_global_runner()
|
|
326
|
-
execution = runner.start_execution(LABEL2COLOUR_METADATA)
|
|
327
319
|
params = label2colour_params(
|
|
328
320
|
lut=lut,
|
|
329
321
|
info=info,
|
|
@@ -337,15 +329,14 @@ def label2colour(
|
|
|
337
329
|
nodes_in=nodes_in,
|
|
338
330
|
colour_out=colour_out,
|
|
339
331
|
)
|
|
340
|
-
return label2colour_execute(params,
|
|
332
|
+
return label2colour_execute(params, runner)
|
|
341
333
|
|
|
342
334
|
|
|
343
335
|
__all__ = [
|
|
344
336
|
"LABEL2COLOUR_METADATA",
|
|
345
|
-
"Label2colourConfigParameters",
|
|
346
337
|
"Label2colourOutputs",
|
|
347
|
-
"Label2colourParameters",
|
|
348
338
|
"label2colour",
|
|
349
339
|
"label2colour_config_params",
|
|
340
|
+
"label2colour_execute",
|
|
350
341
|
"label2colour_params",
|
|
351
342
|
]
|