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/mrcat.py
CHANGED
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
MRCAT_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="18ee3a555dc21091bd71575f0cabc1362de4ece7.boutiques",
|
|
10
10
|
name="mrcat",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,35 @@ MRCAT_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
MrcatConfigParameters = typing.TypedDict('MrcatConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
MrcatConfigParametersTagged = typing.TypedDict('MrcatConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
MrcatParameters = typing.TypedDict('MrcatParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/mrcat"]],
|
|
30
|
+
"axis": typing.NotRequired[int | None],
|
|
31
|
+
"datatype": typing.NotRequired[str | None],
|
|
32
|
+
"info": bool,
|
|
33
|
+
"quiet": bool,
|
|
34
|
+
"debug": bool,
|
|
35
|
+
"force": bool,
|
|
36
|
+
"nthreads": typing.NotRequired[int | None],
|
|
37
|
+
"config": typing.NotRequired[list[MrcatConfigParameters] | None],
|
|
38
|
+
"help": bool,
|
|
39
|
+
"version": bool,
|
|
40
|
+
"image1": InputPathType,
|
|
41
|
+
"image2": list[InputPathType],
|
|
42
|
+
"output": str,
|
|
43
|
+
})
|
|
44
|
+
MrcatParametersTagged = typing.TypedDict('MrcatParametersTagged', {
|
|
45
|
+
"@type": typing.Literal["mrtrix/mrcat"],
|
|
25
46
|
"axis": typing.NotRequired[int | None],
|
|
26
47
|
"datatype": typing.NotRequired[str | None],
|
|
27
48
|
"info": bool,
|
|
@@ -36,45 +57,12 @@ MrcatParameters = typing.TypedDict('MrcatParameters', {
|
|
|
36
57
|
"image2": list[InputPathType],
|
|
37
58
|
"output": str,
|
|
38
59
|
})
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
def dyn_cargs(
|
|
42
|
-
t: str,
|
|
43
|
-
) -> typing.Any:
|
|
44
|
-
"""
|
|
45
|
-
Get build cargs function by command type.
|
|
46
|
-
|
|
47
|
-
Args:
|
|
48
|
-
t: Command type.
|
|
49
|
-
Returns:
|
|
50
|
-
Build cargs function.
|
|
51
|
-
"""
|
|
52
|
-
return {
|
|
53
|
-
"mrcat": mrcat_cargs,
|
|
54
|
-
"config": mrcat_config_cargs,
|
|
55
|
-
}.get(t)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def dyn_outputs(
|
|
59
|
-
t: str,
|
|
60
|
-
) -> typing.Any:
|
|
61
|
-
"""
|
|
62
|
-
Get build outputs function by command type.
|
|
63
|
-
|
|
64
|
-
Args:
|
|
65
|
-
t: Command type.
|
|
66
|
-
Returns:
|
|
67
|
-
Build outputs function.
|
|
68
|
-
"""
|
|
69
|
-
return {
|
|
70
|
-
"mrcat": mrcat_outputs,
|
|
71
|
-
}.get(t)
|
|
72
60
|
|
|
73
61
|
|
|
74
62
|
def mrcat_config_params(
|
|
75
63
|
key: str,
|
|
76
64
|
value: str,
|
|
77
|
-
) ->
|
|
65
|
+
) -> MrcatConfigParametersTagged:
|
|
78
66
|
"""
|
|
79
67
|
Build parameters.
|
|
80
68
|
|
|
@@ -85,7 +73,7 @@ def mrcat_config_params(
|
|
|
85
73
|
Parameter dictionary
|
|
86
74
|
"""
|
|
87
75
|
params = {
|
|
88
|
-
"
|
|
76
|
+
"@type": "config",
|
|
89
77
|
"key": key,
|
|
90
78
|
"value": value,
|
|
91
79
|
}
|
|
@@ -107,14 +95,14 @@ def mrcat_config_cargs(
|
|
|
107
95
|
"""
|
|
108
96
|
cargs = []
|
|
109
97
|
cargs.append("-config")
|
|
110
|
-
cargs.append(params.get("key"))
|
|
111
|
-
cargs.append(params.get("value"))
|
|
98
|
+
cargs.append(params.get("key", None))
|
|
99
|
+
cargs.append(params.get("value", None))
|
|
112
100
|
return cargs
|
|
113
101
|
|
|
114
102
|
|
|
115
103
|
class MrcatOutputs(typing.NamedTuple):
|
|
116
104
|
"""
|
|
117
|
-
Output object returned when calling `
|
|
105
|
+
Output object returned when calling `MrcatParameters(...)`.
|
|
118
106
|
"""
|
|
119
107
|
root: OutputPathType
|
|
120
108
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -136,7 +124,7 @@ def mrcat_params(
|
|
|
136
124
|
config: list[MrcatConfigParameters] | None = None,
|
|
137
125
|
help_: bool = False,
|
|
138
126
|
version: bool = False,
|
|
139
|
-
) ->
|
|
127
|
+
) -> MrcatParametersTagged:
|
|
140
128
|
"""
|
|
141
129
|
Build parameters.
|
|
142
130
|
|
|
@@ -170,7 +158,7 @@ def mrcat_params(
|
|
|
170
158
|
Parameter dictionary
|
|
171
159
|
"""
|
|
172
160
|
params = {
|
|
173
|
-
"
|
|
161
|
+
"@type": "mrtrix/mrcat",
|
|
174
162
|
"info": info,
|
|
175
163
|
"quiet": quiet,
|
|
176
164
|
"debug": debug,
|
|
@@ -207,38 +195,38 @@ def mrcat_cargs(
|
|
|
207
195
|
"""
|
|
208
196
|
cargs = []
|
|
209
197
|
cargs.append("mrcat")
|
|
210
|
-
if params.get("axis") is not None:
|
|
198
|
+
if params.get("axis", None) is not None:
|
|
211
199
|
cargs.extend([
|
|
212
200
|
"-axis",
|
|
213
|
-
str(params.get("axis"))
|
|
201
|
+
str(params.get("axis", None))
|
|
214
202
|
])
|
|
215
|
-
if params.get("datatype") is not None:
|
|
203
|
+
if params.get("datatype", None) is not None:
|
|
216
204
|
cargs.extend([
|
|
217
205
|
"-datatype",
|
|
218
|
-
params.get("datatype")
|
|
206
|
+
params.get("datatype", None)
|
|
219
207
|
])
|
|
220
|
-
if params.get("info"):
|
|
208
|
+
if params.get("info", False):
|
|
221
209
|
cargs.append("-info")
|
|
222
|
-
if params.get("quiet"):
|
|
210
|
+
if params.get("quiet", False):
|
|
223
211
|
cargs.append("-quiet")
|
|
224
|
-
if params.get("debug"):
|
|
212
|
+
if params.get("debug", False):
|
|
225
213
|
cargs.append("-debug")
|
|
226
|
-
if params.get("force"):
|
|
214
|
+
if params.get("force", False):
|
|
227
215
|
cargs.append("-force")
|
|
228
|
-
if params.get("nthreads") is not None:
|
|
216
|
+
if params.get("nthreads", None) is not None:
|
|
229
217
|
cargs.extend([
|
|
230
218
|
"-nthreads",
|
|
231
|
-
str(params.get("nthreads"))
|
|
219
|
+
str(params.get("nthreads", None))
|
|
232
220
|
])
|
|
233
|
-
if params.get("config") is not None:
|
|
234
|
-
cargs.extend([a for c in [
|
|
235
|
-
if params.get("help"):
|
|
221
|
+
if params.get("config", None) is not None:
|
|
222
|
+
cargs.extend([a for c in [mrcat_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
223
|
+
if params.get("help", False):
|
|
236
224
|
cargs.append("-help")
|
|
237
|
-
if params.get("version"):
|
|
225
|
+
if params.get("version", False):
|
|
238
226
|
cargs.append("-version")
|
|
239
|
-
cargs.append(execution.input_file(params.get("image1")))
|
|
240
|
-
cargs.extend([execution.input_file(f) for f in params.get("image2")])
|
|
241
|
-
cargs.append(params.get("output"))
|
|
227
|
+
cargs.append(execution.input_file(params.get("image1", None)))
|
|
228
|
+
cargs.extend([execution.input_file(f) for f in params.get("image2", None)])
|
|
229
|
+
cargs.append(params.get("output", None))
|
|
242
230
|
return cargs
|
|
243
231
|
|
|
244
232
|
|
|
@@ -257,16 +245,18 @@ def mrcat_outputs(
|
|
|
257
245
|
"""
|
|
258
246
|
ret = MrcatOutputs(
|
|
259
247
|
root=execution.output_file("."),
|
|
260
|
-
output=execution.output_file(params.get("output")),
|
|
248
|
+
output=execution.output_file(params.get("output", None)),
|
|
261
249
|
)
|
|
262
250
|
return ret
|
|
263
251
|
|
|
264
252
|
|
|
265
253
|
def mrcat_execute(
|
|
266
254
|
params: MrcatParameters,
|
|
267
|
-
|
|
255
|
+
runner: Runner | None = None,
|
|
268
256
|
) -> MrcatOutputs:
|
|
269
257
|
"""
|
|
258
|
+
mrcat
|
|
259
|
+
|
|
270
260
|
Concatenate several images into one.
|
|
271
261
|
|
|
272
262
|
|
|
@@ -281,10 +271,12 @@ def mrcat_execute(
|
|
|
281
271
|
|
|
282
272
|
Args:
|
|
283
273
|
params: The parameters.
|
|
284
|
-
|
|
274
|
+
runner: Command runner.
|
|
285
275
|
Returns:
|
|
286
276
|
NamedTuple of outputs (described in `MrcatOutputs`).
|
|
287
277
|
"""
|
|
278
|
+
runner = runner or get_global_runner()
|
|
279
|
+
execution = runner.start_execution(MRCAT_METADATA)
|
|
288
280
|
params = execution.params(params)
|
|
289
281
|
cargs = mrcat_cargs(params, execution)
|
|
290
282
|
ret = mrcat_outputs(params, execution)
|
|
@@ -309,6 +301,8 @@ def mrcat(
|
|
|
309
301
|
runner: Runner | None = None,
|
|
310
302
|
) -> MrcatOutputs:
|
|
311
303
|
"""
|
|
304
|
+
mrcat
|
|
305
|
+
|
|
312
306
|
Concatenate several images into one.
|
|
313
307
|
|
|
314
308
|
|
|
@@ -351,8 +345,6 @@ def mrcat(
|
|
|
351
345
|
Returns:
|
|
352
346
|
NamedTuple of outputs (described in `MrcatOutputs`).
|
|
353
347
|
"""
|
|
354
|
-
runner = runner or get_global_runner()
|
|
355
|
-
execution = runner.start_execution(MRCAT_METADATA)
|
|
356
348
|
params = mrcat_params(
|
|
357
349
|
axis=axis,
|
|
358
350
|
datatype=datatype,
|
|
@@ -368,15 +360,14 @@ def mrcat(
|
|
|
368
360
|
image2=image2,
|
|
369
361
|
output=output,
|
|
370
362
|
)
|
|
371
|
-
return mrcat_execute(params,
|
|
363
|
+
return mrcat_execute(params, runner)
|
|
372
364
|
|
|
373
365
|
|
|
374
366
|
__all__ = [
|
|
375
367
|
"MRCAT_METADATA",
|
|
376
|
-
"MrcatConfigParameters",
|
|
377
368
|
"MrcatOutputs",
|
|
378
|
-
"MrcatParameters",
|
|
379
369
|
"mrcat",
|
|
380
370
|
"mrcat_config_params",
|
|
371
|
+
"mrcat_execute",
|
|
381
372
|
"mrcat_params",
|
|
382
373
|
]
|
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
MRCENTROID_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="3db7f938efa26f30a08814f6c0e6329316866d53.boutiques",
|
|
10
10
|
name="mrcentroid",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,33 @@ MRCENTROID_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
MrcentroidConfigParameters = typing.TypedDict('MrcentroidConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
MrcentroidConfigParametersTagged = typing.TypedDict('MrcentroidConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
MrcentroidParameters = typing.TypedDict('MrcentroidParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/mrcentroid"]],
|
|
30
|
+
"mask": typing.NotRequired[InputPathType | 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[MrcentroidConfigParameters] | None],
|
|
38
|
+
"help": bool,
|
|
39
|
+
"version": bool,
|
|
40
|
+
"input": InputPathType,
|
|
41
|
+
})
|
|
42
|
+
MrcentroidParametersTagged = typing.TypedDict('MrcentroidParametersTagged', {
|
|
43
|
+
"@type": typing.Literal["mrtrix/mrcentroid"],
|
|
25
44
|
"mask": typing.NotRequired[InputPathType | None],
|
|
26
45
|
"voxelspace": bool,
|
|
27
46
|
"info": bool,
|
|
@@ -34,44 +53,12 @@ MrcentroidParameters = typing.TypedDict('MrcentroidParameters', {
|
|
|
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
|
-
"mrcentroid": mrcentroid_cargs,
|
|
52
|
-
"config": mrcentroid_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 mrcentroid_config_params(
|
|
72
59
|
key: str,
|
|
73
60
|
value: str,
|
|
74
|
-
) ->
|
|
61
|
+
) -> MrcentroidConfigParametersTagged:
|
|
75
62
|
"""
|
|
76
63
|
Build parameters.
|
|
77
64
|
|
|
@@ -82,7 +69,7 @@ def mrcentroid_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 mrcentroid_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 MrcentroidOutputs(typing.NamedTuple):
|
|
113
100
|
"""
|
|
114
|
-
Output object returned when calling `
|
|
101
|
+
Output object returned when calling `MrcentroidParameters(...)`.
|
|
115
102
|
"""
|
|
116
103
|
root: OutputPathType
|
|
117
104
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -129,7 +116,7 @@ def mrcentroid_params(
|
|
|
129
116
|
config: list[MrcentroidConfigParameters] | None = None,
|
|
130
117
|
help_: bool = False,
|
|
131
118
|
version: bool = False,
|
|
132
|
-
) ->
|
|
119
|
+
) -> MrcentroidParametersTagged:
|
|
133
120
|
"""
|
|
134
121
|
Build parameters.
|
|
135
122
|
|
|
@@ -154,7 +141,7 @@ def mrcentroid_params(
|
|
|
154
141
|
Parameter dictionary
|
|
155
142
|
"""
|
|
156
143
|
params = {
|
|
157
|
-
"
|
|
144
|
+
"@type": "mrtrix/mrcentroid",
|
|
158
145
|
"voxelspace": voxelspace,
|
|
159
146
|
"info": info,
|
|
160
147
|
"quiet": quiet,
|
|
@@ -188,33 +175,33 @@ def mrcentroid_cargs(
|
|
|
188
175
|
"""
|
|
189
176
|
cargs = []
|
|
190
177
|
cargs.append("mrcentroid")
|
|
191
|
-
if params.get("mask") is not None:
|
|
178
|
+
if params.get("mask", None) is not None:
|
|
192
179
|
cargs.extend([
|
|
193
180
|
"-mask",
|
|
194
|
-
execution.input_file(params.get("mask"))
|
|
181
|
+
execution.input_file(params.get("mask", 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 [mrcentroid_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 mrcentroid_outputs(
|
|
|
239
226
|
|
|
240
227
|
def mrcentroid_execute(
|
|
241
228
|
params: MrcentroidParameters,
|
|
242
|
-
|
|
229
|
+
runner: Runner | None = None,
|
|
243
230
|
) -> MrcentroidOutputs:
|
|
244
231
|
"""
|
|
232
|
+
mrcentroid
|
|
233
|
+
|
|
245
234
|
Determine the centre of mass / centre of gravity of an image.
|
|
246
235
|
|
|
247
236
|
|
|
@@ -256,10 +245,12 @@ def mrcentroid_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 `MrcentroidOutputs`).
|
|
262
251
|
"""
|
|
252
|
+
runner = runner or get_global_runner()
|
|
253
|
+
execution = runner.start_execution(MRCENTROID_METADATA)
|
|
263
254
|
params = execution.params(params)
|
|
264
255
|
cargs = mrcentroid_cargs(params, execution)
|
|
265
256
|
ret = mrcentroid_outputs(params, execution)
|
|
@@ -282,6 +273,8 @@ def mrcentroid(
|
|
|
282
273
|
runner: Runner | None = None,
|
|
283
274
|
) -> MrcentroidOutputs:
|
|
284
275
|
"""
|
|
276
|
+
mrcentroid
|
|
277
|
+
|
|
285
278
|
Determine the centre of mass / centre of gravity of an image.
|
|
286
279
|
|
|
287
280
|
|
|
@@ -315,8 +308,6 @@ def mrcentroid(
|
|
|
315
308
|
Returns:
|
|
316
309
|
NamedTuple of outputs (described in `MrcentroidOutputs`).
|
|
317
310
|
"""
|
|
318
|
-
runner = runner or get_global_runner()
|
|
319
|
-
execution = runner.start_execution(MRCENTROID_METADATA)
|
|
320
311
|
params = mrcentroid_params(
|
|
321
312
|
mask=mask,
|
|
322
313
|
voxelspace=voxelspace,
|
|
@@ -330,15 +321,14 @@ def mrcentroid(
|
|
|
330
321
|
version=version,
|
|
331
322
|
input_=input_,
|
|
332
323
|
)
|
|
333
|
-
return mrcentroid_execute(params,
|
|
324
|
+
return mrcentroid_execute(params, runner)
|
|
334
325
|
|
|
335
326
|
|
|
336
327
|
__all__ = [
|
|
337
328
|
"MRCENTROID_METADATA",
|
|
338
|
-
"MrcentroidConfigParameters",
|
|
339
329
|
"MrcentroidOutputs",
|
|
340
|
-
"MrcentroidParameters",
|
|
341
330
|
"mrcentroid",
|
|
342
331
|
"mrcentroid_config_params",
|
|
332
|
+
"mrcentroid_execute",
|
|
343
333
|
"mrcentroid_params",
|
|
344
334
|
]
|