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
|
TCKRESAMPLE_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="78ef274f2a87923f211402ee1cddb82172cd3499.boutiques",
|
|
10
10
|
name="tckresample",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,7 +14,13 @@ TCKRESAMPLE_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
TckresampleLineParameters = typing.TypedDict('TckresampleLineParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["line"]],
|
|
18
|
+
"num": int,
|
|
19
|
+
"start": list[float],
|
|
20
|
+
"end": list[float],
|
|
21
|
+
})
|
|
22
|
+
TckresampleLineParametersTagged = typing.TypedDict('TckresampleLineParametersTagged', {
|
|
23
|
+
"@type": typing.Literal["line"],
|
|
18
24
|
"num": int,
|
|
19
25
|
"start": list[float],
|
|
20
26
|
"end": list[float],
|
|
@@ -22,7 +28,14 @@ TckresampleLineParameters = typing.TypedDict('TckresampleLineParameters', {
|
|
|
22
28
|
|
|
23
29
|
|
|
24
30
|
TckresampleArcParameters = typing.TypedDict('TckresampleArcParameters', {
|
|
25
|
-
"
|
|
31
|
+
"@type": typing.NotRequired[typing.Literal["arc"]],
|
|
32
|
+
"num": int,
|
|
33
|
+
"start": list[float],
|
|
34
|
+
"mid": list[float],
|
|
35
|
+
"end": list[float],
|
|
36
|
+
})
|
|
37
|
+
TckresampleArcParametersTagged = typing.TypedDict('TckresampleArcParametersTagged', {
|
|
38
|
+
"@type": typing.Literal["arc"],
|
|
26
39
|
"num": int,
|
|
27
40
|
"start": list[float],
|
|
28
41
|
"mid": list[float],
|
|
@@ -31,14 +44,39 @@ TckresampleArcParameters = typing.TypedDict('TckresampleArcParameters', {
|
|
|
31
44
|
|
|
32
45
|
|
|
33
46
|
TckresampleConfigParameters = typing.TypedDict('TckresampleConfigParameters', {
|
|
34
|
-
"
|
|
47
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
48
|
+
"key": str,
|
|
49
|
+
"value": str,
|
|
50
|
+
})
|
|
51
|
+
TckresampleConfigParametersTagged = typing.TypedDict('TckresampleConfigParametersTagged', {
|
|
52
|
+
"@type": typing.Literal["config"],
|
|
35
53
|
"key": str,
|
|
36
54
|
"value": str,
|
|
37
55
|
})
|
|
38
56
|
|
|
39
57
|
|
|
40
58
|
TckresampleParameters = typing.TypedDict('TckresampleParameters', {
|
|
41
|
-
"
|
|
59
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/tckresample"]],
|
|
60
|
+
"upsample": typing.NotRequired[int | None],
|
|
61
|
+
"downsample": typing.NotRequired[int | None],
|
|
62
|
+
"step_size": typing.NotRequired[float | None],
|
|
63
|
+
"num_points": typing.NotRequired[int | None],
|
|
64
|
+
"endpoints": bool,
|
|
65
|
+
"line": typing.NotRequired[TckresampleLineParameters | None],
|
|
66
|
+
"arc": typing.NotRequired[TckresampleArcParameters | None],
|
|
67
|
+
"info": bool,
|
|
68
|
+
"quiet": bool,
|
|
69
|
+
"debug": bool,
|
|
70
|
+
"force": bool,
|
|
71
|
+
"nthreads": typing.NotRequired[int | None],
|
|
72
|
+
"config": typing.NotRequired[list[TckresampleConfigParameters] | None],
|
|
73
|
+
"help": bool,
|
|
74
|
+
"version": bool,
|
|
75
|
+
"in_tracks": InputPathType,
|
|
76
|
+
"out_tracks": str,
|
|
77
|
+
})
|
|
78
|
+
TckresampleParametersTagged = typing.TypedDict('TckresampleParametersTagged', {
|
|
79
|
+
"@type": typing.Literal["mrtrix/tckresample"],
|
|
42
80
|
"upsample": typing.NotRequired[int | None],
|
|
43
81
|
"downsample": typing.NotRequired[int | None],
|
|
44
82
|
"step_size": typing.NotRequired[float | None],
|
|
@@ -57,48 +95,13 @@ TckresampleParameters = typing.TypedDict('TckresampleParameters', {
|
|
|
57
95
|
"in_tracks": InputPathType,
|
|
58
96
|
"out_tracks": str,
|
|
59
97
|
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
def dyn_cargs(
|
|
63
|
-
t: str,
|
|
64
|
-
) -> typing.Any:
|
|
65
|
-
"""
|
|
66
|
-
Get build cargs function by command type.
|
|
67
|
-
|
|
68
|
-
Args:
|
|
69
|
-
t: Command type.
|
|
70
|
-
Returns:
|
|
71
|
-
Build cargs function.
|
|
72
|
-
"""
|
|
73
|
-
return {
|
|
74
|
-
"tckresample": tckresample_cargs,
|
|
75
|
-
"line": tckresample_line_cargs,
|
|
76
|
-
"arc": tckresample_arc_cargs,
|
|
77
|
-
"config": tckresample_config_cargs,
|
|
78
|
-
}.get(t)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
def dyn_outputs(
|
|
82
|
-
t: str,
|
|
83
|
-
) -> typing.Any:
|
|
84
|
-
"""
|
|
85
|
-
Get build outputs function by command type.
|
|
86
|
-
|
|
87
|
-
Args:
|
|
88
|
-
t: Command type.
|
|
89
|
-
Returns:
|
|
90
|
-
Build outputs function.
|
|
91
|
-
"""
|
|
92
|
-
return {
|
|
93
|
-
"tckresample": tckresample_outputs,
|
|
94
|
-
}.get(t)
|
|
95
98
|
|
|
96
99
|
|
|
97
100
|
def tckresample_line_params(
|
|
98
101
|
num: int,
|
|
99
102
|
start: list[float],
|
|
100
103
|
end: list[float],
|
|
101
|
-
) ->
|
|
104
|
+
) -> TckresampleLineParametersTagged:
|
|
102
105
|
"""
|
|
103
106
|
Build parameters.
|
|
104
107
|
|
|
@@ -116,7 +119,7 @@ def tckresample_line_params(
|
|
|
116
119
|
Parameter dictionary
|
|
117
120
|
"""
|
|
118
121
|
params = {
|
|
119
|
-
"
|
|
122
|
+
"@type": "line",
|
|
120
123
|
"num": num,
|
|
121
124
|
"start": start,
|
|
122
125
|
"end": end,
|
|
@@ -139,9 +142,9 @@ def tckresample_line_cargs(
|
|
|
139
142
|
"""
|
|
140
143
|
cargs = []
|
|
141
144
|
cargs.append("-line")
|
|
142
|
-
cargs.append(str(params.get("num")))
|
|
143
|
-
cargs.append(",".join(map(str, params.get("start"))))
|
|
144
|
-
cargs.append(",".join(map(str, params.get("end"))))
|
|
145
|
+
cargs.append(str(params.get("num", None)))
|
|
146
|
+
cargs.append(",".join(map(str, params.get("start", None))))
|
|
147
|
+
cargs.append(",".join(map(str, params.get("end", None))))
|
|
145
148
|
return cargs
|
|
146
149
|
|
|
147
150
|
|
|
@@ -150,7 +153,7 @@ def tckresample_arc_params(
|
|
|
150
153
|
start: list[float],
|
|
151
154
|
mid: list[float],
|
|
152
155
|
end: list[float],
|
|
153
|
-
) ->
|
|
156
|
+
) -> TckresampleArcParametersTagged:
|
|
154
157
|
"""
|
|
155
158
|
Build parameters.
|
|
156
159
|
|
|
@@ -171,7 +174,7 @@ def tckresample_arc_params(
|
|
|
171
174
|
Parameter dictionary
|
|
172
175
|
"""
|
|
173
176
|
params = {
|
|
174
|
-
"
|
|
177
|
+
"@type": "arc",
|
|
175
178
|
"num": num,
|
|
176
179
|
"start": start,
|
|
177
180
|
"mid": mid,
|
|
@@ -195,17 +198,17 @@ def tckresample_arc_cargs(
|
|
|
195
198
|
"""
|
|
196
199
|
cargs = []
|
|
197
200
|
cargs.append("-arc")
|
|
198
|
-
cargs.append(str(params.get("num")))
|
|
199
|
-
cargs.append(",".join(map(str, params.get("start"))))
|
|
200
|
-
cargs.append(",".join(map(str, params.get("mid"))))
|
|
201
|
-
cargs.append(",".join(map(str, params.get("end"))))
|
|
201
|
+
cargs.append(str(params.get("num", None)))
|
|
202
|
+
cargs.append(",".join(map(str, params.get("start", None))))
|
|
203
|
+
cargs.append(",".join(map(str, params.get("mid", None))))
|
|
204
|
+
cargs.append(",".join(map(str, params.get("end", None))))
|
|
202
205
|
return cargs
|
|
203
206
|
|
|
204
207
|
|
|
205
208
|
def tckresample_config_params(
|
|
206
209
|
key: str,
|
|
207
210
|
value: str,
|
|
208
|
-
) ->
|
|
211
|
+
) -> TckresampleConfigParametersTagged:
|
|
209
212
|
"""
|
|
210
213
|
Build parameters.
|
|
211
214
|
|
|
@@ -216,7 +219,7 @@ def tckresample_config_params(
|
|
|
216
219
|
Parameter dictionary
|
|
217
220
|
"""
|
|
218
221
|
params = {
|
|
219
|
-
"
|
|
222
|
+
"@type": "config",
|
|
220
223
|
"key": key,
|
|
221
224
|
"value": value,
|
|
222
225
|
}
|
|
@@ -238,14 +241,14 @@ def tckresample_config_cargs(
|
|
|
238
241
|
"""
|
|
239
242
|
cargs = []
|
|
240
243
|
cargs.append("-config")
|
|
241
|
-
cargs.append(params.get("key"))
|
|
242
|
-
cargs.append(params.get("value"))
|
|
244
|
+
cargs.append(params.get("key", None))
|
|
245
|
+
cargs.append(params.get("value", None))
|
|
243
246
|
return cargs
|
|
244
247
|
|
|
245
248
|
|
|
246
249
|
class TckresampleOutputs(typing.NamedTuple):
|
|
247
250
|
"""
|
|
248
|
-
Output object returned when calling `
|
|
251
|
+
Output object returned when calling `TckresampleParameters(...)`.
|
|
249
252
|
"""
|
|
250
253
|
root: OutputPathType
|
|
251
254
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -271,7 +274,7 @@ def tckresample_params(
|
|
|
271
274
|
config: list[TckresampleConfigParameters] | None = None,
|
|
272
275
|
help_: bool = False,
|
|
273
276
|
version: bool = False,
|
|
274
|
-
) ->
|
|
277
|
+
) -> TckresampleParametersTagged:
|
|
275
278
|
"""
|
|
276
279
|
Build parameters.
|
|
277
280
|
|
|
@@ -308,7 +311,7 @@ def tckresample_params(
|
|
|
308
311
|
Parameter dictionary
|
|
309
312
|
"""
|
|
310
313
|
params = {
|
|
311
|
-
"
|
|
314
|
+
"@type": "mrtrix/tckresample",
|
|
312
315
|
"endpoints": endpoints,
|
|
313
316
|
"info": info,
|
|
314
317
|
"quiet": quiet,
|
|
@@ -353,53 +356,53 @@ def tckresample_cargs(
|
|
|
353
356
|
"""
|
|
354
357
|
cargs = []
|
|
355
358
|
cargs.append("tckresample")
|
|
356
|
-
if params.get("upsample") is not None:
|
|
359
|
+
if params.get("upsample", None) is not None:
|
|
357
360
|
cargs.extend([
|
|
358
361
|
"-upsample",
|
|
359
|
-
str(params.get("upsample"))
|
|
362
|
+
str(params.get("upsample", None))
|
|
360
363
|
])
|
|
361
|
-
if params.get("downsample") is not None:
|
|
364
|
+
if params.get("downsample", None) is not None:
|
|
362
365
|
cargs.extend([
|
|
363
366
|
"-downsample",
|
|
364
|
-
str(params.get("downsample"))
|
|
367
|
+
str(params.get("downsample", None))
|
|
365
368
|
])
|
|
366
|
-
if params.get("step_size") is not None:
|
|
369
|
+
if params.get("step_size", None) is not None:
|
|
367
370
|
cargs.extend([
|
|
368
371
|
"-step_size",
|
|
369
|
-
str(params.get("step_size"))
|
|
372
|
+
str(params.get("step_size", None))
|
|
370
373
|
])
|
|
371
|
-
if params.get("num_points") is not None:
|
|
374
|
+
if params.get("num_points", None) is not None:
|
|
372
375
|
cargs.extend([
|
|
373
376
|
"-num_points",
|
|
374
|
-
str(params.get("num_points"))
|
|
377
|
+
str(params.get("num_points", None))
|
|
375
378
|
])
|
|
376
|
-
if params.get("endpoints"):
|
|
379
|
+
if params.get("endpoints", False):
|
|
377
380
|
cargs.append("-endpoints")
|
|
378
|
-
if params.get("line") is not None:
|
|
379
|
-
cargs.extend(
|
|
380
|
-
if params.get("arc") is not None:
|
|
381
|
-
cargs.extend(
|
|
382
|
-
if params.get("info"):
|
|
381
|
+
if params.get("line", None) is not None:
|
|
382
|
+
cargs.extend(tckresample_line_cargs(params.get("line", None), execution))
|
|
383
|
+
if params.get("arc", None) is not None:
|
|
384
|
+
cargs.extend(tckresample_arc_cargs(params.get("arc", None), execution))
|
|
385
|
+
if params.get("info", False):
|
|
383
386
|
cargs.append("-info")
|
|
384
|
-
if params.get("quiet"):
|
|
387
|
+
if params.get("quiet", False):
|
|
385
388
|
cargs.append("-quiet")
|
|
386
|
-
if params.get("debug"):
|
|
389
|
+
if params.get("debug", False):
|
|
387
390
|
cargs.append("-debug")
|
|
388
|
-
if params.get("force"):
|
|
391
|
+
if params.get("force", False):
|
|
389
392
|
cargs.append("-force")
|
|
390
|
-
if params.get("nthreads") is not None:
|
|
393
|
+
if params.get("nthreads", None) is not None:
|
|
391
394
|
cargs.extend([
|
|
392
395
|
"-nthreads",
|
|
393
|
-
str(params.get("nthreads"))
|
|
396
|
+
str(params.get("nthreads", None))
|
|
394
397
|
])
|
|
395
|
-
if params.get("config") is not None:
|
|
396
|
-
cargs.extend([a for c in [
|
|
397
|
-
if params.get("help"):
|
|
398
|
+
if params.get("config", None) is not None:
|
|
399
|
+
cargs.extend([a for c in [tckresample_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
400
|
+
if params.get("help", False):
|
|
398
401
|
cargs.append("-help")
|
|
399
|
-
if params.get("version"):
|
|
402
|
+
if params.get("version", False):
|
|
400
403
|
cargs.append("-version")
|
|
401
|
-
cargs.append(execution.input_file(params.get("in_tracks")))
|
|
402
|
-
cargs.append(params.get("out_tracks"))
|
|
404
|
+
cargs.append(execution.input_file(params.get("in_tracks", None)))
|
|
405
|
+
cargs.append(params.get("out_tracks", None))
|
|
403
406
|
return cargs
|
|
404
407
|
|
|
405
408
|
|
|
@@ -418,16 +421,18 @@ def tckresample_outputs(
|
|
|
418
421
|
"""
|
|
419
422
|
ret = TckresampleOutputs(
|
|
420
423
|
root=execution.output_file("."),
|
|
421
|
-
out_tracks=execution.output_file(params.get("out_tracks")),
|
|
424
|
+
out_tracks=execution.output_file(params.get("out_tracks", None)),
|
|
422
425
|
)
|
|
423
426
|
return ret
|
|
424
427
|
|
|
425
428
|
|
|
426
429
|
def tckresample_execute(
|
|
427
430
|
params: TckresampleParameters,
|
|
428
|
-
|
|
431
|
+
runner: Runner | None = None,
|
|
429
432
|
) -> TckresampleOutputs:
|
|
430
433
|
"""
|
|
434
|
+
tckresample
|
|
435
|
+
|
|
431
436
|
Resample each streamline in a track file to a new set of vertices.
|
|
432
437
|
|
|
433
438
|
It is necessary to specify precisely ONE of the command-line options for
|
|
@@ -453,10 +458,12 @@ def tckresample_execute(
|
|
|
453
458
|
|
|
454
459
|
Args:
|
|
455
460
|
params: The parameters.
|
|
456
|
-
|
|
461
|
+
runner: Command runner.
|
|
457
462
|
Returns:
|
|
458
463
|
NamedTuple of outputs (described in `TckresampleOutputs`).
|
|
459
464
|
"""
|
|
465
|
+
runner = runner or get_global_runner()
|
|
466
|
+
execution = runner.start_execution(TCKRESAMPLE_METADATA)
|
|
460
467
|
params = execution.params(params)
|
|
461
468
|
cargs = tckresample_cargs(params, execution)
|
|
462
469
|
ret = tckresample_outputs(params, execution)
|
|
@@ -485,6 +492,8 @@ def tckresample(
|
|
|
485
492
|
runner: Runner | None = None,
|
|
486
493
|
) -> TckresampleOutputs:
|
|
487
494
|
"""
|
|
495
|
+
tckresample
|
|
496
|
+
|
|
488
497
|
Resample each streamline in a track file to a new set of vertices.
|
|
489
498
|
|
|
490
499
|
It is necessary to specify precisely ONE of the command-line options for
|
|
@@ -541,8 +550,6 @@ def tckresample(
|
|
|
541
550
|
Returns:
|
|
542
551
|
NamedTuple of outputs (described in `TckresampleOutputs`).
|
|
543
552
|
"""
|
|
544
|
-
runner = runner or get_global_runner()
|
|
545
|
-
execution = runner.start_execution(TCKRESAMPLE_METADATA)
|
|
546
553
|
params = tckresample_params(
|
|
547
554
|
upsample=upsample,
|
|
548
555
|
downsample=downsample,
|
|
@@ -562,19 +569,16 @@ def tckresample(
|
|
|
562
569
|
in_tracks=in_tracks,
|
|
563
570
|
out_tracks=out_tracks,
|
|
564
571
|
)
|
|
565
|
-
return tckresample_execute(params,
|
|
572
|
+
return tckresample_execute(params, runner)
|
|
566
573
|
|
|
567
574
|
|
|
568
575
|
__all__ = [
|
|
569
576
|
"TCKRESAMPLE_METADATA",
|
|
570
|
-
"TckresampleArcParameters",
|
|
571
|
-
"TckresampleConfigParameters",
|
|
572
|
-
"TckresampleLineParameters",
|
|
573
577
|
"TckresampleOutputs",
|
|
574
|
-
"TckresampleParameters",
|
|
575
578
|
"tckresample",
|
|
576
579
|
"tckresample_arc_params",
|
|
577
580
|
"tckresample_config_params",
|
|
581
|
+
"tckresample_execute",
|
|
578
582
|
"tckresample_line_params",
|
|
579
583
|
"tckresample_params",
|
|
580
584
|
]
|
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
TCKSAMPLE_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="274c00456de615fd846529a52bdcb4684c1c52eb.boutiques",
|
|
10
10
|
name="tcksample",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,37 @@ TCKSAMPLE_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
TcksampleConfigParameters = typing.TypedDict('TcksampleConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
TcksampleConfigParametersTagged = typing.TypedDict('TcksampleConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
TcksampleParameters = typing.TypedDict('TcksampleParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/tcksample"]],
|
|
30
|
+
"stat_tck": typing.NotRequired[str | None],
|
|
31
|
+
"nointerp": bool,
|
|
32
|
+
"precise": bool,
|
|
33
|
+
"use_tdi_fraction": bool,
|
|
34
|
+
"info": bool,
|
|
35
|
+
"quiet": bool,
|
|
36
|
+
"debug": bool,
|
|
37
|
+
"force": bool,
|
|
38
|
+
"nthreads": typing.NotRequired[int | None],
|
|
39
|
+
"config": typing.NotRequired[list[TcksampleConfigParameters] | None],
|
|
40
|
+
"help": bool,
|
|
41
|
+
"version": bool,
|
|
42
|
+
"tracks": InputPathType,
|
|
43
|
+
"image": InputPathType,
|
|
44
|
+
"values": str,
|
|
45
|
+
})
|
|
46
|
+
TcksampleParametersTagged = typing.TypedDict('TcksampleParametersTagged', {
|
|
47
|
+
"@type": typing.Literal["mrtrix/tcksample"],
|
|
25
48
|
"stat_tck": typing.NotRequired[str | None],
|
|
26
49
|
"nointerp": bool,
|
|
27
50
|
"precise": bool,
|
|
@@ -38,45 +61,12 @@ TcksampleParameters = typing.TypedDict('TcksampleParameters', {
|
|
|
38
61
|
"image": InputPathType,
|
|
39
62
|
"values": 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
|
-
"tcksample": tcksample_cargs,
|
|
56
|
-
"config": tcksample_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
|
-
"tcksample": tcksample_outputs,
|
|
73
|
-
}.get(t)
|
|
74
64
|
|
|
75
65
|
|
|
76
66
|
def tcksample_config_params(
|
|
77
67
|
key: str,
|
|
78
68
|
value: str,
|
|
79
|
-
) ->
|
|
69
|
+
) -> TcksampleConfigParametersTagged:
|
|
80
70
|
"""
|
|
81
71
|
Build parameters.
|
|
82
72
|
|
|
@@ -87,7 +77,7 @@ def tcksample_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 tcksample_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 TcksampleOutputs(typing.NamedTuple):
|
|
118
108
|
"""
|
|
119
|
-
Output object returned when calling `
|
|
109
|
+
Output object returned when calling `TcksampleParameters(...)`.
|
|
120
110
|
"""
|
|
121
111
|
root: OutputPathType
|
|
122
112
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -140,7 +130,7 @@ def tcksample_params(
|
|
|
140
130
|
config: list[TcksampleConfigParameters] | None = None,
|
|
141
131
|
help_: bool = False,
|
|
142
132
|
version: bool = False,
|
|
143
|
-
) ->
|
|
133
|
+
) -> TcksampleParametersTagged:
|
|
144
134
|
"""
|
|
145
135
|
Build parameters.
|
|
146
136
|
|
|
@@ -175,7 +165,7 @@ def tcksample_params(
|
|
|
175
165
|
Parameter dictionary
|
|
176
166
|
"""
|
|
177
167
|
params = {
|
|
178
|
-
"
|
|
168
|
+
"@type": "mrtrix/tcksample",
|
|
179
169
|
"nointerp": nointerp,
|
|
180
170
|
"precise": precise,
|
|
181
171
|
"use_tdi_fraction": use_tdi_fraction,
|
|
@@ -213,39 +203,39 @@ def tcksample_cargs(
|
|
|
213
203
|
"""
|
|
214
204
|
cargs = []
|
|
215
205
|
cargs.append("tcksample")
|
|
216
|
-
if params.get("stat_tck") is not None:
|
|
206
|
+
if params.get("stat_tck", None) is not None:
|
|
217
207
|
cargs.extend([
|
|
218
208
|
"-stat_tck",
|
|
219
|
-
params.get("stat_tck")
|
|
209
|
+
params.get("stat_tck", None)
|
|
220
210
|
])
|
|
221
|
-
if params.get("nointerp"):
|
|
211
|
+
if params.get("nointerp", False):
|
|
222
212
|
cargs.append("-nointerp")
|
|
223
|
-
if params.get("precise"):
|
|
213
|
+
if params.get("precise", False):
|
|
224
214
|
cargs.append("-precise")
|
|
225
|
-
if params.get("use_tdi_fraction"):
|
|
215
|
+
if params.get("use_tdi_fraction", False):
|
|
226
216
|
cargs.append("-use_tdi_fraction")
|
|
227
|
-
if params.get("info"):
|
|
217
|
+
if params.get("info", False):
|
|
228
218
|
cargs.append("-info")
|
|
229
|
-
if params.get("quiet"):
|
|
219
|
+
if params.get("quiet", False):
|
|
230
220
|
cargs.append("-quiet")
|
|
231
|
-
if params.get("debug"):
|
|
221
|
+
if params.get("debug", False):
|
|
232
222
|
cargs.append("-debug")
|
|
233
|
-
if params.get("force"):
|
|
223
|
+
if params.get("force", False):
|
|
234
224
|
cargs.append("-force")
|
|
235
|
-
if params.get("nthreads") is not None:
|
|
225
|
+
if params.get("nthreads", None) is not None:
|
|
236
226
|
cargs.extend([
|
|
237
227
|
"-nthreads",
|
|
238
|
-
str(params.get("nthreads"))
|
|
228
|
+
str(params.get("nthreads", None))
|
|
239
229
|
])
|
|
240
|
-
if params.get("config") is not None:
|
|
241
|
-
cargs.extend([a for c in [
|
|
242
|
-
if params.get("help"):
|
|
230
|
+
if params.get("config", None) is not None:
|
|
231
|
+
cargs.extend([a for c in [tcksample_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
232
|
+
if params.get("help", False):
|
|
243
233
|
cargs.append("-help")
|
|
244
|
-
if params.get("version"):
|
|
234
|
+
if params.get("version", False):
|
|
245
235
|
cargs.append("-version")
|
|
246
|
-
cargs.append(execution.input_file(params.get("tracks")))
|
|
247
|
-
cargs.append(execution.input_file(params.get("image")))
|
|
248
|
-
cargs.append(params.get("values"))
|
|
236
|
+
cargs.append(execution.input_file(params.get("tracks", None)))
|
|
237
|
+
cargs.append(execution.input_file(params.get("image", None)))
|
|
238
|
+
cargs.append(params.get("values", None))
|
|
249
239
|
return cargs
|
|
250
240
|
|
|
251
241
|
|
|
@@ -264,16 +254,18 @@ def tcksample_outputs(
|
|
|
264
254
|
"""
|
|
265
255
|
ret = TcksampleOutputs(
|
|
266
256
|
root=execution.output_file("."),
|
|
267
|
-
values_=execution.output_file(params.get("values")),
|
|
257
|
+
values_=execution.output_file(params.get("values", None)),
|
|
268
258
|
)
|
|
269
259
|
return ret
|
|
270
260
|
|
|
271
261
|
|
|
272
262
|
def tcksample_execute(
|
|
273
263
|
params: TcksampleParameters,
|
|
274
|
-
|
|
264
|
+
runner: Runner | None = None,
|
|
275
265
|
) -> TcksampleOutputs:
|
|
276
266
|
"""
|
|
267
|
+
tcksample
|
|
268
|
+
|
|
277
269
|
Sample values of an associated image along tracks.
|
|
278
270
|
|
|
279
271
|
By default, the value of the underlying image at each point along the track
|
|
@@ -293,10 +285,12 @@ def tcksample_execute(
|
|
|
293
285
|
|
|
294
286
|
Args:
|
|
295
287
|
params: The parameters.
|
|
296
|
-
|
|
288
|
+
runner: Command runner.
|
|
297
289
|
Returns:
|
|
298
290
|
NamedTuple of outputs (described in `TcksampleOutputs`).
|
|
299
291
|
"""
|
|
292
|
+
runner = runner or get_global_runner()
|
|
293
|
+
execution = runner.start_execution(TCKSAMPLE_METADATA)
|
|
300
294
|
params = execution.params(params)
|
|
301
295
|
cargs = tcksample_cargs(params, execution)
|
|
302
296
|
ret = tcksample_outputs(params, execution)
|
|
@@ -323,6 +317,8 @@ def tcksample(
|
|
|
323
317
|
runner: Runner | None = None,
|
|
324
318
|
) -> TcksampleOutputs:
|
|
325
319
|
"""
|
|
320
|
+
tcksample
|
|
321
|
+
|
|
326
322
|
Sample values of an associated image along tracks.
|
|
327
323
|
|
|
328
324
|
By default, the value of the underlying image at each point along the track
|
|
@@ -371,8 +367,6 @@ def tcksample(
|
|
|
371
367
|
Returns:
|
|
372
368
|
NamedTuple of outputs (described in `TcksampleOutputs`).
|
|
373
369
|
"""
|
|
374
|
-
runner = runner or get_global_runner()
|
|
375
|
-
execution = runner.start_execution(TCKSAMPLE_METADATA)
|
|
376
370
|
params = tcksample_params(
|
|
377
371
|
stat_tck=stat_tck,
|
|
378
372
|
nointerp=nointerp,
|
|
@@ -390,15 +384,14 @@ def tcksample(
|
|
|
390
384
|
image=image,
|
|
391
385
|
values_=values_,
|
|
392
386
|
)
|
|
393
|
-
return tcksample_execute(params,
|
|
387
|
+
return tcksample_execute(params, runner)
|
|
394
388
|
|
|
395
389
|
|
|
396
390
|
__all__ = [
|
|
397
391
|
"TCKSAMPLE_METADATA",
|
|
398
|
-
"TcksampleConfigParameters",
|
|
399
392
|
"TcksampleOutputs",
|
|
400
|
-
"TcksampleParameters",
|
|
401
393
|
"tcksample",
|
|
402
394
|
"tcksample_config_params",
|
|
395
|
+
"tcksample_execute",
|
|
403
396
|
"tcksample_params",
|
|
404
397
|
]
|