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,498 @@
|
|
|
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
|
+
SHCONV_METADATA = Metadata(
|
|
9
|
+
id="3c84c5743ea66d880048dc5dc975db440966a75e.boutiques",
|
|
10
|
+
name="shconv",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
ShconvVariousStringParameters = typing.TypedDict('ShconvVariousStringParameters', {
|
|
17
|
+
"__STYX_TYPE__": typing.Literal["VariousString"],
|
|
18
|
+
"obj": str,
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
ShconvVariousFileParameters = typing.TypedDict('ShconvVariousFileParameters', {
|
|
23
|
+
"__STYX_TYPE__": typing.Literal["VariousFile"],
|
|
24
|
+
"obj": InputPathType,
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
ShconvConfigParameters = typing.TypedDict('ShconvConfigParameters', {
|
|
29
|
+
"__STYX_TYPE__": typing.Literal["config"],
|
|
30
|
+
"key": str,
|
|
31
|
+
"value": str,
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
ShconvParameters = typing.TypedDict('ShconvParameters', {
|
|
36
|
+
"__STYX_TYPE__": typing.Literal["shconv"],
|
|
37
|
+
"datatype": typing.NotRequired[str | None],
|
|
38
|
+
"strides": typing.NotRequired[typing.Union[ShconvVariousStringParameters, ShconvVariousFileParameters] | None],
|
|
39
|
+
"info": bool,
|
|
40
|
+
"quiet": bool,
|
|
41
|
+
"debug": bool,
|
|
42
|
+
"force": bool,
|
|
43
|
+
"nthreads": typing.NotRequired[int | None],
|
|
44
|
+
"config": typing.NotRequired[list[ShconvConfigParameters] | None],
|
|
45
|
+
"help": bool,
|
|
46
|
+
"version": bool,
|
|
47
|
+
"odf_response": list[str],
|
|
48
|
+
"SH_out": str,
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def dyn_cargs(
|
|
53
|
+
t: str,
|
|
54
|
+
) -> typing.Any:
|
|
55
|
+
"""
|
|
56
|
+
Get build cargs function by command type.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
t: Command type.
|
|
60
|
+
Returns:
|
|
61
|
+
Build cargs function.
|
|
62
|
+
"""
|
|
63
|
+
return {
|
|
64
|
+
"shconv": shconv_cargs,
|
|
65
|
+
"VariousString": shconv_various_string_cargs,
|
|
66
|
+
"VariousFile": shconv_various_file_cargs,
|
|
67
|
+
"config": shconv_config_cargs,
|
|
68
|
+
}.get(t)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def dyn_outputs(
|
|
72
|
+
t: str,
|
|
73
|
+
) -> typing.Any:
|
|
74
|
+
"""
|
|
75
|
+
Get build outputs function by command type.
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
t: Command type.
|
|
79
|
+
Returns:
|
|
80
|
+
Build outputs function.
|
|
81
|
+
"""
|
|
82
|
+
return {
|
|
83
|
+
"shconv": shconv_outputs,
|
|
84
|
+
}.get(t)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def shconv_various_string_params(
|
|
88
|
+
obj: str,
|
|
89
|
+
) -> ShconvVariousStringParameters:
|
|
90
|
+
"""
|
|
91
|
+
Build parameters.
|
|
92
|
+
|
|
93
|
+
Args:
|
|
94
|
+
obj: String object.
|
|
95
|
+
Returns:
|
|
96
|
+
Parameter dictionary
|
|
97
|
+
"""
|
|
98
|
+
params = {
|
|
99
|
+
"__STYXTYPE__": "VariousString",
|
|
100
|
+
"obj": obj,
|
|
101
|
+
}
|
|
102
|
+
return params
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def shconv_various_string_cargs(
|
|
106
|
+
params: ShconvVariousStringParameters,
|
|
107
|
+
execution: Execution,
|
|
108
|
+
) -> list[str]:
|
|
109
|
+
"""
|
|
110
|
+
Build command-line arguments from parameters.
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
params: The parameters.
|
|
114
|
+
execution: The execution object for resolving input paths.
|
|
115
|
+
Returns:
|
|
116
|
+
Command-line arguments.
|
|
117
|
+
"""
|
|
118
|
+
cargs = []
|
|
119
|
+
cargs.append(params.get("obj"))
|
|
120
|
+
return cargs
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def shconv_various_file_params(
|
|
124
|
+
obj: InputPathType,
|
|
125
|
+
) -> ShconvVariousFileParameters:
|
|
126
|
+
"""
|
|
127
|
+
Build parameters.
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
obj: File object.
|
|
131
|
+
Returns:
|
|
132
|
+
Parameter dictionary
|
|
133
|
+
"""
|
|
134
|
+
params = {
|
|
135
|
+
"__STYXTYPE__": "VariousFile",
|
|
136
|
+
"obj": obj,
|
|
137
|
+
}
|
|
138
|
+
return params
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def shconv_various_file_cargs(
|
|
142
|
+
params: ShconvVariousFileParameters,
|
|
143
|
+
execution: Execution,
|
|
144
|
+
) -> list[str]:
|
|
145
|
+
"""
|
|
146
|
+
Build command-line arguments from parameters.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
params: The parameters.
|
|
150
|
+
execution: The execution object for resolving input paths.
|
|
151
|
+
Returns:
|
|
152
|
+
Command-line arguments.
|
|
153
|
+
"""
|
|
154
|
+
cargs = []
|
|
155
|
+
cargs.append(execution.input_file(params.get("obj")))
|
|
156
|
+
return cargs
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def shconv_config_params(
|
|
160
|
+
key: str,
|
|
161
|
+
value: str,
|
|
162
|
+
) -> ShconvConfigParameters:
|
|
163
|
+
"""
|
|
164
|
+
Build parameters.
|
|
165
|
+
|
|
166
|
+
Args:
|
|
167
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
168
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
169
|
+
Returns:
|
|
170
|
+
Parameter dictionary
|
|
171
|
+
"""
|
|
172
|
+
params = {
|
|
173
|
+
"__STYXTYPE__": "config",
|
|
174
|
+
"key": key,
|
|
175
|
+
"value": value,
|
|
176
|
+
}
|
|
177
|
+
return params
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def shconv_config_cargs(
|
|
181
|
+
params: ShconvConfigParameters,
|
|
182
|
+
execution: Execution,
|
|
183
|
+
) -> list[str]:
|
|
184
|
+
"""
|
|
185
|
+
Build command-line arguments from parameters.
|
|
186
|
+
|
|
187
|
+
Args:
|
|
188
|
+
params: The parameters.
|
|
189
|
+
execution: The execution object for resolving input paths.
|
|
190
|
+
Returns:
|
|
191
|
+
Command-line arguments.
|
|
192
|
+
"""
|
|
193
|
+
cargs = []
|
|
194
|
+
cargs.append("-config")
|
|
195
|
+
cargs.append(params.get("key"))
|
|
196
|
+
cargs.append(params.get("value"))
|
|
197
|
+
return cargs
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class ShconvOutputs(typing.NamedTuple):
|
|
201
|
+
"""
|
|
202
|
+
Output object returned when calling `shconv(...)`.
|
|
203
|
+
"""
|
|
204
|
+
root: OutputPathType
|
|
205
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
206
|
+
sh_out: OutputPathType
|
|
207
|
+
"""the output spherical harmonics coefficients image."""
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def shconv_params(
|
|
211
|
+
odf_response: list[str],
|
|
212
|
+
sh_out: str,
|
|
213
|
+
datatype: str | None = None,
|
|
214
|
+
strides: typing.Union[ShconvVariousStringParameters, ShconvVariousFileParameters] | None = None,
|
|
215
|
+
info: bool = False,
|
|
216
|
+
quiet: bool = False,
|
|
217
|
+
debug: bool = False,
|
|
218
|
+
force: bool = False,
|
|
219
|
+
nthreads: int | None = None,
|
|
220
|
+
config: list[ShconvConfigParameters] | None = None,
|
|
221
|
+
help_: bool = False,
|
|
222
|
+
version: bool = False,
|
|
223
|
+
) -> ShconvParameters:
|
|
224
|
+
"""
|
|
225
|
+
Build parameters.
|
|
226
|
+
|
|
227
|
+
Args:
|
|
228
|
+
odf_response: pairs of input ODF image and corresponding responses.
|
|
229
|
+
sh_out: the output spherical harmonics coefficients image.
|
|
230
|
+
datatype: specify output image data type. Valid choices are: float32,\
|
|
231
|
+
float32le, float32be, float64, float64le, float64be, int64, uint64,\
|
|
232
|
+
int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
|
|
233
|
+
int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
|
|
234
|
+
cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
|
|
235
|
+
int8, uint8, bit.
|
|
236
|
+
strides: specify the strides of the output data in memory; either as a\
|
|
237
|
+
comma-separated list of (signed) integers, or as a template image from\
|
|
238
|
+
which the strides shall be extracted and used. The actual strides\
|
|
239
|
+
produced will depend on whether the output image format can support it.
|
|
240
|
+
info: display information messages.
|
|
241
|
+
quiet: do not display information messages or progress status;\
|
|
242
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
243
|
+
environment variable to a non-empty string.
|
|
244
|
+
debug: display debugging messages.
|
|
245
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
246
|
+
input and output might cause unexpected behaviour).
|
|
247
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
248
|
+
(set to 0 to disable multi-threading).
|
|
249
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
250
|
+
help_: display this information page and exit.
|
|
251
|
+
version: display version information and exit.
|
|
252
|
+
Returns:
|
|
253
|
+
Parameter dictionary
|
|
254
|
+
"""
|
|
255
|
+
params = {
|
|
256
|
+
"__STYXTYPE__": "shconv",
|
|
257
|
+
"info": info,
|
|
258
|
+
"quiet": quiet,
|
|
259
|
+
"debug": debug,
|
|
260
|
+
"force": force,
|
|
261
|
+
"help": help_,
|
|
262
|
+
"version": version,
|
|
263
|
+
"odf_response": odf_response,
|
|
264
|
+
"SH_out": sh_out,
|
|
265
|
+
}
|
|
266
|
+
if datatype is not None:
|
|
267
|
+
params["datatype"] = datatype
|
|
268
|
+
if strides is not None:
|
|
269
|
+
params["strides"] = strides
|
|
270
|
+
if nthreads is not None:
|
|
271
|
+
params["nthreads"] = nthreads
|
|
272
|
+
if config is not None:
|
|
273
|
+
params["config"] = config
|
|
274
|
+
return params
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def shconv_cargs(
|
|
278
|
+
params: ShconvParameters,
|
|
279
|
+
execution: Execution,
|
|
280
|
+
) -> list[str]:
|
|
281
|
+
"""
|
|
282
|
+
Build command-line arguments from parameters.
|
|
283
|
+
|
|
284
|
+
Args:
|
|
285
|
+
params: The parameters.
|
|
286
|
+
execution: The execution object for resolving input paths.
|
|
287
|
+
Returns:
|
|
288
|
+
Command-line arguments.
|
|
289
|
+
"""
|
|
290
|
+
cargs = []
|
|
291
|
+
cargs.append("shconv")
|
|
292
|
+
if params.get("datatype") is not None:
|
|
293
|
+
cargs.extend([
|
|
294
|
+
"-datatype",
|
|
295
|
+
params.get("datatype")
|
|
296
|
+
])
|
|
297
|
+
if params.get("strides") is not None:
|
|
298
|
+
cargs.extend([
|
|
299
|
+
"-strides",
|
|
300
|
+
*dyn_cargs(params.get("strides")["__STYXTYPE__"])(params.get("strides"), execution)
|
|
301
|
+
])
|
|
302
|
+
if params.get("info"):
|
|
303
|
+
cargs.append("-info")
|
|
304
|
+
if params.get("quiet"):
|
|
305
|
+
cargs.append("-quiet")
|
|
306
|
+
if params.get("debug"):
|
|
307
|
+
cargs.append("-debug")
|
|
308
|
+
if params.get("force"):
|
|
309
|
+
cargs.append("-force")
|
|
310
|
+
if params.get("nthreads") is not None:
|
|
311
|
+
cargs.extend([
|
|
312
|
+
"-nthreads",
|
|
313
|
+
str(params.get("nthreads"))
|
|
314
|
+
])
|
|
315
|
+
if params.get("config") is not None:
|
|
316
|
+
cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
|
|
317
|
+
if params.get("help"):
|
|
318
|
+
cargs.append("-help")
|
|
319
|
+
if params.get("version"):
|
|
320
|
+
cargs.append("-version")
|
|
321
|
+
cargs.extend(params.get("odf_response"))
|
|
322
|
+
cargs.append(params.get("SH_out"))
|
|
323
|
+
return cargs
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
def shconv_outputs(
|
|
327
|
+
params: ShconvParameters,
|
|
328
|
+
execution: Execution,
|
|
329
|
+
) -> ShconvOutputs:
|
|
330
|
+
"""
|
|
331
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
332
|
+
|
|
333
|
+
Args:
|
|
334
|
+
params: The parameters.
|
|
335
|
+
execution: The execution object for resolving input paths.
|
|
336
|
+
Returns:
|
|
337
|
+
Outputs object.
|
|
338
|
+
"""
|
|
339
|
+
ret = ShconvOutputs(
|
|
340
|
+
root=execution.output_file("."),
|
|
341
|
+
sh_out=execution.output_file(params.get("SH_out")),
|
|
342
|
+
)
|
|
343
|
+
return ret
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
def shconv_execute(
|
|
347
|
+
params: ShconvParameters,
|
|
348
|
+
execution: Execution,
|
|
349
|
+
) -> ShconvOutputs:
|
|
350
|
+
"""
|
|
351
|
+
Perform spherical convolution.
|
|
352
|
+
|
|
353
|
+
Provided with matching pairs of response function and ODF images (containing
|
|
354
|
+
SH coefficients), perform spherical convolution to provide the corresponding
|
|
355
|
+
SH coefficients of the signal.
|
|
356
|
+
|
|
357
|
+
If multiple pairs of inputs are provided, their contributions will be summed
|
|
358
|
+
into a single output.
|
|
359
|
+
|
|
360
|
+
If the responses are multi-shell (with one line of coefficients per shell),
|
|
361
|
+
the output will be a 5-dimensional image, with the SH coefficients of the
|
|
362
|
+
signal in each shell stored at different indices along the 5th dimension.
|
|
363
|
+
|
|
364
|
+
The spherical harmonic coefficients are stored according the conventions
|
|
365
|
+
described the main documentation, which can be found at the following link:
|
|
366
|
+
https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html
|
|
367
|
+
|
|
368
|
+
The spherical harmonic coefficients are stored according the conventions
|
|
369
|
+
described the main documentation, which can be found at the following link:
|
|
370
|
+
https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html
|
|
371
|
+
|
|
372
|
+
References:
|
|
373
|
+
|
|
374
|
+
.
|
|
375
|
+
|
|
376
|
+
Author: MRTrix3 Developers
|
|
377
|
+
|
|
378
|
+
URL: https://www.mrtrix.org/
|
|
379
|
+
|
|
380
|
+
Args:
|
|
381
|
+
params: The parameters.
|
|
382
|
+
execution: The execution object.
|
|
383
|
+
Returns:
|
|
384
|
+
NamedTuple of outputs (described in `ShconvOutputs`).
|
|
385
|
+
"""
|
|
386
|
+
params = execution.params(params)
|
|
387
|
+
cargs = shconv_cargs(params, execution)
|
|
388
|
+
ret = shconv_outputs(params, execution)
|
|
389
|
+
execution.run(cargs)
|
|
390
|
+
return ret
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
def shconv(
|
|
394
|
+
odf_response: list[str],
|
|
395
|
+
sh_out: str,
|
|
396
|
+
datatype: str | None = None,
|
|
397
|
+
strides: typing.Union[ShconvVariousStringParameters, ShconvVariousFileParameters] | None = None,
|
|
398
|
+
info: bool = False,
|
|
399
|
+
quiet: bool = False,
|
|
400
|
+
debug: bool = False,
|
|
401
|
+
force: bool = False,
|
|
402
|
+
nthreads: int | None = None,
|
|
403
|
+
config: list[ShconvConfigParameters] | None = None,
|
|
404
|
+
help_: bool = False,
|
|
405
|
+
version: bool = False,
|
|
406
|
+
runner: Runner | None = None,
|
|
407
|
+
) -> ShconvOutputs:
|
|
408
|
+
"""
|
|
409
|
+
Perform spherical convolution.
|
|
410
|
+
|
|
411
|
+
Provided with matching pairs of response function and ODF images (containing
|
|
412
|
+
SH coefficients), perform spherical convolution to provide the corresponding
|
|
413
|
+
SH coefficients of the signal.
|
|
414
|
+
|
|
415
|
+
If multiple pairs of inputs are provided, their contributions will be summed
|
|
416
|
+
into a single output.
|
|
417
|
+
|
|
418
|
+
If the responses are multi-shell (with one line of coefficients per shell),
|
|
419
|
+
the output will be a 5-dimensional image, with the SH coefficients of the
|
|
420
|
+
signal in each shell stored at different indices along the 5th dimension.
|
|
421
|
+
|
|
422
|
+
The spherical harmonic coefficients are stored according the conventions
|
|
423
|
+
described the main documentation, which can be found at the following link:
|
|
424
|
+
https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html
|
|
425
|
+
|
|
426
|
+
The spherical harmonic coefficients are stored according the conventions
|
|
427
|
+
described the main documentation, which can be found at the following link:
|
|
428
|
+
https://mrtrix.readthedocs.io/en/3.0.4/concepts/spherical_harmonics.html
|
|
429
|
+
|
|
430
|
+
References:
|
|
431
|
+
|
|
432
|
+
.
|
|
433
|
+
|
|
434
|
+
Author: MRTrix3 Developers
|
|
435
|
+
|
|
436
|
+
URL: https://www.mrtrix.org/
|
|
437
|
+
|
|
438
|
+
Args:
|
|
439
|
+
odf_response: pairs of input ODF image and corresponding responses.
|
|
440
|
+
sh_out: the output spherical harmonics coefficients image.
|
|
441
|
+
datatype: specify output image data type. Valid choices are: float32,\
|
|
442
|
+
float32le, float32be, float64, float64le, float64be, int64, uint64,\
|
|
443
|
+
int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
|
|
444
|
+
int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
|
|
445
|
+
cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
|
|
446
|
+
int8, uint8, bit.
|
|
447
|
+
strides: specify the strides of the output data in memory; either as a\
|
|
448
|
+
comma-separated list of (signed) integers, or as a template image from\
|
|
449
|
+
which the strides shall be extracted and used. The actual strides\
|
|
450
|
+
produced will depend on whether the output image format can support it.
|
|
451
|
+
info: display information messages.
|
|
452
|
+
quiet: do not display information messages or progress status;\
|
|
453
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
454
|
+
environment variable to a non-empty string.
|
|
455
|
+
debug: display debugging messages.
|
|
456
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
457
|
+
input and output might cause unexpected behaviour).
|
|
458
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
459
|
+
(set to 0 to disable multi-threading).
|
|
460
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
461
|
+
help_: display this information page and exit.
|
|
462
|
+
version: display version information and exit.
|
|
463
|
+
runner: Command runner.
|
|
464
|
+
Returns:
|
|
465
|
+
NamedTuple of outputs (described in `ShconvOutputs`).
|
|
466
|
+
"""
|
|
467
|
+
runner = runner or get_global_runner()
|
|
468
|
+
execution = runner.start_execution(SHCONV_METADATA)
|
|
469
|
+
params = shconv_params(
|
|
470
|
+
datatype=datatype,
|
|
471
|
+
strides=strides,
|
|
472
|
+
info=info,
|
|
473
|
+
quiet=quiet,
|
|
474
|
+
debug=debug,
|
|
475
|
+
force=force,
|
|
476
|
+
nthreads=nthreads,
|
|
477
|
+
config=config,
|
|
478
|
+
help_=help_,
|
|
479
|
+
version=version,
|
|
480
|
+
odf_response=odf_response,
|
|
481
|
+
sh_out=sh_out,
|
|
482
|
+
)
|
|
483
|
+
return shconv_execute(params, execution)
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
__all__ = [
|
|
487
|
+
"SHCONV_METADATA",
|
|
488
|
+
"ShconvConfigParameters",
|
|
489
|
+
"ShconvOutputs",
|
|
490
|
+
"ShconvParameters",
|
|
491
|
+
"ShconvVariousFileParameters",
|
|
492
|
+
"ShconvVariousStringParameters",
|
|
493
|
+
"shconv",
|
|
494
|
+
"shconv_config_params",
|
|
495
|
+
"shconv_params",
|
|
496
|
+
"shconv_various_file_params",
|
|
497
|
+
"shconv_various_string_params",
|
|
498
|
+
]
|