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,423 @@
|
|
|
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
|
+
DIRGEN_METADATA = Metadata(
|
|
9
|
+
id="111662ebc02bd748b7609e8b39562fb928767bbb.boutiques",
|
|
10
|
+
name="dirgen",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
DirgenConfigParameters = typing.TypedDict('DirgenConfigParameters', {
|
|
17
|
+
"__STYX_TYPE__": typing.Literal["config"],
|
|
18
|
+
"key": str,
|
|
19
|
+
"value": str,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
DirgenParameters = typing.TypedDict('DirgenParameters', {
|
|
24
|
+
"__STYX_TYPE__": typing.Literal["dirgen"],
|
|
25
|
+
"power": typing.NotRequired[int | None],
|
|
26
|
+
"niter": typing.NotRequired[int | None],
|
|
27
|
+
"restarts": typing.NotRequired[int | None],
|
|
28
|
+
"unipolar": bool,
|
|
29
|
+
"cartesian": bool,
|
|
30
|
+
"info": bool,
|
|
31
|
+
"quiet": bool,
|
|
32
|
+
"debug": bool,
|
|
33
|
+
"force": bool,
|
|
34
|
+
"nthreads": typing.NotRequired[int | None],
|
|
35
|
+
"config": typing.NotRequired[list[DirgenConfigParameters] | None],
|
|
36
|
+
"help": bool,
|
|
37
|
+
"version": bool,
|
|
38
|
+
"ndir": int,
|
|
39
|
+
"dirs": str,
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def dyn_cargs(
|
|
44
|
+
t: str,
|
|
45
|
+
) -> typing.Any:
|
|
46
|
+
"""
|
|
47
|
+
Get build cargs function by command type.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
t: Command type.
|
|
51
|
+
Returns:
|
|
52
|
+
Build cargs function.
|
|
53
|
+
"""
|
|
54
|
+
return {
|
|
55
|
+
"dirgen": dirgen_cargs,
|
|
56
|
+
"config": dirgen_config_cargs,
|
|
57
|
+
}.get(t)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def dyn_outputs(
|
|
61
|
+
t: str,
|
|
62
|
+
) -> typing.Any:
|
|
63
|
+
"""
|
|
64
|
+
Get build outputs function by command type.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
t: Command type.
|
|
68
|
+
Returns:
|
|
69
|
+
Build outputs function.
|
|
70
|
+
"""
|
|
71
|
+
return {
|
|
72
|
+
"dirgen": dirgen_outputs,
|
|
73
|
+
}.get(t)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def dirgen_config_params(
|
|
77
|
+
key: str,
|
|
78
|
+
value: str,
|
|
79
|
+
) -> DirgenConfigParameters:
|
|
80
|
+
"""
|
|
81
|
+
Build parameters.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
85
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
86
|
+
Returns:
|
|
87
|
+
Parameter dictionary
|
|
88
|
+
"""
|
|
89
|
+
params = {
|
|
90
|
+
"__STYXTYPE__": "config",
|
|
91
|
+
"key": key,
|
|
92
|
+
"value": value,
|
|
93
|
+
}
|
|
94
|
+
return params
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def dirgen_config_cargs(
|
|
98
|
+
params: DirgenConfigParameters,
|
|
99
|
+
execution: Execution,
|
|
100
|
+
) -> list[str]:
|
|
101
|
+
"""
|
|
102
|
+
Build command-line arguments from parameters.
|
|
103
|
+
|
|
104
|
+
Args:
|
|
105
|
+
params: The parameters.
|
|
106
|
+
execution: The execution object for resolving input paths.
|
|
107
|
+
Returns:
|
|
108
|
+
Command-line arguments.
|
|
109
|
+
"""
|
|
110
|
+
cargs = []
|
|
111
|
+
cargs.append("-config")
|
|
112
|
+
cargs.append(params.get("key"))
|
|
113
|
+
cargs.append(params.get("value"))
|
|
114
|
+
return cargs
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
class DirgenOutputs(typing.NamedTuple):
|
|
118
|
+
"""
|
|
119
|
+
Output object returned when calling `dirgen(...)`.
|
|
120
|
+
"""
|
|
121
|
+
root: OutputPathType
|
|
122
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
123
|
+
dirs: OutputPathType
|
|
124
|
+
"""the text file to write the directions to, as [ az el ] pairs."""
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def dirgen_params(
|
|
128
|
+
ndir: int,
|
|
129
|
+
dirs: str,
|
|
130
|
+
power: int | None = None,
|
|
131
|
+
niter: int | None = None,
|
|
132
|
+
restarts: int | None = None,
|
|
133
|
+
unipolar: bool = False,
|
|
134
|
+
cartesian: bool = False,
|
|
135
|
+
info: bool = False,
|
|
136
|
+
quiet: bool = False,
|
|
137
|
+
debug: bool = False,
|
|
138
|
+
force: bool = False,
|
|
139
|
+
nthreads: int | None = None,
|
|
140
|
+
config: list[DirgenConfigParameters] | None = None,
|
|
141
|
+
help_: bool = False,
|
|
142
|
+
version: bool = False,
|
|
143
|
+
) -> DirgenParameters:
|
|
144
|
+
"""
|
|
145
|
+
Build parameters.
|
|
146
|
+
|
|
147
|
+
Args:
|
|
148
|
+
ndir: the number of directions to generate.
|
|
149
|
+
dirs: the text file to write the directions to, as [ az el ] pairs.
|
|
150
|
+
power: specify exponent to use for repulsion power law (default: 1).\
|
|
151
|
+
This must be a power of 2 (i.e. 1, 2, 4, 8, 16, ...).
|
|
152
|
+
niter: specify the maximum number of iterations to perform (default:\
|
|
153
|
+
10000).
|
|
154
|
+
restarts: specify the number of restarts to perform (default: 10).
|
|
155
|
+
unipolar: optimise assuming a unipolar electrostatic repulsion model\
|
|
156
|
+
rather than the bipolar model normally assumed in DWI.
|
|
157
|
+
cartesian: Output the directions in Cartesian coordinates [x y z]\
|
|
158
|
+
instead of [az el].
|
|
159
|
+
info: display information messages.
|
|
160
|
+
quiet: do not display information messages or progress status;\
|
|
161
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
162
|
+
environment variable to a non-empty string.
|
|
163
|
+
debug: display debugging messages.
|
|
164
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
165
|
+
input and output might cause unexpected behaviour).
|
|
166
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
167
|
+
(set to 0 to disable multi-threading).
|
|
168
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
169
|
+
help_: display this information page and exit.
|
|
170
|
+
version: display version information and exit.
|
|
171
|
+
Returns:
|
|
172
|
+
Parameter dictionary
|
|
173
|
+
"""
|
|
174
|
+
params = {
|
|
175
|
+
"__STYXTYPE__": "dirgen",
|
|
176
|
+
"unipolar": unipolar,
|
|
177
|
+
"cartesian": cartesian,
|
|
178
|
+
"info": info,
|
|
179
|
+
"quiet": quiet,
|
|
180
|
+
"debug": debug,
|
|
181
|
+
"force": force,
|
|
182
|
+
"help": help_,
|
|
183
|
+
"version": version,
|
|
184
|
+
"ndir": ndir,
|
|
185
|
+
"dirs": dirs,
|
|
186
|
+
}
|
|
187
|
+
if power is not None:
|
|
188
|
+
params["power"] = power
|
|
189
|
+
if niter is not None:
|
|
190
|
+
params["niter"] = niter
|
|
191
|
+
if restarts is not None:
|
|
192
|
+
params["restarts"] = restarts
|
|
193
|
+
if nthreads is not None:
|
|
194
|
+
params["nthreads"] = nthreads
|
|
195
|
+
if config is not None:
|
|
196
|
+
params["config"] = config
|
|
197
|
+
return params
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def dirgen_cargs(
|
|
201
|
+
params: DirgenParameters,
|
|
202
|
+
execution: Execution,
|
|
203
|
+
) -> list[str]:
|
|
204
|
+
"""
|
|
205
|
+
Build command-line arguments from parameters.
|
|
206
|
+
|
|
207
|
+
Args:
|
|
208
|
+
params: The parameters.
|
|
209
|
+
execution: The execution object for resolving input paths.
|
|
210
|
+
Returns:
|
|
211
|
+
Command-line arguments.
|
|
212
|
+
"""
|
|
213
|
+
cargs = []
|
|
214
|
+
cargs.append("dirgen")
|
|
215
|
+
if params.get("power") is not None:
|
|
216
|
+
cargs.extend([
|
|
217
|
+
"-power",
|
|
218
|
+
str(params.get("power"))
|
|
219
|
+
])
|
|
220
|
+
if params.get("niter") is not None:
|
|
221
|
+
cargs.extend([
|
|
222
|
+
"-niter",
|
|
223
|
+
str(params.get("niter"))
|
|
224
|
+
])
|
|
225
|
+
if params.get("restarts") is not None:
|
|
226
|
+
cargs.extend([
|
|
227
|
+
"-restarts",
|
|
228
|
+
str(params.get("restarts"))
|
|
229
|
+
])
|
|
230
|
+
if params.get("unipolar"):
|
|
231
|
+
cargs.append("-unipolar")
|
|
232
|
+
if params.get("cartesian"):
|
|
233
|
+
cargs.append("-cartesian")
|
|
234
|
+
if params.get("info"):
|
|
235
|
+
cargs.append("-info")
|
|
236
|
+
if params.get("quiet"):
|
|
237
|
+
cargs.append("-quiet")
|
|
238
|
+
if params.get("debug"):
|
|
239
|
+
cargs.append("-debug")
|
|
240
|
+
if params.get("force"):
|
|
241
|
+
cargs.append("-force")
|
|
242
|
+
if params.get("nthreads") is not None:
|
|
243
|
+
cargs.extend([
|
|
244
|
+
"-nthreads",
|
|
245
|
+
str(params.get("nthreads"))
|
|
246
|
+
])
|
|
247
|
+
if params.get("config") is not None:
|
|
248
|
+
cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
|
|
249
|
+
if params.get("help"):
|
|
250
|
+
cargs.append("-help")
|
|
251
|
+
if params.get("version"):
|
|
252
|
+
cargs.append("-version")
|
|
253
|
+
cargs.append(str(params.get("ndir")))
|
|
254
|
+
cargs.append(params.get("dirs"))
|
|
255
|
+
return cargs
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
def dirgen_outputs(
|
|
259
|
+
params: DirgenParameters,
|
|
260
|
+
execution: Execution,
|
|
261
|
+
) -> DirgenOutputs:
|
|
262
|
+
"""
|
|
263
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
264
|
+
|
|
265
|
+
Args:
|
|
266
|
+
params: The parameters.
|
|
267
|
+
execution: The execution object for resolving input paths.
|
|
268
|
+
Returns:
|
|
269
|
+
Outputs object.
|
|
270
|
+
"""
|
|
271
|
+
ret = DirgenOutputs(
|
|
272
|
+
root=execution.output_file("."),
|
|
273
|
+
dirs=execution.output_file(params.get("dirs")),
|
|
274
|
+
)
|
|
275
|
+
return ret
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
def dirgen_execute(
|
|
279
|
+
params: DirgenParameters,
|
|
280
|
+
execution: Execution,
|
|
281
|
+
) -> DirgenOutputs:
|
|
282
|
+
"""
|
|
283
|
+
Generate a set of uniformly distributed directions using a bipolar electrostatic
|
|
284
|
+
repulsion model.
|
|
285
|
+
|
|
286
|
+
Directions are distributed by analogy to an electrostatic repulsion system,
|
|
287
|
+
with each direction corresponding to a single electrostatic charge (for
|
|
288
|
+
-unipolar), or a pair of diametrically opposed charges (for the default
|
|
289
|
+
bipolar case). The energy of the system is determined based on the Coulomb
|
|
290
|
+
repulsion, which assumes the form 1/r^power, where r is the distance between
|
|
291
|
+
any pair of charges, and p is the power assumed for the repulsion law
|
|
292
|
+
(default: 1). The minimum energy state is obtained by gradient descent.
|
|
293
|
+
|
|
294
|
+
References:
|
|
295
|
+
|
|
296
|
+
Jones, D.; Horsfield, M. & Simmons, A. Optimal strategies for measuring
|
|
297
|
+
diffusion in anisotropic systems by magnetic resonance imaging. Magnetic
|
|
298
|
+
Resonance in Medicine, 1999, 42: 515-525
|
|
299
|
+
|
|
300
|
+
Papadakis, N. G.; Murrills, C. D.; Hall, L. D.; Huang, C. L.-H. & Adrian
|
|
301
|
+
Carpenter, T. Minimal gradient encoding for robust estimation of diffusion
|
|
302
|
+
anisotropy. Magnetic Resonance Imaging, 2000, 18: 671-679.
|
|
303
|
+
|
|
304
|
+
Author: MRTrix3 Developers
|
|
305
|
+
|
|
306
|
+
URL: https://www.mrtrix.org/
|
|
307
|
+
|
|
308
|
+
Args:
|
|
309
|
+
params: The parameters.
|
|
310
|
+
execution: The execution object.
|
|
311
|
+
Returns:
|
|
312
|
+
NamedTuple of outputs (described in `DirgenOutputs`).
|
|
313
|
+
"""
|
|
314
|
+
params = execution.params(params)
|
|
315
|
+
cargs = dirgen_cargs(params, execution)
|
|
316
|
+
ret = dirgen_outputs(params, execution)
|
|
317
|
+
execution.run(cargs)
|
|
318
|
+
return ret
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
def dirgen(
|
|
322
|
+
ndir: int,
|
|
323
|
+
dirs: str,
|
|
324
|
+
power: int | None = None,
|
|
325
|
+
niter: int | None = None,
|
|
326
|
+
restarts: int | None = None,
|
|
327
|
+
unipolar: bool = False,
|
|
328
|
+
cartesian: bool = False,
|
|
329
|
+
info: bool = False,
|
|
330
|
+
quiet: bool = False,
|
|
331
|
+
debug: bool = False,
|
|
332
|
+
force: bool = False,
|
|
333
|
+
nthreads: int | None = None,
|
|
334
|
+
config: list[DirgenConfigParameters] | None = None,
|
|
335
|
+
help_: bool = False,
|
|
336
|
+
version: bool = False,
|
|
337
|
+
runner: Runner | None = None,
|
|
338
|
+
) -> DirgenOutputs:
|
|
339
|
+
"""
|
|
340
|
+
Generate a set of uniformly distributed directions using a bipolar electrostatic
|
|
341
|
+
repulsion model.
|
|
342
|
+
|
|
343
|
+
Directions are distributed by analogy to an electrostatic repulsion system,
|
|
344
|
+
with each direction corresponding to a single electrostatic charge (for
|
|
345
|
+
-unipolar), or a pair of diametrically opposed charges (for the default
|
|
346
|
+
bipolar case). The energy of the system is determined based on the Coulomb
|
|
347
|
+
repulsion, which assumes the form 1/r^power, where r is the distance between
|
|
348
|
+
any pair of charges, and p is the power assumed for the repulsion law
|
|
349
|
+
(default: 1). The minimum energy state is obtained by gradient descent.
|
|
350
|
+
|
|
351
|
+
References:
|
|
352
|
+
|
|
353
|
+
Jones, D.; Horsfield, M. & Simmons, A. Optimal strategies for measuring
|
|
354
|
+
diffusion in anisotropic systems by magnetic resonance imaging. Magnetic
|
|
355
|
+
Resonance in Medicine, 1999, 42: 515-525
|
|
356
|
+
|
|
357
|
+
Papadakis, N. G.; Murrills, C. D.; Hall, L. D.; Huang, C. L.-H. & Adrian
|
|
358
|
+
Carpenter, T. Minimal gradient encoding for robust estimation of diffusion
|
|
359
|
+
anisotropy. Magnetic Resonance Imaging, 2000, 18: 671-679.
|
|
360
|
+
|
|
361
|
+
Author: MRTrix3 Developers
|
|
362
|
+
|
|
363
|
+
URL: https://www.mrtrix.org/
|
|
364
|
+
|
|
365
|
+
Args:
|
|
366
|
+
ndir: the number of directions to generate.
|
|
367
|
+
dirs: the text file to write the directions to, as [ az el ] pairs.
|
|
368
|
+
power: specify exponent to use for repulsion power law (default: 1).\
|
|
369
|
+
This must be a power of 2 (i.e. 1, 2, 4, 8, 16, ...).
|
|
370
|
+
niter: specify the maximum number of iterations to perform (default:\
|
|
371
|
+
10000).
|
|
372
|
+
restarts: specify the number of restarts to perform (default: 10).
|
|
373
|
+
unipolar: optimise assuming a unipolar electrostatic repulsion model\
|
|
374
|
+
rather than the bipolar model normally assumed in DWI.
|
|
375
|
+
cartesian: Output the directions in Cartesian coordinates [x y z]\
|
|
376
|
+
instead of [az el].
|
|
377
|
+
info: display information messages.
|
|
378
|
+
quiet: do not display information messages or progress status;\
|
|
379
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
380
|
+
environment variable to a non-empty string.
|
|
381
|
+
debug: display debugging messages.
|
|
382
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
383
|
+
input and output might cause unexpected behaviour).
|
|
384
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
385
|
+
(set to 0 to disable multi-threading).
|
|
386
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
387
|
+
help_: display this information page and exit.
|
|
388
|
+
version: display version information and exit.
|
|
389
|
+
runner: Command runner.
|
|
390
|
+
Returns:
|
|
391
|
+
NamedTuple of outputs (described in `DirgenOutputs`).
|
|
392
|
+
"""
|
|
393
|
+
runner = runner or get_global_runner()
|
|
394
|
+
execution = runner.start_execution(DIRGEN_METADATA)
|
|
395
|
+
params = dirgen_params(
|
|
396
|
+
power=power,
|
|
397
|
+
niter=niter,
|
|
398
|
+
restarts=restarts,
|
|
399
|
+
unipolar=unipolar,
|
|
400
|
+
cartesian=cartesian,
|
|
401
|
+
info=info,
|
|
402
|
+
quiet=quiet,
|
|
403
|
+
debug=debug,
|
|
404
|
+
force=force,
|
|
405
|
+
nthreads=nthreads,
|
|
406
|
+
config=config,
|
|
407
|
+
help_=help_,
|
|
408
|
+
version=version,
|
|
409
|
+
ndir=ndir,
|
|
410
|
+
dirs=dirs,
|
|
411
|
+
)
|
|
412
|
+
return dirgen_execute(params, execution)
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
__all__ = [
|
|
416
|
+
"DIRGEN_METADATA",
|
|
417
|
+
"DirgenConfigParameters",
|
|
418
|
+
"DirgenOutputs",
|
|
419
|
+
"DirgenParameters",
|
|
420
|
+
"dirgen",
|
|
421
|
+
"dirgen_config_params",
|
|
422
|
+
"dirgen_params",
|
|
423
|
+
]
|