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
|
SH2RESPONSE_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="b0158f6418a85b394a1f360188b67bbde8c8da29.boutiques",
|
|
10
10
|
name="sh2response",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,36 @@ SH2RESPONSE_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Sh2responseConfigParameters = typing.TypedDict('Sh2responseConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
Sh2responseConfigParametersTagged = typing.TypedDict('Sh2responseConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
Sh2responseParameters = typing.TypedDict('Sh2responseParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/sh2response"]],
|
|
30
|
+
"lmax": typing.NotRequired[int | None],
|
|
31
|
+
"dump": typing.NotRequired[str | None],
|
|
32
|
+
"info": bool,
|
|
33
|
+
"quiet": bool,
|
|
34
|
+
"debug": bool,
|
|
35
|
+
"force": bool,
|
|
36
|
+
"nthreads": typing.NotRequired[int | None],
|
|
37
|
+
"config": typing.NotRequired[list[Sh2responseConfigParameters] | None],
|
|
38
|
+
"help": bool,
|
|
39
|
+
"version": bool,
|
|
40
|
+
"SH": InputPathType,
|
|
41
|
+
"mask": InputPathType,
|
|
42
|
+
"directions": InputPathType,
|
|
43
|
+
"response": str,
|
|
44
|
+
})
|
|
45
|
+
Sh2responseParametersTagged = typing.TypedDict('Sh2responseParametersTagged', {
|
|
46
|
+
"@type": typing.Literal["mrtrix/sh2response"],
|
|
25
47
|
"lmax": typing.NotRequired[int | None],
|
|
26
48
|
"dump": typing.NotRequired[str | None],
|
|
27
49
|
"info": bool,
|
|
@@ -37,45 +59,12 @@ Sh2responseParameters = typing.TypedDict('Sh2responseParameters', {
|
|
|
37
59
|
"directions": InputPathType,
|
|
38
60
|
"response": str,
|
|
39
61
|
})
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
def dyn_cargs(
|
|
43
|
-
t: str,
|
|
44
|
-
) -> typing.Any:
|
|
45
|
-
"""
|
|
46
|
-
Get build cargs function by command type.
|
|
47
|
-
|
|
48
|
-
Args:
|
|
49
|
-
t: Command type.
|
|
50
|
-
Returns:
|
|
51
|
-
Build cargs function.
|
|
52
|
-
"""
|
|
53
|
-
return {
|
|
54
|
-
"sh2response": sh2response_cargs,
|
|
55
|
-
"config": sh2response_config_cargs,
|
|
56
|
-
}.get(t)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def dyn_outputs(
|
|
60
|
-
t: str,
|
|
61
|
-
) -> typing.Any:
|
|
62
|
-
"""
|
|
63
|
-
Get build outputs function by command type.
|
|
64
|
-
|
|
65
|
-
Args:
|
|
66
|
-
t: Command type.
|
|
67
|
-
Returns:
|
|
68
|
-
Build outputs function.
|
|
69
|
-
"""
|
|
70
|
-
return {
|
|
71
|
-
"sh2response": sh2response_outputs,
|
|
72
|
-
}.get(t)
|
|
73
62
|
|
|
74
63
|
|
|
75
64
|
def sh2response_config_params(
|
|
76
65
|
key: str,
|
|
77
66
|
value: str,
|
|
78
|
-
) ->
|
|
67
|
+
) -> Sh2responseConfigParametersTagged:
|
|
79
68
|
"""
|
|
80
69
|
Build parameters.
|
|
81
70
|
|
|
@@ -86,7 +75,7 @@ def sh2response_config_params(
|
|
|
86
75
|
Parameter dictionary
|
|
87
76
|
"""
|
|
88
77
|
params = {
|
|
89
|
-
"
|
|
78
|
+
"@type": "config",
|
|
90
79
|
"key": key,
|
|
91
80
|
"value": value,
|
|
92
81
|
}
|
|
@@ -108,14 +97,14 @@ def sh2response_config_cargs(
|
|
|
108
97
|
"""
|
|
109
98
|
cargs = []
|
|
110
99
|
cargs.append("-config")
|
|
111
|
-
cargs.append(params.get("key"))
|
|
112
|
-
cargs.append(params.get("value"))
|
|
100
|
+
cargs.append(params.get("key", None))
|
|
101
|
+
cargs.append(params.get("value", None))
|
|
113
102
|
return cargs
|
|
114
103
|
|
|
115
104
|
|
|
116
105
|
class Sh2responseOutputs(typing.NamedTuple):
|
|
117
106
|
"""
|
|
118
|
-
Output object returned when calling `
|
|
107
|
+
Output object returned when calling `Sh2responseParameters(...)`.
|
|
119
108
|
"""
|
|
120
109
|
root: OutputPathType
|
|
121
110
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -141,7 +130,7 @@ def sh2response_params(
|
|
|
141
130
|
config: list[Sh2responseConfigParameters] | None = None,
|
|
142
131
|
help_: bool = False,
|
|
143
132
|
version: bool = False,
|
|
144
|
-
) ->
|
|
133
|
+
) -> Sh2responseParametersTagged:
|
|
145
134
|
"""
|
|
146
135
|
Build parameters.
|
|
147
136
|
|
|
@@ -173,7 +162,7 @@ def sh2response_params(
|
|
|
173
162
|
Parameter dictionary
|
|
174
163
|
"""
|
|
175
164
|
params = {
|
|
176
|
-
"
|
|
165
|
+
"@type": "mrtrix/sh2response",
|
|
177
166
|
"info": info,
|
|
178
167
|
"quiet": quiet,
|
|
179
168
|
"debug": debug,
|
|
@@ -211,39 +200,39 @@ def sh2response_cargs(
|
|
|
211
200
|
"""
|
|
212
201
|
cargs = []
|
|
213
202
|
cargs.append("sh2response")
|
|
214
|
-
if params.get("lmax") is not None:
|
|
203
|
+
if params.get("lmax", None) is not None:
|
|
215
204
|
cargs.extend([
|
|
216
205
|
"-lmax",
|
|
217
|
-
str(params.get("lmax"))
|
|
206
|
+
str(params.get("lmax", None))
|
|
218
207
|
])
|
|
219
|
-
if params.get("dump") is not None:
|
|
208
|
+
if params.get("dump", None) is not None:
|
|
220
209
|
cargs.extend([
|
|
221
210
|
"-dump",
|
|
222
|
-
params.get("dump")
|
|
211
|
+
params.get("dump", None)
|
|
223
212
|
])
|
|
224
|
-
if params.get("info"):
|
|
213
|
+
if params.get("info", False):
|
|
225
214
|
cargs.append("-info")
|
|
226
|
-
if params.get("quiet"):
|
|
215
|
+
if params.get("quiet", False):
|
|
227
216
|
cargs.append("-quiet")
|
|
228
|
-
if params.get("debug"):
|
|
217
|
+
if params.get("debug", False):
|
|
229
218
|
cargs.append("-debug")
|
|
230
|
-
if params.get("force"):
|
|
219
|
+
if params.get("force", False):
|
|
231
220
|
cargs.append("-force")
|
|
232
|
-
if params.get("nthreads") is not None:
|
|
221
|
+
if params.get("nthreads", None) is not None:
|
|
233
222
|
cargs.extend([
|
|
234
223
|
"-nthreads",
|
|
235
|
-
str(params.get("nthreads"))
|
|
224
|
+
str(params.get("nthreads", None))
|
|
236
225
|
])
|
|
237
|
-
if params.get("config") is not None:
|
|
238
|
-
cargs.extend([a for c in [
|
|
239
|
-
if params.get("help"):
|
|
226
|
+
if params.get("config", None) is not None:
|
|
227
|
+
cargs.extend([a for c in [sh2response_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
228
|
+
if params.get("help", False):
|
|
240
229
|
cargs.append("-help")
|
|
241
|
-
if params.get("version"):
|
|
230
|
+
if params.get("version", False):
|
|
242
231
|
cargs.append("-version")
|
|
243
|
-
cargs.append(execution.input_file(params.get("SH")))
|
|
244
|
-
cargs.append(execution.input_file(params.get("mask")))
|
|
245
|
-
cargs.append(execution.input_file(params.get("directions")))
|
|
246
|
-
cargs.append(params.get("response"))
|
|
232
|
+
cargs.append(execution.input_file(params.get("SH", None)))
|
|
233
|
+
cargs.append(execution.input_file(params.get("mask", None)))
|
|
234
|
+
cargs.append(execution.input_file(params.get("directions", None)))
|
|
235
|
+
cargs.append(params.get("response", None))
|
|
247
236
|
return cargs
|
|
248
237
|
|
|
249
238
|
|
|
@@ -262,17 +251,19 @@ def sh2response_outputs(
|
|
|
262
251
|
"""
|
|
263
252
|
ret = Sh2responseOutputs(
|
|
264
253
|
root=execution.output_file("."),
|
|
265
|
-
response=execution.output_file(params.get("response")),
|
|
266
|
-
dump=execution.output_file(params.get("dump")) if (params.get("dump") is not None) else None,
|
|
254
|
+
response=execution.output_file(params.get("response", None)),
|
|
255
|
+
dump=execution.output_file(params.get("dump", None)) if (params.get("dump") is not None) else None,
|
|
267
256
|
)
|
|
268
257
|
return ret
|
|
269
258
|
|
|
270
259
|
|
|
271
260
|
def sh2response_execute(
|
|
272
261
|
params: Sh2responseParameters,
|
|
273
|
-
|
|
262
|
+
runner: Runner | None = None,
|
|
274
263
|
) -> Sh2responseOutputs:
|
|
275
264
|
"""
|
|
265
|
+
sh2response
|
|
266
|
+
|
|
276
267
|
Generate an appropriate response function from the image data for spherical
|
|
277
268
|
deconvolution.
|
|
278
269
|
|
|
@@ -290,10 +281,12 @@ def sh2response_execute(
|
|
|
290
281
|
|
|
291
282
|
Args:
|
|
292
283
|
params: The parameters.
|
|
293
|
-
|
|
284
|
+
runner: Command runner.
|
|
294
285
|
Returns:
|
|
295
286
|
NamedTuple of outputs (described in `Sh2responseOutputs`).
|
|
296
287
|
"""
|
|
288
|
+
runner = runner or get_global_runner()
|
|
289
|
+
execution = runner.start_execution(SH2RESPONSE_METADATA)
|
|
297
290
|
params = execution.params(params)
|
|
298
291
|
cargs = sh2response_cargs(params, execution)
|
|
299
292
|
ret = sh2response_outputs(params, execution)
|
|
@@ -319,6 +312,8 @@ def sh2response(
|
|
|
319
312
|
runner: Runner | None = None,
|
|
320
313
|
) -> Sh2responseOutputs:
|
|
321
314
|
"""
|
|
315
|
+
sh2response
|
|
316
|
+
|
|
322
317
|
Generate an appropriate response function from the image data for spherical
|
|
323
318
|
deconvolution.
|
|
324
319
|
|
|
@@ -362,8 +357,6 @@ def sh2response(
|
|
|
362
357
|
Returns:
|
|
363
358
|
NamedTuple of outputs (described in `Sh2responseOutputs`).
|
|
364
359
|
"""
|
|
365
|
-
runner = runner or get_global_runner()
|
|
366
|
-
execution = runner.start_execution(SH2RESPONSE_METADATA)
|
|
367
360
|
params = sh2response_params(
|
|
368
361
|
lmax=lmax,
|
|
369
362
|
dump=dump,
|
|
@@ -380,15 +373,14 @@ def sh2response(
|
|
|
380
373
|
directions=directions,
|
|
381
374
|
response=response,
|
|
382
375
|
)
|
|
383
|
-
return sh2response_execute(params,
|
|
376
|
+
return sh2response_execute(params, runner)
|
|
384
377
|
|
|
385
378
|
|
|
386
379
|
__all__ = [
|
|
387
380
|
"SH2RESPONSE_METADATA",
|
|
388
|
-
"Sh2responseConfigParameters",
|
|
389
381
|
"Sh2responseOutputs",
|
|
390
|
-
"Sh2responseParameters",
|
|
391
382
|
"sh2response",
|
|
392
383
|
"sh2response_config_params",
|
|
384
|
+
"sh2response_execute",
|
|
393
385
|
"sh2response_params",
|
|
394
386
|
]
|
niwrap_mrtrix/mrtrix/shbasis.py
CHANGED
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
SHBASIS_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="8d1c3a9e142d8ac3b0cfbca9e0fcd6b3d41e317e.boutiques",
|
|
10
10
|
name="shbasis",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,32 @@ SHBASIS_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
ShbasisConfigParameters = typing.TypedDict('ShbasisConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
ShbasisConfigParametersTagged = typing.TypedDict('ShbasisConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
ShbasisParameters = typing.TypedDict('ShbasisParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/shbasis"]],
|
|
30
|
+
"convert": typing.NotRequired[str | None],
|
|
31
|
+
"info": bool,
|
|
32
|
+
"quiet": bool,
|
|
33
|
+
"debug": bool,
|
|
34
|
+
"force": bool,
|
|
35
|
+
"nthreads": typing.NotRequired[int | None],
|
|
36
|
+
"config": typing.NotRequired[list[ShbasisConfigParameters] | None],
|
|
37
|
+
"help": bool,
|
|
38
|
+
"version": bool,
|
|
39
|
+
"SH": list[InputPathType],
|
|
40
|
+
})
|
|
41
|
+
ShbasisParametersTagged = typing.TypedDict('ShbasisParametersTagged', {
|
|
42
|
+
"@type": typing.Literal["mrtrix/shbasis"],
|
|
25
43
|
"convert": typing.NotRequired[str | None],
|
|
26
44
|
"info": bool,
|
|
27
45
|
"quiet": bool,
|
|
@@ -33,44 +51,12 @@ ShbasisParameters = typing.TypedDict('ShbasisParameters', {
|
|
|
33
51
|
"version": bool,
|
|
34
52
|
"SH": list[InputPathType],
|
|
35
53
|
})
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def dyn_cargs(
|
|
39
|
-
t: str,
|
|
40
|
-
) -> typing.Any:
|
|
41
|
-
"""
|
|
42
|
-
Get build cargs function by command type.
|
|
43
|
-
|
|
44
|
-
Args:
|
|
45
|
-
t: Command type.
|
|
46
|
-
Returns:
|
|
47
|
-
Build cargs function.
|
|
48
|
-
"""
|
|
49
|
-
return {
|
|
50
|
-
"shbasis": shbasis_cargs,
|
|
51
|
-
"config": shbasis_config_cargs,
|
|
52
|
-
}.get(t)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def dyn_outputs(
|
|
56
|
-
t: str,
|
|
57
|
-
) -> typing.Any:
|
|
58
|
-
"""
|
|
59
|
-
Get build outputs function by command type.
|
|
60
|
-
|
|
61
|
-
Args:
|
|
62
|
-
t: Command type.
|
|
63
|
-
Returns:
|
|
64
|
-
Build outputs function.
|
|
65
|
-
"""
|
|
66
|
-
return {
|
|
67
|
-
}.get(t)
|
|
68
54
|
|
|
69
55
|
|
|
70
56
|
def shbasis_config_params(
|
|
71
57
|
key: str,
|
|
72
58
|
value: str,
|
|
73
|
-
) ->
|
|
59
|
+
) -> ShbasisConfigParametersTagged:
|
|
74
60
|
"""
|
|
75
61
|
Build parameters.
|
|
76
62
|
|
|
@@ -81,7 +67,7 @@ def shbasis_config_params(
|
|
|
81
67
|
Parameter dictionary
|
|
82
68
|
"""
|
|
83
69
|
params = {
|
|
84
|
-
"
|
|
70
|
+
"@type": "config",
|
|
85
71
|
"key": key,
|
|
86
72
|
"value": value,
|
|
87
73
|
}
|
|
@@ -103,14 +89,14 @@ def shbasis_config_cargs(
|
|
|
103
89
|
"""
|
|
104
90
|
cargs = []
|
|
105
91
|
cargs.append("-config")
|
|
106
|
-
cargs.append(params.get("key"))
|
|
107
|
-
cargs.append(params.get("value"))
|
|
92
|
+
cargs.append(params.get("key", None))
|
|
93
|
+
cargs.append(params.get("value", None))
|
|
108
94
|
return cargs
|
|
109
95
|
|
|
110
96
|
|
|
111
97
|
class ShbasisOutputs(typing.NamedTuple):
|
|
112
98
|
"""
|
|
113
|
-
Output object returned when calling `
|
|
99
|
+
Output object returned when calling `ShbasisParameters(...)`.
|
|
114
100
|
"""
|
|
115
101
|
root: OutputPathType
|
|
116
102
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -127,7 +113,7 @@ def shbasis_params(
|
|
|
127
113
|
config: list[ShbasisConfigParameters] | None = None,
|
|
128
114
|
help_: bool = False,
|
|
129
115
|
version: bool = False,
|
|
130
|
-
) ->
|
|
116
|
+
) -> ShbasisParametersTagged:
|
|
131
117
|
"""
|
|
132
118
|
Build parameters.
|
|
133
119
|
|
|
@@ -151,7 +137,7 @@ def shbasis_params(
|
|
|
151
137
|
Parameter dictionary
|
|
152
138
|
"""
|
|
153
139
|
params = {
|
|
154
|
-
"
|
|
140
|
+
"@type": "mrtrix/shbasis",
|
|
155
141
|
"info": info,
|
|
156
142
|
"quiet": quiet,
|
|
157
143
|
"debug": debug,
|
|
@@ -184,31 +170,31 @@ def shbasis_cargs(
|
|
|
184
170
|
"""
|
|
185
171
|
cargs = []
|
|
186
172
|
cargs.append("shbasis")
|
|
187
|
-
if params.get("convert") is not None:
|
|
173
|
+
if params.get("convert", None) is not None:
|
|
188
174
|
cargs.extend([
|
|
189
175
|
"-convert",
|
|
190
|
-
params.get("convert")
|
|
176
|
+
params.get("convert", None)
|
|
191
177
|
])
|
|
192
|
-
if params.get("info"):
|
|
178
|
+
if params.get("info", False):
|
|
193
179
|
cargs.append("-info")
|
|
194
|
-
if params.get("quiet"):
|
|
180
|
+
if params.get("quiet", False):
|
|
195
181
|
cargs.append("-quiet")
|
|
196
|
-
if params.get("debug"):
|
|
182
|
+
if params.get("debug", False):
|
|
197
183
|
cargs.append("-debug")
|
|
198
|
-
if params.get("force"):
|
|
184
|
+
if params.get("force", False):
|
|
199
185
|
cargs.append("-force")
|
|
200
|
-
if params.get("nthreads") is not None:
|
|
186
|
+
if params.get("nthreads", None) is not None:
|
|
201
187
|
cargs.extend([
|
|
202
188
|
"-nthreads",
|
|
203
|
-
str(params.get("nthreads"))
|
|
189
|
+
str(params.get("nthreads", None))
|
|
204
190
|
])
|
|
205
|
-
if params.get("config") is not None:
|
|
206
|
-
cargs.extend([a for c in [
|
|
207
|
-
if params.get("help"):
|
|
191
|
+
if params.get("config", None) is not None:
|
|
192
|
+
cargs.extend([a for c in [shbasis_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
193
|
+
if params.get("help", False):
|
|
208
194
|
cargs.append("-help")
|
|
209
|
-
if params.get("version"):
|
|
195
|
+
if params.get("version", False):
|
|
210
196
|
cargs.append("-version")
|
|
211
|
-
cargs.extend([execution.input_file(f) for f in params.get("SH")])
|
|
197
|
+
cargs.extend([execution.input_file(f) for f in params.get("SH", None)])
|
|
212
198
|
return cargs
|
|
213
199
|
|
|
214
200
|
|
|
@@ -233,9 +219,11 @@ def shbasis_outputs(
|
|
|
233
219
|
|
|
234
220
|
def shbasis_execute(
|
|
235
221
|
params: ShbasisParameters,
|
|
236
|
-
|
|
222
|
+
runner: Runner | None = None,
|
|
237
223
|
) -> ShbasisOutputs:
|
|
238
224
|
"""
|
|
225
|
+
shbasis
|
|
226
|
+
|
|
239
227
|
Examine the values in spherical harmonic images to estimate (and optionally
|
|
240
228
|
change) the SH basis used.
|
|
241
229
|
|
|
@@ -269,10 +257,12 @@ def shbasis_execute(
|
|
|
269
257
|
|
|
270
258
|
Args:
|
|
271
259
|
params: The parameters.
|
|
272
|
-
|
|
260
|
+
runner: Command runner.
|
|
273
261
|
Returns:
|
|
274
262
|
NamedTuple of outputs (described in `ShbasisOutputs`).
|
|
275
263
|
"""
|
|
264
|
+
runner = runner or get_global_runner()
|
|
265
|
+
execution = runner.start_execution(SHBASIS_METADATA)
|
|
276
266
|
params = execution.params(params)
|
|
277
267
|
cargs = shbasis_cargs(params, execution)
|
|
278
268
|
ret = shbasis_outputs(params, execution)
|
|
@@ -294,6 +284,8 @@ def shbasis(
|
|
|
294
284
|
runner: Runner | None = None,
|
|
295
285
|
) -> ShbasisOutputs:
|
|
296
286
|
"""
|
|
287
|
+
shbasis
|
|
288
|
+
|
|
297
289
|
Examine the values in spherical harmonic images to estimate (and optionally
|
|
298
290
|
change) the SH basis used.
|
|
299
291
|
|
|
@@ -345,8 +337,6 @@ def shbasis(
|
|
|
345
337
|
Returns:
|
|
346
338
|
NamedTuple of outputs (described in `ShbasisOutputs`).
|
|
347
339
|
"""
|
|
348
|
-
runner = runner or get_global_runner()
|
|
349
|
-
execution = runner.start_execution(SHBASIS_METADATA)
|
|
350
340
|
params = shbasis_params(
|
|
351
341
|
convert=convert,
|
|
352
342
|
info=info,
|
|
@@ -359,15 +349,14 @@ def shbasis(
|
|
|
359
349
|
version=version,
|
|
360
350
|
sh=sh,
|
|
361
351
|
)
|
|
362
|
-
return shbasis_execute(params,
|
|
352
|
+
return shbasis_execute(params, runner)
|
|
363
353
|
|
|
364
354
|
|
|
365
355
|
__all__ = [
|
|
366
356
|
"SHBASIS_METADATA",
|
|
367
|
-
"ShbasisConfigParameters",
|
|
368
357
|
"ShbasisOutputs",
|
|
369
|
-
"ShbasisParameters",
|
|
370
358
|
"shbasis",
|
|
371
359
|
"shbasis_config_params",
|
|
360
|
+
"shbasis_execute",
|
|
372
361
|
"shbasis_params",
|
|
373
362
|
]
|