niwrap-mrtrix 0.6.2__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.2.dist-info/METADATA +0 -8
- niwrap_mrtrix-0.6.2.dist-info/RECORD +0 -119
- niwrap_mrtrix-0.6.2.dist-info/WHEEL +0 -4
niwrap_mrtrix/mrtrix/dirflip.py
CHANGED
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
DIRFLIP_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="d8812d8343a227a55e2791ff77c8b329d1aaf85d.boutiques",
|
|
10
10
|
name="dirflip",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,34 @@ DIRFLIP_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
DirflipConfigParameters = typing.TypedDict('DirflipConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
DirflipConfigParametersTagged = typing.TypedDict('DirflipConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
DirflipParameters = typing.TypedDict('DirflipParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/dirflip"]],
|
|
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[DirflipConfigParameters] | None],
|
|
38
|
+
"help": bool,
|
|
39
|
+
"version": bool,
|
|
40
|
+
"in": InputPathType,
|
|
41
|
+
"out": str,
|
|
42
|
+
})
|
|
43
|
+
DirflipParametersTagged = typing.TypedDict('DirflipParametersTagged', {
|
|
44
|
+
"@type": typing.Literal["mrtrix/dirflip"],
|
|
25
45
|
"permutations": typing.NotRequired[int | None],
|
|
26
46
|
"cartesian": bool,
|
|
27
47
|
"info": bool,
|
|
@@ -35,45 +55,12 @@ DirflipParameters = typing.TypedDict('DirflipParameters', {
|
|
|
35
55
|
"in": 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
|
-
"dirflip": dirflip_cargs,
|
|
53
|
-
"config": dirflip_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
|
-
"dirflip": dirflip_outputs,
|
|
70
|
-
}.get(t)
|
|
71
58
|
|
|
72
59
|
|
|
73
60
|
def dirflip_config_params(
|
|
74
61
|
key: str,
|
|
75
62
|
value: str,
|
|
76
|
-
) ->
|
|
63
|
+
) -> DirflipConfigParametersTagged:
|
|
77
64
|
"""
|
|
78
65
|
Build parameters.
|
|
79
66
|
|
|
@@ -84,7 +71,7 @@ def dirflip_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 dirflip_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 DirflipOutputs(typing.NamedTuple):
|
|
115
102
|
"""
|
|
116
|
-
Output object returned when calling `
|
|
103
|
+
Output object returned when calling `DirflipParameters(...)`.
|
|
117
104
|
"""
|
|
118
105
|
root: OutputPathType
|
|
119
106
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -134,7 +121,7 @@ def dirflip_params(
|
|
|
134
121
|
config: list[DirflipConfigParameters] | None = None,
|
|
135
122
|
help_: bool = False,
|
|
136
123
|
version: bool = False,
|
|
137
|
-
) ->
|
|
124
|
+
) -> DirflipParametersTagged:
|
|
138
125
|
"""
|
|
139
126
|
Build parameters.
|
|
140
127
|
|
|
@@ -160,7 +147,7 @@ def dirflip_params(
|
|
|
160
147
|
Parameter dictionary
|
|
161
148
|
"""
|
|
162
149
|
params = {
|
|
163
|
-
"
|
|
150
|
+
"@type": "mrtrix/dirflip",
|
|
164
151
|
"cartesian": cartesian,
|
|
165
152
|
"info": info,
|
|
166
153
|
"quiet": quiet,
|
|
@@ -195,34 +182,34 @@ def dirflip_cargs(
|
|
|
195
182
|
"""
|
|
196
183
|
cargs = []
|
|
197
184
|
cargs.append("dirflip")
|
|
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 [dirflip_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("in")))
|
|
225
|
-
cargs.append(params.get("out"))
|
|
211
|
+
cargs.append(execution.input_file(params.get("in", None)))
|
|
212
|
+
cargs.append(params.get("out", None))
|
|
226
213
|
return cargs
|
|
227
214
|
|
|
228
215
|
|
|
@@ -241,16 +228,18 @@ def dirflip_outputs(
|
|
|
241
228
|
"""
|
|
242
229
|
ret = DirflipOutputs(
|
|
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 dirflip_execute(
|
|
250
237
|
params: DirflipParameters,
|
|
251
|
-
|
|
238
|
+
runner: Runner | None = None,
|
|
252
239
|
) -> DirflipOutputs:
|
|
253
240
|
"""
|
|
241
|
+
dirflip
|
|
242
|
+
|
|
254
243
|
Invert the polarity of individual directions so as to optimise a unipolar
|
|
255
244
|
electrostatic repulsion model.
|
|
256
245
|
|
|
@@ -268,10 +257,12 @@ def dirflip_execute(
|
|
|
268
257
|
|
|
269
258
|
Args:
|
|
270
259
|
params: The parameters.
|
|
271
|
-
|
|
260
|
+
runner: Command runner.
|
|
272
261
|
Returns:
|
|
273
262
|
NamedTuple of outputs (described in `DirflipOutputs`).
|
|
274
263
|
"""
|
|
264
|
+
runner = runner or get_global_runner()
|
|
265
|
+
execution = runner.start_execution(DIRFLIP_METADATA)
|
|
275
266
|
params = execution.params(params)
|
|
276
267
|
cargs = dirflip_cargs(params, execution)
|
|
277
268
|
ret = dirflip_outputs(params, execution)
|
|
@@ -295,6 +286,8 @@ def dirflip(
|
|
|
295
286
|
runner: Runner | None = None,
|
|
296
287
|
) -> DirflipOutputs:
|
|
297
288
|
"""
|
|
289
|
+
dirflip
|
|
290
|
+
|
|
298
291
|
Invert the polarity of individual directions so as to optimise a unipolar
|
|
299
292
|
electrostatic repulsion model.
|
|
300
293
|
|
|
@@ -332,8 +325,6 @@ def dirflip(
|
|
|
332
325
|
Returns:
|
|
333
326
|
NamedTuple of outputs (described in `DirflipOutputs`).
|
|
334
327
|
"""
|
|
335
|
-
runner = runner or get_global_runner()
|
|
336
|
-
execution = runner.start_execution(DIRFLIP_METADATA)
|
|
337
328
|
params = dirflip_params(
|
|
338
329
|
permutations=permutations,
|
|
339
330
|
cartesian=cartesian,
|
|
@@ -348,15 +339,14 @@ def dirflip(
|
|
|
348
339
|
in_=in_,
|
|
349
340
|
out=out,
|
|
350
341
|
)
|
|
351
|
-
return dirflip_execute(params,
|
|
342
|
+
return dirflip_execute(params, runner)
|
|
352
343
|
|
|
353
344
|
|
|
354
345
|
__all__ = [
|
|
355
346
|
"DIRFLIP_METADATA",
|
|
356
|
-
"DirflipConfigParameters",
|
|
357
347
|
"DirflipOutputs",
|
|
358
|
-
"DirflipParameters",
|
|
359
348
|
"dirflip",
|
|
360
349
|
"dirflip_config_params",
|
|
350
|
+
"dirflip_execute",
|
|
361
351
|
"dirflip_params",
|
|
362
352
|
]
|
niwrap_mrtrix/mrtrix/dirgen.py
CHANGED
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
DIRGEN_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="cda69ea8a57022773ddb6022ca8ca9caa5cc0e2b.boutiques",
|
|
10
10
|
name="dirgen",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,37 @@ DIRGEN_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
DirgenConfigParameters = typing.TypedDict('DirgenConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
DirgenConfigParametersTagged = typing.TypedDict('DirgenConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
DirgenParameters = typing.TypedDict('DirgenParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/dirgen"]],
|
|
30
|
+
"power": typing.NotRequired[int | None],
|
|
31
|
+
"niter": typing.NotRequired[int | None],
|
|
32
|
+
"restarts": typing.NotRequired[int | None],
|
|
33
|
+
"unipolar": bool,
|
|
34
|
+
"cartesian": bool,
|
|
35
|
+
"info": bool,
|
|
36
|
+
"quiet": bool,
|
|
37
|
+
"debug": bool,
|
|
38
|
+
"force": bool,
|
|
39
|
+
"nthreads": typing.NotRequired[int | None],
|
|
40
|
+
"config": typing.NotRequired[list[DirgenConfigParameters] | None],
|
|
41
|
+
"help": bool,
|
|
42
|
+
"version": bool,
|
|
43
|
+
"ndir": int,
|
|
44
|
+
"dirs": str,
|
|
45
|
+
})
|
|
46
|
+
DirgenParametersTagged = typing.TypedDict('DirgenParametersTagged', {
|
|
47
|
+
"@type": typing.Literal["mrtrix/dirgen"],
|
|
25
48
|
"power": typing.NotRequired[int | None],
|
|
26
49
|
"niter": typing.NotRequired[int | None],
|
|
27
50
|
"restarts": typing.NotRequired[int | None],
|
|
@@ -38,45 +61,12 @@ DirgenParameters = typing.TypedDict('DirgenParameters', {
|
|
|
38
61
|
"ndir": int,
|
|
39
62
|
"dirs": str,
|
|
40
63
|
})
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
def dyn_cargs(
|
|
44
|
-
t: str,
|
|
45
|
-
) -> typing.Any:
|
|
46
|
-
"""
|
|
47
|
-
Get build cargs function by command type.
|
|
48
|
-
|
|
49
|
-
Args:
|
|
50
|
-
t: Command type.
|
|
51
|
-
Returns:
|
|
52
|
-
Build cargs function.
|
|
53
|
-
"""
|
|
54
|
-
return {
|
|
55
|
-
"dirgen": dirgen_cargs,
|
|
56
|
-
"config": dirgen_config_cargs,
|
|
57
|
-
}.get(t)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def dyn_outputs(
|
|
61
|
-
t: str,
|
|
62
|
-
) -> typing.Any:
|
|
63
|
-
"""
|
|
64
|
-
Get build outputs function by command type.
|
|
65
|
-
|
|
66
|
-
Args:
|
|
67
|
-
t: Command type.
|
|
68
|
-
Returns:
|
|
69
|
-
Build outputs function.
|
|
70
|
-
"""
|
|
71
|
-
return {
|
|
72
|
-
"dirgen": dirgen_outputs,
|
|
73
|
-
}.get(t)
|
|
74
64
|
|
|
75
65
|
|
|
76
66
|
def dirgen_config_params(
|
|
77
67
|
key: str,
|
|
78
68
|
value: str,
|
|
79
|
-
) ->
|
|
69
|
+
) -> DirgenConfigParametersTagged:
|
|
80
70
|
"""
|
|
81
71
|
Build parameters.
|
|
82
72
|
|
|
@@ -87,7 +77,7 @@ def dirgen_config_params(
|
|
|
87
77
|
Parameter dictionary
|
|
88
78
|
"""
|
|
89
79
|
params = {
|
|
90
|
-
"
|
|
80
|
+
"@type": "config",
|
|
91
81
|
"key": key,
|
|
92
82
|
"value": value,
|
|
93
83
|
}
|
|
@@ -109,14 +99,14 @@ def dirgen_config_cargs(
|
|
|
109
99
|
"""
|
|
110
100
|
cargs = []
|
|
111
101
|
cargs.append("-config")
|
|
112
|
-
cargs.append(params.get("key"))
|
|
113
|
-
cargs.append(params.get("value"))
|
|
102
|
+
cargs.append(params.get("key", None))
|
|
103
|
+
cargs.append(params.get("value", None))
|
|
114
104
|
return cargs
|
|
115
105
|
|
|
116
106
|
|
|
117
107
|
class DirgenOutputs(typing.NamedTuple):
|
|
118
108
|
"""
|
|
119
|
-
Output object returned when calling `
|
|
109
|
+
Output object returned when calling `DirgenParameters(...)`.
|
|
120
110
|
"""
|
|
121
111
|
root: OutputPathType
|
|
122
112
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -140,7 +130,7 @@ def dirgen_params(
|
|
|
140
130
|
config: list[DirgenConfigParameters] | None = None,
|
|
141
131
|
help_: bool = False,
|
|
142
132
|
version: bool = False,
|
|
143
|
-
) ->
|
|
133
|
+
) -> DirgenParametersTagged:
|
|
144
134
|
"""
|
|
145
135
|
Build parameters.
|
|
146
136
|
|
|
@@ -172,7 +162,7 @@ def dirgen_params(
|
|
|
172
162
|
Parameter dictionary
|
|
173
163
|
"""
|
|
174
164
|
params = {
|
|
175
|
-
"
|
|
165
|
+
"@type": "mrtrix/dirgen",
|
|
176
166
|
"unipolar": unipolar,
|
|
177
167
|
"cartesian": cartesian,
|
|
178
168
|
"info": info,
|
|
@@ -212,46 +202,46 @@ def dirgen_cargs(
|
|
|
212
202
|
"""
|
|
213
203
|
cargs = []
|
|
214
204
|
cargs.append("dirgen")
|
|
215
|
-
if params.get("power") is not None:
|
|
205
|
+
if params.get("power", None) is not None:
|
|
216
206
|
cargs.extend([
|
|
217
207
|
"-power",
|
|
218
|
-
str(params.get("power"))
|
|
208
|
+
str(params.get("power", None))
|
|
219
209
|
])
|
|
220
|
-
if params.get("niter") is not None:
|
|
210
|
+
if params.get("niter", None) is not None:
|
|
221
211
|
cargs.extend([
|
|
222
212
|
"-niter",
|
|
223
|
-
str(params.get("niter"))
|
|
213
|
+
str(params.get("niter", None))
|
|
224
214
|
])
|
|
225
|
-
if params.get("restarts") is not None:
|
|
215
|
+
if params.get("restarts", None) is not None:
|
|
226
216
|
cargs.extend([
|
|
227
217
|
"-restarts",
|
|
228
|
-
str(params.get("restarts"))
|
|
218
|
+
str(params.get("restarts", None))
|
|
229
219
|
])
|
|
230
|
-
if params.get("unipolar"):
|
|
220
|
+
if params.get("unipolar", False):
|
|
231
221
|
cargs.append("-unipolar")
|
|
232
|
-
if params.get("cartesian"):
|
|
222
|
+
if params.get("cartesian", False):
|
|
233
223
|
cargs.append("-cartesian")
|
|
234
|
-
if params.get("info"):
|
|
224
|
+
if params.get("info", False):
|
|
235
225
|
cargs.append("-info")
|
|
236
|
-
if params.get("quiet"):
|
|
226
|
+
if params.get("quiet", False):
|
|
237
227
|
cargs.append("-quiet")
|
|
238
|
-
if params.get("debug"):
|
|
228
|
+
if params.get("debug", False):
|
|
239
229
|
cargs.append("-debug")
|
|
240
|
-
if params.get("force"):
|
|
230
|
+
if params.get("force", False):
|
|
241
231
|
cargs.append("-force")
|
|
242
|
-
if params.get("nthreads") is not None:
|
|
232
|
+
if params.get("nthreads", None) is not None:
|
|
243
233
|
cargs.extend([
|
|
244
234
|
"-nthreads",
|
|
245
|
-
str(params.get("nthreads"))
|
|
235
|
+
str(params.get("nthreads", None))
|
|
246
236
|
])
|
|
247
|
-
if params.get("config") is not None:
|
|
248
|
-
cargs.extend([a for c in [
|
|
249
|
-
if params.get("help"):
|
|
237
|
+
if params.get("config", None) is not None:
|
|
238
|
+
cargs.extend([a for c in [dirgen_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
239
|
+
if params.get("help", False):
|
|
250
240
|
cargs.append("-help")
|
|
251
|
-
if params.get("version"):
|
|
241
|
+
if params.get("version", False):
|
|
252
242
|
cargs.append("-version")
|
|
253
|
-
cargs.append(str(params.get("ndir")))
|
|
254
|
-
cargs.append(params.get("dirs"))
|
|
243
|
+
cargs.append(str(params.get("ndir", None)))
|
|
244
|
+
cargs.append(params.get("dirs", None))
|
|
255
245
|
return cargs
|
|
256
246
|
|
|
257
247
|
|
|
@@ -270,18 +260,20 @@ def dirgen_outputs(
|
|
|
270
260
|
"""
|
|
271
261
|
ret = DirgenOutputs(
|
|
272
262
|
root=execution.output_file("."),
|
|
273
|
-
dirs=execution.output_file(params.get("dirs")),
|
|
263
|
+
dirs=execution.output_file(params.get("dirs", None)),
|
|
274
264
|
)
|
|
275
265
|
return ret
|
|
276
266
|
|
|
277
267
|
|
|
278
268
|
def dirgen_execute(
|
|
279
269
|
params: DirgenParameters,
|
|
280
|
-
|
|
270
|
+
runner: Runner | None = None,
|
|
281
271
|
) -> DirgenOutputs:
|
|
282
272
|
"""
|
|
283
|
-
|
|
284
|
-
|
|
273
|
+
dirgen
|
|
274
|
+
|
|
275
|
+
Generate a set of uniformly distributed directions using a bipolar
|
|
276
|
+
electrostatic repulsion model.
|
|
285
277
|
|
|
286
278
|
Directions are distributed by analogy to an electrostatic repulsion system,
|
|
287
279
|
with each direction corresponding to a single electrostatic charge (for
|
|
@@ -307,10 +299,12 @@ def dirgen_execute(
|
|
|
307
299
|
|
|
308
300
|
Args:
|
|
309
301
|
params: The parameters.
|
|
310
|
-
|
|
302
|
+
runner: Command runner.
|
|
311
303
|
Returns:
|
|
312
304
|
NamedTuple of outputs (described in `DirgenOutputs`).
|
|
313
305
|
"""
|
|
306
|
+
runner = runner or get_global_runner()
|
|
307
|
+
execution = runner.start_execution(DIRGEN_METADATA)
|
|
314
308
|
params = execution.params(params)
|
|
315
309
|
cargs = dirgen_cargs(params, execution)
|
|
316
310
|
ret = dirgen_outputs(params, execution)
|
|
@@ -337,8 +331,10 @@ def dirgen(
|
|
|
337
331
|
runner: Runner | None = None,
|
|
338
332
|
) -> DirgenOutputs:
|
|
339
333
|
"""
|
|
340
|
-
|
|
341
|
-
|
|
334
|
+
dirgen
|
|
335
|
+
|
|
336
|
+
Generate a set of uniformly distributed directions using a bipolar
|
|
337
|
+
electrostatic repulsion model.
|
|
342
338
|
|
|
343
339
|
Directions are distributed by analogy to an electrostatic repulsion system,
|
|
344
340
|
with each direction corresponding to a single electrostatic charge (for
|
|
@@ -390,8 +386,6 @@ def dirgen(
|
|
|
390
386
|
Returns:
|
|
391
387
|
NamedTuple of outputs (described in `DirgenOutputs`).
|
|
392
388
|
"""
|
|
393
|
-
runner = runner or get_global_runner()
|
|
394
|
-
execution = runner.start_execution(DIRGEN_METADATA)
|
|
395
389
|
params = dirgen_params(
|
|
396
390
|
power=power,
|
|
397
391
|
niter=niter,
|
|
@@ -409,15 +403,14 @@ def dirgen(
|
|
|
409
403
|
ndir=ndir,
|
|
410
404
|
dirs=dirs,
|
|
411
405
|
)
|
|
412
|
-
return dirgen_execute(params,
|
|
406
|
+
return dirgen_execute(params, runner)
|
|
413
407
|
|
|
414
408
|
|
|
415
409
|
__all__ = [
|
|
416
410
|
"DIRGEN_METADATA",
|
|
417
|
-
"DirgenConfigParameters",
|
|
418
411
|
"DirgenOutputs",
|
|
419
|
-
"DirgenParameters",
|
|
420
412
|
"dirgen",
|
|
421
413
|
"dirgen_config_params",
|
|
414
|
+
"dirgen_execute",
|
|
422
415
|
"dirgen_params",
|
|
423
416
|
]
|