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
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
LABELSTATS_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="df8064dca9e1446035277a06d1872158b80f29f1.boutiques",
|
|
10
10
|
name="labelstats",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,33 @@ LABELSTATS_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
LabelstatsConfigParameters = typing.TypedDict('LabelstatsConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
LabelstatsConfigParametersTagged = typing.TypedDict('LabelstatsConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
LabelstatsParameters = typing.TypedDict('LabelstatsParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/labelstats"]],
|
|
30
|
+
"output": typing.NotRequired[str | None],
|
|
31
|
+
"voxelspace": bool,
|
|
32
|
+
"info": bool,
|
|
33
|
+
"quiet": bool,
|
|
34
|
+
"debug": bool,
|
|
35
|
+
"force": bool,
|
|
36
|
+
"nthreads": typing.NotRequired[int | None],
|
|
37
|
+
"config": typing.NotRequired[list[LabelstatsConfigParameters] | None],
|
|
38
|
+
"help": bool,
|
|
39
|
+
"version": bool,
|
|
40
|
+
"input": InputPathType,
|
|
41
|
+
})
|
|
42
|
+
LabelstatsParametersTagged = typing.TypedDict('LabelstatsParametersTagged', {
|
|
43
|
+
"@type": typing.Literal["mrtrix/labelstats"],
|
|
25
44
|
"output": typing.NotRequired[str | None],
|
|
26
45
|
"voxelspace": bool,
|
|
27
46
|
"info": bool,
|
|
@@ -34,44 +53,12 @@ LabelstatsParameters = typing.TypedDict('LabelstatsParameters', {
|
|
|
34
53
|
"version": bool,
|
|
35
54
|
"input": InputPathType,
|
|
36
55
|
})
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def dyn_cargs(
|
|
40
|
-
t: str,
|
|
41
|
-
) -> typing.Any:
|
|
42
|
-
"""
|
|
43
|
-
Get build cargs function by command type.
|
|
44
|
-
|
|
45
|
-
Args:
|
|
46
|
-
t: Command type.
|
|
47
|
-
Returns:
|
|
48
|
-
Build cargs function.
|
|
49
|
-
"""
|
|
50
|
-
return {
|
|
51
|
-
"labelstats": labelstats_cargs,
|
|
52
|
-
"config": labelstats_config_cargs,
|
|
53
|
-
}.get(t)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def dyn_outputs(
|
|
57
|
-
t: str,
|
|
58
|
-
) -> typing.Any:
|
|
59
|
-
"""
|
|
60
|
-
Get build outputs function by command type.
|
|
61
|
-
|
|
62
|
-
Args:
|
|
63
|
-
t: Command type.
|
|
64
|
-
Returns:
|
|
65
|
-
Build outputs function.
|
|
66
|
-
"""
|
|
67
|
-
return {
|
|
68
|
-
}.get(t)
|
|
69
56
|
|
|
70
57
|
|
|
71
58
|
def labelstats_config_params(
|
|
72
59
|
key: str,
|
|
73
60
|
value: str,
|
|
74
|
-
) ->
|
|
61
|
+
) -> LabelstatsConfigParametersTagged:
|
|
75
62
|
"""
|
|
76
63
|
Build parameters.
|
|
77
64
|
|
|
@@ -82,7 +69,7 @@ def labelstats_config_params(
|
|
|
82
69
|
Parameter dictionary
|
|
83
70
|
"""
|
|
84
71
|
params = {
|
|
85
|
-
"
|
|
72
|
+
"@type": "config",
|
|
86
73
|
"key": key,
|
|
87
74
|
"value": value,
|
|
88
75
|
}
|
|
@@ -104,14 +91,14 @@ def labelstats_config_cargs(
|
|
|
104
91
|
"""
|
|
105
92
|
cargs = []
|
|
106
93
|
cargs.append("-config")
|
|
107
|
-
cargs.append(params.get("key"))
|
|
108
|
-
cargs.append(params.get("value"))
|
|
94
|
+
cargs.append(params.get("key", None))
|
|
95
|
+
cargs.append(params.get("value", None))
|
|
109
96
|
return cargs
|
|
110
97
|
|
|
111
98
|
|
|
112
99
|
class LabelstatsOutputs(typing.NamedTuple):
|
|
113
100
|
"""
|
|
114
|
-
Output object returned when calling `
|
|
101
|
+
Output object returned when calling `LabelstatsParameters(...)`.
|
|
115
102
|
"""
|
|
116
103
|
root: OutputPathType
|
|
117
104
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -129,7 +116,7 @@ def labelstats_params(
|
|
|
129
116
|
config: list[LabelstatsConfigParameters] | None = None,
|
|
130
117
|
help_: bool = False,
|
|
131
118
|
version: bool = False,
|
|
132
|
-
) ->
|
|
119
|
+
) -> LabelstatsParametersTagged:
|
|
133
120
|
"""
|
|
134
121
|
Build parameters.
|
|
135
122
|
|
|
@@ -154,7 +141,7 @@ def labelstats_params(
|
|
|
154
141
|
Parameter dictionary
|
|
155
142
|
"""
|
|
156
143
|
params = {
|
|
157
|
-
"
|
|
144
|
+
"@type": "mrtrix/labelstats",
|
|
158
145
|
"voxelspace": voxelspace,
|
|
159
146
|
"info": info,
|
|
160
147
|
"quiet": quiet,
|
|
@@ -188,33 +175,33 @@ def labelstats_cargs(
|
|
|
188
175
|
"""
|
|
189
176
|
cargs = []
|
|
190
177
|
cargs.append("labelstats")
|
|
191
|
-
if params.get("output") is not None:
|
|
178
|
+
if params.get("output", None) is not None:
|
|
192
179
|
cargs.extend([
|
|
193
180
|
"-output",
|
|
194
|
-
params.get("output")
|
|
181
|
+
params.get("output", None)
|
|
195
182
|
])
|
|
196
|
-
if params.get("voxelspace"):
|
|
183
|
+
if params.get("voxelspace", False):
|
|
197
184
|
cargs.append("-voxelspace")
|
|
198
|
-
if params.get("info"):
|
|
185
|
+
if params.get("info", False):
|
|
199
186
|
cargs.append("-info")
|
|
200
|
-
if params.get("quiet"):
|
|
187
|
+
if params.get("quiet", False):
|
|
201
188
|
cargs.append("-quiet")
|
|
202
|
-
if params.get("debug"):
|
|
189
|
+
if params.get("debug", False):
|
|
203
190
|
cargs.append("-debug")
|
|
204
|
-
if params.get("force"):
|
|
191
|
+
if params.get("force", False):
|
|
205
192
|
cargs.append("-force")
|
|
206
|
-
if params.get("nthreads") is not None:
|
|
193
|
+
if params.get("nthreads", None) is not None:
|
|
207
194
|
cargs.extend([
|
|
208
195
|
"-nthreads",
|
|
209
|
-
str(params.get("nthreads"))
|
|
196
|
+
str(params.get("nthreads", None))
|
|
210
197
|
])
|
|
211
|
-
if params.get("config") is not None:
|
|
212
|
-
cargs.extend([a for c in [
|
|
213
|
-
if params.get("help"):
|
|
198
|
+
if params.get("config", None) is not None:
|
|
199
|
+
cargs.extend([a for c in [labelstats_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
200
|
+
if params.get("help", False):
|
|
214
201
|
cargs.append("-help")
|
|
215
|
-
if params.get("version"):
|
|
202
|
+
if params.get("version", False):
|
|
216
203
|
cargs.append("-version")
|
|
217
|
-
cargs.append(execution.input_file(params.get("input")))
|
|
204
|
+
cargs.append(execution.input_file(params.get("input", None)))
|
|
218
205
|
return cargs
|
|
219
206
|
|
|
220
207
|
|
|
@@ -239,9 +226,11 @@ def labelstats_outputs(
|
|
|
239
226
|
|
|
240
227
|
def labelstats_execute(
|
|
241
228
|
params: LabelstatsParameters,
|
|
242
|
-
|
|
229
|
+
runner: Runner | None = None,
|
|
243
230
|
) -> LabelstatsOutputs:
|
|
244
231
|
"""
|
|
232
|
+
labelstats
|
|
233
|
+
|
|
245
234
|
Compute statistics of parcels within a label image.
|
|
246
235
|
|
|
247
236
|
|
|
@@ -256,10 +245,12 @@ def labelstats_execute(
|
|
|
256
245
|
|
|
257
246
|
Args:
|
|
258
247
|
params: The parameters.
|
|
259
|
-
|
|
248
|
+
runner: Command runner.
|
|
260
249
|
Returns:
|
|
261
250
|
NamedTuple of outputs (described in `LabelstatsOutputs`).
|
|
262
251
|
"""
|
|
252
|
+
runner = runner or get_global_runner()
|
|
253
|
+
execution = runner.start_execution(LABELSTATS_METADATA)
|
|
263
254
|
params = execution.params(params)
|
|
264
255
|
cargs = labelstats_cargs(params, execution)
|
|
265
256
|
ret = labelstats_outputs(params, execution)
|
|
@@ -282,6 +273,8 @@ def labelstats(
|
|
|
282
273
|
runner: Runner | None = None,
|
|
283
274
|
) -> LabelstatsOutputs:
|
|
284
275
|
"""
|
|
276
|
+
labelstats
|
|
277
|
+
|
|
285
278
|
Compute statistics of parcels within a label image.
|
|
286
279
|
|
|
287
280
|
|
|
@@ -315,8 +308,6 @@ def labelstats(
|
|
|
315
308
|
Returns:
|
|
316
309
|
NamedTuple of outputs (described in `LabelstatsOutputs`).
|
|
317
310
|
"""
|
|
318
|
-
runner = runner or get_global_runner()
|
|
319
|
-
execution = runner.start_execution(LABELSTATS_METADATA)
|
|
320
311
|
params = labelstats_params(
|
|
321
312
|
output=output,
|
|
322
313
|
voxelspace=voxelspace,
|
|
@@ -330,15 +321,14 @@ def labelstats(
|
|
|
330
321
|
version=version,
|
|
331
322
|
input_=input_,
|
|
332
323
|
)
|
|
333
|
-
return labelstats_execute(params,
|
|
324
|
+
return labelstats_execute(params, runner)
|
|
334
325
|
|
|
335
326
|
|
|
336
327
|
__all__ = [
|
|
337
328
|
"LABELSTATS_METADATA",
|
|
338
|
-
"LabelstatsConfigParameters",
|
|
339
329
|
"LabelstatsOutputs",
|
|
340
|
-
"LabelstatsParameters",
|
|
341
330
|
"labelstats",
|
|
342
331
|
"labelstats_config_params",
|
|
332
|
+
"labelstats_execute",
|
|
343
333
|
"labelstats_params",
|
|
344
334
|
]
|
niwrap_mrtrix/mrtrix/maskdump.py
CHANGED
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
MASKDUMP_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="2eb2e4e159fba58b9701608239b0227569dc91cd.boutiques",
|
|
10
10
|
name="maskdump",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,32 @@ MASKDUMP_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
MaskdumpConfigParameters = typing.TypedDict('MaskdumpConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
MaskdumpConfigParametersTagged = typing.TypedDict('MaskdumpConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
MaskdumpParameters = typing.TypedDict('MaskdumpParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/maskdump"]],
|
|
30
|
+
"info": bool,
|
|
31
|
+
"quiet": bool,
|
|
32
|
+
"debug": bool,
|
|
33
|
+
"force": bool,
|
|
34
|
+
"nthreads": typing.NotRequired[int | None],
|
|
35
|
+
"config": typing.NotRequired[list[MaskdumpConfigParameters] | None],
|
|
36
|
+
"help": bool,
|
|
37
|
+
"version": bool,
|
|
38
|
+
"input": InputPathType,
|
|
39
|
+
"output": typing.NotRequired[str | None],
|
|
40
|
+
})
|
|
41
|
+
MaskdumpParametersTagged = typing.TypedDict('MaskdumpParametersTagged', {
|
|
42
|
+
"@type": typing.Literal["mrtrix/maskdump"],
|
|
25
43
|
"info": bool,
|
|
26
44
|
"quiet": bool,
|
|
27
45
|
"debug": bool,
|
|
@@ -33,45 +51,12 @@ MaskdumpParameters = typing.TypedDict('MaskdumpParameters', {
|
|
|
33
51
|
"input": InputPathType,
|
|
34
52
|
"output": typing.NotRequired[str | None],
|
|
35
53
|
})
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def dyn_cargs(
|
|
39
|
-
t: str,
|
|
40
|
-
) -> typing.Any:
|
|
41
|
-
"""
|
|
42
|
-
Get build cargs function by command type.
|
|
43
|
-
|
|
44
|
-
Args:
|
|
45
|
-
t: Command type.
|
|
46
|
-
Returns:
|
|
47
|
-
Build cargs function.
|
|
48
|
-
"""
|
|
49
|
-
return {
|
|
50
|
-
"maskdump": maskdump_cargs,
|
|
51
|
-
"config": maskdump_config_cargs,
|
|
52
|
-
}.get(t)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def dyn_outputs(
|
|
56
|
-
t: str,
|
|
57
|
-
) -> typing.Any:
|
|
58
|
-
"""
|
|
59
|
-
Get build outputs function by command type.
|
|
60
|
-
|
|
61
|
-
Args:
|
|
62
|
-
t: Command type.
|
|
63
|
-
Returns:
|
|
64
|
-
Build outputs function.
|
|
65
|
-
"""
|
|
66
|
-
return {
|
|
67
|
-
"maskdump": maskdump_outputs,
|
|
68
|
-
}.get(t)
|
|
69
54
|
|
|
70
55
|
|
|
71
56
|
def maskdump_config_params(
|
|
72
57
|
key: str,
|
|
73
58
|
value: str,
|
|
74
|
-
) ->
|
|
59
|
+
) -> MaskdumpConfigParametersTagged:
|
|
75
60
|
"""
|
|
76
61
|
Build parameters.
|
|
77
62
|
|
|
@@ -82,7 +67,7 @@ def maskdump_config_params(
|
|
|
82
67
|
Parameter dictionary
|
|
83
68
|
"""
|
|
84
69
|
params = {
|
|
85
|
-
"
|
|
70
|
+
"@type": "config",
|
|
86
71
|
"key": key,
|
|
87
72
|
"value": value,
|
|
88
73
|
}
|
|
@@ -104,14 +89,14 @@ def maskdump_config_cargs(
|
|
|
104
89
|
"""
|
|
105
90
|
cargs = []
|
|
106
91
|
cargs.append("-config")
|
|
107
|
-
cargs.append(params.get("key"))
|
|
108
|
-
cargs.append(params.get("value"))
|
|
92
|
+
cargs.append(params.get("key", None))
|
|
93
|
+
cargs.append(params.get("value", None))
|
|
109
94
|
return cargs
|
|
110
95
|
|
|
111
96
|
|
|
112
97
|
class MaskdumpOutputs(typing.NamedTuple):
|
|
113
98
|
"""
|
|
114
|
-
Output object returned when calling `
|
|
99
|
+
Output object returned when calling `MaskdumpParameters(...)`.
|
|
115
100
|
"""
|
|
116
101
|
root: OutputPathType
|
|
117
102
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -130,7 +115,7 @@ def maskdump_params(
|
|
|
130
115
|
help_: bool = False,
|
|
131
116
|
version: bool = False,
|
|
132
117
|
output: str | None = None,
|
|
133
|
-
) ->
|
|
118
|
+
) -> MaskdumpParametersTagged:
|
|
134
119
|
"""
|
|
135
120
|
Build parameters.
|
|
136
121
|
|
|
@@ -153,7 +138,7 @@ def maskdump_params(
|
|
|
153
138
|
Parameter dictionary
|
|
154
139
|
"""
|
|
155
140
|
params = {
|
|
156
|
-
"
|
|
141
|
+
"@type": "mrtrix/maskdump",
|
|
157
142
|
"info": info,
|
|
158
143
|
"quiet": quiet,
|
|
159
144
|
"debug": debug,
|
|
@@ -186,28 +171,28 @@ def maskdump_cargs(
|
|
|
186
171
|
"""
|
|
187
172
|
cargs = []
|
|
188
173
|
cargs.append("maskdump")
|
|
189
|
-
if params.get("info"):
|
|
174
|
+
if params.get("info", False):
|
|
190
175
|
cargs.append("-info")
|
|
191
|
-
if params.get("quiet"):
|
|
176
|
+
if params.get("quiet", False):
|
|
192
177
|
cargs.append("-quiet")
|
|
193
|
-
if params.get("debug"):
|
|
178
|
+
if params.get("debug", False):
|
|
194
179
|
cargs.append("-debug")
|
|
195
|
-
if params.get("force"):
|
|
180
|
+
if params.get("force", False):
|
|
196
181
|
cargs.append("-force")
|
|
197
|
-
if params.get("nthreads") is not None:
|
|
182
|
+
if params.get("nthreads", None) is not None:
|
|
198
183
|
cargs.extend([
|
|
199
184
|
"-nthreads",
|
|
200
|
-
str(params.get("nthreads"))
|
|
185
|
+
str(params.get("nthreads", None))
|
|
201
186
|
])
|
|
202
|
-
if params.get("config") is not None:
|
|
203
|
-
cargs.extend([a for c in [
|
|
204
|
-
if params.get("help"):
|
|
187
|
+
if params.get("config", None) is not None:
|
|
188
|
+
cargs.extend([a for c in [maskdump_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
189
|
+
if params.get("help", False):
|
|
205
190
|
cargs.append("-help")
|
|
206
|
-
if params.get("version"):
|
|
191
|
+
if params.get("version", False):
|
|
207
192
|
cargs.append("-version")
|
|
208
|
-
cargs.append(execution.input_file(params.get("input")))
|
|
209
|
-
if params.get("output") is not None:
|
|
210
|
-
cargs.append(params.get("output"))
|
|
193
|
+
cargs.append(execution.input_file(params.get("input", None)))
|
|
194
|
+
if params.get("output", None) is not None:
|
|
195
|
+
cargs.append(params.get("output", None))
|
|
211
196
|
return cargs
|
|
212
197
|
|
|
213
198
|
|
|
@@ -226,16 +211,18 @@ def maskdump_outputs(
|
|
|
226
211
|
"""
|
|
227
212
|
ret = MaskdumpOutputs(
|
|
228
213
|
root=execution.output_file("."),
|
|
229
|
-
output=execution.output_file(params.get("output")) if (params.get("output") is not None) else None,
|
|
214
|
+
output=execution.output_file(params.get("output", None)) if (params.get("output") is not None) else None,
|
|
230
215
|
)
|
|
231
216
|
return ret
|
|
232
217
|
|
|
233
218
|
|
|
234
219
|
def maskdump_execute(
|
|
235
220
|
params: MaskdumpParameters,
|
|
236
|
-
|
|
221
|
+
runner: Runner | None = None,
|
|
237
222
|
) -> MaskdumpOutputs:
|
|
238
223
|
"""
|
|
224
|
+
maskdump
|
|
225
|
+
|
|
239
226
|
Print out the locations of all non-zero voxels in a mask image.
|
|
240
227
|
|
|
241
228
|
If no destination file is specified, the voxel locations will be printed to
|
|
@@ -251,10 +238,12 @@ def maskdump_execute(
|
|
|
251
238
|
|
|
252
239
|
Args:
|
|
253
240
|
params: The parameters.
|
|
254
|
-
|
|
241
|
+
runner: Command runner.
|
|
255
242
|
Returns:
|
|
256
243
|
NamedTuple of outputs (described in `MaskdumpOutputs`).
|
|
257
244
|
"""
|
|
245
|
+
runner = runner or get_global_runner()
|
|
246
|
+
execution = runner.start_execution(MASKDUMP_METADATA)
|
|
258
247
|
params = execution.params(params)
|
|
259
248
|
cargs = maskdump_cargs(params, execution)
|
|
260
249
|
ret = maskdump_outputs(params, execution)
|
|
@@ -276,6 +265,8 @@ def maskdump(
|
|
|
276
265
|
runner: Runner | None = None,
|
|
277
266
|
) -> MaskdumpOutputs:
|
|
278
267
|
"""
|
|
268
|
+
maskdump
|
|
269
|
+
|
|
279
270
|
Print out the locations of all non-zero voxels in a mask image.
|
|
280
271
|
|
|
281
272
|
If no destination file is specified, the voxel locations will be printed to
|
|
@@ -308,8 +299,6 @@ def maskdump(
|
|
|
308
299
|
Returns:
|
|
309
300
|
NamedTuple of outputs (described in `MaskdumpOutputs`).
|
|
310
301
|
"""
|
|
311
|
-
runner = runner or get_global_runner()
|
|
312
|
-
execution = runner.start_execution(MASKDUMP_METADATA)
|
|
313
302
|
params = maskdump_params(
|
|
314
303
|
info=info,
|
|
315
304
|
quiet=quiet,
|
|
@@ -322,15 +311,14 @@ def maskdump(
|
|
|
322
311
|
input_=input_,
|
|
323
312
|
output=output,
|
|
324
313
|
)
|
|
325
|
-
return maskdump_execute(params,
|
|
314
|
+
return maskdump_execute(params, runner)
|
|
326
315
|
|
|
327
316
|
|
|
328
317
|
__all__ = [
|
|
329
318
|
"MASKDUMP_METADATA",
|
|
330
|
-
"MaskdumpConfigParameters",
|
|
331
319
|
"MaskdumpOutputs",
|
|
332
|
-
"MaskdumpParameters",
|
|
333
320
|
"maskdump",
|
|
334
321
|
"maskdump_config_params",
|
|
322
|
+
"maskdump_execute",
|
|
335
323
|
"maskdump_params",
|
|
336
324
|
]
|