niwrap-mrtrix 0.8.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.
- niwrap_mrtrix/mrtrix/__init__.py +263 -0
- niwrap_mrtrix/mrtrix/afdconnectivity.py +527 -0
- niwrap_mrtrix/mrtrix/amp2response.py +560 -0
- niwrap_mrtrix/mrtrix/amp2sh.py +870 -0
- niwrap_mrtrix/mrtrix/connectome2tck.py +583 -0
- niwrap_mrtrix/mrtrix/connectomeedit.py +413 -0
- niwrap_mrtrix/mrtrix/connectomestats.py +956 -0
- niwrap_mrtrix/mrtrix/dcmedit.py +552 -0
- niwrap_mrtrix/mrtrix/dcminfo.py +529 -0
- niwrap_mrtrix/mrtrix/dirflip.py +440 -0
- niwrap_mrtrix/mrtrix/dirgen.py +514 -0
- niwrap_mrtrix/mrtrix/dirmerge.py +446 -0
- niwrap_mrtrix/mrtrix/dirorder.py +421 -0
- niwrap_mrtrix/mrtrix/dirsplit.py +436 -0
- niwrap_mrtrix/mrtrix/dirstat.py +640 -0
- niwrap_mrtrix/mrtrix/dwi2adc.py +531 -0
- niwrap_mrtrix/mrtrix/dwi2fod.py +1156 -0
- niwrap_mrtrix/mrtrix/dwi2mask.py +570 -0
- niwrap_mrtrix/mrtrix/dwi2response.py +1774 -0
- niwrap_mrtrix/mrtrix/dwi2tensor.py +715 -0
- niwrap_mrtrix/mrtrix/dwibiascorrect.py +673 -0
- niwrap_mrtrix/mrtrix/dwidenoise.py +570 -0
- niwrap_mrtrix/mrtrix/dwiextract.py +1111 -0
- niwrap_mrtrix/mrtrix/dwigradcheck.py +665 -0
- niwrap_mrtrix/mrtrix/fixel2peaks.py +613 -0
- niwrap_mrtrix/mrtrix/fixel2sh.py +430 -0
- niwrap_mrtrix/mrtrix/fixel2tsf.py +435 -0
- niwrap_mrtrix/mrtrix/fixel2voxel.py +523 -0
- niwrap_mrtrix/mrtrix/fixelcfestats.py +1179 -0
- niwrap_mrtrix/mrtrix/fixelconnectivity.py +477 -0
- niwrap_mrtrix/mrtrix/fixelconvert.py +850 -0
- niwrap_mrtrix/mrtrix/fixelcorrespondence.py +455 -0
- niwrap_mrtrix/mrtrix/fixelcrop.py +422 -0
- niwrap_mrtrix/mrtrix/fixelfilter.py +882 -0
- niwrap_mrtrix/mrtrix/fixelreorient.py +435 -0
- niwrap_mrtrix/mrtrix/fod2dec.py +571 -0
- niwrap_mrtrix/mrtrix/fod2fixel.py +646 -0
- niwrap_mrtrix/mrtrix/label2colour.py +426 -0
- niwrap_mrtrix/mrtrix/label2mesh.py +417 -0
- niwrap_mrtrix/mrtrix/labelconvert.py +460 -0
- niwrap_mrtrix/mrtrix/labelstats.py +418 -0
- niwrap_mrtrix/mrtrix/maskdump.py +404 -0
- niwrap_mrtrix/mrtrix/maskfilter.py +730 -0
- niwrap_mrtrix/mrtrix/mesh2voxel.py +422 -0
- niwrap_mrtrix/mrtrix/meshconvert.py +514 -0
- niwrap_mrtrix/mrtrix/meshfilter.py +452 -0
- niwrap_mrtrix/mrtrix/mraverageheader.py +485 -0
- niwrap_mrtrix/mrtrix/mrcalc.py +4302 -0
- niwrap_mrtrix/mrtrix/mrcat.py +467 -0
- niwrap_mrtrix/mrtrix/mrcentroid.py +418 -0
- niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +446 -0
- niwrap_mrtrix/mrtrix/mrclusterstats.py +930 -0
- niwrap_mrtrix/mrtrix/mrcolour.py +490 -0
- niwrap_mrtrix/mrtrix/mrconvert.py +1967 -0
- niwrap_mrtrix/mrtrix/mrdegibbs.py +535 -0
- niwrap_mrtrix/mrtrix/mrdump.py +423 -0
- niwrap_mrtrix/mrtrix/mredit.py +737 -0
- niwrap_mrtrix/mrtrix/mrfilter.py +971 -0
- niwrap_mrtrix/mrtrix/mrgrid.py +1079 -0
- niwrap_mrtrix/mrtrix/mrhistmatch.py +494 -0
- niwrap_mrtrix/mrtrix/mrhistogram.py +484 -0
- niwrap_mrtrix/mrtrix/mrinfo.py +1282 -0
- niwrap_mrtrix/mrtrix/mrmath.py +503 -0
- niwrap_mrtrix/mrtrix/mrmetric.py +525 -0
- niwrap_mrtrix/mrtrix/mrregister.py +2098 -0
- niwrap_mrtrix/mrtrix/mrstats.py +534 -0
- niwrap_mrtrix/mrtrix/mrthreshold.py +666 -0
- niwrap_mrtrix/mrtrix/mrtransform.py +1372 -0
- niwrap_mrtrix/mrtrix/mtnormalise.py +725 -0
- niwrap_mrtrix/mrtrix/peaks2amp.py +403 -0
- niwrap_mrtrix/mrtrix/peaks2fixel.py +422 -0
- niwrap_mrtrix/mrtrix/responsemean.py +385 -0
- niwrap_mrtrix/mrtrix/sh2amp.py +844 -0
- niwrap_mrtrix/mrtrix/sh2peaks.py +632 -0
- niwrap_mrtrix/mrtrix/sh2power.py +427 -0
- niwrap_mrtrix/mrtrix/sh2response.py +481 -0
- niwrap_mrtrix/mrtrix/shbasis.py +445 -0
- niwrap_mrtrix/mrtrix/shconv.py +661 -0
- niwrap_mrtrix/mrtrix/tck2connectome.py +727 -0
- niwrap_mrtrix/mrtrix/tck2fixel.py +447 -0
- niwrap_mrtrix/mrtrix/tckconvert.py +775 -0
- niwrap_mrtrix/mrtrix/tckdfc.py +684 -0
- niwrap_mrtrix/mrtrix/tckedit.py +1478 -0
- niwrap_mrtrix/mrtrix/tckgen.py +2733 -0
- niwrap_mrtrix/mrtrix/tckglobal.py +944 -0
- niwrap_mrtrix/mrtrix/tckinfo.py +402 -0
- niwrap_mrtrix/mrtrix/tckmap.py +1004 -0
- niwrap_mrtrix/mrtrix/tckresample.py +760 -0
- niwrap_mrtrix/mrtrix/tcksample.py +497 -0
- niwrap_mrtrix/mrtrix/tcksift.py +739 -0
- niwrap_mrtrix/mrtrix/tcksift2.py +902 -0
- niwrap_mrtrix/mrtrix/tckstats.py +550 -0
- niwrap_mrtrix/mrtrix/tcktransform.py +414 -0
- niwrap_mrtrix/mrtrix/tensor2metric.py +659 -0
- niwrap_mrtrix/mrtrix/transformcalc.py +421 -0
- niwrap_mrtrix/mrtrix/transformcompose.py +625 -0
- niwrap_mrtrix/mrtrix/transformconvert.py +423 -0
- niwrap_mrtrix/mrtrix/tsfdivide.py +414 -0
- niwrap_mrtrix/mrtrix/tsfinfo.py +421 -0
- niwrap_mrtrix/mrtrix/tsfmult.py +401 -0
- niwrap_mrtrix/mrtrix/tsfsmooth.py +420 -0
- niwrap_mrtrix/mrtrix/tsfthreshold.py +428 -0
- niwrap_mrtrix/mrtrix/tsfvalidate.py +398 -0
- niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +432 -0
- niwrap_mrtrix/mrtrix/v_5tt2vis.py +505 -0
- niwrap_mrtrix/mrtrix/v_5ttcheck.py +409 -0
- niwrap_mrtrix/mrtrix/v_5ttedit.py +513 -0
- niwrap_mrtrix/mrtrix/v_5ttgen.py +1107 -0
- niwrap_mrtrix/mrtrix/vectorstats.py +736 -0
- niwrap_mrtrix/mrtrix/voxel2fixel.py +430 -0
- niwrap_mrtrix/mrtrix/voxel2mesh.py +454 -0
- niwrap_mrtrix/mrtrix/warp2metric.py +556 -0
- niwrap_mrtrix/mrtrix/warpconvert.py +498 -0
- niwrap_mrtrix/mrtrix/warpcorrect.py +448 -0
- niwrap_mrtrix/mrtrix/warpinit.py +425 -0
- niwrap_mrtrix/mrtrix/warpinvert.py +448 -0
- niwrap_mrtrix-0.8.0.dist-info/METADATA +8 -0
- niwrap_mrtrix-0.8.0.dist-info/RECORD +119 -0
- niwrap_mrtrix-0.8.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,430 @@
|
|
|
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="8c1f4206ebf1611310a84b3b1b1527e0a6b154c6.boutiques",
|
|
10
|
+
name="fixel2sh",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
_Fixel2shConfigParamsDictNoTag = typing.TypedDict('_Fixel2shConfigParamsDictNoTag', {
|
|
17
|
+
"key": str,
|
|
18
|
+
"value": str,
|
|
19
|
+
})
|
|
20
|
+
Fixel2shConfigParamsDictTagged = typing.TypedDict('Fixel2shConfigParamsDictTagged', {
|
|
21
|
+
"@type": typing.Literal["config"],
|
|
22
|
+
"key": str,
|
|
23
|
+
"value": str,
|
|
24
|
+
})
|
|
25
|
+
Fixel2shConfigParamsDict = _Fixel2shConfigParamsDictNoTag | Fixel2shConfigParamsDictTagged
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_Fixel2shParamsDictNoTag = typing.TypedDict('_Fixel2shParamsDictNoTag', {
|
|
29
|
+
"lmax": typing.NotRequired[int | None],
|
|
30
|
+
"info": bool,
|
|
31
|
+
"quiet": bool,
|
|
32
|
+
"debug": bool,
|
|
33
|
+
"force": bool,
|
|
34
|
+
"nthreads": typing.NotRequired[int | None],
|
|
35
|
+
"config": typing.NotRequired[list[Fixel2shConfigParamsDict] | None],
|
|
36
|
+
"help": bool,
|
|
37
|
+
"version": bool,
|
|
38
|
+
"fixel_in": InputPathType,
|
|
39
|
+
"sh_out": str,
|
|
40
|
+
})
|
|
41
|
+
Fixel2shParamsDictTagged = typing.TypedDict('Fixel2shParamsDictTagged', {
|
|
42
|
+
"@type": typing.Literal["mrtrix/fixel2sh"],
|
|
43
|
+
"lmax": typing.NotRequired[int | None],
|
|
44
|
+
"info": bool,
|
|
45
|
+
"quiet": bool,
|
|
46
|
+
"debug": bool,
|
|
47
|
+
"force": bool,
|
|
48
|
+
"nthreads": typing.NotRequired[int | None],
|
|
49
|
+
"config": typing.NotRequired[list[Fixel2shConfigParamsDict] | None],
|
|
50
|
+
"help": bool,
|
|
51
|
+
"version": bool,
|
|
52
|
+
"fixel_in": InputPathType,
|
|
53
|
+
"sh_out": str,
|
|
54
|
+
})
|
|
55
|
+
Fixel2shParamsDict = _Fixel2shParamsDictNoTag | Fixel2shParamsDictTagged
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def fixel2sh_config(
|
|
59
|
+
key: str,
|
|
60
|
+
value: str,
|
|
61
|
+
) -> Fixel2shConfigParamsDictTagged:
|
|
62
|
+
"""
|
|
63
|
+
Build parameters.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
67
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
68
|
+
Returns:
|
|
69
|
+
Parameter dictionary
|
|
70
|
+
"""
|
|
71
|
+
params = {
|
|
72
|
+
"@type": "config",
|
|
73
|
+
"key": key,
|
|
74
|
+
"value": value,
|
|
75
|
+
}
|
|
76
|
+
return params
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def fixel2sh_config_validate(
|
|
80
|
+
params: typing.Any,
|
|
81
|
+
) -> None:
|
|
82
|
+
"""
|
|
83
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
84
|
+
`Fixel2shConfigParamsDict` object.
|
|
85
|
+
|
|
86
|
+
Args:
|
|
87
|
+
params: The parameters object to validate.
|
|
88
|
+
"""
|
|
89
|
+
if params is None or not isinstance(params, dict):
|
|
90
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
91
|
+
if params.get("key", None) is None:
|
|
92
|
+
raise StyxValidationError("`key` must not be None")
|
|
93
|
+
if not isinstance(params["key"], str):
|
|
94
|
+
raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
|
|
95
|
+
if params.get("value", None) is None:
|
|
96
|
+
raise StyxValidationError("`value` must not be None")
|
|
97
|
+
if not isinstance(params["value"], str):
|
|
98
|
+
raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def fixel2sh_config_cargs(
|
|
102
|
+
params: Fixel2shConfigParamsDict,
|
|
103
|
+
execution: Execution,
|
|
104
|
+
) -> list[str]:
|
|
105
|
+
"""
|
|
106
|
+
Build command-line arguments from parameters.
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
params: The parameters.
|
|
110
|
+
execution: The execution object for resolving input paths.
|
|
111
|
+
Returns:
|
|
112
|
+
Command-line arguments.
|
|
113
|
+
"""
|
|
114
|
+
cargs = []
|
|
115
|
+
cargs.append("-config")
|
|
116
|
+
cargs.append(params.get("key", None))
|
|
117
|
+
cargs.append(params.get("value", None))
|
|
118
|
+
return cargs
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class Fixel2shOutputs(typing.NamedTuple):
|
|
122
|
+
"""
|
|
123
|
+
Output object returned when calling `Fixel2shParamsDict(...)`.
|
|
124
|
+
"""
|
|
125
|
+
root: OutputPathType
|
|
126
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
127
|
+
sh_out: OutputPathType
|
|
128
|
+
"""the output sh image."""
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def fixel2sh_params(
|
|
132
|
+
fixel_in: InputPathType,
|
|
133
|
+
sh_out: str,
|
|
134
|
+
lmax: int | None = None,
|
|
135
|
+
info: bool = False,
|
|
136
|
+
quiet: bool = False,
|
|
137
|
+
debug: bool = False,
|
|
138
|
+
force: bool = False,
|
|
139
|
+
nthreads: int | None = None,
|
|
140
|
+
config: list[Fixel2shConfigParamsDict] | None = None,
|
|
141
|
+
help_: bool = False,
|
|
142
|
+
version: bool = False,
|
|
143
|
+
) -> Fixel2shParamsDictTagged:
|
|
144
|
+
"""
|
|
145
|
+
Build parameters.
|
|
146
|
+
|
|
147
|
+
Args:
|
|
148
|
+
fixel_in: the input fixel data file.
|
|
149
|
+
sh_out: the output sh image.
|
|
150
|
+
lmax: set the maximum harmonic order for the output series (Default: 8).
|
|
151
|
+
info: display information messages.
|
|
152
|
+
quiet: do not display information messages or progress status;\
|
|
153
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
154
|
+
environment variable to a non-empty string.
|
|
155
|
+
debug: display debugging messages.
|
|
156
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
157
|
+
input and output might cause unexpected behaviour).
|
|
158
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
159
|
+
(set to 0 to disable multi-threading).
|
|
160
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
161
|
+
help_: display this information page and exit.
|
|
162
|
+
version: display version information and exit.
|
|
163
|
+
Returns:
|
|
164
|
+
Parameter dictionary
|
|
165
|
+
"""
|
|
166
|
+
params = {
|
|
167
|
+
"@type": "mrtrix/fixel2sh",
|
|
168
|
+
"info": info,
|
|
169
|
+
"quiet": quiet,
|
|
170
|
+
"debug": debug,
|
|
171
|
+
"force": force,
|
|
172
|
+
"help": help_,
|
|
173
|
+
"version": version,
|
|
174
|
+
"fixel_in": fixel_in,
|
|
175
|
+
"sh_out": sh_out,
|
|
176
|
+
}
|
|
177
|
+
if lmax is not None:
|
|
178
|
+
params["lmax"] = lmax
|
|
179
|
+
if nthreads is not None:
|
|
180
|
+
params["nthreads"] = nthreads
|
|
181
|
+
if config is not None:
|
|
182
|
+
params["config"] = config
|
|
183
|
+
return params
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def fixel2sh_validate(
|
|
187
|
+
params: typing.Any,
|
|
188
|
+
) -> None:
|
|
189
|
+
"""
|
|
190
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
191
|
+
`Fixel2shParamsDict` object.
|
|
192
|
+
|
|
193
|
+
Args:
|
|
194
|
+
params: The parameters object to validate.
|
|
195
|
+
"""
|
|
196
|
+
if params is None or not isinstance(params, dict):
|
|
197
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
198
|
+
if params.get("lmax", None) is not None:
|
|
199
|
+
if not isinstance(params["lmax"], int):
|
|
200
|
+
raise StyxValidationError(f'`lmax` has the wrong type: Received `{type(params.get("lmax", None))}` expected `int | None`')
|
|
201
|
+
if params.get("info", False) is None:
|
|
202
|
+
raise StyxValidationError("`info` must not be None")
|
|
203
|
+
if not isinstance(params["info"], bool):
|
|
204
|
+
raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
|
|
205
|
+
if params.get("quiet", False) is None:
|
|
206
|
+
raise StyxValidationError("`quiet` must not be None")
|
|
207
|
+
if not isinstance(params["quiet"], bool):
|
|
208
|
+
raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
|
|
209
|
+
if params.get("debug", False) is None:
|
|
210
|
+
raise StyxValidationError("`debug` must not be None")
|
|
211
|
+
if not isinstance(params["debug"], bool):
|
|
212
|
+
raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
|
|
213
|
+
if params.get("force", False) is None:
|
|
214
|
+
raise StyxValidationError("`force` must not be None")
|
|
215
|
+
if not isinstance(params["force"], bool):
|
|
216
|
+
raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
|
|
217
|
+
if params.get("nthreads", None) is not None:
|
|
218
|
+
if not isinstance(params["nthreads"], int):
|
|
219
|
+
raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
|
|
220
|
+
if params.get("config", None) is not None:
|
|
221
|
+
if not isinstance(params["config"], list):
|
|
222
|
+
raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[Fixel2shConfigParamsDict] | None`')
|
|
223
|
+
for e in params["config"]:
|
|
224
|
+
fixel2sh_config_validate(e)
|
|
225
|
+
if params.get("help", False) is None:
|
|
226
|
+
raise StyxValidationError("`help` must not be None")
|
|
227
|
+
if not isinstance(params["help"], bool):
|
|
228
|
+
raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
|
|
229
|
+
if params.get("version", False) is None:
|
|
230
|
+
raise StyxValidationError("`version` must not be None")
|
|
231
|
+
if not isinstance(params["version"], bool):
|
|
232
|
+
raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
|
|
233
|
+
if params.get("fixel_in", None) is None:
|
|
234
|
+
raise StyxValidationError("`fixel_in` must not be None")
|
|
235
|
+
if not isinstance(params["fixel_in"], (pathlib.Path, str)):
|
|
236
|
+
raise StyxValidationError(f'`fixel_in` has the wrong type: Received `{type(params.get("fixel_in", None))}` expected `InputPathType`')
|
|
237
|
+
if params.get("sh_out", None) is None:
|
|
238
|
+
raise StyxValidationError("`sh_out` must not be None")
|
|
239
|
+
if not isinstance(params["sh_out"], str):
|
|
240
|
+
raise StyxValidationError(f'`sh_out` has the wrong type: Received `{type(params.get("sh_out", None))}` expected `str`')
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def fixel2sh_cargs(
|
|
244
|
+
params: Fixel2shParamsDict,
|
|
245
|
+
execution: Execution,
|
|
246
|
+
) -> list[str]:
|
|
247
|
+
"""
|
|
248
|
+
Build command-line arguments from parameters.
|
|
249
|
+
|
|
250
|
+
Args:
|
|
251
|
+
params: The parameters.
|
|
252
|
+
execution: The execution object for resolving input paths.
|
|
253
|
+
Returns:
|
|
254
|
+
Command-line arguments.
|
|
255
|
+
"""
|
|
256
|
+
cargs = []
|
|
257
|
+
cargs.append("fixel2sh")
|
|
258
|
+
if params.get("lmax", None) is not None:
|
|
259
|
+
cargs.extend([
|
|
260
|
+
"-lmax",
|
|
261
|
+
str(params.get("lmax", None))
|
|
262
|
+
])
|
|
263
|
+
if params.get("info", False):
|
|
264
|
+
cargs.append("-info")
|
|
265
|
+
if params.get("quiet", False):
|
|
266
|
+
cargs.append("-quiet")
|
|
267
|
+
if params.get("debug", False):
|
|
268
|
+
cargs.append("-debug")
|
|
269
|
+
if params.get("force", False):
|
|
270
|
+
cargs.append("-force")
|
|
271
|
+
if params.get("nthreads", None) is not None:
|
|
272
|
+
cargs.extend([
|
|
273
|
+
"-nthreads",
|
|
274
|
+
str(params.get("nthreads", None))
|
|
275
|
+
])
|
|
276
|
+
if params.get("config", None) is not None:
|
|
277
|
+
cargs.extend([a for c in [fixel2sh_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
278
|
+
if params.get("help", False):
|
|
279
|
+
cargs.append("-help")
|
|
280
|
+
if params.get("version", False):
|
|
281
|
+
cargs.append("-version")
|
|
282
|
+
cargs.append(execution.input_file(params.get("fixel_in", None)))
|
|
283
|
+
cargs.append(params.get("sh_out", None))
|
|
284
|
+
return cargs
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
def fixel2sh_outputs(
|
|
288
|
+
params: Fixel2shParamsDict,
|
|
289
|
+
execution: Execution,
|
|
290
|
+
) -> Fixel2shOutputs:
|
|
291
|
+
"""
|
|
292
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
293
|
+
|
|
294
|
+
Args:
|
|
295
|
+
params: The parameters.
|
|
296
|
+
execution: The execution object for resolving input paths.
|
|
297
|
+
Returns:
|
|
298
|
+
Outputs object.
|
|
299
|
+
"""
|
|
300
|
+
ret = Fixel2shOutputs(
|
|
301
|
+
root=execution.output_file("."),
|
|
302
|
+
sh_out=execution.output_file(params.get("sh_out", None)),
|
|
303
|
+
)
|
|
304
|
+
return ret
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def fixel2sh_execute(
|
|
308
|
+
params: Fixel2shParamsDict,
|
|
309
|
+
runner: Runner | None = None,
|
|
310
|
+
) -> Fixel2shOutputs:
|
|
311
|
+
"""
|
|
312
|
+
fixel2sh
|
|
313
|
+
|
|
314
|
+
Convert a fixel-based sparse-data image into an spherical harmonic image.
|
|
315
|
+
|
|
316
|
+
This command generates spherical harmonic data from fixels that can be
|
|
317
|
+
visualised using the ODF tool in MRview. The output ODF lobes are scaled
|
|
318
|
+
according to the values in the input fixel image.
|
|
319
|
+
|
|
320
|
+
The spherical harmonic coefficients are stored according the conventions
|
|
321
|
+
described the main documentation, which can be found at the following link:
|
|
322
|
+
https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html
|
|
323
|
+
|
|
324
|
+
References:
|
|
325
|
+
|
|
326
|
+
.
|
|
327
|
+
|
|
328
|
+
Author: MRTrix3 Developers
|
|
329
|
+
|
|
330
|
+
URL: https://www.mrtrix.org/
|
|
331
|
+
|
|
332
|
+
Args:
|
|
333
|
+
params: The parameters.
|
|
334
|
+
runner: Command runner.
|
|
335
|
+
Returns:
|
|
336
|
+
NamedTuple of outputs (described in `Fixel2shOutputs`).
|
|
337
|
+
"""
|
|
338
|
+
fixel2sh_validate(params)
|
|
339
|
+
runner = runner or get_global_runner()
|
|
340
|
+
execution = runner.start_execution(FIXEL2SH_METADATA)
|
|
341
|
+
params = execution.params(params)
|
|
342
|
+
cargs = fixel2sh_cargs(params, execution)
|
|
343
|
+
ret = fixel2sh_outputs(params, execution)
|
|
344
|
+
execution.run(cargs)
|
|
345
|
+
return ret
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
def fixel2sh(
|
|
349
|
+
fixel_in: InputPathType,
|
|
350
|
+
sh_out: str,
|
|
351
|
+
lmax: int | None = None,
|
|
352
|
+
info: bool = False,
|
|
353
|
+
quiet: bool = False,
|
|
354
|
+
debug: bool = False,
|
|
355
|
+
force: bool = False,
|
|
356
|
+
nthreads: int | None = None,
|
|
357
|
+
config: list[Fixel2shConfigParamsDict] | None = None,
|
|
358
|
+
help_: bool = False,
|
|
359
|
+
version: bool = False,
|
|
360
|
+
runner: Runner | None = None,
|
|
361
|
+
) -> Fixel2shOutputs:
|
|
362
|
+
"""
|
|
363
|
+
fixel2sh
|
|
364
|
+
|
|
365
|
+
Convert a fixel-based sparse-data image into an spherical harmonic image.
|
|
366
|
+
|
|
367
|
+
This command generates spherical harmonic data from fixels that can be
|
|
368
|
+
visualised using the ODF tool in MRview. The output ODF lobes are scaled
|
|
369
|
+
according to the values in the input fixel image.
|
|
370
|
+
|
|
371
|
+
The spherical harmonic coefficients are stored according the conventions
|
|
372
|
+
described the main documentation, which can be found at the following link:
|
|
373
|
+
https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html
|
|
374
|
+
|
|
375
|
+
References:
|
|
376
|
+
|
|
377
|
+
.
|
|
378
|
+
|
|
379
|
+
Author: MRTrix3 Developers
|
|
380
|
+
|
|
381
|
+
URL: https://www.mrtrix.org/
|
|
382
|
+
|
|
383
|
+
Args:
|
|
384
|
+
fixel_in: the input fixel data file.
|
|
385
|
+
sh_out: the output sh image.
|
|
386
|
+
lmax: set the maximum harmonic order for the output series (Default: 8).
|
|
387
|
+
info: display information messages.
|
|
388
|
+
quiet: do not display information messages or progress status;\
|
|
389
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
390
|
+
environment variable to a non-empty string.
|
|
391
|
+
debug: display debugging messages.
|
|
392
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
393
|
+
input and output might cause unexpected behaviour).
|
|
394
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
395
|
+
(set to 0 to disable multi-threading).
|
|
396
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
397
|
+
help_: display this information page and exit.
|
|
398
|
+
version: display version information and exit.
|
|
399
|
+
runner: Command runner.
|
|
400
|
+
Returns:
|
|
401
|
+
NamedTuple of outputs (described in `Fixel2shOutputs`).
|
|
402
|
+
"""
|
|
403
|
+
params = fixel2sh_params(
|
|
404
|
+
lmax=lmax,
|
|
405
|
+
info=info,
|
|
406
|
+
quiet=quiet,
|
|
407
|
+
debug=debug,
|
|
408
|
+
force=force,
|
|
409
|
+
nthreads=nthreads,
|
|
410
|
+
config=config,
|
|
411
|
+
help_=help_,
|
|
412
|
+
version=version,
|
|
413
|
+
fixel_in=fixel_in,
|
|
414
|
+
sh_out=sh_out,
|
|
415
|
+
)
|
|
416
|
+
return fixel2sh_execute(params, runner)
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
__all__ = [
|
|
420
|
+
"FIXEL2SH_METADATA",
|
|
421
|
+
"Fixel2shConfigParamsDict",
|
|
422
|
+
"Fixel2shConfigParamsDictTagged",
|
|
423
|
+
"Fixel2shOutputs",
|
|
424
|
+
"Fixel2shParamsDict",
|
|
425
|
+
"Fixel2shParamsDictTagged",
|
|
426
|
+
"fixel2sh",
|
|
427
|
+
"fixel2sh_config",
|
|
428
|
+
"fixel2sh_execute",
|
|
429
|
+
"fixel2sh_params",
|
|
430
|
+
]
|