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,530 @@
|
|
|
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
|
+
DIRSTAT_METADATA = Metadata(
|
|
9
|
+
id="b222674c205e6c5c5726d0d3c896ce48287bbceb.boutiques",
|
|
10
|
+
name="dirstat",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
DirstatFslgradParameters = typing.TypedDict('DirstatFslgradParameters', {
|
|
17
|
+
"__STYX_TYPE__": typing.Literal["fslgrad"],
|
|
18
|
+
"bvecs": InputPathType,
|
|
19
|
+
"bvals": InputPathType,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
DirstatConfigParameters = typing.TypedDict('DirstatConfigParameters', {
|
|
24
|
+
"__STYX_TYPE__": typing.Literal["config"],
|
|
25
|
+
"key": str,
|
|
26
|
+
"value": str,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
DirstatParameters = typing.TypedDict('DirstatParameters', {
|
|
31
|
+
"__STYX_TYPE__": typing.Literal["dirstat"],
|
|
32
|
+
"output": typing.NotRequired[str | None],
|
|
33
|
+
"shells": typing.NotRequired[list[float] | None],
|
|
34
|
+
"grad": typing.NotRequired[InputPathType | None],
|
|
35
|
+
"fslgrad": typing.NotRequired[DirstatFslgradParameters | None],
|
|
36
|
+
"info": bool,
|
|
37
|
+
"quiet": bool,
|
|
38
|
+
"debug": bool,
|
|
39
|
+
"force": bool,
|
|
40
|
+
"nthreads": typing.NotRequired[int | None],
|
|
41
|
+
"config": typing.NotRequired[list[DirstatConfigParameters] | None],
|
|
42
|
+
"help": bool,
|
|
43
|
+
"version": bool,
|
|
44
|
+
"dirs": InputPathType,
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def dyn_cargs(
|
|
49
|
+
t: str,
|
|
50
|
+
) -> typing.Any:
|
|
51
|
+
"""
|
|
52
|
+
Get build cargs function by command type.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
t: Command type.
|
|
56
|
+
Returns:
|
|
57
|
+
Build cargs function.
|
|
58
|
+
"""
|
|
59
|
+
return {
|
|
60
|
+
"dirstat": dirstat_cargs,
|
|
61
|
+
"fslgrad": dirstat_fslgrad_cargs,
|
|
62
|
+
"config": dirstat_config_cargs,
|
|
63
|
+
}.get(t)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def dyn_outputs(
|
|
67
|
+
t: str,
|
|
68
|
+
) -> typing.Any:
|
|
69
|
+
"""
|
|
70
|
+
Get build outputs function by command type.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
t: Command type.
|
|
74
|
+
Returns:
|
|
75
|
+
Build outputs function.
|
|
76
|
+
"""
|
|
77
|
+
return {
|
|
78
|
+
}.get(t)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def dirstat_fslgrad_params(
|
|
82
|
+
bvecs: InputPathType,
|
|
83
|
+
bvals: InputPathType,
|
|
84
|
+
) -> DirstatFslgradParameters:
|
|
85
|
+
"""
|
|
86
|
+
Build parameters.
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
bvecs: Provide the diffusion-weighted gradient scheme used in the\
|
|
90
|
+
acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
|
|
91
|
+
scheme is present in the input image header, the data provided with\
|
|
92
|
+
this option will be instead used.
|
|
93
|
+
bvals: Provide the diffusion-weighted gradient scheme used in the\
|
|
94
|
+
acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
|
|
95
|
+
scheme is present in the input image header, the data provided with\
|
|
96
|
+
this option will be instead used.
|
|
97
|
+
Returns:
|
|
98
|
+
Parameter dictionary
|
|
99
|
+
"""
|
|
100
|
+
params = {
|
|
101
|
+
"__STYXTYPE__": "fslgrad",
|
|
102
|
+
"bvecs": bvecs,
|
|
103
|
+
"bvals": bvals,
|
|
104
|
+
}
|
|
105
|
+
return params
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def dirstat_fslgrad_cargs(
|
|
109
|
+
params: DirstatFslgradParameters,
|
|
110
|
+
execution: Execution,
|
|
111
|
+
) -> list[str]:
|
|
112
|
+
"""
|
|
113
|
+
Build command-line arguments from parameters.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
params: The parameters.
|
|
117
|
+
execution: The execution object for resolving input paths.
|
|
118
|
+
Returns:
|
|
119
|
+
Command-line arguments.
|
|
120
|
+
"""
|
|
121
|
+
cargs = []
|
|
122
|
+
cargs.append("-fslgrad")
|
|
123
|
+
cargs.append(execution.input_file(params.get("bvecs")))
|
|
124
|
+
cargs.append(execution.input_file(params.get("bvals")))
|
|
125
|
+
return cargs
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def dirstat_config_params(
|
|
129
|
+
key: str,
|
|
130
|
+
value: str,
|
|
131
|
+
) -> DirstatConfigParameters:
|
|
132
|
+
"""
|
|
133
|
+
Build parameters.
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
137
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
138
|
+
Returns:
|
|
139
|
+
Parameter dictionary
|
|
140
|
+
"""
|
|
141
|
+
params = {
|
|
142
|
+
"__STYXTYPE__": "config",
|
|
143
|
+
"key": key,
|
|
144
|
+
"value": value,
|
|
145
|
+
}
|
|
146
|
+
return params
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def dirstat_config_cargs(
|
|
150
|
+
params: DirstatConfigParameters,
|
|
151
|
+
execution: Execution,
|
|
152
|
+
) -> list[str]:
|
|
153
|
+
"""
|
|
154
|
+
Build command-line arguments from parameters.
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
params: The parameters.
|
|
158
|
+
execution: The execution object for resolving input paths.
|
|
159
|
+
Returns:
|
|
160
|
+
Command-line arguments.
|
|
161
|
+
"""
|
|
162
|
+
cargs = []
|
|
163
|
+
cargs.append("-config")
|
|
164
|
+
cargs.append(params.get("key"))
|
|
165
|
+
cargs.append(params.get("value"))
|
|
166
|
+
return cargs
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
class DirstatOutputs(typing.NamedTuple):
|
|
170
|
+
"""
|
|
171
|
+
Output object returned when calling `dirstat(...)`.
|
|
172
|
+
"""
|
|
173
|
+
root: OutputPathType
|
|
174
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def dirstat_params(
|
|
178
|
+
dirs: InputPathType,
|
|
179
|
+
output: str | None = None,
|
|
180
|
+
shells: list[float] | None = None,
|
|
181
|
+
grad: InputPathType | None = None,
|
|
182
|
+
fslgrad: DirstatFslgradParameters | None = None,
|
|
183
|
+
info: bool = False,
|
|
184
|
+
quiet: bool = False,
|
|
185
|
+
debug: bool = False,
|
|
186
|
+
force: bool = False,
|
|
187
|
+
nthreads: int | None = None,
|
|
188
|
+
config: list[DirstatConfigParameters] | None = None,
|
|
189
|
+
help_: bool = False,
|
|
190
|
+
version: bool = False,
|
|
191
|
+
) -> DirstatParameters:
|
|
192
|
+
"""
|
|
193
|
+
Build parameters.
|
|
194
|
+
|
|
195
|
+
Args:
|
|
196
|
+
dirs: the text file or image containing the directions.
|
|
197
|
+
output: output selected metrics as a space-delimited list, suitable for\
|
|
198
|
+
use in scripts. This will produce one line of values per selected\
|
|
199
|
+
shell. Valid metrics are as specified in the description above.
|
|
200
|
+
shells: specify one or more b-values to use during processing, as a\
|
|
201
|
+
comma-separated list of the desired approximate b-values (b-values are\
|
|
202
|
+
clustered to allow for small deviations). Note that some commands are\
|
|
203
|
+
incompatible with multiple b-values, and will report an error if more\
|
|
204
|
+
than one b-value is provided.\
|
|
205
|
+
WARNING: note that, even though the b=0 volumes are never referred\
|
|
206
|
+
to as shells in the literature, they still have to be explicitly\
|
|
207
|
+
included in the list of b-values as provided to the -shell option!\
|
|
208
|
+
Several algorithms which include the b=0 volumes in their\
|
|
209
|
+
computations may otherwise return an undesired result.
|
|
210
|
+
grad: Provide the diffusion-weighted gradient scheme used in the\
|
|
211
|
+
acquisition in a text file. This should be supplied as a 4xN text file\
|
|
212
|
+
with each line is in the format [ X Y Z b ], where [ X Y Z ] describe\
|
|
213
|
+
the direction of the applied gradient, and b gives the b-value in units\
|
|
214
|
+
of s/mm^2. If a diffusion gradient scheme is present in the input image\
|
|
215
|
+
header, the data provided with this option will be instead used.
|
|
216
|
+
fslgrad: Provide the diffusion-weighted gradient scheme used in the\
|
|
217
|
+
acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
|
|
218
|
+
scheme is present in the input image header, the data provided with\
|
|
219
|
+
this option will be instead used.
|
|
220
|
+
info: display information messages.
|
|
221
|
+
quiet: do not display information messages or progress status;\
|
|
222
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
223
|
+
environment variable to a non-empty string.
|
|
224
|
+
debug: display debugging messages.
|
|
225
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
226
|
+
input and output might cause unexpected behaviour).
|
|
227
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
228
|
+
(set to 0 to disable multi-threading).
|
|
229
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
230
|
+
help_: display this information page and exit.
|
|
231
|
+
version: display version information and exit.
|
|
232
|
+
Returns:
|
|
233
|
+
Parameter dictionary
|
|
234
|
+
"""
|
|
235
|
+
params = {
|
|
236
|
+
"__STYXTYPE__": "dirstat",
|
|
237
|
+
"info": info,
|
|
238
|
+
"quiet": quiet,
|
|
239
|
+
"debug": debug,
|
|
240
|
+
"force": force,
|
|
241
|
+
"help": help_,
|
|
242
|
+
"version": version,
|
|
243
|
+
"dirs": dirs,
|
|
244
|
+
}
|
|
245
|
+
if output is not None:
|
|
246
|
+
params["output"] = output
|
|
247
|
+
if shells is not None:
|
|
248
|
+
params["shells"] = shells
|
|
249
|
+
if grad is not None:
|
|
250
|
+
params["grad"] = grad
|
|
251
|
+
if fslgrad is not None:
|
|
252
|
+
params["fslgrad"] = fslgrad
|
|
253
|
+
if nthreads is not None:
|
|
254
|
+
params["nthreads"] = nthreads
|
|
255
|
+
if config is not None:
|
|
256
|
+
params["config"] = config
|
|
257
|
+
return params
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def dirstat_cargs(
|
|
261
|
+
params: DirstatParameters,
|
|
262
|
+
execution: Execution,
|
|
263
|
+
) -> list[str]:
|
|
264
|
+
"""
|
|
265
|
+
Build command-line arguments from parameters.
|
|
266
|
+
|
|
267
|
+
Args:
|
|
268
|
+
params: The parameters.
|
|
269
|
+
execution: The execution object for resolving input paths.
|
|
270
|
+
Returns:
|
|
271
|
+
Command-line arguments.
|
|
272
|
+
"""
|
|
273
|
+
cargs = []
|
|
274
|
+
cargs.append("dirstat")
|
|
275
|
+
if params.get("output") is not None:
|
|
276
|
+
cargs.extend([
|
|
277
|
+
"-output",
|
|
278
|
+
params.get("output")
|
|
279
|
+
])
|
|
280
|
+
if params.get("shells") is not None:
|
|
281
|
+
cargs.extend([
|
|
282
|
+
"-shells",
|
|
283
|
+
",".join(map(str, params.get("shells")))
|
|
284
|
+
])
|
|
285
|
+
if params.get("grad") is not None:
|
|
286
|
+
cargs.extend([
|
|
287
|
+
"-grad",
|
|
288
|
+
execution.input_file(params.get("grad"))
|
|
289
|
+
])
|
|
290
|
+
if params.get("fslgrad") is not None:
|
|
291
|
+
cargs.extend(dyn_cargs(params.get("fslgrad")["__STYXTYPE__"])(params.get("fslgrad"), execution))
|
|
292
|
+
if params.get("info"):
|
|
293
|
+
cargs.append("-info")
|
|
294
|
+
if params.get("quiet"):
|
|
295
|
+
cargs.append("-quiet")
|
|
296
|
+
if params.get("debug"):
|
|
297
|
+
cargs.append("-debug")
|
|
298
|
+
if params.get("force"):
|
|
299
|
+
cargs.append("-force")
|
|
300
|
+
if params.get("nthreads") is not None:
|
|
301
|
+
cargs.extend([
|
|
302
|
+
"-nthreads",
|
|
303
|
+
str(params.get("nthreads"))
|
|
304
|
+
])
|
|
305
|
+
if params.get("config") is not None:
|
|
306
|
+
cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
|
|
307
|
+
if params.get("help"):
|
|
308
|
+
cargs.append("-help")
|
|
309
|
+
if params.get("version"):
|
|
310
|
+
cargs.append("-version")
|
|
311
|
+
cargs.append(execution.input_file(params.get("dirs")))
|
|
312
|
+
return cargs
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
def dirstat_outputs(
|
|
316
|
+
params: DirstatParameters,
|
|
317
|
+
execution: Execution,
|
|
318
|
+
) -> DirstatOutputs:
|
|
319
|
+
"""
|
|
320
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
321
|
+
|
|
322
|
+
Args:
|
|
323
|
+
params: The parameters.
|
|
324
|
+
execution: The execution object for resolving input paths.
|
|
325
|
+
Returns:
|
|
326
|
+
Outputs object.
|
|
327
|
+
"""
|
|
328
|
+
ret = DirstatOutputs(
|
|
329
|
+
root=execution.output_file("."),
|
|
330
|
+
)
|
|
331
|
+
return ret
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
def dirstat_execute(
|
|
335
|
+
params: DirstatParameters,
|
|
336
|
+
execution: Execution,
|
|
337
|
+
) -> DirstatOutputs:
|
|
338
|
+
"""
|
|
339
|
+
Report statistics on a direction set.
|
|
340
|
+
|
|
341
|
+
This command will accept as inputs:
|
|
342
|
+
|
|
343
|
+
- directions file in spherical coordinates (ASCII text, [ az el ]
|
|
344
|
+
space-separated values, one per line);
|
|
345
|
+
|
|
346
|
+
- directions file in Cartesian coordinates (ASCII text, [ x y z ]
|
|
347
|
+
space-separated values, one per line);
|
|
348
|
+
|
|
349
|
+
- DW gradient files (MRtrix format: ASCII text, [ x y z b ] space-separated
|
|
350
|
+
values, one per line);
|
|
351
|
+
|
|
352
|
+
- image files, using the DW gradient scheme found in the header (or provided
|
|
353
|
+
using the appropriate command line options below).
|
|
354
|
+
|
|
355
|
+
By default, this produces all relevant metrics for the direction set
|
|
356
|
+
provided. If the direction set contains multiple shells, metrics are
|
|
357
|
+
provided for each shell separately.
|
|
358
|
+
|
|
359
|
+
Metrics are produced assuming a unipolar or bipolar electrostatic repulsion
|
|
360
|
+
model, producing the potential energy (total, mean, min & max), and the
|
|
361
|
+
nearest-neighbour angles (mean, min & max). The condition number is also
|
|
362
|
+
produced for the spherical harmonic fits up to the highest harmonic order
|
|
363
|
+
supported by the number of volumes. Finally, the norm of the mean direction
|
|
364
|
+
vector is provided as a measure of the overall symmetry of the direction set
|
|
365
|
+
(important with respect to eddy-current resilience).
|
|
366
|
+
|
|
367
|
+
Specific metrics can also be queried independently via the "-output" option,
|
|
368
|
+
using these shorthands:
|
|
369
|
+
U/B for unipolar/bipolar model,
|
|
370
|
+
E/N for energy and nearest-neighbour respectively,
|
|
371
|
+
t/-/+ for total/min/max respectively (mean implied otherwise);
|
|
372
|
+
SHn for condition number of SH fit at order n (with n an even integer);
|
|
373
|
+
ASYM for asymmetry index (norm of mean direction vector);
|
|
374
|
+
N for the number of directions.
|
|
375
|
+
|
|
376
|
+
References:
|
|
377
|
+
|
|
378
|
+
.
|
|
379
|
+
|
|
380
|
+
Author: MRTrix3 Developers
|
|
381
|
+
|
|
382
|
+
URL: https://www.mrtrix.org/
|
|
383
|
+
|
|
384
|
+
Args:
|
|
385
|
+
params: The parameters.
|
|
386
|
+
execution: The execution object.
|
|
387
|
+
Returns:
|
|
388
|
+
NamedTuple of outputs (described in `DirstatOutputs`).
|
|
389
|
+
"""
|
|
390
|
+
params = execution.params(params)
|
|
391
|
+
cargs = dirstat_cargs(params, execution)
|
|
392
|
+
ret = dirstat_outputs(params, execution)
|
|
393
|
+
execution.run(cargs)
|
|
394
|
+
return ret
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
def dirstat(
|
|
398
|
+
dirs: InputPathType,
|
|
399
|
+
output: str | None = None,
|
|
400
|
+
shells: list[float] | None = None,
|
|
401
|
+
grad: InputPathType | None = None,
|
|
402
|
+
fslgrad: DirstatFslgradParameters | None = None,
|
|
403
|
+
info: bool = False,
|
|
404
|
+
quiet: bool = False,
|
|
405
|
+
debug: bool = False,
|
|
406
|
+
force: bool = False,
|
|
407
|
+
nthreads: int | None = None,
|
|
408
|
+
config: list[DirstatConfigParameters] | None = None,
|
|
409
|
+
help_: bool = False,
|
|
410
|
+
version: bool = False,
|
|
411
|
+
runner: Runner | None = None,
|
|
412
|
+
) -> DirstatOutputs:
|
|
413
|
+
"""
|
|
414
|
+
Report statistics on a direction set.
|
|
415
|
+
|
|
416
|
+
This command will accept as inputs:
|
|
417
|
+
|
|
418
|
+
- directions file in spherical coordinates (ASCII text, [ az el ]
|
|
419
|
+
space-separated values, one per line);
|
|
420
|
+
|
|
421
|
+
- directions file in Cartesian coordinates (ASCII text, [ x y z ]
|
|
422
|
+
space-separated values, one per line);
|
|
423
|
+
|
|
424
|
+
- DW gradient files (MRtrix format: ASCII text, [ x y z b ] space-separated
|
|
425
|
+
values, one per line);
|
|
426
|
+
|
|
427
|
+
- image files, using the DW gradient scheme found in the header (or provided
|
|
428
|
+
using the appropriate command line options below).
|
|
429
|
+
|
|
430
|
+
By default, this produces all relevant metrics for the direction set
|
|
431
|
+
provided. If the direction set contains multiple shells, metrics are
|
|
432
|
+
provided for each shell separately.
|
|
433
|
+
|
|
434
|
+
Metrics are produced assuming a unipolar or bipolar electrostatic repulsion
|
|
435
|
+
model, producing the potential energy (total, mean, min & max), and the
|
|
436
|
+
nearest-neighbour angles (mean, min & max). The condition number is also
|
|
437
|
+
produced for the spherical harmonic fits up to the highest harmonic order
|
|
438
|
+
supported by the number of volumes. Finally, the norm of the mean direction
|
|
439
|
+
vector is provided as a measure of the overall symmetry of the direction set
|
|
440
|
+
(important with respect to eddy-current resilience).
|
|
441
|
+
|
|
442
|
+
Specific metrics can also be queried independently via the "-output" option,
|
|
443
|
+
using these shorthands:
|
|
444
|
+
U/B for unipolar/bipolar model,
|
|
445
|
+
E/N for energy and nearest-neighbour respectively,
|
|
446
|
+
t/-/+ for total/min/max respectively (mean implied otherwise);
|
|
447
|
+
SHn for condition number of SH fit at order n (with n an even integer);
|
|
448
|
+
ASYM for asymmetry index (norm of mean direction vector);
|
|
449
|
+
N for the number of directions.
|
|
450
|
+
|
|
451
|
+
References:
|
|
452
|
+
|
|
453
|
+
.
|
|
454
|
+
|
|
455
|
+
Author: MRTrix3 Developers
|
|
456
|
+
|
|
457
|
+
URL: https://www.mrtrix.org/
|
|
458
|
+
|
|
459
|
+
Args:
|
|
460
|
+
dirs: the text file or image containing the directions.
|
|
461
|
+
output: output selected metrics as a space-delimited list, suitable for\
|
|
462
|
+
use in scripts. This will produce one line of values per selected\
|
|
463
|
+
shell. Valid metrics are as specified in the description above.
|
|
464
|
+
shells: specify one or more b-values to use during processing, as a\
|
|
465
|
+
comma-separated list of the desired approximate b-values (b-values are\
|
|
466
|
+
clustered to allow for small deviations). Note that some commands are\
|
|
467
|
+
incompatible with multiple b-values, and will report an error if more\
|
|
468
|
+
than one b-value is provided.\
|
|
469
|
+
WARNING: note that, even though the b=0 volumes are never referred\
|
|
470
|
+
to as shells in the literature, they still have to be explicitly\
|
|
471
|
+
included in the list of b-values as provided to the -shell option!\
|
|
472
|
+
Several algorithms which include the b=0 volumes in their\
|
|
473
|
+
computations may otherwise return an undesired result.
|
|
474
|
+
grad: Provide the diffusion-weighted gradient scheme used in the\
|
|
475
|
+
acquisition in a text file. This should be supplied as a 4xN text file\
|
|
476
|
+
with each line is in the format [ X Y Z b ], where [ X Y Z ] describe\
|
|
477
|
+
the direction of the applied gradient, and b gives the b-value in units\
|
|
478
|
+
of s/mm^2. If a diffusion gradient scheme is present in the input image\
|
|
479
|
+
header, the data provided with this option will be instead used.
|
|
480
|
+
fslgrad: Provide the diffusion-weighted gradient scheme used in the\
|
|
481
|
+
acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
|
|
482
|
+
scheme is present in the input image header, the data provided with\
|
|
483
|
+
this option will be instead used.
|
|
484
|
+
info: display information messages.
|
|
485
|
+
quiet: do not display information messages or progress status;\
|
|
486
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
487
|
+
environment variable to a non-empty string.
|
|
488
|
+
debug: display debugging messages.
|
|
489
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
490
|
+
input and output might cause unexpected behaviour).
|
|
491
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
492
|
+
(set to 0 to disable multi-threading).
|
|
493
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
494
|
+
help_: display this information page and exit.
|
|
495
|
+
version: display version information and exit.
|
|
496
|
+
runner: Command runner.
|
|
497
|
+
Returns:
|
|
498
|
+
NamedTuple of outputs (described in `DirstatOutputs`).
|
|
499
|
+
"""
|
|
500
|
+
runner = runner or get_global_runner()
|
|
501
|
+
execution = runner.start_execution(DIRSTAT_METADATA)
|
|
502
|
+
params = dirstat_params(
|
|
503
|
+
output=output,
|
|
504
|
+
shells=shells,
|
|
505
|
+
grad=grad,
|
|
506
|
+
fslgrad=fslgrad,
|
|
507
|
+
info=info,
|
|
508
|
+
quiet=quiet,
|
|
509
|
+
debug=debug,
|
|
510
|
+
force=force,
|
|
511
|
+
nthreads=nthreads,
|
|
512
|
+
config=config,
|
|
513
|
+
help_=help_,
|
|
514
|
+
version=version,
|
|
515
|
+
dirs=dirs,
|
|
516
|
+
)
|
|
517
|
+
return dirstat_execute(params, execution)
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
__all__ = [
|
|
521
|
+
"DIRSTAT_METADATA",
|
|
522
|
+
"DirstatConfigParameters",
|
|
523
|
+
"DirstatFslgradParameters",
|
|
524
|
+
"DirstatOutputs",
|
|
525
|
+
"DirstatParameters",
|
|
526
|
+
"dirstat",
|
|
527
|
+
"dirstat_config_params",
|
|
528
|
+
"dirstat_fslgrad_params",
|
|
529
|
+
"dirstat_params",
|
|
530
|
+
]
|