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/amp2sh.py
CHANGED
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
AMP2SH_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="b1deae186542fe482c4a2e51622f124fe000c4fc.boutiques",
|
|
10
10
|
name="amp2sh",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,33 +14,51 @@ AMP2SH_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Amp2shFslgradParameters = typing.TypedDict('Amp2shFslgradParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["fslgrad"]],
|
|
18
|
+
"bvecs": InputPathType,
|
|
19
|
+
"bvals": InputPathType,
|
|
20
|
+
})
|
|
21
|
+
Amp2shFslgradParametersTagged = typing.TypedDict('Amp2shFslgradParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["fslgrad"],
|
|
18
23
|
"bvecs": InputPathType,
|
|
19
24
|
"bvals": InputPathType,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
Amp2shVariousStringParameters = typing.TypedDict('Amp2shVariousStringParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["VariousString"]],
|
|
30
|
+
"obj": str,
|
|
31
|
+
})
|
|
32
|
+
Amp2shVariousStringParametersTagged = typing.TypedDict('Amp2shVariousStringParametersTagged', {
|
|
33
|
+
"@type": typing.Literal["VariousString"],
|
|
25
34
|
"obj": str,
|
|
26
35
|
})
|
|
27
36
|
|
|
28
37
|
|
|
29
38
|
Amp2shVariousFileParameters = typing.TypedDict('Amp2shVariousFileParameters', {
|
|
30
|
-
"
|
|
39
|
+
"@type": typing.NotRequired[typing.Literal["VariousFile"]],
|
|
40
|
+
"obj": InputPathType,
|
|
41
|
+
})
|
|
42
|
+
Amp2shVariousFileParametersTagged = typing.TypedDict('Amp2shVariousFileParametersTagged', {
|
|
43
|
+
"@type": typing.Literal["VariousFile"],
|
|
31
44
|
"obj": InputPathType,
|
|
32
45
|
})
|
|
33
46
|
|
|
34
47
|
|
|
35
48
|
Amp2shConfigParameters = typing.TypedDict('Amp2shConfigParameters', {
|
|
36
|
-
"
|
|
49
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
50
|
+
"key": str,
|
|
51
|
+
"value": str,
|
|
52
|
+
})
|
|
53
|
+
Amp2shConfigParametersTagged = typing.TypedDict('Amp2shConfigParametersTagged', {
|
|
54
|
+
"@type": typing.Literal["config"],
|
|
37
55
|
"key": str,
|
|
38
56
|
"value": str,
|
|
39
57
|
})
|
|
40
58
|
|
|
41
59
|
|
|
42
60
|
Amp2shParameters = typing.TypedDict('Amp2shParameters', {
|
|
43
|
-
"
|
|
61
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/amp2sh"]],
|
|
44
62
|
"lmax": typing.NotRequired[int | None],
|
|
45
63
|
"normalise": bool,
|
|
46
64
|
"directions": typing.NotRequired[InputPathType | None],
|
|
@@ -48,7 +66,28 @@ Amp2shParameters = typing.TypedDict('Amp2shParameters', {
|
|
|
48
66
|
"grad": typing.NotRequired[InputPathType | None],
|
|
49
67
|
"fslgrad": typing.NotRequired[Amp2shFslgradParameters | None],
|
|
50
68
|
"shells": typing.NotRequired[list[float] | None],
|
|
51
|
-
"strides": typing.NotRequired[typing.Union[
|
|
69
|
+
"strides": typing.NotRequired[typing.Union[Amp2shVariousStringParametersTagged, Amp2shVariousFileParametersTagged] | None],
|
|
70
|
+
"info": bool,
|
|
71
|
+
"quiet": bool,
|
|
72
|
+
"debug": bool,
|
|
73
|
+
"force": bool,
|
|
74
|
+
"nthreads": typing.NotRequired[int | None],
|
|
75
|
+
"config": typing.NotRequired[list[Amp2shConfigParameters] | None],
|
|
76
|
+
"help": bool,
|
|
77
|
+
"version": bool,
|
|
78
|
+
"amp": InputPathType,
|
|
79
|
+
"SH": str,
|
|
80
|
+
})
|
|
81
|
+
Amp2shParametersTagged = typing.TypedDict('Amp2shParametersTagged', {
|
|
82
|
+
"@type": typing.Literal["mrtrix/amp2sh"],
|
|
83
|
+
"lmax": typing.NotRequired[int | None],
|
|
84
|
+
"normalise": bool,
|
|
85
|
+
"directions": typing.NotRequired[InputPathType | None],
|
|
86
|
+
"rician": typing.NotRequired[InputPathType | None],
|
|
87
|
+
"grad": typing.NotRequired[InputPathType | None],
|
|
88
|
+
"fslgrad": typing.NotRequired[Amp2shFslgradParameters | None],
|
|
89
|
+
"shells": typing.NotRequired[list[float] | None],
|
|
90
|
+
"strides": typing.NotRequired[typing.Union[Amp2shVariousStringParametersTagged, Amp2shVariousFileParametersTagged] | None],
|
|
52
91
|
"info": bool,
|
|
53
92
|
"quiet": bool,
|
|
54
93
|
"debug": bool,
|
|
@@ -62,7 +101,7 @@ Amp2shParameters = typing.TypedDict('Amp2shParameters', {
|
|
|
62
101
|
})
|
|
63
102
|
|
|
64
103
|
|
|
65
|
-
def
|
|
104
|
+
def amp2sh_strides_cargs_dyn_fn(
|
|
66
105
|
t: str,
|
|
67
106
|
) -> typing.Any:
|
|
68
107
|
"""
|
|
@@ -74,15 +113,12 @@ def dyn_cargs(
|
|
|
74
113
|
Build cargs function.
|
|
75
114
|
"""
|
|
76
115
|
return {
|
|
77
|
-
"amp2sh": amp2sh_cargs,
|
|
78
|
-
"fslgrad": amp2sh_fslgrad_cargs,
|
|
79
116
|
"VariousString": amp2sh_various_string_cargs,
|
|
80
117
|
"VariousFile": amp2sh_various_file_cargs,
|
|
81
|
-
"config": amp2sh_config_cargs,
|
|
82
118
|
}.get(t)
|
|
83
119
|
|
|
84
120
|
|
|
85
|
-
def
|
|
121
|
+
def amp2sh_strides_outputs_dyn_fn(
|
|
86
122
|
t: str,
|
|
87
123
|
) -> typing.Any:
|
|
88
124
|
"""
|
|
@@ -94,14 +130,13 @@ def dyn_outputs(
|
|
|
94
130
|
Build outputs function.
|
|
95
131
|
"""
|
|
96
132
|
return {
|
|
97
|
-
"amp2sh": amp2sh_outputs,
|
|
98
133
|
}.get(t)
|
|
99
134
|
|
|
100
135
|
|
|
101
136
|
def amp2sh_fslgrad_params(
|
|
102
137
|
bvecs: InputPathType,
|
|
103
138
|
bvals: InputPathType,
|
|
104
|
-
) ->
|
|
139
|
+
) -> Amp2shFslgradParametersTagged:
|
|
105
140
|
"""
|
|
106
141
|
Build parameters.
|
|
107
142
|
|
|
@@ -118,7 +153,7 @@ def amp2sh_fslgrad_params(
|
|
|
118
153
|
Parameter dictionary
|
|
119
154
|
"""
|
|
120
155
|
params = {
|
|
121
|
-
"
|
|
156
|
+
"@type": "fslgrad",
|
|
122
157
|
"bvecs": bvecs,
|
|
123
158
|
"bvals": bvals,
|
|
124
159
|
}
|
|
@@ -140,14 +175,14 @@ def amp2sh_fslgrad_cargs(
|
|
|
140
175
|
"""
|
|
141
176
|
cargs = []
|
|
142
177
|
cargs.append("-fslgrad")
|
|
143
|
-
cargs.append(execution.input_file(params.get("bvecs")))
|
|
144
|
-
cargs.append(execution.input_file(params.get("bvals")))
|
|
178
|
+
cargs.append(execution.input_file(params.get("bvecs", None)))
|
|
179
|
+
cargs.append(execution.input_file(params.get("bvals", None)))
|
|
145
180
|
return cargs
|
|
146
181
|
|
|
147
182
|
|
|
148
183
|
def amp2sh_various_string_params(
|
|
149
184
|
obj: str,
|
|
150
|
-
) ->
|
|
185
|
+
) -> Amp2shVariousStringParametersTagged:
|
|
151
186
|
"""
|
|
152
187
|
Build parameters.
|
|
153
188
|
|
|
@@ -157,7 +192,7 @@ def amp2sh_various_string_params(
|
|
|
157
192
|
Parameter dictionary
|
|
158
193
|
"""
|
|
159
194
|
params = {
|
|
160
|
-
"
|
|
195
|
+
"@type": "VariousString",
|
|
161
196
|
"obj": obj,
|
|
162
197
|
}
|
|
163
198
|
return params
|
|
@@ -177,13 +212,13 @@ def amp2sh_various_string_cargs(
|
|
|
177
212
|
Command-line arguments.
|
|
178
213
|
"""
|
|
179
214
|
cargs = []
|
|
180
|
-
cargs.append(params.get("obj"))
|
|
215
|
+
cargs.append(params.get("obj", None))
|
|
181
216
|
return cargs
|
|
182
217
|
|
|
183
218
|
|
|
184
219
|
def amp2sh_various_file_params(
|
|
185
220
|
obj: InputPathType,
|
|
186
|
-
) ->
|
|
221
|
+
) -> Amp2shVariousFileParametersTagged:
|
|
187
222
|
"""
|
|
188
223
|
Build parameters.
|
|
189
224
|
|
|
@@ -193,7 +228,7 @@ def amp2sh_various_file_params(
|
|
|
193
228
|
Parameter dictionary
|
|
194
229
|
"""
|
|
195
230
|
params = {
|
|
196
|
-
"
|
|
231
|
+
"@type": "VariousFile",
|
|
197
232
|
"obj": obj,
|
|
198
233
|
}
|
|
199
234
|
return params
|
|
@@ -213,14 +248,14 @@ def amp2sh_various_file_cargs(
|
|
|
213
248
|
Command-line arguments.
|
|
214
249
|
"""
|
|
215
250
|
cargs = []
|
|
216
|
-
cargs.append(execution.input_file(params.get("obj")))
|
|
251
|
+
cargs.append(execution.input_file(params.get("obj", None)))
|
|
217
252
|
return cargs
|
|
218
253
|
|
|
219
254
|
|
|
220
255
|
def amp2sh_config_params(
|
|
221
256
|
key: str,
|
|
222
257
|
value: str,
|
|
223
|
-
) ->
|
|
258
|
+
) -> Amp2shConfigParametersTagged:
|
|
224
259
|
"""
|
|
225
260
|
Build parameters.
|
|
226
261
|
|
|
@@ -231,7 +266,7 @@ def amp2sh_config_params(
|
|
|
231
266
|
Parameter dictionary
|
|
232
267
|
"""
|
|
233
268
|
params = {
|
|
234
|
-
"
|
|
269
|
+
"@type": "config",
|
|
235
270
|
"key": key,
|
|
236
271
|
"value": value,
|
|
237
272
|
}
|
|
@@ -253,14 +288,14 @@ def amp2sh_config_cargs(
|
|
|
253
288
|
"""
|
|
254
289
|
cargs = []
|
|
255
290
|
cargs.append("-config")
|
|
256
|
-
cargs.append(params.get("key"))
|
|
257
|
-
cargs.append(params.get("value"))
|
|
291
|
+
cargs.append(params.get("key", None))
|
|
292
|
+
cargs.append(params.get("value", None))
|
|
258
293
|
return cargs
|
|
259
294
|
|
|
260
295
|
|
|
261
296
|
class Amp2shOutputs(typing.NamedTuple):
|
|
262
297
|
"""
|
|
263
|
-
Output object returned when calling `
|
|
298
|
+
Output object returned when calling `Amp2shParameters(...)`.
|
|
264
299
|
"""
|
|
265
300
|
root: OutputPathType
|
|
266
301
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -278,7 +313,7 @@ def amp2sh_params(
|
|
|
278
313
|
grad: InputPathType | None = None,
|
|
279
314
|
fslgrad: Amp2shFslgradParameters | None = None,
|
|
280
315
|
shells: list[float] | None = None,
|
|
281
|
-
strides: typing.Union[
|
|
316
|
+
strides: typing.Union[Amp2shVariousStringParametersTagged, Amp2shVariousFileParametersTagged] | None = None,
|
|
282
317
|
info: bool = False,
|
|
283
318
|
quiet: bool = False,
|
|
284
319
|
debug: bool = False,
|
|
@@ -287,7 +322,7 @@ def amp2sh_params(
|
|
|
287
322
|
config: list[Amp2shConfigParameters] | None = None,
|
|
288
323
|
help_: bool = False,
|
|
289
324
|
version: bool = False,
|
|
290
|
-
) ->
|
|
325
|
+
) -> Amp2shParametersTagged:
|
|
291
326
|
"""
|
|
292
327
|
Build parameters.
|
|
293
328
|
|
|
@@ -344,7 +379,7 @@ def amp2sh_params(
|
|
|
344
379
|
Parameter dictionary
|
|
345
380
|
"""
|
|
346
381
|
params = {
|
|
347
|
-
"
|
|
382
|
+
"@type": "mrtrix/amp2sh",
|
|
348
383
|
"normalise": normalise,
|
|
349
384
|
"info": info,
|
|
350
385
|
"quiet": quiet,
|
|
@@ -391,61 +426,61 @@ def amp2sh_cargs(
|
|
|
391
426
|
"""
|
|
392
427
|
cargs = []
|
|
393
428
|
cargs.append("amp2sh")
|
|
394
|
-
if params.get("lmax") is not None:
|
|
429
|
+
if params.get("lmax", None) is not None:
|
|
395
430
|
cargs.extend([
|
|
396
431
|
"-lmax",
|
|
397
|
-
str(params.get("lmax"))
|
|
432
|
+
str(params.get("lmax", None))
|
|
398
433
|
])
|
|
399
|
-
if params.get("normalise"):
|
|
434
|
+
if params.get("normalise", False):
|
|
400
435
|
cargs.append("-normalise")
|
|
401
|
-
if params.get("directions") is not None:
|
|
436
|
+
if params.get("directions", None) is not None:
|
|
402
437
|
cargs.extend([
|
|
403
438
|
"-directions",
|
|
404
|
-
execution.input_file(params.get("directions"))
|
|
439
|
+
execution.input_file(params.get("directions", None))
|
|
405
440
|
])
|
|
406
|
-
if params.get("rician") is not None:
|
|
441
|
+
if params.get("rician", None) is not None:
|
|
407
442
|
cargs.extend([
|
|
408
443
|
"-rician",
|
|
409
|
-
execution.input_file(params.get("rician"))
|
|
444
|
+
execution.input_file(params.get("rician", None))
|
|
410
445
|
])
|
|
411
|
-
if params.get("grad") is not None:
|
|
446
|
+
if params.get("grad", None) is not None:
|
|
412
447
|
cargs.extend([
|
|
413
448
|
"-grad",
|
|
414
|
-
execution.input_file(params.get("grad"))
|
|
449
|
+
execution.input_file(params.get("grad", None))
|
|
415
450
|
])
|
|
416
|
-
if params.get("fslgrad") is not None:
|
|
417
|
-
cargs.extend(
|
|
418
|
-
if params.get("shells") is not None:
|
|
451
|
+
if params.get("fslgrad", None) is not None:
|
|
452
|
+
cargs.extend(amp2sh_fslgrad_cargs(params.get("fslgrad", None), execution))
|
|
453
|
+
if params.get("shells", None) is not None:
|
|
419
454
|
cargs.extend([
|
|
420
455
|
"-shells",
|
|
421
|
-
",".join(map(str, params.get("shells")))
|
|
456
|
+
",".join(map(str, params.get("shells", None)))
|
|
422
457
|
])
|
|
423
|
-
if params.get("strides") is not None:
|
|
458
|
+
if params.get("strides", None) is not None:
|
|
424
459
|
cargs.extend([
|
|
425
460
|
"-strides",
|
|
426
|
-
*
|
|
461
|
+
*amp2sh_strides_cargs_dyn_fn(params.get("strides", None)["@type"])(params.get("strides", None), execution)
|
|
427
462
|
])
|
|
428
|
-
if params.get("info"):
|
|
463
|
+
if params.get("info", False):
|
|
429
464
|
cargs.append("-info")
|
|
430
|
-
if params.get("quiet"):
|
|
465
|
+
if params.get("quiet", False):
|
|
431
466
|
cargs.append("-quiet")
|
|
432
|
-
if params.get("debug"):
|
|
467
|
+
if params.get("debug", False):
|
|
433
468
|
cargs.append("-debug")
|
|
434
|
-
if params.get("force"):
|
|
469
|
+
if params.get("force", False):
|
|
435
470
|
cargs.append("-force")
|
|
436
|
-
if params.get("nthreads") is not None:
|
|
471
|
+
if params.get("nthreads", None) is not None:
|
|
437
472
|
cargs.extend([
|
|
438
473
|
"-nthreads",
|
|
439
|
-
str(params.get("nthreads"))
|
|
474
|
+
str(params.get("nthreads", None))
|
|
440
475
|
])
|
|
441
|
-
if params.get("config") is not None:
|
|
442
|
-
cargs.extend([a for c in [
|
|
443
|
-
if params.get("help"):
|
|
476
|
+
if params.get("config", None) is not None:
|
|
477
|
+
cargs.extend([a for c in [amp2sh_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
478
|
+
if params.get("help", False):
|
|
444
479
|
cargs.append("-help")
|
|
445
|
-
if params.get("version"):
|
|
480
|
+
if params.get("version", False):
|
|
446
481
|
cargs.append("-version")
|
|
447
|
-
cargs.append(execution.input_file(params.get("amp")))
|
|
448
|
-
cargs.append(params.get("SH"))
|
|
482
|
+
cargs.append(execution.input_file(params.get("amp", None)))
|
|
483
|
+
cargs.append(params.get("SH", None))
|
|
449
484
|
return cargs
|
|
450
485
|
|
|
451
486
|
|
|
@@ -464,18 +499,20 @@ def amp2sh_outputs(
|
|
|
464
499
|
"""
|
|
465
500
|
ret = Amp2shOutputs(
|
|
466
501
|
root=execution.output_file("."),
|
|
467
|
-
sh=execution.output_file(params.get("SH")),
|
|
502
|
+
sh=execution.output_file(params.get("SH", None)),
|
|
468
503
|
)
|
|
469
504
|
return ret
|
|
470
505
|
|
|
471
506
|
|
|
472
507
|
def amp2sh_execute(
|
|
473
508
|
params: Amp2shParameters,
|
|
474
|
-
|
|
509
|
+
runner: Runner | None = None,
|
|
475
510
|
) -> Amp2shOutputs:
|
|
476
511
|
"""
|
|
477
|
-
|
|
478
|
-
|
|
512
|
+
amp2sh
|
|
513
|
+
|
|
514
|
+
Convert a set of amplitudes (defined along a set of corresponding
|
|
515
|
+
directions) to their spherical harmonic representation.
|
|
479
516
|
|
|
480
517
|
The spherical harmonic decomposition is calculated by least-squares linear
|
|
481
518
|
fitting to the amplitude data.
|
|
@@ -502,10 +539,12 @@ def amp2sh_execute(
|
|
|
502
539
|
|
|
503
540
|
Args:
|
|
504
541
|
params: The parameters.
|
|
505
|
-
|
|
542
|
+
runner: Command runner.
|
|
506
543
|
Returns:
|
|
507
544
|
NamedTuple of outputs (described in `Amp2shOutputs`).
|
|
508
545
|
"""
|
|
546
|
+
runner = runner or get_global_runner()
|
|
547
|
+
execution = runner.start_execution(AMP2SH_METADATA)
|
|
509
548
|
params = execution.params(params)
|
|
510
549
|
cargs = amp2sh_cargs(params, execution)
|
|
511
550
|
ret = amp2sh_outputs(params, execution)
|
|
@@ -523,7 +562,7 @@ def amp2sh(
|
|
|
523
562
|
grad: InputPathType | None = None,
|
|
524
563
|
fslgrad: Amp2shFslgradParameters | None = None,
|
|
525
564
|
shells: list[float] | None = None,
|
|
526
|
-
strides: typing.Union[
|
|
565
|
+
strides: typing.Union[Amp2shVariousStringParametersTagged, Amp2shVariousFileParametersTagged] | None = None,
|
|
527
566
|
info: bool = False,
|
|
528
567
|
quiet: bool = False,
|
|
529
568
|
debug: bool = False,
|
|
@@ -535,8 +574,10 @@ def amp2sh(
|
|
|
535
574
|
runner: Runner | None = None,
|
|
536
575
|
) -> Amp2shOutputs:
|
|
537
576
|
"""
|
|
538
|
-
|
|
539
|
-
|
|
577
|
+
amp2sh
|
|
578
|
+
|
|
579
|
+
Convert a set of amplitudes (defined along a set of corresponding
|
|
580
|
+
directions) to their spherical harmonic representation.
|
|
540
581
|
|
|
541
582
|
The spherical harmonic decomposition is calculated by least-squares linear
|
|
542
583
|
fitting to the amplitude data.
|
|
@@ -614,8 +655,6 @@ def amp2sh(
|
|
|
614
655
|
Returns:
|
|
615
656
|
NamedTuple of outputs (described in `Amp2shOutputs`).
|
|
616
657
|
"""
|
|
617
|
-
runner = runner or get_global_runner()
|
|
618
|
-
execution = runner.start_execution(AMP2SH_METADATA)
|
|
619
658
|
params = amp2sh_params(
|
|
620
659
|
lmax=lmax,
|
|
621
660
|
normalise=normalise,
|
|
@@ -636,19 +675,15 @@ def amp2sh(
|
|
|
636
675
|
amp=amp,
|
|
637
676
|
sh=sh,
|
|
638
677
|
)
|
|
639
|
-
return amp2sh_execute(params,
|
|
678
|
+
return amp2sh_execute(params, runner)
|
|
640
679
|
|
|
641
680
|
|
|
642
681
|
__all__ = [
|
|
643
682
|
"AMP2SH_METADATA",
|
|
644
|
-
"Amp2shConfigParameters",
|
|
645
|
-
"Amp2shFslgradParameters",
|
|
646
683
|
"Amp2shOutputs",
|
|
647
|
-
"Amp2shParameters",
|
|
648
|
-
"Amp2shVariousFileParameters",
|
|
649
|
-
"Amp2shVariousStringParameters",
|
|
650
684
|
"amp2sh",
|
|
651
685
|
"amp2sh_config_params",
|
|
686
|
+
"amp2sh_execute",
|
|
652
687
|
"amp2sh_fslgrad_params",
|
|
653
688
|
"amp2sh_params",
|
|
654
689
|
"amp2sh_various_file_params",
|