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
|
FIXELREORIENT_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="c2bf37ec8d7ea2da68c628776a8974d1b5351f66.boutiques",
|
|
10
10
|
name="fixelreorient",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,33 @@ FIXELREORIENT_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
FixelreorientConfigParameters = typing.TypedDict('FixelreorientConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
FixelreorientConfigParametersTagged = typing.TypedDict('FixelreorientConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
FixelreorientParameters = typing.TypedDict('FixelreorientParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/fixelreorient"]],
|
|
30
|
+
"info": bool,
|
|
31
|
+
"quiet": bool,
|
|
32
|
+
"debug": bool,
|
|
33
|
+
"force": bool,
|
|
34
|
+
"nthreads": typing.NotRequired[int | None],
|
|
35
|
+
"config": typing.NotRequired[list[FixelreorientConfigParameters] | None],
|
|
36
|
+
"help": bool,
|
|
37
|
+
"version": bool,
|
|
38
|
+
"fixel_in": InputPathType,
|
|
39
|
+
"warp": InputPathType,
|
|
40
|
+
"fixel_out": str,
|
|
41
|
+
})
|
|
42
|
+
FixelreorientParametersTagged = typing.TypedDict('FixelreorientParametersTagged', {
|
|
43
|
+
"@type": typing.Literal["mrtrix/fixelreorient"],
|
|
25
44
|
"info": bool,
|
|
26
45
|
"quiet": bool,
|
|
27
46
|
"debug": bool,
|
|
@@ -34,45 +53,12 @@ FixelreorientParameters = typing.TypedDict('FixelreorientParameters', {
|
|
|
34
53
|
"warp": InputPathType,
|
|
35
54
|
"fixel_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
|
-
"fixelreorient": fixelreorient_cargs,
|
|
52
|
-
"config": fixelreorient_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
|
-
"fixelreorient": fixelreorient_outputs,
|
|
69
|
-
}.get(t)
|
|
70
56
|
|
|
71
57
|
|
|
72
58
|
def fixelreorient_config_params(
|
|
73
59
|
key: str,
|
|
74
60
|
value: str,
|
|
75
|
-
) ->
|
|
61
|
+
) -> FixelreorientConfigParametersTagged:
|
|
76
62
|
"""
|
|
77
63
|
Build parameters.
|
|
78
64
|
|
|
@@ -83,7 +69,7 @@ def fixelreorient_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 fixelreorient_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 FixelreorientOutputs(typing.NamedTuple):
|
|
114
100
|
"""
|
|
115
|
-
Output object returned when calling `
|
|
101
|
+
Output object returned when calling `FixelreorientParameters(...)`.
|
|
116
102
|
"""
|
|
117
103
|
root: OutputPathType
|
|
118
104
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -135,7 +121,7 @@ def fixelreorient_params(
|
|
|
135
121
|
config: list[FixelreorientConfigParameters] | None = None,
|
|
136
122
|
help_: bool = False,
|
|
137
123
|
version: bool = False,
|
|
138
|
-
) ->
|
|
124
|
+
) -> FixelreorientParametersTagged:
|
|
139
125
|
"""
|
|
140
126
|
Build parameters.
|
|
141
127
|
|
|
@@ -166,7 +152,7 @@ def fixelreorient_params(
|
|
|
166
152
|
Parameter dictionary
|
|
167
153
|
"""
|
|
168
154
|
params = {
|
|
169
|
-
"
|
|
155
|
+
"@type": "mrtrix/fixelreorient",
|
|
170
156
|
"info": info,
|
|
171
157
|
"quiet": quiet,
|
|
172
158
|
"debug": debug,
|
|
@@ -199,28 +185,28 @@ def fixelreorient_cargs(
|
|
|
199
185
|
"""
|
|
200
186
|
cargs = []
|
|
201
187
|
cargs.append("fixelreorient")
|
|
202
|
-
if params.get("info"):
|
|
188
|
+
if params.get("info", False):
|
|
203
189
|
cargs.append("-info")
|
|
204
|
-
if params.get("quiet"):
|
|
190
|
+
if params.get("quiet", False):
|
|
205
191
|
cargs.append("-quiet")
|
|
206
|
-
if params.get("debug"):
|
|
192
|
+
if params.get("debug", False):
|
|
207
193
|
cargs.append("-debug")
|
|
208
|
-
if params.get("force"):
|
|
194
|
+
if params.get("force", False):
|
|
209
195
|
cargs.append("-force")
|
|
210
|
-
if params.get("nthreads") is not None:
|
|
196
|
+
if params.get("nthreads", None) is not None:
|
|
211
197
|
cargs.extend([
|
|
212
198
|
"-nthreads",
|
|
213
|
-
str(params.get("nthreads"))
|
|
199
|
+
str(params.get("nthreads", None))
|
|
214
200
|
])
|
|
215
|
-
if params.get("config") is not None:
|
|
216
|
-
cargs.extend([a for c in [
|
|
217
|
-
if params.get("help"):
|
|
201
|
+
if params.get("config", None) is not None:
|
|
202
|
+
cargs.extend([a for c in [fixelreorient_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
203
|
+
if params.get("help", False):
|
|
218
204
|
cargs.append("-help")
|
|
219
|
-
if params.get("version"):
|
|
205
|
+
if params.get("version", False):
|
|
220
206
|
cargs.append("-version")
|
|
221
|
-
cargs.append(execution.input_file(params.get("fixel_in")))
|
|
222
|
-
cargs.append(execution.input_file(params.get("warp")))
|
|
223
|
-
cargs.append(params.get("fixel_out"))
|
|
207
|
+
cargs.append(execution.input_file(params.get("fixel_in", None)))
|
|
208
|
+
cargs.append(execution.input_file(params.get("warp", None)))
|
|
209
|
+
cargs.append(params.get("fixel_out", None))
|
|
224
210
|
return cargs
|
|
225
211
|
|
|
226
212
|
|
|
@@ -239,16 +225,18 @@ def fixelreorient_outputs(
|
|
|
239
225
|
"""
|
|
240
226
|
ret = FixelreorientOutputs(
|
|
241
227
|
root=execution.output_file("."),
|
|
242
|
-
fixel_out=execution.output_file(params.get("fixel_out")),
|
|
228
|
+
fixel_out=execution.output_file(params.get("fixel_out", None)),
|
|
243
229
|
)
|
|
244
230
|
return ret
|
|
245
231
|
|
|
246
232
|
|
|
247
233
|
def fixelreorient_execute(
|
|
248
234
|
params: FixelreorientParameters,
|
|
249
|
-
|
|
235
|
+
runner: Runner | None = None,
|
|
250
236
|
) -> FixelreorientOutputs:
|
|
251
237
|
"""
|
|
238
|
+
fixelreorient
|
|
239
|
+
|
|
252
240
|
Reorient fixel directions.
|
|
253
241
|
|
|
254
242
|
Reorientation is performed by transforming the vector representing the fixel
|
|
@@ -265,10 +253,12 @@ def fixelreorient_execute(
|
|
|
265
253
|
|
|
266
254
|
Args:
|
|
267
255
|
params: The parameters.
|
|
268
|
-
|
|
256
|
+
runner: Command runner.
|
|
269
257
|
Returns:
|
|
270
258
|
NamedTuple of outputs (described in `FixelreorientOutputs`).
|
|
271
259
|
"""
|
|
260
|
+
runner = runner or get_global_runner()
|
|
261
|
+
execution = runner.start_execution(FIXELREORIENT_METADATA)
|
|
272
262
|
params = execution.params(params)
|
|
273
263
|
cargs = fixelreorient_cargs(params, execution)
|
|
274
264
|
ret = fixelreorient_outputs(params, execution)
|
|
@@ -291,6 +281,8 @@ def fixelreorient(
|
|
|
291
281
|
runner: Runner | None = None,
|
|
292
282
|
) -> FixelreorientOutputs:
|
|
293
283
|
"""
|
|
284
|
+
fixelreorient
|
|
285
|
+
|
|
294
286
|
Reorient fixel directions.
|
|
295
287
|
|
|
296
288
|
Reorientation is performed by transforming the vector representing the fixel
|
|
@@ -332,8 +324,6 @@ def fixelreorient(
|
|
|
332
324
|
Returns:
|
|
333
325
|
NamedTuple of outputs (described in `FixelreorientOutputs`).
|
|
334
326
|
"""
|
|
335
|
-
runner = runner or get_global_runner()
|
|
336
|
-
execution = runner.start_execution(FIXELREORIENT_METADATA)
|
|
337
327
|
params = fixelreorient_params(
|
|
338
328
|
info=info,
|
|
339
329
|
quiet=quiet,
|
|
@@ -347,15 +337,14 @@ def fixelreorient(
|
|
|
347
337
|
warp=warp,
|
|
348
338
|
fixel_out=fixel_out,
|
|
349
339
|
)
|
|
350
|
-
return fixelreorient_execute(params,
|
|
340
|
+
return fixelreorient_execute(params, runner)
|
|
351
341
|
|
|
352
342
|
|
|
353
343
|
__all__ = [
|
|
354
344
|
"FIXELREORIENT_METADATA",
|
|
355
|
-
"FixelreorientConfigParameters",
|
|
356
345
|
"FixelreorientOutputs",
|
|
357
|
-
"FixelreorientParameters",
|
|
358
346
|
"fixelreorient",
|
|
359
347
|
"fixelreorient_config_params",
|
|
348
|
+
"fixelreorient_execute",
|
|
360
349
|
"fixelreorient_params",
|
|
361
350
|
]
|
niwrap_mrtrix/mrtrix/fod2dec.py
CHANGED
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
FOD2DEC_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="56fd41eb31bb1240fd6341ac5abf21815b0e9dac.boutiques",
|
|
10
10
|
name="fod2dec",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,39 @@ FOD2DEC_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Fod2decConfigParameters = typing.TypedDict('Fod2decConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
Fod2decConfigParametersTagged = typing.TypedDict('Fod2decConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
Fod2decParameters = typing.TypedDict('Fod2decParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/fod2dec"]],
|
|
30
|
+
"mask": typing.NotRequired[InputPathType | None],
|
|
31
|
+
"contrast": typing.NotRequired[InputPathType | None],
|
|
32
|
+
"lum": bool,
|
|
33
|
+
"lum_coefs": typing.NotRequired[list[float] | None],
|
|
34
|
+
"lum_gamma": typing.NotRequired[float | None],
|
|
35
|
+
"threshold": typing.NotRequired[float | None],
|
|
36
|
+
"no_weight": bool,
|
|
37
|
+
"info": bool,
|
|
38
|
+
"quiet": bool,
|
|
39
|
+
"debug": bool,
|
|
40
|
+
"force": bool,
|
|
41
|
+
"nthreads": typing.NotRequired[int | None],
|
|
42
|
+
"config": typing.NotRequired[list[Fod2decConfigParameters] | None],
|
|
43
|
+
"help": bool,
|
|
44
|
+
"version": bool,
|
|
45
|
+
"input": InputPathType,
|
|
46
|
+
"output": str,
|
|
47
|
+
})
|
|
48
|
+
Fod2decParametersTagged = typing.TypedDict('Fod2decParametersTagged', {
|
|
49
|
+
"@type": typing.Literal["mrtrix/fod2dec"],
|
|
25
50
|
"mask": typing.NotRequired[InputPathType | None],
|
|
26
51
|
"contrast": typing.NotRequired[InputPathType | None],
|
|
27
52
|
"lum": bool,
|
|
@@ -40,45 +65,12 @@ Fod2decParameters = typing.TypedDict('Fod2decParameters', {
|
|
|
40
65
|
"input": InputPathType,
|
|
41
66
|
"output": str,
|
|
42
67
|
})
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def dyn_cargs(
|
|
46
|
-
t: str,
|
|
47
|
-
) -> typing.Any:
|
|
48
|
-
"""
|
|
49
|
-
Get build cargs function by command type.
|
|
50
|
-
|
|
51
|
-
Args:
|
|
52
|
-
t: Command type.
|
|
53
|
-
Returns:
|
|
54
|
-
Build cargs function.
|
|
55
|
-
"""
|
|
56
|
-
return {
|
|
57
|
-
"fod2dec": fod2dec_cargs,
|
|
58
|
-
"config": fod2dec_config_cargs,
|
|
59
|
-
}.get(t)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
def dyn_outputs(
|
|
63
|
-
t: str,
|
|
64
|
-
) -> typing.Any:
|
|
65
|
-
"""
|
|
66
|
-
Get build outputs function by command type.
|
|
67
|
-
|
|
68
|
-
Args:
|
|
69
|
-
t: Command type.
|
|
70
|
-
Returns:
|
|
71
|
-
Build outputs function.
|
|
72
|
-
"""
|
|
73
|
-
return {
|
|
74
|
-
"fod2dec": fod2dec_outputs,
|
|
75
|
-
}.get(t)
|
|
76
68
|
|
|
77
69
|
|
|
78
70
|
def fod2dec_config_params(
|
|
79
71
|
key: str,
|
|
80
72
|
value: str,
|
|
81
|
-
) ->
|
|
73
|
+
) -> Fod2decConfigParametersTagged:
|
|
82
74
|
"""
|
|
83
75
|
Build parameters.
|
|
84
76
|
|
|
@@ -89,7 +81,7 @@ def fod2dec_config_params(
|
|
|
89
81
|
Parameter dictionary
|
|
90
82
|
"""
|
|
91
83
|
params = {
|
|
92
|
-
"
|
|
84
|
+
"@type": "config",
|
|
93
85
|
"key": key,
|
|
94
86
|
"value": value,
|
|
95
87
|
}
|
|
@@ -111,14 +103,14 @@ def fod2dec_config_cargs(
|
|
|
111
103
|
"""
|
|
112
104
|
cargs = []
|
|
113
105
|
cargs.append("-config")
|
|
114
|
-
cargs.append(params.get("key"))
|
|
115
|
-
cargs.append(params.get("value"))
|
|
106
|
+
cargs.append(params.get("key", None))
|
|
107
|
+
cargs.append(params.get("value", None))
|
|
116
108
|
return cargs
|
|
117
109
|
|
|
118
110
|
|
|
119
111
|
class Fod2decOutputs(typing.NamedTuple):
|
|
120
112
|
"""
|
|
121
|
-
Output object returned when calling `
|
|
113
|
+
Output object returned when calling `Fod2decParameters(...)`.
|
|
122
114
|
"""
|
|
123
115
|
root: OutputPathType
|
|
124
116
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -144,7 +136,7 @@ def fod2dec_params(
|
|
|
144
136
|
config: list[Fod2decConfigParameters] | None = None,
|
|
145
137
|
help_: bool = False,
|
|
146
138
|
version: bool = False,
|
|
147
|
-
) ->
|
|
139
|
+
) -> Fod2decParametersTagged:
|
|
148
140
|
"""
|
|
149
141
|
Build parameters.
|
|
150
142
|
|
|
@@ -191,7 +183,7 @@ def fod2dec_params(
|
|
|
191
183
|
Parameter dictionary
|
|
192
184
|
"""
|
|
193
185
|
params = {
|
|
194
|
-
"
|
|
186
|
+
"@type": "mrtrix/fod2dec",
|
|
195
187
|
"lum": lum,
|
|
196
188
|
"no_weight": no_weight,
|
|
197
189
|
"info": info,
|
|
@@ -235,56 +227,56 @@ def fod2dec_cargs(
|
|
|
235
227
|
"""
|
|
236
228
|
cargs = []
|
|
237
229
|
cargs.append("fod2dec")
|
|
238
|
-
if params.get("mask") is not None:
|
|
230
|
+
if params.get("mask", None) is not None:
|
|
239
231
|
cargs.extend([
|
|
240
232
|
"-mask",
|
|
241
|
-
execution.input_file(params.get("mask"))
|
|
233
|
+
execution.input_file(params.get("mask", None))
|
|
242
234
|
])
|
|
243
|
-
if params.get("contrast") is not None:
|
|
235
|
+
if params.get("contrast", None) is not None:
|
|
244
236
|
cargs.extend([
|
|
245
237
|
"-contrast",
|
|
246
|
-
execution.input_file(params.get("contrast"))
|
|
238
|
+
execution.input_file(params.get("contrast", None))
|
|
247
239
|
])
|
|
248
|
-
if params.get("lum"):
|
|
240
|
+
if params.get("lum", False):
|
|
249
241
|
cargs.append("-lum")
|
|
250
|
-
if params.get("lum_coefs") is not None:
|
|
242
|
+
if params.get("lum_coefs", None) is not None:
|
|
251
243
|
cargs.extend([
|
|
252
244
|
"-lum_coefs",
|
|
253
|
-
*map(str, params.get("lum_coefs"))
|
|
245
|
+
*map(str, params.get("lum_coefs", None))
|
|
254
246
|
])
|
|
255
|
-
if params.get("lum_gamma") is not None:
|
|
247
|
+
if params.get("lum_gamma", None) is not None:
|
|
256
248
|
cargs.extend([
|
|
257
249
|
"-lum_gamma",
|
|
258
|
-
str(params.get("lum_gamma"))
|
|
250
|
+
str(params.get("lum_gamma", None))
|
|
259
251
|
])
|
|
260
|
-
if params.get("threshold") is not None:
|
|
252
|
+
if params.get("threshold", None) is not None:
|
|
261
253
|
cargs.extend([
|
|
262
254
|
"-threshold",
|
|
263
|
-
str(params.get("threshold"))
|
|
255
|
+
str(params.get("threshold", None))
|
|
264
256
|
])
|
|
265
|
-
if params.get("no_weight"):
|
|
257
|
+
if params.get("no_weight", False):
|
|
266
258
|
cargs.append("-no_weight")
|
|
267
|
-
if params.get("info"):
|
|
259
|
+
if params.get("info", False):
|
|
268
260
|
cargs.append("-info")
|
|
269
|
-
if params.get("quiet"):
|
|
261
|
+
if params.get("quiet", False):
|
|
270
262
|
cargs.append("-quiet")
|
|
271
|
-
if params.get("debug"):
|
|
263
|
+
if params.get("debug", False):
|
|
272
264
|
cargs.append("-debug")
|
|
273
|
-
if params.get("force"):
|
|
265
|
+
if params.get("force", False):
|
|
274
266
|
cargs.append("-force")
|
|
275
|
-
if params.get("nthreads") is not None:
|
|
267
|
+
if params.get("nthreads", None) is not None:
|
|
276
268
|
cargs.extend([
|
|
277
269
|
"-nthreads",
|
|
278
|
-
str(params.get("nthreads"))
|
|
270
|
+
str(params.get("nthreads", None))
|
|
279
271
|
])
|
|
280
|
-
if params.get("config") is not None:
|
|
281
|
-
cargs.extend([a for c in [
|
|
282
|
-
if params.get("help"):
|
|
272
|
+
if params.get("config", None) is not None:
|
|
273
|
+
cargs.extend([a for c in [fod2dec_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
274
|
+
if params.get("help", False):
|
|
283
275
|
cargs.append("-help")
|
|
284
|
-
if params.get("version"):
|
|
276
|
+
if params.get("version", False):
|
|
285
277
|
cargs.append("-version")
|
|
286
|
-
cargs.append(execution.input_file(params.get("input")))
|
|
287
|
-
cargs.append(params.get("output"))
|
|
278
|
+
cargs.append(execution.input_file(params.get("input", None)))
|
|
279
|
+
cargs.append(params.get("output", None))
|
|
288
280
|
return cargs
|
|
289
281
|
|
|
290
282
|
|
|
@@ -303,16 +295,18 @@ def fod2dec_outputs(
|
|
|
303
295
|
"""
|
|
304
296
|
ret = Fod2decOutputs(
|
|
305
297
|
root=execution.output_file("."),
|
|
306
|
-
output=execution.output_file(params.get("output")),
|
|
298
|
+
output=execution.output_file(params.get("output", None)),
|
|
307
299
|
)
|
|
308
300
|
return ret
|
|
309
301
|
|
|
310
302
|
|
|
311
303
|
def fod2dec_execute(
|
|
312
304
|
params: Fod2decParameters,
|
|
313
|
-
|
|
305
|
+
runner: Runner | None = None,
|
|
314
306
|
) -> Fod2decOutputs:
|
|
315
307
|
"""
|
|
308
|
+
fod2dec
|
|
309
|
+
|
|
316
310
|
Generate FOD-based DEC maps, with optional panchromatic sharpening and/or
|
|
317
311
|
luminance/perception correction.
|
|
318
312
|
|
|
@@ -337,10 +331,12 @@ def fod2dec_execute(
|
|
|
337
331
|
|
|
338
332
|
Args:
|
|
339
333
|
params: The parameters.
|
|
340
|
-
|
|
334
|
+
runner: Command runner.
|
|
341
335
|
Returns:
|
|
342
336
|
NamedTuple of outputs (described in `Fod2decOutputs`).
|
|
343
337
|
"""
|
|
338
|
+
runner = runner or get_global_runner()
|
|
339
|
+
execution = runner.start_execution(FOD2DEC_METADATA)
|
|
344
340
|
params = execution.params(params)
|
|
345
341
|
cargs = fod2dec_cargs(params, execution)
|
|
346
342
|
ret = fod2dec_outputs(params, execution)
|
|
@@ -369,6 +365,8 @@ def fod2dec(
|
|
|
369
365
|
runner: Runner | None = None,
|
|
370
366
|
) -> Fod2decOutputs:
|
|
371
367
|
"""
|
|
368
|
+
fod2dec
|
|
369
|
+
|
|
372
370
|
Generate FOD-based DEC maps, with optional panchromatic sharpening and/or
|
|
373
371
|
luminance/perception correction.
|
|
374
372
|
|
|
@@ -434,8 +432,6 @@ def fod2dec(
|
|
|
434
432
|
Returns:
|
|
435
433
|
NamedTuple of outputs (described in `Fod2decOutputs`).
|
|
436
434
|
"""
|
|
437
|
-
runner = runner or get_global_runner()
|
|
438
|
-
execution = runner.start_execution(FOD2DEC_METADATA)
|
|
439
435
|
params = fod2dec_params(
|
|
440
436
|
mask=mask,
|
|
441
437
|
contrast=contrast,
|
|
@@ -455,15 +451,14 @@ def fod2dec(
|
|
|
455
451
|
input_=input_,
|
|
456
452
|
output=output,
|
|
457
453
|
)
|
|
458
|
-
return fod2dec_execute(params,
|
|
454
|
+
return fod2dec_execute(params, runner)
|
|
459
455
|
|
|
460
456
|
|
|
461
457
|
__all__ = [
|
|
462
458
|
"FOD2DEC_METADATA",
|
|
463
|
-
"Fod2decConfigParameters",
|
|
464
459
|
"Fod2decOutputs",
|
|
465
|
-
"Fod2decParameters",
|
|
466
460
|
"fod2dec",
|
|
467
461
|
"fod2dec_config_params",
|
|
462
|
+
"fod2dec_execute",
|
|
468
463
|
"fod2dec_params",
|
|
469
464
|
]
|