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
|
FIXELCORRESPONDENCE_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="0cdb6d5a0f6fc504a73335d26a91aed6bead44ba.boutiques",
|
|
10
10
|
name="fixelcorrespondence",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,35 @@ FIXELCORRESPONDENCE_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
FixelcorrespondenceConfigParameters = typing.TypedDict('FixelcorrespondenceConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
FixelcorrespondenceConfigParametersTagged = typing.TypedDict('FixelcorrespondenceConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
FixelcorrespondenceParameters = typing.TypedDict('FixelcorrespondenceParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/fixelcorrespondence"]],
|
|
30
|
+
"angle": typing.NotRequired[float | None],
|
|
31
|
+
"info": bool,
|
|
32
|
+
"quiet": bool,
|
|
33
|
+
"debug": bool,
|
|
34
|
+
"force": bool,
|
|
35
|
+
"nthreads": typing.NotRequired[int | None],
|
|
36
|
+
"config": typing.NotRequired[list[FixelcorrespondenceConfigParameters] | None],
|
|
37
|
+
"help": bool,
|
|
38
|
+
"version": bool,
|
|
39
|
+
"subject_data": InputPathType,
|
|
40
|
+
"template_directory": InputPathType,
|
|
41
|
+
"output_directory": str,
|
|
42
|
+
"output_data": str,
|
|
43
|
+
})
|
|
44
|
+
FixelcorrespondenceParametersTagged = typing.TypedDict('FixelcorrespondenceParametersTagged', {
|
|
45
|
+
"@type": typing.Literal["mrtrix/fixelcorrespondence"],
|
|
25
46
|
"angle": typing.NotRequired[float | None],
|
|
26
47
|
"info": bool,
|
|
27
48
|
"quiet": bool,
|
|
@@ -36,44 +57,12 @@ FixelcorrespondenceParameters = typing.TypedDict('FixelcorrespondenceParameters'
|
|
|
36
57
|
"output_directory": str,
|
|
37
58
|
"output_data": 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
|
-
"fixelcorrespondence": fixelcorrespondence_cargs,
|
|
54
|
-
"config": fixelcorrespondence_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
|
-
}.get(t)
|
|
71
60
|
|
|
72
61
|
|
|
73
62
|
def fixelcorrespondence_config_params(
|
|
74
63
|
key: str,
|
|
75
64
|
value: str,
|
|
76
|
-
) ->
|
|
65
|
+
) -> FixelcorrespondenceConfigParametersTagged:
|
|
77
66
|
"""
|
|
78
67
|
Build parameters.
|
|
79
68
|
|
|
@@ -84,7 +73,7 @@ def fixelcorrespondence_config_params(
|
|
|
84
73
|
Parameter dictionary
|
|
85
74
|
"""
|
|
86
75
|
params = {
|
|
87
|
-
"
|
|
76
|
+
"@type": "config",
|
|
88
77
|
"key": key,
|
|
89
78
|
"value": value,
|
|
90
79
|
}
|
|
@@ -106,14 +95,14 @@ def fixelcorrespondence_config_cargs(
|
|
|
106
95
|
"""
|
|
107
96
|
cargs = []
|
|
108
97
|
cargs.append("-config")
|
|
109
|
-
cargs.append(params.get("key"))
|
|
110
|
-
cargs.append(params.get("value"))
|
|
98
|
+
cargs.append(params.get("key", None))
|
|
99
|
+
cargs.append(params.get("value", None))
|
|
111
100
|
return cargs
|
|
112
101
|
|
|
113
102
|
|
|
114
103
|
class FixelcorrespondenceOutputs(typing.NamedTuple):
|
|
115
104
|
"""
|
|
116
|
-
Output object returned when calling `
|
|
105
|
+
Output object returned when calling `FixelcorrespondenceParameters(...)`.
|
|
117
106
|
"""
|
|
118
107
|
root: OutputPathType
|
|
119
108
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -133,7 +122,7 @@ def fixelcorrespondence_params(
|
|
|
133
122
|
config: list[FixelcorrespondenceConfigParameters] | None = None,
|
|
134
123
|
help_: bool = False,
|
|
135
124
|
version: bool = False,
|
|
136
|
-
) ->
|
|
125
|
+
) -> FixelcorrespondenceParametersTagged:
|
|
137
126
|
"""
|
|
138
127
|
Build parameters.
|
|
139
128
|
|
|
@@ -163,7 +152,7 @@ def fixelcorrespondence_params(
|
|
|
163
152
|
Parameter dictionary
|
|
164
153
|
"""
|
|
165
154
|
params = {
|
|
166
|
-
"
|
|
155
|
+
"@type": "mrtrix/fixelcorrespondence",
|
|
167
156
|
"info": info,
|
|
168
157
|
"quiet": quiet,
|
|
169
158
|
"debug": debug,
|
|
@@ -199,34 +188,34 @@ def fixelcorrespondence_cargs(
|
|
|
199
188
|
"""
|
|
200
189
|
cargs = []
|
|
201
190
|
cargs.append("fixelcorrespondence")
|
|
202
|
-
if params.get("angle") is not None:
|
|
191
|
+
if params.get("angle", None) is not None:
|
|
203
192
|
cargs.extend([
|
|
204
193
|
"-angle",
|
|
205
|
-
str(params.get("angle"))
|
|
194
|
+
str(params.get("angle", None))
|
|
206
195
|
])
|
|
207
|
-
if params.get("info"):
|
|
196
|
+
if params.get("info", False):
|
|
208
197
|
cargs.append("-info")
|
|
209
|
-
if params.get("quiet"):
|
|
198
|
+
if params.get("quiet", False):
|
|
210
199
|
cargs.append("-quiet")
|
|
211
|
-
if params.get("debug"):
|
|
200
|
+
if params.get("debug", False):
|
|
212
201
|
cargs.append("-debug")
|
|
213
|
-
if params.get("force"):
|
|
202
|
+
if params.get("force", False):
|
|
214
203
|
cargs.append("-force")
|
|
215
|
-
if params.get("nthreads") is not None:
|
|
204
|
+
if params.get("nthreads", None) is not None:
|
|
216
205
|
cargs.extend([
|
|
217
206
|
"-nthreads",
|
|
218
|
-
str(params.get("nthreads"))
|
|
207
|
+
str(params.get("nthreads", None))
|
|
219
208
|
])
|
|
220
|
-
if params.get("config") is not None:
|
|
221
|
-
cargs.extend([a for c in [
|
|
222
|
-
if params.get("help"):
|
|
209
|
+
if params.get("config", None) is not None:
|
|
210
|
+
cargs.extend([a for c in [fixelcorrespondence_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
211
|
+
if params.get("help", False):
|
|
223
212
|
cargs.append("-help")
|
|
224
|
-
if params.get("version"):
|
|
213
|
+
if params.get("version", False):
|
|
225
214
|
cargs.append("-version")
|
|
226
|
-
cargs.append(execution.input_file(params.get("subject_data")))
|
|
227
|
-
cargs.append(execution.input_file(params.get("template_directory")))
|
|
228
|
-
cargs.append(params.get("output_directory"))
|
|
229
|
-
cargs.append(params.get("output_data"))
|
|
215
|
+
cargs.append(execution.input_file(params.get("subject_data", None)))
|
|
216
|
+
cargs.append(execution.input_file(params.get("template_directory", None)))
|
|
217
|
+
cargs.append(params.get("output_directory", None))
|
|
218
|
+
cargs.append(params.get("output_data", None))
|
|
230
219
|
return cargs
|
|
231
220
|
|
|
232
221
|
|
|
@@ -251,11 +240,13 @@ def fixelcorrespondence_outputs(
|
|
|
251
240
|
|
|
252
241
|
def fixelcorrespondence_execute(
|
|
253
242
|
params: FixelcorrespondenceParameters,
|
|
254
|
-
|
|
243
|
+
runner: Runner | None = None,
|
|
255
244
|
) -> FixelcorrespondenceOutputs:
|
|
256
245
|
"""
|
|
257
|
-
|
|
258
|
-
|
|
246
|
+
fixelcorrespondence
|
|
247
|
+
|
|
248
|
+
Obtain fixel-fixel correpondence between a subject fixel image and a
|
|
249
|
+
template fixel mask.
|
|
259
250
|
|
|
260
251
|
It is assumed that the subject image has already been spatially normalised
|
|
261
252
|
and is aligned with the template. The output fixel image will have the same
|
|
@@ -271,10 +262,12 @@ def fixelcorrespondence_execute(
|
|
|
271
262
|
|
|
272
263
|
Args:
|
|
273
264
|
params: The parameters.
|
|
274
|
-
|
|
265
|
+
runner: Command runner.
|
|
275
266
|
Returns:
|
|
276
267
|
NamedTuple of outputs (described in `FixelcorrespondenceOutputs`).
|
|
277
268
|
"""
|
|
269
|
+
runner = runner or get_global_runner()
|
|
270
|
+
execution = runner.start_execution(FIXELCORRESPONDENCE_METADATA)
|
|
278
271
|
params = execution.params(params)
|
|
279
272
|
cargs = fixelcorrespondence_cargs(params, execution)
|
|
280
273
|
ret = fixelcorrespondence_outputs(params, execution)
|
|
@@ -299,8 +292,10 @@ def fixelcorrespondence(
|
|
|
299
292
|
runner: Runner | None = None,
|
|
300
293
|
) -> FixelcorrespondenceOutputs:
|
|
301
294
|
"""
|
|
302
|
-
|
|
303
|
-
|
|
295
|
+
fixelcorrespondence
|
|
296
|
+
|
|
297
|
+
Obtain fixel-fixel correpondence between a subject fixel image and a
|
|
298
|
+
template fixel mask.
|
|
304
299
|
|
|
305
300
|
It is assumed that the subject image has already been spatially normalised
|
|
306
301
|
and is aligned with the template. The output fixel image will have the same
|
|
@@ -340,8 +335,6 @@ def fixelcorrespondence(
|
|
|
340
335
|
Returns:
|
|
341
336
|
NamedTuple of outputs (described in `FixelcorrespondenceOutputs`).
|
|
342
337
|
"""
|
|
343
|
-
runner = runner or get_global_runner()
|
|
344
|
-
execution = runner.start_execution(FIXELCORRESPONDENCE_METADATA)
|
|
345
338
|
params = fixelcorrespondence_params(
|
|
346
339
|
angle=angle,
|
|
347
340
|
info=info,
|
|
@@ -357,15 +350,14 @@ def fixelcorrespondence(
|
|
|
357
350
|
output_directory=output_directory,
|
|
358
351
|
output_data=output_data,
|
|
359
352
|
)
|
|
360
|
-
return fixelcorrespondence_execute(params,
|
|
353
|
+
return fixelcorrespondence_execute(params, runner)
|
|
361
354
|
|
|
362
355
|
|
|
363
356
|
__all__ = [
|
|
364
357
|
"FIXELCORRESPONDENCE_METADATA",
|
|
365
|
-
"FixelcorrespondenceConfigParameters",
|
|
366
358
|
"FixelcorrespondenceOutputs",
|
|
367
|
-
"FixelcorrespondenceParameters",
|
|
368
359
|
"fixelcorrespondence",
|
|
369
360
|
"fixelcorrespondence_config_params",
|
|
361
|
+
"fixelcorrespondence_execute",
|
|
370
362
|
"fixelcorrespondence_params",
|
|
371
363
|
]
|
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
FIXELCROP_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="d70da385bb1143b77638a918a070ee631393b7f4.boutiques",
|
|
10
10
|
name="fixelcrop",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,14 +14,33 @@ FIXELCROP_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
FixelcropConfigParameters = typing.TypedDict('FixelcropConfigParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
FixelcropConfigParametersTagged = typing.TypedDict('FixelcropConfigParametersTagged', {
|
|
22
|
+
"@type": typing.Literal["config"],
|
|
18
23
|
"key": str,
|
|
19
24
|
"value": str,
|
|
20
25
|
})
|
|
21
26
|
|
|
22
27
|
|
|
23
28
|
FixelcropParameters = typing.TypedDict('FixelcropParameters', {
|
|
24
|
-
"
|
|
29
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/fixelcrop"]],
|
|
30
|
+
"info": bool,
|
|
31
|
+
"quiet": bool,
|
|
32
|
+
"debug": bool,
|
|
33
|
+
"force": bool,
|
|
34
|
+
"nthreads": typing.NotRequired[int | None],
|
|
35
|
+
"config": typing.NotRequired[list[FixelcropConfigParameters] | None],
|
|
36
|
+
"help": bool,
|
|
37
|
+
"version": bool,
|
|
38
|
+
"input_fixel_directory": InputPathType,
|
|
39
|
+
"input_fixel_mask": InputPathType,
|
|
40
|
+
"output_fixel_directory": str,
|
|
41
|
+
})
|
|
42
|
+
FixelcropParametersTagged = typing.TypedDict('FixelcropParametersTagged', {
|
|
43
|
+
"@type": typing.Literal["mrtrix/fixelcrop"],
|
|
25
44
|
"info": bool,
|
|
26
45
|
"quiet": bool,
|
|
27
46
|
"debug": bool,
|
|
@@ -34,45 +53,12 @@ FixelcropParameters = typing.TypedDict('FixelcropParameters', {
|
|
|
34
53
|
"input_fixel_mask": InputPathType,
|
|
35
54
|
"output_fixel_directory": str,
|
|
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
|
-
"fixelcrop": fixelcrop_cargs,
|
|
52
|
-
"config": fixelcrop_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
|
-
"fixelcrop": fixelcrop_outputs,
|
|
69
|
-
}.get(t)
|
|
70
56
|
|
|
71
57
|
|
|
72
58
|
def fixelcrop_config_params(
|
|
73
59
|
key: str,
|
|
74
60
|
value: str,
|
|
75
|
-
) ->
|
|
61
|
+
) -> FixelcropConfigParametersTagged:
|
|
76
62
|
"""
|
|
77
63
|
Build parameters.
|
|
78
64
|
|
|
@@ -83,7 +69,7 @@ def fixelcrop_config_params(
|
|
|
83
69
|
Parameter dictionary
|
|
84
70
|
"""
|
|
85
71
|
params = {
|
|
86
|
-
"
|
|
72
|
+
"@type": "config",
|
|
87
73
|
"key": key,
|
|
88
74
|
"value": value,
|
|
89
75
|
}
|
|
@@ -105,14 +91,14 @@ def fixelcrop_config_cargs(
|
|
|
105
91
|
"""
|
|
106
92
|
cargs = []
|
|
107
93
|
cargs.append("-config")
|
|
108
|
-
cargs.append(params.get("key"))
|
|
109
|
-
cargs.append(params.get("value"))
|
|
94
|
+
cargs.append(params.get("key", None))
|
|
95
|
+
cargs.append(params.get("value", None))
|
|
110
96
|
return cargs
|
|
111
97
|
|
|
112
98
|
|
|
113
99
|
class FixelcropOutputs(typing.NamedTuple):
|
|
114
100
|
"""
|
|
115
|
-
Output object returned when calling `
|
|
101
|
+
Output object returned when calling `FixelcropParameters(...)`.
|
|
116
102
|
"""
|
|
117
103
|
root: OutputPathType
|
|
118
104
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -132,7 +118,7 @@ def fixelcrop_params(
|
|
|
132
118
|
config: list[FixelcropConfigParameters] | None = None,
|
|
133
119
|
help_: bool = False,
|
|
134
120
|
version: bool = False,
|
|
135
|
-
) ->
|
|
121
|
+
) -> FixelcropParametersTagged:
|
|
136
122
|
"""
|
|
137
123
|
Build parameters.
|
|
138
124
|
|
|
@@ -159,7 +145,7 @@ def fixelcrop_params(
|
|
|
159
145
|
Parameter dictionary
|
|
160
146
|
"""
|
|
161
147
|
params = {
|
|
162
|
-
"
|
|
148
|
+
"@type": "mrtrix/fixelcrop",
|
|
163
149
|
"info": info,
|
|
164
150
|
"quiet": quiet,
|
|
165
151
|
"debug": debug,
|
|
@@ -192,28 +178,28 @@ def fixelcrop_cargs(
|
|
|
192
178
|
"""
|
|
193
179
|
cargs = []
|
|
194
180
|
cargs.append("fixelcrop")
|
|
195
|
-
if params.get("info"):
|
|
181
|
+
if params.get("info", False):
|
|
196
182
|
cargs.append("-info")
|
|
197
|
-
if params.get("quiet"):
|
|
183
|
+
if params.get("quiet", False):
|
|
198
184
|
cargs.append("-quiet")
|
|
199
|
-
if params.get("debug"):
|
|
185
|
+
if params.get("debug", False):
|
|
200
186
|
cargs.append("-debug")
|
|
201
|
-
if params.get("force"):
|
|
187
|
+
if params.get("force", False):
|
|
202
188
|
cargs.append("-force")
|
|
203
|
-
if params.get("nthreads") is not None:
|
|
189
|
+
if params.get("nthreads", None) is not None:
|
|
204
190
|
cargs.extend([
|
|
205
191
|
"-nthreads",
|
|
206
|
-
str(params.get("nthreads"))
|
|
192
|
+
str(params.get("nthreads", None))
|
|
207
193
|
])
|
|
208
|
-
if params.get("config") is not None:
|
|
209
|
-
cargs.extend([a for c in [
|
|
210
|
-
if params.get("help"):
|
|
194
|
+
if params.get("config", None) is not None:
|
|
195
|
+
cargs.extend([a for c in [fixelcrop_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
196
|
+
if params.get("help", False):
|
|
211
197
|
cargs.append("-help")
|
|
212
|
-
if params.get("version"):
|
|
198
|
+
if params.get("version", False):
|
|
213
199
|
cargs.append("-version")
|
|
214
|
-
cargs.append(execution.input_file(params.get("input_fixel_directory")))
|
|
215
|
-
cargs.append(execution.input_file(params.get("input_fixel_mask")))
|
|
216
|
-
cargs.append(params.get("output_fixel_directory"))
|
|
200
|
+
cargs.append(execution.input_file(params.get("input_fixel_directory", None)))
|
|
201
|
+
cargs.append(execution.input_file(params.get("input_fixel_mask", None)))
|
|
202
|
+
cargs.append(params.get("output_fixel_directory", None))
|
|
217
203
|
return cargs
|
|
218
204
|
|
|
219
205
|
|
|
@@ -232,16 +218,18 @@ def fixelcrop_outputs(
|
|
|
232
218
|
"""
|
|
233
219
|
ret = FixelcropOutputs(
|
|
234
220
|
root=execution.output_file("."),
|
|
235
|
-
output_fixel_directory=execution.output_file(params.get("output_fixel_directory")),
|
|
221
|
+
output_fixel_directory=execution.output_file(params.get("output_fixel_directory", None)),
|
|
236
222
|
)
|
|
237
223
|
return ret
|
|
238
224
|
|
|
239
225
|
|
|
240
226
|
def fixelcrop_execute(
|
|
241
227
|
params: FixelcropParameters,
|
|
242
|
-
|
|
228
|
+
runner: Runner | None = None,
|
|
243
229
|
) -> FixelcropOutputs:
|
|
244
230
|
"""
|
|
231
|
+
fixelcrop
|
|
232
|
+
|
|
245
233
|
Crop/remove fixels from sparse fixel image using a binary fixel mask.
|
|
246
234
|
|
|
247
235
|
The mask must be input as a fixel data file the same dimensions as the fixel
|
|
@@ -257,10 +245,12 @@ def fixelcrop_execute(
|
|
|
257
245
|
|
|
258
246
|
Args:
|
|
259
247
|
params: The parameters.
|
|
260
|
-
|
|
248
|
+
runner: Command runner.
|
|
261
249
|
Returns:
|
|
262
250
|
NamedTuple of outputs (described in `FixelcropOutputs`).
|
|
263
251
|
"""
|
|
252
|
+
runner = runner or get_global_runner()
|
|
253
|
+
execution = runner.start_execution(FIXELCROP_METADATA)
|
|
264
254
|
params = execution.params(params)
|
|
265
255
|
cargs = fixelcrop_cargs(params, execution)
|
|
266
256
|
ret = fixelcrop_outputs(params, execution)
|
|
@@ -283,6 +273,8 @@ def fixelcrop(
|
|
|
283
273
|
runner: Runner | None = None,
|
|
284
274
|
) -> FixelcropOutputs:
|
|
285
275
|
"""
|
|
276
|
+
fixelcrop
|
|
277
|
+
|
|
286
278
|
Crop/remove fixels from sparse fixel image using a binary fixel mask.
|
|
287
279
|
|
|
288
280
|
The mask must be input as a fixel data file the same dimensions as the fixel
|
|
@@ -319,8 +311,6 @@ def fixelcrop(
|
|
|
319
311
|
Returns:
|
|
320
312
|
NamedTuple of outputs (described in `FixelcropOutputs`).
|
|
321
313
|
"""
|
|
322
|
-
runner = runner or get_global_runner()
|
|
323
|
-
execution = runner.start_execution(FIXELCROP_METADATA)
|
|
324
314
|
params = fixelcrop_params(
|
|
325
315
|
info=info,
|
|
326
316
|
quiet=quiet,
|
|
@@ -334,15 +324,14 @@ def fixelcrop(
|
|
|
334
324
|
input_fixel_mask=input_fixel_mask,
|
|
335
325
|
output_fixel_directory=output_fixel_directory,
|
|
336
326
|
)
|
|
337
|
-
return fixelcrop_execute(params,
|
|
327
|
+
return fixelcrop_execute(params, runner)
|
|
338
328
|
|
|
339
329
|
|
|
340
330
|
__all__ = [
|
|
341
331
|
"FIXELCROP_METADATA",
|
|
342
|
-
"FixelcropConfigParameters",
|
|
343
332
|
"FixelcropOutputs",
|
|
344
|
-
"FixelcropParameters",
|
|
345
333
|
"fixelcrop",
|
|
346
334
|
"fixelcrop_config_params",
|
|
335
|
+
"fixelcrop_execute",
|
|
347
336
|
"fixelcrop_params",
|
|
348
337
|
]
|