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