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/dirsplit.py
CHANGED
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
DIRSPLIT_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="7c55878e57655ef50ae5568918ecc61af1b94ca1.boutiques",
|
|
10
10
|
name="dirsplit",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,34 @@ DIRSPLIT_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
DirsplitConfigParameters = typing.TypedDict('DirsplitConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
DirsplitConfigParametersTagged = typing.TypedDict('DirsplitConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
DirsplitParameters = typing.TypedDict('DirsplitParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/dirsplit"]],
|
|
30
|
+
"permutations": typing.NotRequired[int | None],
|
|
31
|
+
"cartesian": bool,
|
|
32
|
+
"info": bool,
|
|
33
|
+
"quiet": bool,
|
|
34
|
+
"debug": bool,
|
|
35
|
+
"force": bool,
|
|
36
|
+
"nthreads": typing.NotRequired[int | None],
|
|
37
|
+
"config": typing.NotRequired[list[DirsplitConfigParameters] | None],
|
|
38
|
+
"help": bool,
|
|
39
|
+
"version": bool,
|
|
40
|
+
"dirs": InputPathType,
|
|
41
|
+
"out": str,
|
|
42
|
+
})
|
|
43
|
+
DirsplitParametersTagged = typing.TypedDict('DirsplitParametersTagged', {
|
|
44
|
+
"@type": typing.Literal["mrtrix/dirsplit"],
|
|
25
45
|
"permutations": typing.NotRequired[int | None],
|
|
26
46
|
"cartesian": bool,
|
|
27
47
|
"info": bool,
|
|
@@ -35,45 +55,12 @@ DirsplitParameters = typing.TypedDict('DirsplitParameters', {
|
|
|
35
55
|
"dirs": InputPathType,
|
|
36
56
|
"out": str,
|
|
37
57
|
})
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def dyn_cargs(
|
|
41
|
-
t: str,
|
|
42
|
-
) -> typing.Any:
|
|
43
|
-
"""
|
|
44
|
-
Get build cargs function by command type.
|
|
45
|
-
|
|
46
|
-
Args:
|
|
47
|
-
t: Command type.
|
|
48
|
-
Returns:
|
|
49
|
-
Build cargs function.
|
|
50
|
-
"""
|
|
51
|
-
return {
|
|
52
|
-
"dirsplit": dirsplit_cargs,
|
|
53
|
-
"config": dirsplit_config_cargs,
|
|
54
|
-
}.get(t)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def dyn_outputs(
|
|
58
|
-
t: str,
|
|
59
|
-
) -> typing.Any:
|
|
60
|
-
"""
|
|
61
|
-
Get build outputs function by command type.
|
|
62
|
-
|
|
63
|
-
Args:
|
|
64
|
-
t: Command type.
|
|
65
|
-
Returns:
|
|
66
|
-
Build outputs function.
|
|
67
|
-
"""
|
|
68
|
-
return {
|
|
69
|
-
"dirsplit": dirsplit_outputs,
|
|
70
|
-
}.get(t)
|
|
71
58
|
|
|
72
59
|
|
|
73
60
|
def dirsplit_config_params(
|
|
74
61
|
key: str,
|
|
75
62
|
value: str,
|
|
76
|
-
) ->
|
|
63
|
+
) -> DirsplitConfigParametersTagged:
|
|
77
64
|
"""
|
|
78
65
|
Build parameters.
|
|
79
66
|
|
|
@@ -84,7 +71,7 @@ def dirsplit_config_params(
|
|
|
84
71
|
Parameter dictionary
|
|
85
72
|
"""
|
|
86
73
|
params = {
|
|
87
|
-
"
|
|
74
|
+
"@type": "config",
|
|
88
75
|
"key": key,
|
|
89
76
|
"value": value,
|
|
90
77
|
}
|
|
@@ -106,14 +93,14 @@ def dirsplit_config_cargs(
|
|
|
106
93
|
"""
|
|
107
94
|
cargs = []
|
|
108
95
|
cargs.append("-config")
|
|
109
|
-
cargs.append(params.get("key"))
|
|
110
|
-
cargs.append(params.get("value"))
|
|
96
|
+
cargs.append(params.get("key", None))
|
|
97
|
+
cargs.append(params.get("value", None))
|
|
111
98
|
return cargs
|
|
112
99
|
|
|
113
100
|
|
|
114
101
|
class DirsplitOutputs(typing.NamedTuple):
|
|
115
102
|
"""
|
|
116
|
-
Output object returned when calling `
|
|
103
|
+
Output object returned when calling `DirsplitParameters(...)`.
|
|
117
104
|
"""
|
|
118
105
|
root: OutputPathType
|
|
119
106
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -134,7 +121,7 @@ def dirsplit_params(
|
|
|
134
121
|
config: list[DirsplitConfigParameters] | None = None,
|
|
135
122
|
help_: bool = False,
|
|
136
123
|
version: bool = False,
|
|
137
|
-
) ->
|
|
124
|
+
) -> DirsplitParametersTagged:
|
|
138
125
|
"""
|
|
139
126
|
Build parameters.
|
|
140
127
|
|
|
@@ -160,7 +147,7 @@ def dirsplit_params(
|
|
|
160
147
|
Parameter dictionary
|
|
161
148
|
"""
|
|
162
149
|
params = {
|
|
163
|
-
"
|
|
150
|
+
"@type": "mrtrix/dirsplit",
|
|
164
151
|
"cartesian": cartesian,
|
|
165
152
|
"info": info,
|
|
166
153
|
"quiet": quiet,
|
|
@@ -195,34 +182,34 @@ def dirsplit_cargs(
|
|
|
195
182
|
"""
|
|
196
183
|
cargs = []
|
|
197
184
|
cargs.append("dirsplit")
|
|
198
|
-
if params.get("permutations") is not None:
|
|
185
|
+
if params.get("permutations", None) is not None:
|
|
199
186
|
cargs.extend([
|
|
200
187
|
"-permutations",
|
|
201
|
-
str(params.get("permutations"))
|
|
188
|
+
str(params.get("permutations", None))
|
|
202
189
|
])
|
|
203
|
-
if params.get("cartesian"):
|
|
190
|
+
if params.get("cartesian", False):
|
|
204
191
|
cargs.append("-cartesian")
|
|
205
|
-
if params.get("info"):
|
|
192
|
+
if params.get("info", False):
|
|
206
193
|
cargs.append("-info")
|
|
207
|
-
if params.get("quiet"):
|
|
194
|
+
if params.get("quiet", False):
|
|
208
195
|
cargs.append("-quiet")
|
|
209
|
-
if params.get("debug"):
|
|
196
|
+
if params.get("debug", False):
|
|
210
197
|
cargs.append("-debug")
|
|
211
|
-
if params.get("force"):
|
|
198
|
+
if params.get("force", False):
|
|
212
199
|
cargs.append("-force")
|
|
213
|
-
if params.get("nthreads") is not None:
|
|
200
|
+
if params.get("nthreads", None) is not None:
|
|
214
201
|
cargs.extend([
|
|
215
202
|
"-nthreads",
|
|
216
|
-
str(params.get("nthreads"))
|
|
203
|
+
str(params.get("nthreads", None))
|
|
217
204
|
])
|
|
218
|
-
if params.get("config") is not None:
|
|
219
|
-
cargs.extend([a for c in [
|
|
220
|
-
if params.get("help"):
|
|
205
|
+
if params.get("config", None) is not None:
|
|
206
|
+
cargs.extend([a for c in [dirsplit_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
207
|
+
if params.get("help", False):
|
|
221
208
|
cargs.append("-help")
|
|
222
|
-
if params.get("version"):
|
|
209
|
+
if params.get("version", False):
|
|
223
210
|
cargs.append("-version")
|
|
224
|
-
cargs.append(execution.input_file(params.get("dirs")))
|
|
225
|
-
cargs.append(params.get("out"))
|
|
211
|
+
cargs.append(execution.input_file(params.get("dirs", None)))
|
|
212
|
+
cargs.append(params.get("out", None))
|
|
226
213
|
return cargs
|
|
227
214
|
|
|
228
215
|
|
|
@@ -241,16 +228,18 @@ def dirsplit_outputs(
|
|
|
241
228
|
"""
|
|
242
229
|
ret = DirsplitOutputs(
|
|
243
230
|
root=execution.output_file("."),
|
|
244
|
-
out=execution.output_file(params.get("out")),
|
|
231
|
+
out=execution.output_file(params.get("out", None)),
|
|
245
232
|
)
|
|
246
233
|
return ret
|
|
247
234
|
|
|
248
235
|
|
|
249
236
|
def dirsplit_execute(
|
|
250
237
|
params: DirsplitParameters,
|
|
251
|
-
|
|
238
|
+
runner: Runner | None = None,
|
|
252
239
|
) -> DirsplitOutputs:
|
|
253
240
|
"""
|
|
241
|
+
dirsplit
|
|
242
|
+
|
|
254
243
|
Split a set of evenly distributed directions (as generated by dirgen) into
|
|
255
244
|
approximately uniformly distributed subsets.
|
|
256
245
|
|
|
@@ -266,10 +255,12 @@ def dirsplit_execute(
|
|
|
266
255
|
|
|
267
256
|
Args:
|
|
268
257
|
params: The parameters.
|
|
269
|
-
|
|
258
|
+
runner: Command runner.
|
|
270
259
|
Returns:
|
|
271
260
|
NamedTuple of outputs (described in `DirsplitOutputs`).
|
|
272
261
|
"""
|
|
262
|
+
runner = runner or get_global_runner()
|
|
263
|
+
execution = runner.start_execution(DIRSPLIT_METADATA)
|
|
273
264
|
params = execution.params(params)
|
|
274
265
|
cargs = dirsplit_cargs(params, execution)
|
|
275
266
|
ret = dirsplit_outputs(params, execution)
|
|
@@ -293,6 +284,8 @@ def dirsplit(
|
|
|
293
284
|
runner: Runner | None = None,
|
|
294
285
|
) -> DirsplitOutputs:
|
|
295
286
|
"""
|
|
287
|
+
dirsplit
|
|
288
|
+
|
|
296
289
|
Split a set of evenly distributed directions (as generated by dirgen) into
|
|
297
290
|
approximately uniformly distributed subsets.
|
|
298
291
|
|
|
@@ -328,8 +321,6 @@ def dirsplit(
|
|
|
328
321
|
Returns:
|
|
329
322
|
NamedTuple of outputs (described in `DirsplitOutputs`).
|
|
330
323
|
"""
|
|
331
|
-
runner = runner or get_global_runner()
|
|
332
|
-
execution = runner.start_execution(DIRSPLIT_METADATA)
|
|
333
324
|
params = dirsplit_params(
|
|
334
325
|
permutations=permutations,
|
|
335
326
|
cartesian=cartesian,
|
|
@@ -344,15 +335,14 @@ def dirsplit(
|
|
|
344
335
|
dirs=dirs,
|
|
345
336
|
out=out,
|
|
346
337
|
)
|
|
347
|
-
return dirsplit_execute(params,
|
|
338
|
+
return dirsplit_execute(params, runner)
|
|
348
339
|
|
|
349
340
|
|
|
350
341
|
__all__ = [
|
|
351
342
|
"DIRSPLIT_METADATA",
|
|
352
|
-
"DirsplitConfigParameters",
|
|
353
343
|
"DirsplitOutputs",
|
|
354
|
-
"DirsplitParameters",
|
|
355
344
|
"dirsplit",
|
|
356
345
|
"dirsplit_config_params",
|
|
346
|
+
"dirsplit_execute",
|
|
357
347
|
"dirsplit_params",
|
|
358
348
|
]
|
niwrap_mrtrix/mrtrix/dirstat.py
CHANGED
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
DIRSTAT_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="369098dbdbd016bf94682e0106a2f2e1711f2a5b.boutiques",
|
|
10
10
|
name="dirstat",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,21 +14,47 @@ DIRSTAT_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
DirstatFslgradParameters = typing.TypedDict('DirstatFslgradParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["fslgrad"]],
|
|
18
|
+
"bvecs": InputPathType,
|
|
19
|
+
"bvals": InputPathType,
|
|
20
|
+
})
|
|
21
|
+
DirstatFslgradParametersTagged = typing.TypedDict('DirstatFslgradParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["fslgrad"],
|
|
18
23
|
"bvecs": InputPathType,
|
|
19
24
|
"bvals": InputPathType,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
DirstatConfigParameters = typing.TypedDict('DirstatConfigParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
30
|
+
"key": str,
|
|
31
|
+
"value": str,
|
|
32
|
+
})
|
|
33
|
+
DirstatConfigParametersTagged = typing.TypedDict('DirstatConfigParametersTagged', {
|
|
34
|
+
"@type": typing.Literal["config"],
|
|
25
35
|
"key": str,
|
|
26
36
|
"value": str,
|
|
27
37
|
})
|
|
28
38
|
|
|
29
39
|
|
|
30
40
|
DirstatParameters = typing.TypedDict('DirstatParameters', {
|
|
31
|
-
"
|
|
41
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/dirstat"]],
|
|
42
|
+
"output": typing.NotRequired[str | None],
|
|
43
|
+
"shells": typing.NotRequired[list[float] | None],
|
|
44
|
+
"grad": typing.NotRequired[InputPathType | None],
|
|
45
|
+
"fslgrad": typing.NotRequired[DirstatFslgradParameters | None],
|
|
46
|
+
"info": bool,
|
|
47
|
+
"quiet": bool,
|
|
48
|
+
"debug": bool,
|
|
49
|
+
"force": bool,
|
|
50
|
+
"nthreads": typing.NotRequired[int | None],
|
|
51
|
+
"config": typing.NotRequired[list[DirstatConfigParameters] | None],
|
|
52
|
+
"help": bool,
|
|
53
|
+
"version": bool,
|
|
54
|
+
"dirs": InputPathType,
|
|
55
|
+
})
|
|
56
|
+
DirstatParametersTagged = typing.TypedDict('DirstatParametersTagged', {
|
|
57
|
+
"@type": typing.Literal["mrtrix/dirstat"],
|
|
32
58
|
"output": typing.NotRequired[str | None],
|
|
33
59
|
"shells": typing.NotRequired[list[float] | None],
|
|
34
60
|
"grad": typing.NotRequired[InputPathType | None],
|
|
@@ -43,45 +69,12 @@ DirstatParameters = typing.TypedDict('DirstatParameters', {
|
|
|
43
69
|
"version": bool,
|
|
44
70
|
"dirs": InputPathType,
|
|
45
71
|
})
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def dyn_cargs(
|
|
49
|
-
t: str,
|
|
50
|
-
) -> typing.Any:
|
|
51
|
-
"""
|
|
52
|
-
Get build cargs function by command type.
|
|
53
|
-
|
|
54
|
-
Args:
|
|
55
|
-
t: Command type.
|
|
56
|
-
Returns:
|
|
57
|
-
Build cargs function.
|
|
58
|
-
"""
|
|
59
|
-
return {
|
|
60
|
-
"dirstat": dirstat_cargs,
|
|
61
|
-
"fslgrad": dirstat_fslgrad_cargs,
|
|
62
|
-
"config": dirstat_config_cargs,
|
|
63
|
-
}.get(t)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
def dyn_outputs(
|
|
67
|
-
t: str,
|
|
68
|
-
) -> typing.Any:
|
|
69
|
-
"""
|
|
70
|
-
Get build outputs function by command type.
|
|
71
|
-
|
|
72
|
-
Args:
|
|
73
|
-
t: Command type.
|
|
74
|
-
Returns:
|
|
75
|
-
Build outputs function.
|
|
76
|
-
"""
|
|
77
|
-
return {
|
|
78
|
-
}.get(t)
|
|
79
72
|
|
|
80
73
|
|
|
81
74
|
def dirstat_fslgrad_params(
|
|
82
75
|
bvecs: InputPathType,
|
|
83
76
|
bvals: InputPathType,
|
|
84
|
-
) ->
|
|
77
|
+
) -> DirstatFslgradParametersTagged:
|
|
85
78
|
"""
|
|
86
79
|
Build parameters.
|
|
87
80
|
|
|
@@ -98,7 +91,7 @@ def dirstat_fslgrad_params(
|
|
|
98
91
|
Parameter dictionary
|
|
99
92
|
"""
|
|
100
93
|
params = {
|
|
101
|
-
"
|
|
94
|
+
"@type": "fslgrad",
|
|
102
95
|
"bvecs": bvecs,
|
|
103
96
|
"bvals": bvals,
|
|
104
97
|
}
|
|
@@ -120,15 +113,15 @@ def dirstat_fslgrad_cargs(
|
|
|
120
113
|
"""
|
|
121
114
|
cargs = []
|
|
122
115
|
cargs.append("-fslgrad")
|
|
123
|
-
cargs.append(execution.input_file(params.get("bvecs")))
|
|
124
|
-
cargs.append(execution.input_file(params.get("bvals")))
|
|
116
|
+
cargs.append(execution.input_file(params.get("bvecs", None)))
|
|
117
|
+
cargs.append(execution.input_file(params.get("bvals", None)))
|
|
125
118
|
return cargs
|
|
126
119
|
|
|
127
120
|
|
|
128
121
|
def dirstat_config_params(
|
|
129
122
|
key: str,
|
|
130
123
|
value: str,
|
|
131
|
-
) ->
|
|
124
|
+
) -> DirstatConfigParametersTagged:
|
|
132
125
|
"""
|
|
133
126
|
Build parameters.
|
|
134
127
|
|
|
@@ -139,7 +132,7 @@ def dirstat_config_params(
|
|
|
139
132
|
Parameter dictionary
|
|
140
133
|
"""
|
|
141
134
|
params = {
|
|
142
|
-
"
|
|
135
|
+
"@type": "config",
|
|
143
136
|
"key": key,
|
|
144
137
|
"value": value,
|
|
145
138
|
}
|
|
@@ -161,14 +154,14 @@ def dirstat_config_cargs(
|
|
|
161
154
|
"""
|
|
162
155
|
cargs = []
|
|
163
156
|
cargs.append("-config")
|
|
164
|
-
cargs.append(params.get("key"))
|
|
165
|
-
cargs.append(params.get("value"))
|
|
157
|
+
cargs.append(params.get("key", None))
|
|
158
|
+
cargs.append(params.get("value", None))
|
|
166
159
|
return cargs
|
|
167
160
|
|
|
168
161
|
|
|
169
162
|
class DirstatOutputs(typing.NamedTuple):
|
|
170
163
|
"""
|
|
171
|
-
Output object returned when calling `
|
|
164
|
+
Output object returned when calling `DirstatParameters(...)`.
|
|
172
165
|
"""
|
|
173
166
|
root: OutputPathType
|
|
174
167
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -188,7 +181,7 @@ def dirstat_params(
|
|
|
188
181
|
config: list[DirstatConfigParameters] | None = None,
|
|
189
182
|
help_: bool = False,
|
|
190
183
|
version: bool = False,
|
|
191
|
-
) ->
|
|
184
|
+
) -> DirstatParametersTagged:
|
|
192
185
|
"""
|
|
193
186
|
Build parameters.
|
|
194
187
|
|
|
@@ -233,7 +226,7 @@ def dirstat_params(
|
|
|
233
226
|
Parameter dictionary
|
|
234
227
|
"""
|
|
235
228
|
params = {
|
|
236
|
-
"
|
|
229
|
+
"@type": "mrtrix/dirstat",
|
|
237
230
|
"info": info,
|
|
238
231
|
"quiet": quiet,
|
|
239
232
|
"debug": debug,
|
|
@@ -272,43 +265,43 @@ def dirstat_cargs(
|
|
|
272
265
|
"""
|
|
273
266
|
cargs = []
|
|
274
267
|
cargs.append("dirstat")
|
|
275
|
-
if params.get("output") is not None:
|
|
268
|
+
if params.get("output", None) is not None:
|
|
276
269
|
cargs.extend([
|
|
277
270
|
"-output",
|
|
278
|
-
params.get("output")
|
|
271
|
+
params.get("output", None)
|
|
279
272
|
])
|
|
280
|
-
if params.get("shells") is not None:
|
|
273
|
+
if params.get("shells", None) is not None:
|
|
281
274
|
cargs.extend([
|
|
282
275
|
"-shells",
|
|
283
|
-
",".join(map(str, params.get("shells")))
|
|
276
|
+
",".join(map(str, params.get("shells", None)))
|
|
284
277
|
])
|
|
285
|
-
if params.get("grad") is not None:
|
|
278
|
+
if params.get("grad", None) is not None:
|
|
286
279
|
cargs.extend([
|
|
287
280
|
"-grad",
|
|
288
|
-
execution.input_file(params.get("grad"))
|
|
281
|
+
execution.input_file(params.get("grad", None))
|
|
289
282
|
])
|
|
290
|
-
if params.get("fslgrad") is not None:
|
|
291
|
-
cargs.extend(
|
|
292
|
-
if params.get("info"):
|
|
283
|
+
if params.get("fslgrad", None) is not None:
|
|
284
|
+
cargs.extend(dirstat_fslgrad_cargs(params.get("fslgrad", None), execution))
|
|
285
|
+
if params.get("info", False):
|
|
293
286
|
cargs.append("-info")
|
|
294
|
-
if params.get("quiet"):
|
|
287
|
+
if params.get("quiet", False):
|
|
295
288
|
cargs.append("-quiet")
|
|
296
|
-
if params.get("debug"):
|
|
289
|
+
if params.get("debug", False):
|
|
297
290
|
cargs.append("-debug")
|
|
298
|
-
if params.get("force"):
|
|
291
|
+
if params.get("force", False):
|
|
299
292
|
cargs.append("-force")
|
|
300
|
-
if params.get("nthreads") is not None:
|
|
293
|
+
if params.get("nthreads", None) is not None:
|
|
301
294
|
cargs.extend([
|
|
302
295
|
"-nthreads",
|
|
303
|
-
str(params.get("nthreads"))
|
|
296
|
+
str(params.get("nthreads", None))
|
|
304
297
|
])
|
|
305
|
-
if params.get("config") is not None:
|
|
306
|
-
cargs.extend([a for c in [
|
|
307
|
-
if params.get("help"):
|
|
298
|
+
if params.get("config", None) is not None:
|
|
299
|
+
cargs.extend([a for c in [dirstat_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
300
|
+
if params.get("help", False):
|
|
308
301
|
cargs.append("-help")
|
|
309
|
-
if params.get("version"):
|
|
302
|
+
if params.get("version", False):
|
|
310
303
|
cargs.append("-version")
|
|
311
|
-
cargs.append(execution.input_file(params.get("dirs")))
|
|
304
|
+
cargs.append(execution.input_file(params.get("dirs", None)))
|
|
312
305
|
return cargs
|
|
313
306
|
|
|
314
307
|
|
|
@@ -333,9 +326,11 @@ def dirstat_outputs(
|
|
|
333
326
|
|
|
334
327
|
def dirstat_execute(
|
|
335
328
|
params: DirstatParameters,
|
|
336
|
-
|
|
329
|
+
runner: Runner | None = None,
|
|
337
330
|
) -> DirstatOutputs:
|
|
338
331
|
"""
|
|
332
|
+
dirstat
|
|
333
|
+
|
|
339
334
|
Report statistics on a direction set.
|
|
340
335
|
|
|
341
336
|
This command will accept as inputs:
|
|
@@ -383,10 +378,12 @@ def dirstat_execute(
|
|
|
383
378
|
|
|
384
379
|
Args:
|
|
385
380
|
params: The parameters.
|
|
386
|
-
|
|
381
|
+
runner: Command runner.
|
|
387
382
|
Returns:
|
|
388
383
|
NamedTuple of outputs (described in `DirstatOutputs`).
|
|
389
384
|
"""
|
|
385
|
+
runner = runner or get_global_runner()
|
|
386
|
+
execution = runner.start_execution(DIRSTAT_METADATA)
|
|
390
387
|
params = execution.params(params)
|
|
391
388
|
cargs = dirstat_cargs(params, execution)
|
|
392
389
|
ret = dirstat_outputs(params, execution)
|
|
@@ -411,6 +408,8 @@ def dirstat(
|
|
|
411
408
|
runner: Runner | None = None,
|
|
412
409
|
) -> DirstatOutputs:
|
|
413
410
|
"""
|
|
411
|
+
dirstat
|
|
412
|
+
|
|
414
413
|
Report statistics on a direction set.
|
|
415
414
|
|
|
416
415
|
This command will accept as inputs:
|
|
@@ -497,8 +496,6 @@ def dirstat(
|
|
|
497
496
|
Returns:
|
|
498
497
|
NamedTuple of outputs (described in `DirstatOutputs`).
|
|
499
498
|
"""
|
|
500
|
-
runner = runner or get_global_runner()
|
|
501
|
-
execution = runner.start_execution(DIRSTAT_METADATA)
|
|
502
499
|
params = dirstat_params(
|
|
503
500
|
output=output,
|
|
504
501
|
shells=shells,
|
|
@@ -514,17 +511,15 @@ def dirstat(
|
|
|
514
511
|
version=version,
|
|
515
512
|
dirs=dirs,
|
|
516
513
|
)
|
|
517
|
-
return dirstat_execute(params,
|
|
514
|
+
return dirstat_execute(params, runner)
|
|
518
515
|
|
|
519
516
|
|
|
520
517
|
__all__ = [
|
|
521
518
|
"DIRSTAT_METADATA",
|
|
522
|
-
"DirstatConfigParameters",
|
|
523
|
-
"DirstatFslgradParameters",
|
|
524
519
|
"DirstatOutputs",
|
|
525
|
-
"DirstatParameters",
|
|
526
520
|
"dirstat",
|
|
527
521
|
"dirstat_config_params",
|
|
522
|
+
"dirstat_execute",
|
|
528
523
|
"dirstat_fslgrad_params",
|
|
529
524
|
"dirstat_params",
|
|
530
525
|
]
|