niwrap-mrtrix 0.5.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 +130 -0
- niwrap_mrtrix/mrtrix/afdconnectivity.py +445 -0
- niwrap_mrtrix/mrtrix/amp2response.py +453 -0
- niwrap_mrtrix/mrtrix/amp2sh.py +656 -0
- niwrap_mrtrix/mrtrix/connectome2tck.py +470 -0
- niwrap_mrtrix/mrtrix/connectomeedit.py +338 -0
- niwrap_mrtrix/mrtrix/connectomestats.py +767 -0
- niwrap_mrtrix/mrtrix/dcmedit.py +440 -0
- niwrap_mrtrix/mrtrix/dcminfo.py +416 -0
- niwrap_mrtrix/mrtrix/dirflip.py +362 -0
- niwrap_mrtrix/mrtrix/dirgen.py +423 -0
- niwrap_mrtrix/mrtrix/dirmerge.py +365 -0
- niwrap_mrtrix/mrtrix/dirorder.py +347 -0
- niwrap_mrtrix/mrtrix/dirsplit.py +358 -0
- niwrap_mrtrix/mrtrix/dirstat.py +530 -0
- niwrap_mrtrix/mrtrix/dwi2adc.py +428 -0
- niwrap_mrtrix/mrtrix/dwi2fod.py +879 -0
- niwrap_mrtrix/mrtrix/dwi2mask.py +463 -0
- niwrap_mrtrix/mrtrix/dwi2response.py +1295 -0
- niwrap_mrtrix/mrtrix/dwi2tensor.py +587 -0
- niwrap_mrtrix/mrtrix/dwibiascorrect.py +467 -0
- niwrap_mrtrix/mrtrix/dwidenoise.py +478 -0
- niwrap_mrtrix/mrtrix/dwiextract.py +825 -0
- niwrap_mrtrix/mrtrix/dwigradcheck.py +534 -0
- niwrap_mrtrix/mrtrix/fixel2peaks.py +452 -0
- niwrap_mrtrix/mrtrix/fixel2sh.py +357 -0
- niwrap_mrtrix/mrtrix/fixel2tsf.py +357 -0
- niwrap_mrtrix/mrtrix/fixel2voxel.py +437 -0
- niwrap_mrtrix/mrtrix/fixelcfestats.py +893 -0
- niwrap_mrtrix/mrtrix/fixelconnectivity.py +391 -0
- niwrap_mrtrix/mrtrix/fixelconvert.py +588 -0
- niwrap_mrtrix/mrtrix/fixelcorrespondence.py +371 -0
- niwrap_mrtrix/mrtrix/fixelcrop.py +348 -0
- niwrap_mrtrix/mrtrix/fixelfilter.py +616 -0
- niwrap_mrtrix/mrtrix/fixelreorient.py +361 -0
- niwrap_mrtrix/mrtrix/fod2dec.py +469 -0
- niwrap_mrtrix/mrtrix/fod2fixel.py +530 -0
- niwrap_mrtrix/mrtrix/label2colour.py +351 -0
- niwrap_mrtrix/mrtrix/label2mesh.py +343 -0
- niwrap_mrtrix/mrtrix/labelconvert.py +377 -0
- niwrap_mrtrix/mrtrix/labelstats.py +344 -0
- niwrap_mrtrix/mrtrix/maskdump.py +336 -0
- niwrap_mrtrix/mrtrix/maskfilter.py +537 -0
- niwrap_mrtrix/mrtrix/mesh2voxel.py +348 -0
- niwrap_mrtrix/mrtrix/meshconvert.py +410 -0
- niwrap_mrtrix/mrtrix/meshfilter.py +370 -0
- niwrap_mrtrix/mrtrix/mraverageheader.py +396 -0
- niwrap_mrtrix/mrtrix/mrcalc.py +3047 -0
- niwrap_mrtrix/mrtrix/mrcat.py +382 -0
- niwrap_mrtrix/mrtrix/mrcentroid.py +344 -0
- niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +363 -0
- niwrap_mrtrix/mrtrix/mrclusterstats.py +736 -0
- niwrap_mrtrix/mrtrix/mrcolour.py +401 -0
- niwrap_mrtrix/mrtrix/mrconvert.py +1423 -0
- niwrap_mrtrix/mrtrix/mrdegibbs.py +443 -0
- niwrap_mrtrix/mrtrix/mrdump.py +351 -0
- niwrap_mrtrix/mrtrix/mredit.py +546 -0
- niwrap_mrtrix/mrtrix/mrfilter.py +716 -0
- niwrap_mrtrix/mrtrix/mrgrid.py +819 -0
- niwrap_mrtrix/mrtrix/mrhistmatch.py +403 -0
- niwrap_mrtrix/mrtrix/mrhistogram.py +393 -0
- niwrap_mrtrix/mrtrix/mrinfo.py +990 -0
- niwrap_mrtrix/mrtrix/mrmath.py +413 -0
- niwrap_mrtrix/mrtrix/mrmetric.py +425 -0
- niwrap_mrtrix/mrtrix/mrregister.py +1676 -0
- niwrap_mrtrix/mrtrix/mrstats.py +427 -0
- niwrap_mrtrix/mrtrix/mrthreshold.py +549 -0
- niwrap_mrtrix/mrtrix/mrtransform.py +1061 -0
- niwrap_mrtrix/mrtrix/mtnormalise.py +596 -0
- niwrap_mrtrix/mrtrix/peaks2amp.py +334 -0
- niwrap_mrtrix/mrtrix/peaks2fixel.py +349 -0
- niwrap_mrtrix/mrtrix/responsemean.py +316 -0
- niwrap_mrtrix/mrtrix/sh2amp.py +640 -0
- niwrap_mrtrix/mrtrix/sh2peaks.py +505 -0
- niwrap_mrtrix/mrtrix/sh2power.py +353 -0
- niwrap_mrtrix/mrtrix/sh2response.py +394 -0
- niwrap_mrtrix/mrtrix/shbasis.py +373 -0
- niwrap_mrtrix/mrtrix/shconv.py +498 -0
- niwrap_mrtrix/mrtrix/tck2connectome.py +580 -0
- niwrap_mrtrix/mrtrix/tck2fixel.py +363 -0
- niwrap_mrtrix/mrtrix/tckconvert.py +580 -0
- niwrap_mrtrix/mrtrix/tckdfc.py +551 -0
- niwrap_mrtrix/mrtrix/tckedit.py +1003 -0
- niwrap_mrtrix/mrtrix/tckgen.py +1983 -0
- niwrap_mrtrix/mrtrix/tckglobal.py +758 -0
- niwrap_mrtrix/mrtrix/tckinfo.py +329 -0
- niwrap_mrtrix/mrtrix/tckmap.py +772 -0
- niwrap_mrtrix/mrtrix/tckresample.py +580 -0
- niwrap_mrtrix/mrtrix/tcksample.py +404 -0
- niwrap_mrtrix/mrtrix/tcksift.py +592 -0
- niwrap_mrtrix/mrtrix/tcksift2.py +730 -0
- niwrap_mrtrix/mrtrix/tckstats.py +441 -0
- niwrap_mrtrix/mrtrix/tcktransform.py +340 -0
- niwrap_mrtrix/mrtrix/tensor2metric.py +544 -0
- niwrap_mrtrix/mrtrix/transformcalc.py +344 -0
- niwrap_mrtrix/mrtrix/transformcompose.py +465 -0
- niwrap_mrtrix/mrtrix/transformconvert.py +346 -0
- niwrap_mrtrix/mrtrix/tsfdivide.py +340 -0
- niwrap_mrtrix/mrtrix/tsfinfo.py +344 -0
- niwrap_mrtrix/mrtrix/tsfmult.py +340 -0
- niwrap_mrtrix/mrtrix/tsfsmooth.py +347 -0
- niwrap_mrtrix/mrtrix/tsfthreshold.py +349 -0
- niwrap_mrtrix/mrtrix/tsfvalidate.py +328 -0
- niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +359 -0
- niwrap_mrtrix/mrtrix/v_5tt2vis.py +412 -0
- niwrap_mrtrix/mrtrix/v_5ttcheck.py +337 -0
- niwrap_mrtrix/mrtrix/v_5ttedit.py +420 -0
- niwrap_mrtrix/mrtrix/v_5ttgen.py +816 -0
- niwrap_mrtrix/mrtrix/vectorstats.py +585 -0
- niwrap_mrtrix/mrtrix/voxel2fixel.py +350 -0
- niwrap_mrtrix/mrtrix/voxel2mesh.py +376 -0
- niwrap_mrtrix/mrtrix/warp2metric.py +449 -0
- niwrap_mrtrix/mrtrix/warpconvert.py +411 -0
- niwrap_mrtrix/mrtrix/warpcorrect.py +368 -0
- niwrap_mrtrix/mrtrix/warpinit.py +356 -0
- niwrap_mrtrix/mrtrix/warpinvert.py +370 -0
- niwrap_mrtrix-0.5.0.dist-info/METADATA +8 -0
- niwrap_mrtrix-0.5.0.dist-info/RECORD +119 -0
- niwrap_mrtrix-0.5.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
# This file was auto generated by Styx.
|
|
2
|
+
# Do not edit this file directly.
|
|
3
|
+
|
|
4
|
+
import typing
|
|
5
|
+
import pathlib
|
|
6
|
+
from styxdefs import *
|
|
7
|
+
|
|
8
|
+
FIXEL2SH_METADATA = Metadata(
|
|
9
|
+
id="ad311f3879760b3a8467869800c42a82cc4da4d8.boutiques",
|
|
10
|
+
name="fixel2sh",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Fixel2shConfigParameters = typing.TypedDict('Fixel2shConfigParameters', {
|
|
17
|
+
"__STYX_TYPE__": typing.Literal["config"],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
Fixel2shParameters = typing.TypedDict('Fixel2shParameters', {
|
|
24
|
+
"__STYX_TYPE__": typing.Literal["fixel2sh"],
|
|
25
|
+
"lmax": typing.NotRequired[int | None],
|
|
26
|
+
"info": bool,
|
|
27
|
+
"quiet": bool,
|
|
28
|
+
"debug": bool,
|
|
29
|
+
"force": bool,
|
|
30
|
+
"nthreads": typing.NotRequired[int | None],
|
|
31
|
+
"config": typing.NotRequired[list[Fixel2shConfigParameters] | None],
|
|
32
|
+
"help": bool,
|
|
33
|
+
"version": bool,
|
|
34
|
+
"fixel_in": InputPathType,
|
|
35
|
+
"sh_out": str,
|
|
36
|
+
})
|
|
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
|
+
"fixel2sh": fixel2sh_cargs,
|
|
52
|
+
"config": fixel2sh_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
|
+
"fixel2sh": fixel2sh_outputs,
|
|
69
|
+
}.get(t)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def fixel2sh_config_params(
|
|
73
|
+
key: str,
|
|
74
|
+
value: str,
|
|
75
|
+
) -> Fixel2shConfigParameters:
|
|
76
|
+
"""
|
|
77
|
+
Build parameters.
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
81
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
82
|
+
Returns:
|
|
83
|
+
Parameter dictionary
|
|
84
|
+
"""
|
|
85
|
+
params = {
|
|
86
|
+
"__STYXTYPE__": "config",
|
|
87
|
+
"key": key,
|
|
88
|
+
"value": value,
|
|
89
|
+
}
|
|
90
|
+
return params
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def fixel2sh_config_cargs(
|
|
94
|
+
params: Fixel2shConfigParameters,
|
|
95
|
+
execution: Execution,
|
|
96
|
+
) -> list[str]:
|
|
97
|
+
"""
|
|
98
|
+
Build command-line arguments from parameters.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
params: The parameters.
|
|
102
|
+
execution: The execution object for resolving input paths.
|
|
103
|
+
Returns:
|
|
104
|
+
Command-line arguments.
|
|
105
|
+
"""
|
|
106
|
+
cargs = []
|
|
107
|
+
cargs.append("-config")
|
|
108
|
+
cargs.append(params.get("key"))
|
|
109
|
+
cargs.append(params.get("value"))
|
|
110
|
+
return cargs
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class Fixel2shOutputs(typing.NamedTuple):
|
|
114
|
+
"""
|
|
115
|
+
Output object returned when calling `fixel2sh(...)`.
|
|
116
|
+
"""
|
|
117
|
+
root: OutputPathType
|
|
118
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
119
|
+
sh_out: OutputPathType
|
|
120
|
+
"""the output sh image."""
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def fixel2sh_params(
|
|
124
|
+
fixel_in: InputPathType,
|
|
125
|
+
sh_out: str,
|
|
126
|
+
lmax: int | None = None,
|
|
127
|
+
info: bool = False,
|
|
128
|
+
quiet: bool = False,
|
|
129
|
+
debug: bool = False,
|
|
130
|
+
force: bool = False,
|
|
131
|
+
nthreads: int | None = None,
|
|
132
|
+
config: list[Fixel2shConfigParameters] | None = None,
|
|
133
|
+
help_: bool = False,
|
|
134
|
+
version: bool = False,
|
|
135
|
+
) -> Fixel2shParameters:
|
|
136
|
+
"""
|
|
137
|
+
Build parameters.
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
fixel_in: the input fixel data file.
|
|
141
|
+
sh_out: the output sh image.
|
|
142
|
+
lmax: set the maximum harmonic order for the output series (Default: 8).
|
|
143
|
+
info: display information messages.
|
|
144
|
+
quiet: do not display information messages or progress status;\
|
|
145
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
146
|
+
environment variable to a non-empty string.
|
|
147
|
+
debug: display debugging messages.
|
|
148
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
149
|
+
input and output might cause unexpected behaviour).
|
|
150
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
151
|
+
(set to 0 to disable multi-threading).
|
|
152
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
153
|
+
help_: display this information page and exit.
|
|
154
|
+
version: display version information and exit.
|
|
155
|
+
Returns:
|
|
156
|
+
Parameter dictionary
|
|
157
|
+
"""
|
|
158
|
+
params = {
|
|
159
|
+
"__STYXTYPE__": "fixel2sh",
|
|
160
|
+
"info": info,
|
|
161
|
+
"quiet": quiet,
|
|
162
|
+
"debug": debug,
|
|
163
|
+
"force": force,
|
|
164
|
+
"help": help_,
|
|
165
|
+
"version": version,
|
|
166
|
+
"fixel_in": fixel_in,
|
|
167
|
+
"sh_out": sh_out,
|
|
168
|
+
}
|
|
169
|
+
if lmax is not None:
|
|
170
|
+
params["lmax"] = lmax
|
|
171
|
+
if nthreads is not None:
|
|
172
|
+
params["nthreads"] = nthreads
|
|
173
|
+
if config is not None:
|
|
174
|
+
params["config"] = config
|
|
175
|
+
return params
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def fixel2sh_cargs(
|
|
179
|
+
params: Fixel2shParameters,
|
|
180
|
+
execution: Execution,
|
|
181
|
+
) -> list[str]:
|
|
182
|
+
"""
|
|
183
|
+
Build command-line arguments from parameters.
|
|
184
|
+
|
|
185
|
+
Args:
|
|
186
|
+
params: The parameters.
|
|
187
|
+
execution: The execution object for resolving input paths.
|
|
188
|
+
Returns:
|
|
189
|
+
Command-line arguments.
|
|
190
|
+
"""
|
|
191
|
+
cargs = []
|
|
192
|
+
cargs.append("fixel2sh")
|
|
193
|
+
if params.get("lmax") is not None:
|
|
194
|
+
cargs.extend([
|
|
195
|
+
"-lmax",
|
|
196
|
+
str(params.get("lmax"))
|
|
197
|
+
])
|
|
198
|
+
if params.get("info"):
|
|
199
|
+
cargs.append("-info")
|
|
200
|
+
if params.get("quiet"):
|
|
201
|
+
cargs.append("-quiet")
|
|
202
|
+
if params.get("debug"):
|
|
203
|
+
cargs.append("-debug")
|
|
204
|
+
if params.get("force"):
|
|
205
|
+
cargs.append("-force")
|
|
206
|
+
if params.get("nthreads") is not None:
|
|
207
|
+
cargs.extend([
|
|
208
|
+
"-nthreads",
|
|
209
|
+
str(params.get("nthreads"))
|
|
210
|
+
])
|
|
211
|
+
if params.get("config") is not None:
|
|
212
|
+
cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
|
|
213
|
+
if params.get("help"):
|
|
214
|
+
cargs.append("-help")
|
|
215
|
+
if params.get("version"):
|
|
216
|
+
cargs.append("-version")
|
|
217
|
+
cargs.append(execution.input_file(params.get("fixel_in")))
|
|
218
|
+
cargs.append(params.get("sh_out"))
|
|
219
|
+
return cargs
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def fixel2sh_outputs(
|
|
223
|
+
params: Fixel2shParameters,
|
|
224
|
+
execution: Execution,
|
|
225
|
+
) -> Fixel2shOutputs:
|
|
226
|
+
"""
|
|
227
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
228
|
+
|
|
229
|
+
Args:
|
|
230
|
+
params: The parameters.
|
|
231
|
+
execution: The execution object for resolving input paths.
|
|
232
|
+
Returns:
|
|
233
|
+
Outputs object.
|
|
234
|
+
"""
|
|
235
|
+
ret = Fixel2shOutputs(
|
|
236
|
+
root=execution.output_file("."),
|
|
237
|
+
sh_out=execution.output_file(params.get("sh_out")),
|
|
238
|
+
)
|
|
239
|
+
return ret
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
def fixel2sh_execute(
|
|
243
|
+
params: Fixel2shParameters,
|
|
244
|
+
execution: Execution,
|
|
245
|
+
) -> Fixel2shOutputs:
|
|
246
|
+
"""
|
|
247
|
+
Convert a fixel-based sparse-data image into an spherical harmonic image.
|
|
248
|
+
|
|
249
|
+
This command generates spherical harmonic data from fixels that can be
|
|
250
|
+
visualised using the ODF tool in MRview. The output ODF lobes are scaled
|
|
251
|
+
according to the values in the input fixel image.
|
|
252
|
+
|
|
253
|
+
The spherical harmonic coefficients are stored according the conventions
|
|
254
|
+
described the main documentation, which can be found at the following link:
|
|
255
|
+
https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html
|
|
256
|
+
|
|
257
|
+
References:
|
|
258
|
+
|
|
259
|
+
.
|
|
260
|
+
|
|
261
|
+
Author: MRTrix3 Developers
|
|
262
|
+
|
|
263
|
+
URL: https://www.mrtrix.org/
|
|
264
|
+
|
|
265
|
+
Args:
|
|
266
|
+
params: The parameters.
|
|
267
|
+
execution: The execution object.
|
|
268
|
+
Returns:
|
|
269
|
+
NamedTuple of outputs (described in `Fixel2shOutputs`).
|
|
270
|
+
"""
|
|
271
|
+
params = execution.params(params)
|
|
272
|
+
cargs = fixel2sh_cargs(params, execution)
|
|
273
|
+
ret = fixel2sh_outputs(params, execution)
|
|
274
|
+
execution.run(cargs)
|
|
275
|
+
return ret
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
def fixel2sh(
|
|
279
|
+
fixel_in: InputPathType,
|
|
280
|
+
sh_out: str,
|
|
281
|
+
lmax: int | None = None,
|
|
282
|
+
info: bool = False,
|
|
283
|
+
quiet: bool = False,
|
|
284
|
+
debug: bool = False,
|
|
285
|
+
force: bool = False,
|
|
286
|
+
nthreads: int | None = None,
|
|
287
|
+
config: list[Fixel2shConfigParameters] | None = None,
|
|
288
|
+
help_: bool = False,
|
|
289
|
+
version: bool = False,
|
|
290
|
+
runner: Runner | None = None,
|
|
291
|
+
) -> Fixel2shOutputs:
|
|
292
|
+
"""
|
|
293
|
+
Convert a fixel-based sparse-data image into an spherical harmonic image.
|
|
294
|
+
|
|
295
|
+
This command generates spherical harmonic data from fixels that can be
|
|
296
|
+
visualised using the ODF tool in MRview. The output ODF lobes are scaled
|
|
297
|
+
according to the values in the input fixel image.
|
|
298
|
+
|
|
299
|
+
The spherical harmonic coefficients are stored according the conventions
|
|
300
|
+
described the main documentation, which can be found at the following link:
|
|
301
|
+
https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html
|
|
302
|
+
|
|
303
|
+
References:
|
|
304
|
+
|
|
305
|
+
.
|
|
306
|
+
|
|
307
|
+
Author: MRTrix3 Developers
|
|
308
|
+
|
|
309
|
+
URL: https://www.mrtrix.org/
|
|
310
|
+
|
|
311
|
+
Args:
|
|
312
|
+
fixel_in: the input fixel data file.
|
|
313
|
+
sh_out: the output sh image.
|
|
314
|
+
lmax: set the maximum harmonic order for the output series (Default: 8).
|
|
315
|
+
info: display information messages.
|
|
316
|
+
quiet: do not display information messages or progress status;\
|
|
317
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
318
|
+
environment variable to a non-empty string.
|
|
319
|
+
debug: display debugging messages.
|
|
320
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
321
|
+
input and output might cause unexpected behaviour).
|
|
322
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
323
|
+
(set to 0 to disable multi-threading).
|
|
324
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
325
|
+
help_: display this information page and exit.
|
|
326
|
+
version: display version information and exit.
|
|
327
|
+
runner: Command runner.
|
|
328
|
+
Returns:
|
|
329
|
+
NamedTuple of outputs (described in `Fixel2shOutputs`).
|
|
330
|
+
"""
|
|
331
|
+
runner = runner or get_global_runner()
|
|
332
|
+
execution = runner.start_execution(FIXEL2SH_METADATA)
|
|
333
|
+
params = fixel2sh_params(
|
|
334
|
+
lmax=lmax,
|
|
335
|
+
info=info,
|
|
336
|
+
quiet=quiet,
|
|
337
|
+
debug=debug,
|
|
338
|
+
force=force,
|
|
339
|
+
nthreads=nthreads,
|
|
340
|
+
config=config,
|
|
341
|
+
help_=help_,
|
|
342
|
+
version=version,
|
|
343
|
+
fixel_in=fixel_in,
|
|
344
|
+
sh_out=sh_out,
|
|
345
|
+
)
|
|
346
|
+
return fixel2sh_execute(params, execution)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
__all__ = [
|
|
350
|
+
"FIXEL2SH_METADATA",
|
|
351
|
+
"Fixel2shConfigParameters",
|
|
352
|
+
"Fixel2shOutputs",
|
|
353
|
+
"Fixel2shParameters",
|
|
354
|
+
"fixel2sh",
|
|
355
|
+
"fixel2sh_config_params",
|
|
356
|
+
"fixel2sh_params",
|
|
357
|
+
]
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
# This file was auto generated by Styx.
|
|
2
|
+
# Do not edit this file directly.
|
|
3
|
+
|
|
4
|
+
import typing
|
|
5
|
+
import pathlib
|
|
6
|
+
from styxdefs import *
|
|
7
|
+
|
|
8
|
+
FIXEL2TSF_METADATA = Metadata(
|
|
9
|
+
id="0bbc1887f97398283810259c9bfc2ba108df6a97.boutiques",
|
|
10
|
+
name="fixel2tsf",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Fixel2tsfConfigParameters = typing.TypedDict('Fixel2tsfConfigParameters', {
|
|
17
|
+
"__STYX_TYPE__": typing.Literal["config"],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
Fixel2tsfParameters = typing.TypedDict('Fixel2tsfParameters', {
|
|
24
|
+
"__STYX_TYPE__": typing.Literal["fixel2tsf"],
|
|
25
|
+
"angle": typing.NotRequired[float | None],
|
|
26
|
+
"info": bool,
|
|
27
|
+
"quiet": bool,
|
|
28
|
+
"debug": bool,
|
|
29
|
+
"force": bool,
|
|
30
|
+
"nthreads": typing.NotRequired[int | None],
|
|
31
|
+
"config": typing.NotRequired[list[Fixel2tsfConfigParameters] | None],
|
|
32
|
+
"help": bool,
|
|
33
|
+
"version": bool,
|
|
34
|
+
"fixel_in": InputPathType,
|
|
35
|
+
"tracks": InputPathType,
|
|
36
|
+
"tsf": str,
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def dyn_cargs(
|
|
41
|
+
t: str,
|
|
42
|
+
) -> typing.Any:
|
|
43
|
+
"""
|
|
44
|
+
Get build cargs function by command type.
|
|
45
|
+
|
|
46
|
+
Args:
|
|
47
|
+
t: Command type.
|
|
48
|
+
Returns:
|
|
49
|
+
Build cargs function.
|
|
50
|
+
"""
|
|
51
|
+
return {
|
|
52
|
+
"fixel2tsf": fixel2tsf_cargs,
|
|
53
|
+
"config": fixel2tsf_config_cargs,
|
|
54
|
+
}.get(t)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def dyn_outputs(
|
|
58
|
+
t: str,
|
|
59
|
+
) -> typing.Any:
|
|
60
|
+
"""
|
|
61
|
+
Get build outputs function by command type.
|
|
62
|
+
|
|
63
|
+
Args:
|
|
64
|
+
t: Command type.
|
|
65
|
+
Returns:
|
|
66
|
+
Build outputs function.
|
|
67
|
+
"""
|
|
68
|
+
return {
|
|
69
|
+
"fixel2tsf": fixel2tsf_outputs,
|
|
70
|
+
}.get(t)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def fixel2tsf_config_params(
|
|
74
|
+
key: str,
|
|
75
|
+
value: str,
|
|
76
|
+
) -> Fixel2tsfConfigParameters:
|
|
77
|
+
"""
|
|
78
|
+
Build parameters.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
82
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
83
|
+
Returns:
|
|
84
|
+
Parameter dictionary
|
|
85
|
+
"""
|
|
86
|
+
params = {
|
|
87
|
+
"__STYXTYPE__": "config",
|
|
88
|
+
"key": key,
|
|
89
|
+
"value": value,
|
|
90
|
+
}
|
|
91
|
+
return params
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def fixel2tsf_config_cargs(
|
|
95
|
+
params: Fixel2tsfConfigParameters,
|
|
96
|
+
execution: Execution,
|
|
97
|
+
) -> list[str]:
|
|
98
|
+
"""
|
|
99
|
+
Build command-line arguments from parameters.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
params: The parameters.
|
|
103
|
+
execution: The execution object for resolving input paths.
|
|
104
|
+
Returns:
|
|
105
|
+
Command-line arguments.
|
|
106
|
+
"""
|
|
107
|
+
cargs = []
|
|
108
|
+
cargs.append("-config")
|
|
109
|
+
cargs.append(params.get("key"))
|
|
110
|
+
cargs.append(params.get("value"))
|
|
111
|
+
return cargs
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class Fixel2tsfOutputs(typing.NamedTuple):
|
|
115
|
+
"""
|
|
116
|
+
Output object returned when calling `fixel2tsf(...)`.
|
|
117
|
+
"""
|
|
118
|
+
root: OutputPathType
|
|
119
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
120
|
+
tsf: OutputPathType
|
|
121
|
+
"""the output track scalar file"""
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def fixel2tsf_params(
|
|
125
|
+
fixel_in: InputPathType,
|
|
126
|
+
tracks: InputPathType,
|
|
127
|
+
tsf: str,
|
|
128
|
+
angle: float | None = None,
|
|
129
|
+
info: bool = False,
|
|
130
|
+
quiet: bool = False,
|
|
131
|
+
debug: bool = False,
|
|
132
|
+
force: bool = False,
|
|
133
|
+
nthreads: int | None = None,
|
|
134
|
+
config: list[Fixel2tsfConfigParameters] | None = None,
|
|
135
|
+
help_: bool = False,
|
|
136
|
+
version: bool = False,
|
|
137
|
+
) -> Fixel2tsfParameters:
|
|
138
|
+
"""
|
|
139
|
+
Build parameters.
|
|
140
|
+
|
|
141
|
+
Args:
|
|
142
|
+
fixel_in: the input fixel data file (within the fixel directory).
|
|
143
|
+
tracks: the input track file.
|
|
144
|
+
tsf: the output track scalar file.
|
|
145
|
+
angle: the max anglular threshold for computing correspondence between\
|
|
146
|
+
a fixel direction and track tangent (default = 45 degrees).
|
|
147
|
+
info: display information messages.
|
|
148
|
+
quiet: do not display information messages or progress status;\
|
|
149
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
150
|
+
environment variable to a non-empty string.
|
|
151
|
+
debug: display debugging messages.
|
|
152
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
153
|
+
input and output might cause unexpected behaviour).
|
|
154
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
155
|
+
(set to 0 to disable multi-threading).
|
|
156
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
157
|
+
help_: display this information page and exit.
|
|
158
|
+
version: display version information and exit.
|
|
159
|
+
Returns:
|
|
160
|
+
Parameter dictionary
|
|
161
|
+
"""
|
|
162
|
+
params = {
|
|
163
|
+
"__STYXTYPE__": "fixel2tsf",
|
|
164
|
+
"info": info,
|
|
165
|
+
"quiet": quiet,
|
|
166
|
+
"debug": debug,
|
|
167
|
+
"force": force,
|
|
168
|
+
"help": help_,
|
|
169
|
+
"version": version,
|
|
170
|
+
"fixel_in": fixel_in,
|
|
171
|
+
"tracks": tracks,
|
|
172
|
+
"tsf": tsf,
|
|
173
|
+
}
|
|
174
|
+
if angle is not None:
|
|
175
|
+
params["angle"] = angle
|
|
176
|
+
if nthreads is not None:
|
|
177
|
+
params["nthreads"] = nthreads
|
|
178
|
+
if config is not None:
|
|
179
|
+
params["config"] = config
|
|
180
|
+
return params
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def fixel2tsf_cargs(
|
|
184
|
+
params: Fixel2tsfParameters,
|
|
185
|
+
execution: Execution,
|
|
186
|
+
) -> list[str]:
|
|
187
|
+
"""
|
|
188
|
+
Build command-line arguments from parameters.
|
|
189
|
+
|
|
190
|
+
Args:
|
|
191
|
+
params: The parameters.
|
|
192
|
+
execution: The execution object for resolving input paths.
|
|
193
|
+
Returns:
|
|
194
|
+
Command-line arguments.
|
|
195
|
+
"""
|
|
196
|
+
cargs = []
|
|
197
|
+
cargs.append("fixel2tsf")
|
|
198
|
+
if params.get("angle") is not None:
|
|
199
|
+
cargs.extend([
|
|
200
|
+
"-angle",
|
|
201
|
+
str(params.get("angle"))
|
|
202
|
+
])
|
|
203
|
+
if params.get("info"):
|
|
204
|
+
cargs.append("-info")
|
|
205
|
+
if params.get("quiet"):
|
|
206
|
+
cargs.append("-quiet")
|
|
207
|
+
if params.get("debug"):
|
|
208
|
+
cargs.append("-debug")
|
|
209
|
+
if params.get("force"):
|
|
210
|
+
cargs.append("-force")
|
|
211
|
+
if params.get("nthreads") is not None:
|
|
212
|
+
cargs.extend([
|
|
213
|
+
"-nthreads",
|
|
214
|
+
str(params.get("nthreads"))
|
|
215
|
+
])
|
|
216
|
+
if params.get("config") is not None:
|
|
217
|
+
cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
|
|
218
|
+
if params.get("help"):
|
|
219
|
+
cargs.append("-help")
|
|
220
|
+
if params.get("version"):
|
|
221
|
+
cargs.append("-version")
|
|
222
|
+
cargs.append(execution.input_file(params.get("fixel_in")))
|
|
223
|
+
cargs.append(execution.input_file(params.get("tracks")))
|
|
224
|
+
cargs.append(params.get("tsf"))
|
|
225
|
+
return cargs
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
def fixel2tsf_outputs(
|
|
229
|
+
params: Fixel2tsfParameters,
|
|
230
|
+
execution: Execution,
|
|
231
|
+
) -> Fixel2tsfOutputs:
|
|
232
|
+
"""
|
|
233
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
234
|
+
|
|
235
|
+
Args:
|
|
236
|
+
params: The parameters.
|
|
237
|
+
execution: The execution object for resolving input paths.
|
|
238
|
+
Returns:
|
|
239
|
+
Outputs object.
|
|
240
|
+
"""
|
|
241
|
+
ret = Fixel2tsfOutputs(
|
|
242
|
+
root=execution.output_file("."),
|
|
243
|
+
tsf=execution.output_file(params.get("tsf")),
|
|
244
|
+
)
|
|
245
|
+
return ret
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def fixel2tsf_execute(
|
|
249
|
+
params: Fixel2tsfParameters,
|
|
250
|
+
execution: Execution,
|
|
251
|
+
) -> Fixel2tsfOutputs:
|
|
252
|
+
"""
|
|
253
|
+
Map fixel values to a track scalar file based on an input tractogram.
|
|
254
|
+
|
|
255
|
+
This command is useful for visualising all brain fixels (e.g. the output
|
|
256
|
+
from fixelcfestats) in 3D.
|
|
257
|
+
|
|
258
|
+
References:
|
|
259
|
+
|
|
260
|
+
.
|
|
261
|
+
|
|
262
|
+
Author: MRTrix3 Developers
|
|
263
|
+
|
|
264
|
+
URL: https://www.mrtrix.org/
|
|
265
|
+
|
|
266
|
+
Args:
|
|
267
|
+
params: The parameters.
|
|
268
|
+
execution: The execution object.
|
|
269
|
+
Returns:
|
|
270
|
+
NamedTuple of outputs (described in `Fixel2tsfOutputs`).
|
|
271
|
+
"""
|
|
272
|
+
params = execution.params(params)
|
|
273
|
+
cargs = fixel2tsf_cargs(params, execution)
|
|
274
|
+
ret = fixel2tsf_outputs(params, execution)
|
|
275
|
+
execution.run(cargs)
|
|
276
|
+
return ret
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
def fixel2tsf(
|
|
280
|
+
fixel_in: InputPathType,
|
|
281
|
+
tracks: InputPathType,
|
|
282
|
+
tsf: str,
|
|
283
|
+
angle: float | None = None,
|
|
284
|
+
info: bool = False,
|
|
285
|
+
quiet: bool = False,
|
|
286
|
+
debug: bool = False,
|
|
287
|
+
force: bool = False,
|
|
288
|
+
nthreads: int | None = None,
|
|
289
|
+
config: list[Fixel2tsfConfigParameters] | None = None,
|
|
290
|
+
help_: bool = False,
|
|
291
|
+
version: bool = False,
|
|
292
|
+
runner: Runner | None = None,
|
|
293
|
+
) -> Fixel2tsfOutputs:
|
|
294
|
+
"""
|
|
295
|
+
Map fixel values to a track scalar file based on an input tractogram.
|
|
296
|
+
|
|
297
|
+
This command is useful for visualising all brain fixels (e.g. the output
|
|
298
|
+
from fixelcfestats) in 3D.
|
|
299
|
+
|
|
300
|
+
References:
|
|
301
|
+
|
|
302
|
+
.
|
|
303
|
+
|
|
304
|
+
Author: MRTrix3 Developers
|
|
305
|
+
|
|
306
|
+
URL: https://www.mrtrix.org/
|
|
307
|
+
|
|
308
|
+
Args:
|
|
309
|
+
fixel_in: the input fixel data file (within the fixel directory).
|
|
310
|
+
tracks: the input track file.
|
|
311
|
+
tsf: the output track scalar file.
|
|
312
|
+
angle: the max anglular threshold for computing correspondence between\
|
|
313
|
+
a fixel direction and track tangent (default = 45 degrees).
|
|
314
|
+
info: display information messages.
|
|
315
|
+
quiet: do not display information messages or progress status;\
|
|
316
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
317
|
+
environment variable to a non-empty string.
|
|
318
|
+
debug: display debugging messages.
|
|
319
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
320
|
+
input and output might cause unexpected behaviour).
|
|
321
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
322
|
+
(set to 0 to disable multi-threading).
|
|
323
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
324
|
+
help_: display this information page and exit.
|
|
325
|
+
version: display version information and exit.
|
|
326
|
+
runner: Command runner.
|
|
327
|
+
Returns:
|
|
328
|
+
NamedTuple of outputs (described in `Fixel2tsfOutputs`).
|
|
329
|
+
"""
|
|
330
|
+
runner = runner or get_global_runner()
|
|
331
|
+
execution = runner.start_execution(FIXEL2TSF_METADATA)
|
|
332
|
+
params = fixel2tsf_params(
|
|
333
|
+
angle=angle,
|
|
334
|
+
info=info,
|
|
335
|
+
quiet=quiet,
|
|
336
|
+
debug=debug,
|
|
337
|
+
force=force,
|
|
338
|
+
nthreads=nthreads,
|
|
339
|
+
config=config,
|
|
340
|
+
help_=help_,
|
|
341
|
+
version=version,
|
|
342
|
+
fixel_in=fixel_in,
|
|
343
|
+
tracks=tracks,
|
|
344
|
+
tsf=tsf,
|
|
345
|
+
)
|
|
346
|
+
return fixel2tsf_execute(params, execution)
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
__all__ = [
|
|
350
|
+
"FIXEL2TSF_METADATA",
|
|
351
|
+
"Fixel2tsfConfigParameters",
|
|
352
|
+
"Fixel2tsfOutputs",
|
|
353
|
+
"Fixel2tsfParameters",
|
|
354
|
+
"fixel2tsf",
|
|
355
|
+
"fixel2tsf_config_params",
|
|
356
|
+
"fixel2tsf_params",
|
|
357
|
+
]
|