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/dwi2fod.py
CHANGED
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
DWI2FOD_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="6d16386fcfa6e4701ad68f4333de7173683fda45.boutiques",
|
|
10
10
|
name="dwi2fod",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,40 +14,92 @@ DWI2FOD_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
Dwi2fodFslgradParameters = typing.TypedDict('Dwi2fodFslgradParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["fslgrad"]],
|
|
18
|
+
"bvecs": InputPathType,
|
|
19
|
+
"bvals": InputPathType,
|
|
20
|
+
})
|
|
21
|
+
Dwi2fodFslgradParametersTagged = typing.TypedDict('Dwi2fodFslgradParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["fslgrad"],
|
|
18
23
|
"bvecs": InputPathType,
|
|
19
24
|
"bvals": InputPathType,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
Dwi2fodVariousStringParameters = typing.TypedDict('Dwi2fodVariousStringParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["VariousString"]],
|
|
30
|
+
"obj": str,
|
|
31
|
+
})
|
|
32
|
+
Dwi2fodVariousStringParametersTagged = typing.TypedDict('Dwi2fodVariousStringParametersTagged', {
|
|
33
|
+
"@type": typing.Literal["VariousString"],
|
|
25
34
|
"obj": str,
|
|
26
35
|
})
|
|
27
36
|
|
|
28
37
|
|
|
29
38
|
Dwi2fodVariousFileParameters = typing.TypedDict('Dwi2fodVariousFileParameters', {
|
|
30
|
-
"
|
|
39
|
+
"@type": typing.NotRequired[typing.Literal["VariousFile"]],
|
|
40
|
+
"obj": InputPathType,
|
|
41
|
+
})
|
|
42
|
+
Dwi2fodVariousFileParametersTagged = typing.TypedDict('Dwi2fodVariousFileParametersTagged', {
|
|
43
|
+
"@type": typing.Literal["VariousFile"],
|
|
31
44
|
"obj": InputPathType,
|
|
32
45
|
})
|
|
33
46
|
|
|
34
47
|
|
|
35
48
|
Dwi2fodConfigParameters = typing.TypedDict('Dwi2fodConfigParameters', {
|
|
36
|
-
"
|
|
49
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
50
|
+
"key": str,
|
|
51
|
+
"value": str,
|
|
52
|
+
})
|
|
53
|
+
Dwi2fodConfigParametersTagged = typing.TypedDict('Dwi2fodConfigParametersTagged', {
|
|
54
|
+
"@type": typing.Literal["config"],
|
|
37
55
|
"key": str,
|
|
38
56
|
"value": str,
|
|
39
57
|
})
|
|
40
58
|
|
|
41
59
|
|
|
42
60
|
Dwi2fodResponseOdfParameters = typing.TypedDict('Dwi2fodResponseOdfParameters', {
|
|
43
|
-
"
|
|
61
|
+
"@type": typing.NotRequired[typing.Literal["response_odf"]],
|
|
62
|
+
"response": InputPathType,
|
|
63
|
+
"odf": str,
|
|
64
|
+
})
|
|
65
|
+
Dwi2fodResponseOdfParametersTagged = typing.TypedDict('Dwi2fodResponseOdfParametersTagged', {
|
|
66
|
+
"@type": typing.Literal["response_odf"],
|
|
44
67
|
"response": InputPathType,
|
|
45
68
|
"odf": str,
|
|
46
69
|
})
|
|
47
70
|
|
|
48
71
|
|
|
49
72
|
Dwi2fodParameters = typing.TypedDict('Dwi2fodParameters', {
|
|
50
|
-
"
|
|
73
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/dwi2fod"]],
|
|
74
|
+
"grad": typing.NotRequired[InputPathType | None],
|
|
75
|
+
"fslgrad": typing.NotRequired[Dwi2fodFslgradParameters | None],
|
|
76
|
+
"shells": typing.NotRequired[list[float] | None],
|
|
77
|
+
"directions": typing.NotRequired[InputPathType | None],
|
|
78
|
+
"lmax": typing.NotRequired[list[int] | None],
|
|
79
|
+
"mask": typing.NotRequired[InputPathType | None],
|
|
80
|
+
"filter": typing.NotRequired[InputPathType | None],
|
|
81
|
+
"neg_lambda": typing.NotRequired[float | None],
|
|
82
|
+
"norm_lambda": typing.NotRequired[float | None],
|
|
83
|
+
"threshold": typing.NotRequired[float | None],
|
|
84
|
+
"niter": typing.NotRequired[int | None],
|
|
85
|
+
"norm_lambda_1": typing.NotRequired[float | None],
|
|
86
|
+
"neg_lambda_1": typing.NotRequired[float | None],
|
|
87
|
+
"predicted_signal": typing.NotRequired[str | None],
|
|
88
|
+
"strides": typing.NotRequired[typing.Union[Dwi2fodVariousStringParametersTagged, Dwi2fodVariousFileParametersTagged] | None],
|
|
89
|
+
"info": bool,
|
|
90
|
+
"quiet": bool,
|
|
91
|
+
"debug": bool,
|
|
92
|
+
"force": bool,
|
|
93
|
+
"nthreads": typing.NotRequired[int | None],
|
|
94
|
+
"config": typing.NotRequired[list[Dwi2fodConfigParameters] | None],
|
|
95
|
+
"help": bool,
|
|
96
|
+
"version": bool,
|
|
97
|
+
"algorithm": str,
|
|
98
|
+
"dwi": InputPathType,
|
|
99
|
+
"response_odf": list[Dwi2fodResponseOdfParameters],
|
|
100
|
+
})
|
|
101
|
+
Dwi2fodParametersTagged = typing.TypedDict('Dwi2fodParametersTagged', {
|
|
102
|
+
"@type": typing.Literal["mrtrix/dwi2fod"],
|
|
51
103
|
"grad": typing.NotRequired[InputPathType | None],
|
|
52
104
|
"fslgrad": typing.NotRequired[Dwi2fodFslgradParameters | None],
|
|
53
105
|
"shells": typing.NotRequired[list[float] | None],
|
|
@@ -62,7 +114,7 @@ Dwi2fodParameters = typing.TypedDict('Dwi2fodParameters', {
|
|
|
62
114
|
"norm_lambda_1": typing.NotRequired[float | None],
|
|
63
115
|
"neg_lambda_1": typing.NotRequired[float | None],
|
|
64
116
|
"predicted_signal": typing.NotRequired[str | None],
|
|
65
|
-
"strides": typing.NotRequired[typing.Union[
|
|
117
|
+
"strides": typing.NotRequired[typing.Union[Dwi2fodVariousStringParametersTagged, Dwi2fodVariousFileParametersTagged] | None],
|
|
66
118
|
"info": bool,
|
|
67
119
|
"quiet": bool,
|
|
68
120
|
"debug": bool,
|
|
@@ -77,7 +129,7 @@ Dwi2fodParameters = typing.TypedDict('Dwi2fodParameters', {
|
|
|
77
129
|
})
|
|
78
130
|
|
|
79
131
|
|
|
80
|
-
def
|
|
132
|
+
def dwi2fod_strides_cargs_dyn_fn(
|
|
81
133
|
t: str,
|
|
82
134
|
) -> typing.Any:
|
|
83
135
|
"""
|
|
@@ -89,16 +141,12 @@ def dyn_cargs(
|
|
|
89
141
|
Build cargs function.
|
|
90
142
|
"""
|
|
91
143
|
return {
|
|
92
|
-
"dwi2fod": dwi2fod_cargs,
|
|
93
|
-
"fslgrad": dwi2fod_fslgrad_cargs,
|
|
94
144
|
"VariousString": dwi2fod_various_string_cargs,
|
|
95
145
|
"VariousFile": dwi2fod_various_file_cargs,
|
|
96
|
-
"config": dwi2fod_config_cargs,
|
|
97
|
-
"response_odf": dwi2fod_response_odf_cargs,
|
|
98
146
|
}.get(t)
|
|
99
147
|
|
|
100
148
|
|
|
101
|
-
def
|
|
149
|
+
def dwi2fod_strides_outputs_dyn_fn(
|
|
102
150
|
t: str,
|
|
103
151
|
) -> typing.Any:
|
|
104
152
|
"""
|
|
@@ -110,15 +158,13 @@ def dyn_outputs(
|
|
|
110
158
|
Build outputs function.
|
|
111
159
|
"""
|
|
112
160
|
return {
|
|
113
|
-
"dwi2fod": dwi2fod_outputs,
|
|
114
|
-
"response_odf": dwi2fod_response_odf_outputs,
|
|
115
161
|
}.get(t)
|
|
116
162
|
|
|
117
163
|
|
|
118
164
|
def dwi2fod_fslgrad_params(
|
|
119
165
|
bvecs: InputPathType,
|
|
120
166
|
bvals: InputPathType,
|
|
121
|
-
) ->
|
|
167
|
+
) -> Dwi2fodFslgradParametersTagged:
|
|
122
168
|
"""
|
|
123
169
|
Build parameters.
|
|
124
170
|
|
|
@@ -135,7 +181,7 @@ def dwi2fod_fslgrad_params(
|
|
|
135
181
|
Parameter dictionary
|
|
136
182
|
"""
|
|
137
183
|
params = {
|
|
138
|
-
"
|
|
184
|
+
"@type": "fslgrad",
|
|
139
185
|
"bvecs": bvecs,
|
|
140
186
|
"bvals": bvals,
|
|
141
187
|
}
|
|
@@ -157,14 +203,14 @@ def dwi2fod_fslgrad_cargs(
|
|
|
157
203
|
"""
|
|
158
204
|
cargs = []
|
|
159
205
|
cargs.append("-fslgrad")
|
|
160
|
-
cargs.append(execution.input_file(params.get("bvecs")))
|
|
161
|
-
cargs.append(execution.input_file(params.get("bvals")))
|
|
206
|
+
cargs.append(execution.input_file(params.get("bvecs", None)))
|
|
207
|
+
cargs.append(execution.input_file(params.get("bvals", None)))
|
|
162
208
|
return cargs
|
|
163
209
|
|
|
164
210
|
|
|
165
211
|
def dwi2fod_various_string_params(
|
|
166
212
|
obj: str,
|
|
167
|
-
) ->
|
|
213
|
+
) -> Dwi2fodVariousStringParametersTagged:
|
|
168
214
|
"""
|
|
169
215
|
Build parameters.
|
|
170
216
|
|
|
@@ -174,7 +220,7 @@ def dwi2fod_various_string_params(
|
|
|
174
220
|
Parameter dictionary
|
|
175
221
|
"""
|
|
176
222
|
params = {
|
|
177
|
-
"
|
|
223
|
+
"@type": "VariousString",
|
|
178
224
|
"obj": obj,
|
|
179
225
|
}
|
|
180
226
|
return params
|
|
@@ -194,13 +240,13 @@ def dwi2fod_various_string_cargs(
|
|
|
194
240
|
Command-line arguments.
|
|
195
241
|
"""
|
|
196
242
|
cargs = []
|
|
197
|
-
cargs.append(params.get("obj"))
|
|
243
|
+
cargs.append(params.get("obj", None))
|
|
198
244
|
return cargs
|
|
199
245
|
|
|
200
246
|
|
|
201
247
|
def dwi2fod_various_file_params(
|
|
202
248
|
obj: InputPathType,
|
|
203
|
-
) ->
|
|
249
|
+
) -> Dwi2fodVariousFileParametersTagged:
|
|
204
250
|
"""
|
|
205
251
|
Build parameters.
|
|
206
252
|
|
|
@@ -210,7 +256,7 @@ def dwi2fod_various_file_params(
|
|
|
210
256
|
Parameter dictionary
|
|
211
257
|
"""
|
|
212
258
|
params = {
|
|
213
|
-
"
|
|
259
|
+
"@type": "VariousFile",
|
|
214
260
|
"obj": obj,
|
|
215
261
|
}
|
|
216
262
|
return params
|
|
@@ -230,14 +276,14 @@ def dwi2fod_various_file_cargs(
|
|
|
230
276
|
Command-line arguments.
|
|
231
277
|
"""
|
|
232
278
|
cargs = []
|
|
233
|
-
cargs.append(execution.input_file(params.get("obj")))
|
|
279
|
+
cargs.append(execution.input_file(params.get("obj", None)))
|
|
234
280
|
return cargs
|
|
235
281
|
|
|
236
282
|
|
|
237
283
|
def dwi2fod_config_params(
|
|
238
284
|
key: str,
|
|
239
285
|
value: str,
|
|
240
|
-
) ->
|
|
286
|
+
) -> Dwi2fodConfigParametersTagged:
|
|
241
287
|
"""
|
|
242
288
|
Build parameters.
|
|
243
289
|
|
|
@@ -248,7 +294,7 @@ def dwi2fod_config_params(
|
|
|
248
294
|
Parameter dictionary
|
|
249
295
|
"""
|
|
250
296
|
params = {
|
|
251
|
-
"
|
|
297
|
+
"@type": "config",
|
|
252
298
|
"key": key,
|
|
253
299
|
"value": value,
|
|
254
300
|
}
|
|
@@ -270,8 +316,8 @@ def dwi2fod_config_cargs(
|
|
|
270
316
|
"""
|
|
271
317
|
cargs = []
|
|
272
318
|
cargs.append("-config")
|
|
273
|
-
cargs.append(params.get("key"))
|
|
274
|
-
cargs.append(params.get("value"))
|
|
319
|
+
cargs.append(params.get("key", None))
|
|
320
|
+
cargs.append(params.get("value", None))
|
|
275
321
|
return cargs
|
|
276
322
|
|
|
277
323
|
|
|
@@ -288,7 +334,7 @@ class Dwi2fodResponseOdfOutputs(typing.NamedTuple):
|
|
|
288
334
|
def dwi2fod_response_odf_params(
|
|
289
335
|
response: InputPathType,
|
|
290
336
|
odf: str,
|
|
291
|
-
) ->
|
|
337
|
+
) -> Dwi2fodResponseOdfParametersTagged:
|
|
292
338
|
"""
|
|
293
339
|
Build parameters.
|
|
294
340
|
|
|
@@ -299,7 +345,7 @@ def dwi2fod_response_odf_params(
|
|
|
299
345
|
Parameter dictionary
|
|
300
346
|
"""
|
|
301
347
|
params = {
|
|
302
|
-
"
|
|
348
|
+
"@type": "response_odf",
|
|
303
349
|
"response": response,
|
|
304
350
|
"odf": odf,
|
|
305
351
|
}
|
|
@@ -320,8 +366,8 @@ def dwi2fod_response_odf_cargs(
|
|
|
320
366
|
Command-line arguments.
|
|
321
367
|
"""
|
|
322
368
|
cargs = []
|
|
323
|
-
cargs.append(execution.input_file(params.get("response")))
|
|
324
|
-
cargs.append(params.get("odf"))
|
|
369
|
+
cargs.append(execution.input_file(params.get("response", None)))
|
|
370
|
+
cargs.append(params.get("odf", None))
|
|
325
371
|
return cargs
|
|
326
372
|
|
|
327
373
|
|
|
@@ -340,14 +386,14 @@ def dwi2fod_response_odf_outputs(
|
|
|
340
386
|
"""
|
|
341
387
|
ret = Dwi2fodResponseOdfOutputs(
|
|
342
388
|
root=execution.output_file("."),
|
|
343
|
-
odf=execution.output_file(params.get("odf")),
|
|
389
|
+
odf=execution.output_file(params.get("odf", None)),
|
|
344
390
|
)
|
|
345
391
|
return ret
|
|
346
392
|
|
|
347
393
|
|
|
348
394
|
class Dwi2fodOutputs(typing.NamedTuple):
|
|
349
395
|
"""
|
|
350
|
-
Output object returned when calling `
|
|
396
|
+
Output object returned when calling `Dwi2fodParameters(...)`.
|
|
351
397
|
"""
|
|
352
398
|
root: OutputPathType
|
|
353
399
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -376,7 +422,7 @@ def dwi2fod_params(
|
|
|
376
422
|
norm_lambda_1: float | None = None,
|
|
377
423
|
neg_lambda_1: float | None = None,
|
|
378
424
|
predicted_signal: str | None = None,
|
|
379
|
-
strides: typing.Union[
|
|
425
|
+
strides: typing.Union[Dwi2fodVariousStringParametersTagged, Dwi2fodVariousFileParametersTagged] | None = None,
|
|
380
426
|
info: bool = False,
|
|
381
427
|
quiet: bool = False,
|
|
382
428
|
debug: bool = False,
|
|
@@ -385,7 +431,7 @@ def dwi2fod_params(
|
|
|
385
431
|
config: list[Dwi2fodConfigParameters] | None = None,
|
|
386
432
|
help_: bool = False,
|
|
387
433
|
version: bool = False,
|
|
388
|
-
) ->
|
|
434
|
+
) -> Dwi2fodParametersTagged:
|
|
389
435
|
"""
|
|
390
436
|
Build parameters.
|
|
391
437
|
|
|
@@ -466,7 +512,7 @@ def dwi2fod_params(
|
|
|
466
512
|
Parameter dictionary
|
|
467
513
|
"""
|
|
468
514
|
params = {
|
|
469
|
-
"
|
|
515
|
+
"@type": "mrtrix/dwi2fod",
|
|
470
516
|
"info": info,
|
|
471
517
|
"quiet": quiet,
|
|
472
518
|
"debug": debug,
|
|
@@ -529,100 +575,100 @@ def dwi2fod_cargs(
|
|
|
529
575
|
"""
|
|
530
576
|
cargs = []
|
|
531
577
|
cargs.append("dwi2fod")
|
|
532
|
-
if params.get("grad") is not None:
|
|
578
|
+
if params.get("grad", None) is not None:
|
|
533
579
|
cargs.extend([
|
|
534
580
|
"-grad",
|
|
535
|
-
execution.input_file(params.get("grad"))
|
|
581
|
+
execution.input_file(params.get("grad", None))
|
|
536
582
|
])
|
|
537
|
-
if params.get("fslgrad") is not None:
|
|
538
|
-
cargs.extend(
|
|
539
|
-
if params.get("shells") is not None:
|
|
583
|
+
if params.get("fslgrad", None) is not None:
|
|
584
|
+
cargs.extend(dwi2fod_fslgrad_cargs(params.get("fslgrad", None), execution))
|
|
585
|
+
if params.get("shells", None) is not None:
|
|
540
586
|
cargs.extend([
|
|
541
587
|
"-shells",
|
|
542
|
-
",".join(map(str, params.get("shells")))
|
|
588
|
+
",".join(map(str, params.get("shells", None)))
|
|
543
589
|
])
|
|
544
|
-
if params.get("directions") is not None:
|
|
590
|
+
if params.get("directions", None) is not None:
|
|
545
591
|
cargs.extend([
|
|
546
592
|
"-directions",
|
|
547
|
-
execution.input_file(params.get("directions"))
|
|
593
|
+
execution.input_file(params.get("directions", None))
|
|
548
594
|
])
|
|
549
|
-
if params.get("lmax") is not None:
|
|
595
|
+
if params.get("lmax", None) is not None:
|
|
550
596
|
cargs.extend([
|
|
551
597
|
"-lmax",
|
|
552
|
-
",".join(map(str, params.get("lmax")))
|
|
598
|
+
",".join(map(str, params.get("lmax", None)))
|
|
553
599
|
])
|
|
554
|
-
if params.get("mask") is not None:
|
|
600
|
+
if params.get("mask", None) is not None:
|
|
555
601
|
cargs.extend([
|
|
556
602
|
"-mask",
|
|
557
|
-
execution.input_file(params.get("mask"))
|
|
603
|
+
execution.input_file(params.get("mask", None))
|
|
558
604
|
])
|
|
559
|
-
if params.get("filter") is not None:
|
|
605
|
+
if params.get("filter", None) is not None:
|
|
560
606
|
cargs.extend([
|
|
561
607
|
"-filter",
|
|
562
|
-
execution.input_file(params.get("filter"))
|
|
608
|
+
execution.input_file(params.get("filter", None))
|
|
563
609
|
])
|
|
564
|
-
if params.get("neg_lambda") is not None:
|
|
610
|
+
if params.get("neg_lambda", None) is not None:
|
|
565
611
|
cargs.extend([
|
|
566
612
|
"-neg_lambda",
|
|
567
|
-
str(params.get("neg_lambda"))
|
|
613
|
+
str(params.get("neg_lambda", None))
|
|
568
614
|
])
|
|
569
|
-
if params.get("norm_lambda") is not None:
|
|
615
|
+
if params.get("norm_lambda", None) is not None:
|
|
570
616
|
cargs.extend([
|
|
571
617
|
"-norm_lambda",
|
|
572
|
-
str(params.get("norm_lambda"))
|
|
618
|
+
str(params.get("norm_lambda", None))
|
|
573
619
|
])
|
|
574
|
-
if params.get("threshold") is not None:
|
|
620
|
+
if params.get("threshold", None) is not None:
|
|
575
621
|
cargs.extend([
|
|
576
622
|
"-threshold",
|
|
577
|
-
str(params.get("threshold"))
|
|
623
|
+
str(params.get("threshold", None))
|
|
578
624
|
])
|
|
579
|
-
if params.get("niter") is not None:
|
|
625
|
+
if params.get("niter", None) is not None:
|
|
580
626
|
cargs.extend([
|
|
581
627
|
"-niter",
|
|
582
|
-
str(params.get("niter"))
|
|
628
|
+
str(params.get("niter", None))
|
|
583
629
|
])
|
|
584
|
-
if params.get("norm_lambda_1") is not None:
|
|
630
|
+
if params.get("norm_lambda_1", None) is not None:
|
|
585
631
|
cargs.extend([
|
|
586
632
|
"-norm_lambda",
|
|
587
|
-
str(params.get("norm_lambda_1"))
|
|
633
|
+
str(params.get("norm_lambda_1", None))
|
|
588
634
|
])
|
|
589
|
-
if params.get("neg_lambda_1") is not None:
|
|
635
|
+
if params.get("neg_lambda_1", None) is not None:
|
|
590
636
|
cargs.extend([
|
|
591
637
|
"-neg_lambda",
|
|
592
|
-
str(params.get("neg_lambda_1"))
|
|
638
|
+
str(params.get("neg_lambda_1", None))
|
|
593
639
|
])
|
|
594
|
-
if params.get("predicted_signal") is not None:
|
|
640
|
+
if params.get("predicted_signal", None) is not None:
|
|
595
641
|
cargs.extend([
|
|
596
642
|
"-predicted_signal",
|
|
597
|
-
params.get("predicted_signal")
|
|
643
|
+
params.get("predicted_signal", None)
|
|
598
644
|
])
|
|
599
|
-
if params.get("strides") is not None:
|
|
645
|
+
if params.get("strides", None) is not None:
|
|
600
646
|
cargs.extend([
|
|
601
647
|
"-strides",
|
|
602
|
-
*
|
|
648
|
+
*dwi2fod_strides_cargs_dyn_fn(params.get("strides", None)["@type"])(params.get("strides", None), execution)
|
|
603
649
|
])
|
|
604
|
-
if params.get("info"):
|
|
650
|
+
if params.get("info", False):
|
|
605
651
|
cargs.append("-info")
|
|
606
|
-
if params.get("quiet"):
|
|
652
|
+
if params.get("quiet", False):
|
|
607
653
|
cargs.append("-quiet")
|
|
608
|
-
if params.get("debug"):
|
|
654
|
+
if params.get("debug", False):
|
|
609
655
|
cargs.append("-debug")
|
|
610
|
-
if params.get("force"):
|
|
656
|
+
if params.get("force", False):
|
|
611
657
|
cargs.append("-force")
|
|
612
|
-
if params.get("nthreads") is not None:
|
|
658
|
+
if params.get("nthreads", None) is not None:
|
|
613
659
|
cargs.extend([
|
|
614
660
|
"-nthreads",
|
|
615
|
-
str(params.get("nthreads"))
|
|
661
|
+
str(params.get("nthreads", None))
|
|
616
662
|
])
|
|
617
|
-
if params.get("config") is not None:
|
|
618
|
-
cargs.extend([a for c in [
|
|
619
|
-
if params.get("help"):
|
|
663
|
+
if params.get("config", None) is not None:
|
|
664
|
+
cargs.extend([a for c in [dwi2fod_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
665
|
+
if params.get("help", False):
|
|
620
666
|
cargs.append("-help")
|
|
621
|
-
if params.get("version"):
|
|
667
|
+
if params.get("version", False):
|
|
622
668
|
cargs.append("-version")
|
|
623
|
-
cargs.append(params.get("algorithm"))
|
|
624
|
-
cargs.append(execution.input_file(params.get("dwi")))
|
|
625
|
-
cargs.extend([a for c in [
|
|
669
|
+
cargs.append(params.get("algorithm", None))
|
|
670
|
+
cargs.append(execution.input_file(params.get("dwi", None)))
|
|
671
|
+
cargs.extend([a for c in [dwi2fod_response_odf_cargs(s, execution) for s in params.get("response_odf", None)] for a in c])
|
|
626
672
|
return cargs
|
|
627
673
|
|
|
628
674
|
|
|
@@ -641,17 +687,19 @@ def dwi2fod_outputs(
|
|
|
641
687
|
"""
|
|
642
688
|
ret = Dwi2fodOutputs(
|
|
643
689
|
root=execution.output_file("."),
|
|
644
|
-
predicted_signal=execution.output_file(params.get("predicted_signal")) if (params.get("predicted_signal") is not None) else None,
|
|
645
|
-
response_odf=[
|
|
690
|
+
predicted_signal=execution.output_file(params.get("predicted_signal", None)) if (params.get("predicted_signal") is not None) else None,
|
|
691
|
+
response_odf=[dwi2fod_response_odf_outputs(i, execution) if dwi2fod_response_odf_outputs else None for i in params.get("response_odf")],
|
|
646
692
|
)
|
|
647
693
|
return ret
|
|
648
694
|
|
|
649
695
|
|
|
650
696
|
def dwi2fod_execute(
|
|
651
697
|
params: Dwi2fodParameters,
|
|
652
|
-
|
|
698
|
+
runner: Runner | None = None,
|
|
653
699
|
) -> Dwi2fodOutputs:
|
|
654
700
|
"""
|
|
701
|
+
dwi2fod
|
|
702
|
+
|
|
655
703
|
Estimate fibre orientation distributions from diffusion data using spherical
|
|
656
704
|
deconvolution.
|
|
657
705
|
|
|
@@ -681,10 +729,12 @@ def dwi2fod_execute(
|
|
|
681
729
|
|
|
682
730
|
Args:
|
|
683
731
|
params: The parameters.
|
|
684
|
-
|
|
732
|
+
runner: Command runner.
|
|
685
733
|
Returns:
|
|
686
734
|
NamedTuple of outputs (described in `Dwi2fodOutputs`).
|
|
687
735
|
"""
|
|
736
|
+
runner = runner or get_global_runner()
|
|
737
|
+
execution = runner.start_execution(DWI2FOD_METADATA)
|
|
688
738
|
params = execution.params(params)
|
|
689
739
|
cargs = dwi2fod_cargs(params, execution)
|
|
690
740
|
ret = dwi2fod_outputs(params, execution)
|
|
@@ -710,7 +760,7 @@ def dwi2fod(
|
|
|
710
760
|
norm_lambda_1: float | None = None,
|
|
711
761
|
neg_lambda_1: float | None = None,
|
|
712
762
|
predicted_signal: str | None = None,
|
|
713
|
-
strides: typing.Union[
|
|
763
|
+
strides: typing.Union[Dwi2fodVariousStringParametersTagged, Dwi2fodVariousFileParametersTagged] | None = None,
|
|
714
764
|
info: bool = False,
|
|
715
765
|
quiet: bool = False,
|
|
716
766
|
debug: bool = False,
|
|
@@ -722,6 +772,8 @@ def dwi2fod(
|
|
|
722
772
|
runner: Runner | None = None,
|
|
723
773
|
) -> Dwi2fodOutputs:
|
|
724
774
|
"""
|
|
775
|
+
dwi2fod
|
|
776
|
+
|
|
725
777
|
Estimate fibre orientation distributions from diffusion data using spherical
|
|
726
778
|
deconvolution.
|
|
727
779
|
|
|
@@ -826,8 +878,6 @@ def dwi2fod(
|
|
|
826
878
|
Returns:
|
|
827
879
|
NamedTuple of outputs (described in `Dwi2fodOutputs`).
|
|
828
880
|
"""
|
|
829
|
-
runner = runner or get_global_runner()
|
|
830
|
-
execution = runner.start_execution(DWI2FOD_METADATA)
|
|
831
881
|
params = dwi2fod_params(
|
|
832
882
|
grad=grad,
|
|
833
883
|
fslgrad=fslgrad,
|
|
@@ -856,21 +906,16 @@ def dwi2fod(
|
|
|
856
906
|
dwi=dwi,
|
|
857
907
|
response_odf=response_odf,
|
|
858
908
|
)
|
|
859
|
-
return dwi2fod_execute(params,
|
|
909
|
+
return dwi2fod_execute(params, runner)
|
|
860
910
|
|
|
861
911
|
|
|
862
912
|
__all__ = [
|
|
863
913
|
"DWI2FOD_METADATA",
|
|
864
|
-
"Dwi2fodConfigParameters",
|
|
865
|
-
"Dwi2fodFslgradParameters",
|
|
866
914
|
"Dwi2fodOutputs",
|
|
867
|
-
"Dwi2fodParameters",
|
|
868
915
|
"Dwi2fodResponseOdfOutputs",
|
|
869
|
-
"Dwi2fodResponseOdfParameters",
|
|
870
|
-
"Dwi2fodVariousFileParameters",
|
|
871
|
-
"Dwi2fodVariousStringParameters",
|
|
872
916
|
"dwi2fod",
|
|
873
917
|
"dwi2fod_config_params",
|
|
918
|
+
"dwi2fod_execute",
|
|
874
919
|
"dwi2fod_fslgrad_params",
|
|
875
920
|
"dwi2fod_params",
|
|
876
921
|
"dwi2fod_response_odf_params",
|