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
|
MESHCONVERT_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="8220276fef603995a2f39c3a7bc77794f643295b.boutiques",
|
|
10
10
|
name="meshconvert",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,21 +14,46 @@ MESHCONVERT_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
MeshconvertTransformParameters = typing.TypedDict('MeshconvertTransformParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["transform"]],
|
|
18
|
+
"mode": str,
|
|
19
|
+
"image": InputPathType,
|
|
20
|
+
})
|
|
21
|
+
MeshconvertTransformParametersTagged = typing.TypedDict('MeshconvertTransformParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["transform"],
|
|
18
23
|
"mode": str,
|
|
19
24
|
"image": InputPathType,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
MeshconvertConfigParameters = typing.TypedDict('MeshconvertConfigParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
30
|
+
"key": str,
|
|
31
|
+
"value": str,
|
|
32
|
+
})
|
|
33
|
+
MeshconvertConfigParametersTagged = typing.TypedDict('MeshconvertConfigParametersTagged', {
|
|
34
|
+
"@type": typing.Literal["config"],
|
|
25
35
|
"key": str,
|
|
26
36
|
"value": str,
|
|
27
37
|
})
|
|
28
38
|
|
|
29
39
|
|
|
30
40
|
MeshconvertParameters = typing.TypedDict('MeshconvertParameters', {
|
|
31
|
-
"
|
|
41
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/meshconvert"]],
|
|
42
|
+
"binary": bool,
|
|
43
|
+
"transform": typing.NotRequired[MeshconvertTransformParameters | None],
|
|
44
|
+
"info": bool,
|
|
45
|
+
"quiet": bool,
|
|
46
|
+
"debug": bool,
|
|
47
|
+
"force": bool,
|
|
48
|
+
"nthreads": typing.NotRequired[int | None],
|
|
49
|
+
"config": typing.NotRequired[list[MeshconvertConfigParameters] | None],
|
|
50
|
+
"help": bool,
|
|
51
|
+
"version": bool,
|
|
52
|
+
"input": InputPathType,
|
|
53
|
+
"output": str,
|
|
54
|
+
})
|
|
55
|
+
MeshconvertParametersTagged = typing.TypedDict('MeshconvertParametersTagged', {
|
|
56
|
+
"@type": typing.Literal["mrtrix/meshconvert"],
|
|
32
57
|
"binary": bool,
|
|
33
58
|
"transform": typing.NotRequired[MeshconvertTransformParameters | None],
|
|
34
59
|
"info": bool,
|
|
@@ -42,46 +67,12 @@ MeshconvertParameters = typing.TypedDict('MeshconvertParameters', {
|
|
|
42
67
|
"input": InputPathType,
|
|
43
68
|
"output": str,
|
|
44
69
|
})
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def dyn_cargs(
|
|
48
|
-
t: str,
|
|
49
|
-
) -> typing.Any:
|
|
50
|
-
"""
|
|
51
|
-
Get build cargs function by command type.
|
|
52
|
-
|
|
53
|
-
Args:
|
|
54
|
-
t: Command type.
|
|
55
|
-
Returns:
|
|
56
|
-
Build cargs function.
|
|
57
|
-
"""
|
|
58
|
-
return {
|
|
59
|
-
"meshconvert": meshconvert_cargs,
|
|
60
|
-
"transform": meshconvert_transform_cargs,
|
|
61
|
-
"config": meshconvert_config_cargs,
|
|
62
|
-
}.get(t)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
def dyn_outputs(
|
|
66
|
-
t: str,
|
|
67
|
-
) -> typing.Any:
|
|
68
|
-
"""
|
|
69
|
-
Get build outputs function by command type.
|
|
70
|
-
|
|
71
|
-
Args:
|
|
72
|
-
t: Command type.
|
|
73
|
-
Returns:
|
|
74
|
-
Build outputs function.
|
|
75
|
-
"""
|
|
76
|
-
return {
|
|
77
|
-
"meshconvert": meshconvert_outputs,
|
|
78
|
-
}.get(t)
|
|
79
70
|
|
|
80
71
|
|
|
81
72
|
def meshconvert_transform_params(
|
|
82
73
|
mode: str,
|
|
83
74
|
image: InputPathType,
|
|
84
|
-
) ->
|
|
75
|
+
) -> MeshconvertTransformParametersTagged:
|
|
85
76
|
"""
|
|
86
77
|
Build parameters.
|
|
87
78
|
|
|
@@ -96,7 +87,7 @@ def meshconvert_transform_params(
|
|
|
96
87
|
Parameter dictionary
|
|
97
88
|
"""
|
|
98
89
|
params = {
|
|
99
|
-
"
|
|
90
|
+
"@type": "transform",
|
|
100
91
|
"mode": mode,
|
|
101
92
|
"image": image,
|
|
102
93
|
}
|
|
@@ -118,15 +109,15 @@ def meshconvert_transform_cargs(
|
|
|
118
109
|
"""
|
|
119
110
|
cargs = []
|
|
120
111
|
cargs.append("-transform")
|
|
121
|
-
cargs.append(params.get("mode"))
|
|
122
|
-
cargs.append(execution.input_file(params.get("image")))
|
|
112
|
+
cargs.append(params.get("mode", None))
|
|
113
|
+
cargs.append(execution.input_file(params.get("image", None)))
|
|
123
114
|
return cargs
|
|
124
115
|
|
|
125
116
|
|
|
126
117
|
def meshconvert_config_params(
|
|
127
118
|
key: str,
|
|
128
119
|
value: str,
|
|
129
|
-
) ->
|
|
120
|
+
) -> MeshconvertConfigParametersTagged:
|
|
130
121
|
"""
|
|
131
122
|
Build parameters.
|
|
132
123
|
|
|
@@ -137,7 +128,7 @@ def meshconvert_config_params(
|
|
|
137
128
|
Parameter dictionary
|
|
138
129
|
"""
|
|
139
130
|
params = {
|
|
140
|
-
"
|
|
131
|
+
"@type": "config",
|
|
141
132
|
"key": key,
|
|
142
133
|
"value": value,
|
|
143
134
|
}
|
|
@@ -159,14 +150,14 @@ def meshconvert_config_cargs(
|
|
|
159
150
|
"""
|
|
160
151
|
cargs = []
|
|
161
152
|
cargs.append("-config")
|
|
162
|
-
cargs.append(params.get("key"))
|
|
163
|
-
cargs.append(params.get("value"))
|
|
153
|
+
cargs.append(params.get("key", None))
|
|
154
|
+
cargs.append(params.get("value", None))
|
|
164
155
|
return cargs
|
|
165
156
|
|
|
166
157
|
|
|
167
158
|
class MeshconvertOutputs(typing.NamedTuple):
|
|
168
159
|
"""
|
|
169
|
-
Output object returned when calling `
|
|
160
|
+
Output object returned when calling `MeshconvertParameters(...)`.
|
|
170
161
|
"""
|
|
171
162
|
root: OutputPathType
|
|
172
163
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -187,7 +178,7 @@ def meshconvert_params(
|
|
|
187
178
|
config: list[MeshconvertConfigParameters] | None = None,
|
|
188
179
|
help_: bool = False,
|
|
189
180
|
version: bool = False,
|
|
190
|
-
) ->
|
|
181
|
+
) -> MeshconvertParametersTagged:
|
|
191
182
|
"""
|
|
192
183
|
Build parameters.
|
|
193
184
|
|
|
@@ -214,7 +205,7 @@ def meshconvert_params(
|
|
|
214
205
|
Parameter dictionary
|
|
215
206
|
"""
|
|
216
207
|
params = {
|
|
217
|
-
"
|
|
208
|
+
"@type": "mrtrix/meshconvert",
|
|
218
209
|
"binary": binary,
|
|
219
210
|
"info": info,
|
|
220
211
|
"quiet": quiet,
|
|
@@ -249,31 +240,31 @@ def meshconvert_cargs(
|
|
|
249
240
|
"""
|
|
250
241
|
cargs = []
|
|
251
242
|
cargs.append("meshconvert")
|
|
252
|
-
if params.get("binary"):
|
|
243
|
+
if params.get("binary", False):
|
|
253
244
|
cargs.append("-binary")
|
|
254
|
-
if params.get("transform") is not None:
|
|
255
|
-
cargs.extend(
|
|
256
|
-
if params.get("info"):
|
|
245
|
+
if params.get("transform", None) is not None:
|
|
246
|
+
cargs.extend(meshconvert_transform_cargs(params.get("transform", None), execution))
|
|
247
|
+
if params.get("info", False):
|
|
257
248
|
cargs.append("-info")
|
|
258
|
-
if params.get("quiet"):
|
|
249
|
+
if params.get("quiet", False):
|
|
259
250
|
cargs.append("-quiet")
|
|
260
|
-
if params.get("debug"):
|
|
251
|
+
if params.get("debug", False):
|
|
261
252
|
cargs.append("-debug")
|
|
262
|
-
if params.get("force"):
|
|
253
|
+
if params.get("force", False):
|
|
263
254
|
cargs.append("-force")
|
|
264
|
-
if params.get("nthreads") is not None:
|
|
255
|
+
if params.get("nthreads", None) is not None:
|
|
265
256
|
cargs.extend([
|
|
266
257
|
"-nthreads",
|
|
267
|
-
str(params.get("nthreads"))
|
|
258
|
+
str(params.get("nthreads", None))
|
|
268
259
|
])
|
|
269
|
-
if params.get("config") is not None:
|
|
270
|
-
cargs.extend([a for c in [
|
|
271
|
-
if params.get("help"):
|
|
260
|
+
if params.get("config", None) is not None:
|
|
261
|
+
cargs.extend([a for c in [meshconvert_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
262
|
+
if params.get("help", False):
|
|
272
263
|
cargs.append("-help")
|
|
273
|
-
if params.get("version"):
|
|
264
|
+
if params.get("version", False):
|
|
274
265
|
cargs.append("-version")
|
|
275
|
-
cargs.append(execution.input_file(params.get("input")))
|
|
276
|
-
cargs.append(params.get("output"))
|
|
266
|
+
cargs.append(execution.input_file(params.get("input", None)))
|
|
267
|
+
cargs.append(params.get("output", None))
|
|
277
268
|
return cargs
|
|
278
269
|
|
|
279
270
|
|
|
@@ -292,16 +283,18 @@ def meshconvert_outputs(
|
|
|
292
283
|
"""
|
|
293
284
|
ret = MeshconvertOutputs(
|
|
294
285
|
root=execution.output_file("."),
|
|
295
|
-
output=execution.output_file(params.get("output")),
|
|
286
|
+
output=execution.output_file(params.get("output", None)),
|
|
296
287
|
)
|
|
297
288
|
return ret
|
|
298
289
|
|
|
299
290
|
|
|
300
291
|
def meshconvert_execute(
|
|
301
292
|
params: MeshconvertParameters,
|
|
302
|
-
|
|
293
|
+
runner: Runner | None = None,
|
|
303
294
|
) -> MeshconvertOutputs:
|
|
304
295
|
"""
|
|
296
|
+
meshconvert
|
|
297
|
+
|
|
305
298
|
Convert meshes between different formats, and apply transformations.
|
|
306
299
|
|
|
307
300
|
|
|
@@ -316,10 +309,12 @@ def meshconvert_execute(
|
|
|
316
309
|
|
|
317
310
|
Args:
|
|
318
311
|
params: The parameters.
|
|
319
|
-
|
|
312
|
+
runner: Command runner.
|
|
320
313
|
Returns:
|
|
321
314
|
NamedTuple of outputs (described in `MeshconvertOutputs`).
|
|
322
315
|
"""
|
|
316
|
+
runner = runner or get_global_runner()
|
|
317
|
+
execution = runner.start_execution(MESHCONVERT_METADATA)
|
|
323
318
|
params = execution.params(params)
|
|
324
319
|
cargs = meshconvert_cargs(params, execution)
|
|
325
320
|
ret = meshconvert_outputs(params, execution)
|
|
@@ -343,6 +338,8 @@ def meshconvert(
|
|
|
343
338
|
runner: Runner | None = None,
|
|
344
339
|
) -> MeshconvertOutputs:
|
|
345
340
|
"""
|
|
341
|
+
meshconvert
|
|
342
|
+
|
|
346
343
|
Convert meshes between different formats, and apply transformations.
|
|
347
344
|
|
|
348
345
|
|
|
@@ -378,8 +375,6 @@ def meshconvert(
|
|
|
378
375
|
Returns:
|
|
379
376
|
NamedTuple of outputs (described in `MeshconvertOutputs`).
|
|
380
377
|
"""
|
|
381
|
-
runner = runner or get_global_runner()
|
|
382
|
-
execution = runner.start_execution(MESHCONVERT_METADATA)
|
|
383
378
|
params = meshconvert_params(
|
|
384
379
|
binary=binary,
|
|
385
380
|
transform=transform,
|
|
@@ -394,17 +389,15 @@ def meshconvert(
|
|
|
394
389
|
input_=input_,
|
|
395
390
|
output=output,
|
|
396
391
|
)
|
|
397
|
-
return meshconvert_execute(params,
|
|
392
|
+
return meshconvert_execute(params, runner)
|
|
398
393
|
|
|
399
394
|
|
|
400
395
|
__all__ = [
|
|
401
396
|
"MESHCONVERT_METADATA",
|
|
402
|
-
"MeshconvertConfigParameters",
|
|
403
397
|
"MeshconvertOutputs",
|
|
404
|
-
"MeshconvertParameters",
|
|
405
|
-
"MeshconvertTransformParameters",
|
|
406
398
|
"meshconvert",
|
|
407
399
|
"meshconvert_config_params",
|
|
400
|
+
"meshconvert_execute",
|
|
408
401
|
"meshconvert_params",
|
|
409
402
|
"meshconvert_transform_params",
|
|
410
403
|
]
|
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
MESHFILTER_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="81b6a12d56aece38462e5d295246392629b9a98c.boutiques",
|
|
10
10
|
name="meshfilter",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,35 @@ MESHFILTER_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
MeshfilterConfigParameters = typing.TypedDict('MeshfilterConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
MeshfilterConfigParametersTagged = typing.TypedDict('MeshfilterConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
MeshfilterParameters = typing.TypedDict('MeshfilterParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/meshfilter"]],
|
|
30
|
+
"smooth_spatial": typing.NotRequired[float | None],
|
|
31
|
+
"smooth_influence": typing.NotRequired[float | None],
|
|
32
|
+
"info": bool,
|
|
33
|
+
"quiet": bool,
|
|
34
|
+
"debug": bool,
|
|
35
|
+
"force": bool,
|
|
36
|
+
"nthreads": typing.NotRequired[int | None],
|
|
37
|
+
"config": typing.NotRequired[list[MeshfilterConfigParameters] | None],
|
|
38
|
+
"help": bool,
|
|
39
|
+
"version": bool,
|
|
40
|
+
"input": InputPathType,
|
|
41
|
+
"filter": str,
|
|
42
|
+
"output": str,
|
|
43
|
+
})
|
|
44
|
+
MeshfilterParametersTagged = typing.TypedDict('MeshfilterParametersTagged', {
|
|
45
|
+
"@type": typing.Literal["mrtrix/meshfilter"],
|
|
25
46
|
"smooth_spatial": typing.NotRequired[float | None],
|
|
26
47
|
"smooth_influence": typing.NotRequired[float | None],
|
|
27
48
|
"info": bool,
|
|
@@ -36,45 +57,12 @@ MeshfilterParameters = typing.TypedDict('MeshfilterParameters', {
|
|
|
36
57
|
"filter": str,
|
|
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
|
-
"meshfilter": meshfilter_cargs,
|
|
54
|
-
"config": meshfilter_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
|
-
"meshfilter": meshfilter_outputs,
|
|
71
|
-
}.get(t)
|
|
72
60
|
|
|
73
61
|
|
|
74
62
|
def meshfilter_config_params(
|
|
75
63
|
key: str,
|
|
76
64
|
value: str,
|
|
77
|
-
) ->
|
|
65
|
+
) -> MeshfilterConfigParametersTagged:
|
|
78
66
|
"""
|
|
79
67
|
Build parameters.
|
|
80
68
|
|
|
@@ -85,7 +73,7 @@ def meshfilter_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 meshfilter_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 MeshfilterOutputs(typing.NamedTuple):
|
|
116
104
|
"""
|
|
117
|
-
Output object returned when calling `
|
|
105
|
+
Output object returned when calling `MeshfilterParameters(...)`.
|
|
118
106
|
"""
|
|
119
107
|
root: OutputPathType
|
|
120
108
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -136,7 +124,7 @@ def meshfilter_params(
|
|
|
136
124
|
config: list[MeshfilterConfigParameters] | None = None,
|
|
137
125
|
help_: bool = False,
|
|
138
126
|
version: bool = False,
|
|
139
|
-
) ->
|
|
127
|
+
) -> MeshfilterParametersTagged:
|
|
140
128
|
"""
|
|
141
129
|
Build parameters.
|
|
142
130
|
|
|
@@ -162,7 +150,7 @@ def meshfilter_params(
|
|
|
162
150
|
Parameter dictionary
|
|
163
151
|
"""
|
|
164
152
|
params = {
|
|
165
|
-
"
|
|
153
|
+
"@type": "mrtrix/meshfilter",
|
|
166
154
|
"info": info,
|
|
167
155
|
"quiet": quiet,
|
|
168
156
|
"debug": debug,
|
|
@@ -199,38 +187,38 @@ def meshfilter_cargs(
|
|
|
199
187
|
"""
|
|
200
188
|
cargs = []
|
|
201
189
|
cargs.append("meshfilter")
|
|
202
|
-
if params.get("smooth_spatial") is not None:
|
|
190
|
+
if params.get("smooth_spatial", None) is not None:
|
|
203
191
|
cargs.extend([
|
|
204
192
|
"-smooth_spatial",
|
|
205
|
-
str(params.get("smooth_spatial"))
|
|
193
|
+
str(params.get("smooth_spatial", None))
|
|
206
194
|
])
|
|
207
|
-
if params.get("smooth_influence") is not None:
|
|
195
|
+
if params.get("smooth_influence", None) is not None:
|
|
208
196
|
cargs.extend([
|
|
209
197
|
"-smooth_influence",
|
|
210
|
-
str(params.get("smooth_influence"))
|
|
198
|
+
str(params.get("smooth_influence", None))
|
|
211
199
|
])
|
|
212
|
-
if params.get("info"):
|
|
200
|
+
if params.get("info", False):
|
|
213
201
|
cargs.append("-info")
|
|
214
|
-
if params.get("quiet"):
|
|
202
|
+
if params.get("quiet", False):
|
|
215
203
|
cargs.append("-quiet")
|
|
216
|
-
if params.get("debug"):
|
|
204
|
+
if params.get("debug", False):
|
|
217
205
|
cargs.append("-debug")
|
|
218
|
-
if params.get("force"):
|
|
206
|
+
if params.get("force", False):
|
|
219
207
|
cargs.append("-force")
|
|
220
|
-
if params.get("nthreads") is not None:
|
|
208
|
+
if params.get("nthreads", None) is not None:
|
|
221
209
|
cargs.extend([
|
|
222
210
|
"-nthreads",
|
|
223
|
-
str(params.get("nthreads"))
|
|
211
|
+
str(params.get("nthreads", None))
|
|
224
212
|
])
|
|
225
|
-
if params.get("config") is not None:
|
|
226
|
-
cargs.extend([a for c in [
|
|
227
|
-
if params.get("help"):
|
|
213
|
+
if params.get("config", None) is not None:
|
|
214
|
+
cargs.extend([a for c in [meshfilter_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
215
|
+
if params.get("help", False):
|
|
228
216
|
cargs.append("-help")
|
|
229
|
-
if params.get("version"):
|
|
217
|
+
if params.get("version", False):
|
|
230
218
|
cargs.append("-version")
|
|
231
|
-
cargs.append(execution.input_file(params.get("input")))
|
|
232
|
-
cargs.append(params.get("filter"))
|
|
233
|
-
cargs.append(params.get("output"))
|
|
219
|
+
cargs.append(execution.input_file(params.get("input", None)))
|
|
220
|
+
cargs.append(params.get("filter", None))
|
|
221
|
+
cargs.append(params.get("output", None))
|
|
234
222
|
return cargs
|
|
235
223
|
|
|
236
224
|
|
|
@@ -249,16 +237,18 @@ def meshfilter_outputs(
|
|
|
249
237
|
"""
|
|
250
238
|
ret = MeshfilterOutputs(
|
|
251
239
|
root=execution.output_file("."),
|
|
252
|
-
output=execution.output_file(params.get("output")),
|
|
240
|
+
output=execution.output_file(params.get("output", None)),
|
|
253
241
|
)
|
|
254
242
|
return ret
|
|
255
243
|
|
|
256
244
|
|
|
257
245
|
def meshfilter_execute(
|
|
258
246
|
params: MeshfilterParameters,
|
|
259
|
-
|
|
247
|
+
runner: Runner | None = None,
|
|
260
248
|
) -> MeshfilterOutputs:
|
|
261
249
|
"""
|
|
250
|
+
meshfilter
|
|
251
|
+
|
|
262
252
|
Apply filter operations to meshes.
|
|
263
253
|
|
|
264
254
|
While this command has only one filter operation currently available, it
|
|
@@ -275,10 +265,12 @@ def meshfilter_execute(
|
|
|
275
265
|
|
|
276
266
|
Args:
|
|
277
267
|
params: The parameters.
|
|
278
|
-
|
|
268
|
+
runner: Command runner.
|
|
279
269
|
Returns:
|
|
280
270
|
NamedTuple of outputs (described in `MeshfilterOutputs`).
|
|
281
271
|
"""
|
|
272
|
+
runner = runner or get_global_runner()
|
|
273
|
+
execution = runner.start_execution(MESHFILTER_METADATA)
|
|
282
274
|
params = execution.params(params)
|
|
283
275
|
cargs = meshfilter_cargs(params, execution)
|
|
284
276
|
ret = meshfilter_outputs(params, execution)
|
|
@@ -303,6 +295,8 @@ def meshfilter(
|
|
|
303
295
|
runner: Runner | None = None,
|
|
304
296
|
) -> MeshfilterOutputs:
|
|
305
297
|
"""
|
|
298
|
+
meshfilter
|
|
299
|
+
|
|
306
300
|
Apply filter operations to meshes.
|
|
307
301
|
|
|
308
302
|
While this command has only one filter operation currently available, it
|
|
@@ -339,8 +333,6 @@ def meshfilter(
|
|
|
339
333
|
Returns:
|
|
340
334
|
NamedTuple of outputs (described in `MeshfilterOutputs`).
|
|
341
335
|
"""
|
|
342
|
-
runner = runner or get_global_runner()
|
|
343
|
-
execution = runner.start_execution(MESHFILTER_METADATA)
|
|
344
336
|
params = meshfilter_params(
|
|
345
337
|
smooth_spatial=smooth_spatial,
|
|
346
338
|
smooth_influence=smooth_influence,
|
|
@@ -356,15 +348,14 @@ def meshfilter(
|
|
|
356
348
|
filter_=filter_,
|
|
357
349
|
output=output,
|
|
358
350
|
)
|
|
359
|
-
return meshfilter_execute(params,
|
|
351
|
+
return meshfilter_execute(params, runner)
|
|
360
352
|
|
|
361
353
|
|
|
362
354
|
__all__ = [
|
|
363
355
|
"MESHFILTER_METADATA",
|
|
364
|
-
"MeshfilterConfigParameters",
|
|
365
356
|
"MeshfilterOutputs",
|
|
366
|
-
"MeshfilterParameters",
|
|
367
357
|
"meshfilter",
|
|
368
358
|
"meshfilter_config_params",
|
|
359
|
+
"meshfilter_execute",
|
|
369
360
|
"meshfilter_params",
|
|
370
361
|
]
|