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,437 @@
|
|
|
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
|
+
FIXEL2VOXEL_METADATA = Metadata(
|
|
9
|
+
id="5fccec41beac5ebb945c548f352825b1de7de1ba.boutiques",
|
|
10
|
+
name="fixel2voxel",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Fixel2voxelConfigParameters = typing.TypedDict('Fixel2voxelConfigParameters', {
|
|
17
|
+
"__STYX_TYPE__": typing.Literal["config"],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
Fixel2voxelParameters = typing.TypedDict('Fixel2voxelParameters', {
|
|
24
|
+
"__STYX_TYPE__": typing.Literal["fixel2voxel"],
|
|
25
|
+
"number": typing.NotRequired[int | None],
|
|
26
|
+
"fill": typing.NotRequired[float | None],
|
|
27
|
+
"weighted": typing.NotRequired[InputPathType | None],
|
|
28
|
+
"info": bool,
|
|
29
|
+
"quiet": bool,
|
|
30
|
+
"debug": bool,
|
|
31
|
+
"force": bool,
|
|
32
|
+
"nthreads": typing.NotRequired[int | None],
|
|
33
|
+
"config": typing.NotRequired[list[Fixel2voxelConfigParameters] | None],
|
|
34
|
+
"help": bool,
|
|
35
|
+
"version": bool,
|
|
36
|
+
"fixel_in": InputPathType,
|
|
37
|
+
"operation": str,
|
|
38
|
+
"image_out": str,
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def dyn_cargs(
|
|
43
|
+
t: str,
|
|
44
|
+
) -> typing.Any:
|
|
45
|
+
"""
|
|
46
|
+
Get build cargs function by command type.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
t: Command type.
|
|
50
|
+
Returns:
|
|
51
|
+
Build cargs function.
|
|
52
|
+
"""
|
|
53
|
+
return {
|
|
54
|
+
"fixel2voxel": fixel2voxel_cargs,
|
|
55
|
+
"config": fixel2voxel_config_cargs,
|
|
56
|
+
}.get(t)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def dyn_outputs(
|
|
60
|
+
t: str,
|
|
61
|
+
) -> typing.Any:
|
|
62
|
+
"""
|
|
63
|
+
Get build outputs function by command type.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
t: Command type.
|
|
67
|
+
Returns:
|
|
68
|
+
Build outputs function.
|
|
69
|
+
"""
|
|
70
|
+
return {
|
|
71
|
+
"fixel2voxel": fixel2voxel_outputs,
|
|
72
|
+
}.get(t)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def fixel2voxel_config_params(
|
|
76
|
+
key: str,
|
|
77
|
+
value: str,
|
|
78
|
+
) -> Fixel2voxelConfigParameters:
|
|
79
|
+
"""
|
|
80
|
+
Build parameters.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
84
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
85
|
+
Returns:
|
|
86
|
+
Parameter dictionary
|
|
87
|
+
"""
|
|
88
|
+
params = {
|
|
89
|
+
"__STYXTYPE__": "config",
|
|
90
|
+
"key": key,
|
|
91
|
+
"value": value,
|
|
92
|
+
}
|
|
93
|
+
return params
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def fixel2voxel_config_cargs(
|
|
97
|
+
params: Fixel2voxelConfigParameters,
|
|
98
|
+
execution: Execution,
|
|
99
|
+
) -> list[str]:
|
|
100
|
+
"""
|
|
101
|
+
Build command-line arguments from parameters.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
params: The parameters.
|
|
105
|
+
execution: The execution object for resolving input paths.
|
|
106
|
+
Returns:
|
|
107
|
+
Command-line arguments.
|
|
108
|
+
"""
|
|
109
|
+
cargs = []
|
|
110
|
+
cargs.append("-config")
|
|
111
|
+
cargs.append(params.get("key"))
|
|
112
|
+
cargs.append(params.get("value"))
|
|
113
|
+
return cargs
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class Fixel2voxelOutputs(typing.NamedTuple):
|
|
117
|
+
"""
|
|
118
|
+
Output object returned when calling `fixel2voxel(...)`.
|
|
119
|
+
"""
|
|
120
|
+
root: OutputPathType
|
|
121
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
122
|
+
image_out: OutputPathType
|
|
123
|
+
"""the output scalar image."""
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def fixel2voxel_params(
|
|
127
|
+
fixel_in: InputPathType,
|
|
128
|
+
operation: str,
|
|
129
|
+
image_out: str,
|
|
130
|
+
number: int | None = None,
|
|
131
|
+
fill: float | None = None,
|
|
132
|
+
weighted: InputPathType | None = None,
|
|
133
|
+
info: bool = False,
|
|
134
|
+
quiet: bool = False,
|
|
135
|
+
debug: bool = False,
|
|
136
|
+
force: bool = False,
|
|
137
|
+
nthreads: int | None = None,
|
|
138
|
+
config: list[Fixel2voxelConfigParameters] | None = None,
|
|
139
|
+
help_: bool = False,
|
|
140
|
+
version: bool = False,
|
|
141
|
+
) -> Fixel2voxelParameters:
|
|
142
|
+
"""
|
|
143
|
+
Build parameters.
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
fixel_in: the input fixel data file.
|
|
147
|
+
operation: the operation to apply, one of: mean, sum, product, min,\
|
|
148
|
+
max, absmax, magmax, count, complexity, sf, dec_unit, dec_scaled, none.
|
|
149
|
+
image_out: the output scalar image.
|
|
150
|
+
number: use only the largest N fixels in calculation of the voxel-wise\
|
|
151
|
+
statistic; in the case of operation "none", output only the largest N\
|
|
152
|
+
fixels in each voxel.
|
|
153
|
+
fill: for "none" operation, specify the value to fill when number of\
|
|
154
|
+
fixels is fewer than the maximum (default: 0.0).
|
|
155
|
+
weighted: weight the contribution of each fixel to the per-voxel result\
|
|
156
|
+
according to its volume.
|
|
157
|
+
info: display information messages.
|
|
158
|
+
quiet: do not display information messages or progress status;\
|
|
159
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
160
|
+
environment variable to a non-empty string.
|
|
161
|
+
debug: display debugging messages.
|
|
162
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
163
|
+
input and output might cause unexpected behaviour).
|
|
164
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
165
|
+
(set to 0 to disable multi-threading).
|
|
166
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
167
|
+
help_: display this information page and exit.
|
|
168
|
+
version: display version information and exit.
|
|
169
|
+
Returns:
|
|
170
|
+
Parameter dictionary
|
|
171
|
+
"""
|
|
172
|
+
params = {
|
|
173
|
+
"__STYXTYPE__": "fixel2voxel",
|
|
174
|
+
"info": info,
|
|
175
|
+
"quiet": quiet,
|
|
176
|
+
"debug": debug,
|
|
177
|
+
"force": force,
|
|
178
|
+
"help": help_,
|
|
179
|
+
"version": version,
|
|
180
|
+
"fixel_in": fixel_in,
|
|
181
|
+
"operation": operation,
|
|
182
|
+
"image_out": image_out,
|
|
183
|
+
}
|
|
184
|
+
if number is not None:
|
|
185
|
+
params["number"] = number
|
|
186
|
+
if fill is not None:
|
|
187
|
+
params["fill"] = fill
|
|
188
|
+
if weighted is not None:
|
|
189
|
+
params["weighted"] = weighted
|
|
190
|
+
if nthreads is not None:
|
|
191
|
+
params["nthreads"] = nthreads
|
|
192
|
+
if config is not None:
|
|
193
|
+
params["config"] = config
|
|
194
|
+
return params
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def fixel2voxel_cargs(
|
|
198
|
+
params: Fixel2voxelParameters,
|
|
199
|
+
execution: Execution,
|
|
200
|
+
) -> list[str]:
|
|
201
|
+
"""
|
|
202
|
+
Build command-line arguments from parameters.
|
|
203
|
+
|
|
204
|
+
Args:
|
|
205
|
+
params: The parameters.
|
|
206
|
+
execution: The execution object for resolving input paths.
|
|
207
|
+
Returns:
|
|
208
|
+
Command-line arguments.
|
|
209
|
+
"""
|
|
210
|
+
cargs = []
|
|
211
|
+
cargs.append("fixel2voxel")
|
|
212
|
+
if params.get("number") is not None:
|
|
213
|
+
cargs.extend([
|
|
214
|
+
"-number",
|
|
215
|
+
str(params.get("number"))
|
|
216
|
+
])
|
|
217
|
+
if params.get("fill") is not None:
|
|
218
|
+
cargs.extend([
|
|
219
|
+
"-fill",
|
|
220
|
+
str(params.get("fill"))
|
|
221
|
+
])
|
|
222
|
+
if params.get("weighted") is not None:
|
|
223
|
+
cargs.extend([
|
|
224
|
+
"-weighted",
|
|
225
|
+
execution.input_file(params.get("weighted"))
|
|
226
|
+
])
|
|
227
|
+
if params.get("info"):
|
|
228
|
+
cargs.append("-info")
|
|
229
|
+
if params.get("quiet"):
|
|
230
|
+
cargs.append("-quiet")
|
|
231
|
+
if params.get("debug"):
|
|
232
|
+
cargs.append("-debug")
|
|
233
|
+
if params.get("force"):
|
|
234
|
+
cargs.append("-force")
|
|
235
|
+
if params.get("nthreads") is not None:
|
|
236
|
+
cargs.extend([
|
|
237
|
+
"-nthreads",
|
|
238
|
+
str(params.get("nthreads"))
|
|
239
|
+
])
|
|
240
|
+
if params.get("config") is not None:
|
|
241
|
+
cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
|
|
242
|
+
if params.get("help"):
|
|
243
|
+
cargs.append("-help")
|
|
244
|
+
if params.get("version"):
|
|
245
|
+
cargs.append("-version")
|
|
246
|
+
cargs.append(execution.input_file(params.get("fixel_in")))
|
|
247
|
+
cargs.append(params.get("operation"))
|
|
248
|
+
cargs.append(params.get("image_out"))
|
|
249
|
+
return cargs
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
def fixel2voxel_outputs(
|
|
253
|
+
params: Fixel2voxelParameters,
|
|
254
|
+
execution: Execution,
|
|
255
|
+
) -> Fixel2voxelOutputs:
|
|
256
|
+
"""
|
|
257
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
258
|
+
|
|
259
|
+
Args:
|
|
260
|
+
params: The parameters.
|
|
261
|
+
execution: The execution object for resolving input paths.
|
|
262
|
+
Returns:
|
|
263
|
+
Outputs object.
|
|
264
|
+
"""
|
|
265
|
+
ret = Fixel2voxelOutputs(
|
|
266
|
+
root=execution.output_file("."),
|
|
267
|
+
image_out=execution.output_file(params.get("image_out")),
|
|
268
|
+
)
|
|
269
|
+
return ret
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
def fixel2voxel_execute(
|
|
273
|
+
params: Fixel2voxelParameters,
|
|
274
|
+
execution: Execution,
|
|
275
|
+
) -> Fixel2voxelOutputs:
|
|
276
|
+
"""
|
|
277
|
+
Convert a fixel-based sparse-data image into some form of scalar image.
|
|
278
|
+
|
|
279
|
+
Fixel data can be reduced to voxel data in a number of ways:
|
|
280
|
+
|
|
281
|
+
- Some statistic computed across all fixel values within a voxel: mean, sum,
|
|
282
|
+
product, min, max, absmax, magmax
|
|
283
|
+
|
|
284
|
+
- The number of fixels in each voxel: count
|
|
285
|
+
|
|
286
|
+
- Some measure of crossing-fibre organisation: complexity, sf
|
|
287
|
+
('single-fibre')
|
|
288
|
+
|
|
289
|
+
- A 4D directionally-encoded colour image: dec_unit, dec_scaled
|
|
290
|
+
|
|
291
|
+
- A 4D image containing all fixel data values in each voxel unmodified: none
|
|
292
|
+
|
|
293
|
+
The -weighted option deals with the case where there is some per-fixel
|
|
294
|
+
metric of interest that you wish to collapse into a single scalar measure
|
|
295
|
+
per voxel, but each fixel possesses a different volume, and you wish for
|
|
296
|
+
those fixels with greater volume to have a greater influence on the
|
|
297
|
+
calculation than fixels with lesser volume. For instance, when estimating a
|
|
298
|
+
voxel-based measure of mean axon diameter from per-fixel mean axon
|
|
299
|
+
diameters, a fixel's mean axon diameter should be weigthed by its relative
|
|
300
|
+
volume within the voxel in the calculation of that voxel mean.
|
|
301
|
+
|
|
302
|
+
References:
|
|
303
|
+
|
|
304
|
+
* Reference for 'complexity' operation:
|
|
305
|
+
Riffert, T. W.; Schreiber, J.; Anwander, A. & Knosche, T. R. Beyond
|
|
306
|
+
Fractional Anisotropy: Extraction of bundle-specific structural metrics from
|
|
307
|
+
crossing fibre models. NeuroImage, 2014, 100, 176-191.
|
|
308
|
+
|
|
309
|
+
Author: MRTrix3 Developers
|
|
310
|
+
|
|
311
|
+
URL: https://www.mrtrix.org/
|
|
312
|
+
|
|
313
|
+
Args:
|
|
314
|
+
params: The parameters.
|
|
315
|
+
execution: The execution object.
|
|
316
|
+
Returns:
|
|
317
|
+
NamedTuple of outputs (described in `Fixel2voxelOutputs`).
|
|
318
|
+
"""
|
|
319
|
+
params = execution.params(params)
|
|
320
|
+
cargs = fixel2voxel_cargs(params, execution)
|
|
321
|
+
ret = fixel2voxel_outputs(params, execution)
|
|
322
|
+
execution.run(cargs)
|
|
323
|
+
return ret
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
def fixel2voxel(
|
|
327
|
+
fixel_in: InputPathType,
|
|
328
|
+
operation: str,
|
|
329
|
+
image_out: str,
|
|
330
|
+
number: int | None = None,
|
|
331
|
+
fill: float | None = None,
|
|
332
|
+
weighted: InputPathType | None = None,
|
|
333
|
+
info: bool = False,
|
|
334
|
+
quiet: bool = False,
|
|
335
|
+
debug: bool = False,
|
|
336
|
+
force: bool = False,
|
|
337
|
+
nthreads: int | None = None,
|
|
338
|
+
config: list[Fixel2voxelConfigParameters] | None = None,
|
|
339
|
+
help_: bool = False,
|
|
340
|
+
version: bool = False,
|
|
341
|
+
runner: Runner | None = None,
|
|
342
|
+
) -> Fixel2voxelOutputs:
|
|
343
|
+
"""
|
|
344
|
+
Convert a fixel-based sparse-data image into some form of scalar image.
|
|
345
|
+
|
|
346
|
+
Fixel data can be reduced to voxel data in a number of ways:
|
|
347
|
+
|
|
348
|
+
- Some statistic computed across all fixel values within a voxel: mean, sum,
|
|
349
|
+
product, min, max, absmax, magmax
|
|
350
|
+
|
|
351
|
+
- The number of fixels in each voxel: count
|
|
352
|
+
|
|
353
|
+
- Some measure of crossing-fibre organisation: complexity, sf
|
|
354
|
+
('single-fibre')
|
|
355
|
+
|
|
356
|
+
- A 4D directionally-encoded colour image: dec_unit, dec_scaled
|
|
357
|
+
|
|
358
|
+
- A 4D image containing all fixel data values in each voxel unmodified: none
|
|
359
|
+
|
|
360
|
+
The -weighted option deals with the case where there is some per-fixel
|
|
361
|
+
metric of interest that you wish to collapse into a single scalar measure
|
|
362
|
+
per voxel, but each fixel possesses a different volume, and you wish for
|
|
363
|
+
those fixels with greater volume to have a greater influence on the
|
|
364
|
+
calculation than fixels with lesser volume. For instance, when estimating a
|
|
365
|
+
voxel-based measure of mean axon diameter from per-fixel mean axon
|
|
366
|
+
diameters, a fixel's mean axon diameter should be weigthed by its relative
|
|
367
|
+
volume within the voxel in the calculation of that voxel mean.
|
|
368
|
+
|
|
369
|
+
References:
|
|
370
|
+
|
|
371
|
+
* Reference for 'complexity' operation:
|
|
372
|
+
Riffert, T. W.; Schreiber, J.; Anwander, A. & Knosche, T. R. Beyond
|
|
373
|
+
Fractional Anisotropy: Extraction of bundle-specific structural metrics from
|
|
374
|
+
crossing fibre models. NeuroImage, 2014, 100, 176-191.
|
|
375
|
+
|
|
376
|
+
Author: MRTrix3 Developers
|
|
377
|
+
|
|
378
|
+
URL: https://www.mrtrix.org/
|
|
379
|
+
|
|
380
|
+
Args:
|
|
381
|
+
fixel_in: the input fixel data file.
|
|
382
|
+
operation: the operation to apply, one of: mean, sum, product, min,\
|
|
383
|
+
max, absmax, magmax, count, complexity, sf, dec_unit, dec_scaled, none.
|
|
384
|
+
image_out: the output scalar image.
|
|
385
|
+
number: use only the largest N fixels in calculation of the voxel-wise\
|
|
386
|
+
statistic; in the case of operation "none", output only the largest N\
|
|
387
|
+
fixels in each voxel.
|
|
388
|
+
fill: for "none" operation, specify the value to fill when number of\
|
|
389
|
+
fixels is fewer than the maximum (default: 0.0).
|
|
390
|
+
weighted: weight the contribution of each fixel to the per-voxel result\
|
|
391
|
+
according to its volume.
|
|
392
|
+
info: display information messages.
|
|
393
|
+
quiet: do not display information messages or progress status;\
|
|
394
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
395
|
+
environment variable to a non-empty string.
|
|
396
|
+
debug: display debugging messages.
|
|
397
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
398
|
+
input and output might cause unexpected behaviour).
|
|
399
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
400
|
+
(set to 0 to disable multi-threading).
|
|
401
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
402
|
+
help_: display this information page and exit.
|
|
403
|
+
version: display version information and exit.
|
|
404
|
+
runner: Command runner.
|
|
405
|
+
Returns:
|
|
406
|
+
NamedTuple of outputs (described in `Fixel2voxelOutputs`).
|
|
407
|
+
"""
|
|
408
|
+
runner = runner or get_global_runner()
|
|
409
|
+
execution = runner.start_execution(FIXEL2VOXEL_METADATA)
|
|
410
|
+
params = fixel2voxel_params(
|
|
411
|
+
number=number,
|
|
412
|
+
fill=fill,
|
|
413
|
+
weighted=weighted,
|
|
414
|
+
info=info,
|
|
415
|
+
quiet=quiet,
|
|
416
|
+
debug=debug,
|
|
417
|
+
force=force,
|
|
418
|
+
nthreads=nthreads,
|
|
419
|
+
config=config,
|
|
420
|
+
help_=help_,
|
|
421
|
+
version=version,
|
|
422
|
+
fixel_in=fixel_in,
|
|
423
|
+
operation=operation,
|
|
424
|
+
image_out=image_out,
|
|
425
|
+
)
|
|
426
|
+
return fixel2voxel_execute(params, execution)
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
__all__ = [
|
|
430
|
+
"FIXEL2VOXEL_METADATA",
|
|
431
|
+
"Fixel2voxelConfigParameters",
|
|
432
|
+
"Fixel2voxelOutputs",
|
|
433
|
+
"Fixel2voxelParameters",
|
|
434
|
+
"fixel2voxel",
|
|
435
|
+
"fixel2voxel_config_params",
|
|
436
|
+
"fixel2voxel_params",
|
|
437
|
+
]
|