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,882 @@
|
|
|
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
|
+
FIXELFILTER_METADATA = Metadata(
|
|
9
|
+
id="b5e8a361d7de5f948949260328ab5131eb18a9b7.boutiques",
|
|
10
|
+
name="fixelfilter",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
_FixelfilterConfigParamsDictNoTag = typing.TypedDict('_FixelfilterConfigParamsDictNoTag', {
|
|
17
|
+
"key": str,
|
|
18
|
+
"value": str,
|
|
19
|
+
})
|
|
20
|
+
FixelfilterConfigParamsDictTagged = typing.TypedDict('FixelfilterConfigParamsDictTagged', {
|
|
21
|
+
"@type": typing.Literal["config"],
|
|
22
|
+
"key": str,
|
|
23
|
+
"value": str,
|
|
24
|
+
})
|
|
25
|
+
FixelfilterConfigParamsDict = _FixelfilterConfigParamsDictNoTag | FixelfilterConfigParamsDictTagged
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_FixelfilterVariousStringParamsDictNoTag = typing.TypedDict('_FixelfilterVariousStringParamsDictNoTag', {
|
|
29
|
+
"obj": str,
|
|
30
|
+
})
|
|
31
|
+
FixelfilterVariousStringParamsDictTagged = typing.TypedDict('FixelfilterVariousStringParamsDictTagged', {
|
|
32
|
+
"@type": typing.Literal["VariousString"],
|
|
33
|
+
"obj": str,
|
|
34
|
+
})
|
|
35
|
+
FixelfilterVariousStringParamsDict = _FixelfilterVariousStringParamsDictNoTag | FixelfilterVariousStringParamsDictTagged
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
_FixelfilterVariousFileParamsDictNoTag = typing.TypedDict('_FixelfilterVariousFileParamsDictNoTag', {
|
|
39
|
+
"obj": InputPathType,
|
|
40
|
+
})
|
|
41
|
+
FixelfilterVariousFileParamsDictTagged = typing.TypedDict('FixelfilterVariousFileParamsDictTagged', {
|
|
42
|
+
"@type": typing.Literal["VariousFile"],
|
|
43
|
+
"obj": InputPathType,
|
|
44
|
+
})
|
|
45
|
+
FixelfilterVariousFileParamsDict = _FixelfilterVariousFileParamsDictNoTag | FixelfilterVariousFileParamsDictTagged
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
_FixelfilterVariousString1ParamsDictNoTag = typing.TypedDict('_FixelfilterVariousString1ParamsDictNoTag', {
|
|
49
|
+
"obj": str,
|
|
50
|
+
})
|
|
51
|
+
FixelfilterVariousString1ParamsDictTagged = typing.TypedDict('FixelfilterVariousString1ParamsDictTagged', {
|
|
52
|
+
"@type": typing.Literal["VariousString_1"],
|
|
53
|
+
"obj": str,
|
|
54
|
+
})
|
|
55
|
+
FixelfilterVariousString1ParamsDict = _FixelfilterVariousString1ParamsDictNoTag | FixelfilterVariousString1ParamsDictTagged
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
_FixelfilterVariousFile1ParamsDictNoTag = typing.TypedDict('_FixelfilterVariousFile1ParamsDictNoTag', {
|
|
59
|
+
"obj": InputPathType,
|
|
60
|
+
})
|
|
61
|
+
FixelfilterVariousFile1ParamsDictTagged = typing.TypedDict('FixelfilterVariousFile1ParamsDictTagged', {
|
|
62
|
+
"@type": typing.Literal["VariousFile_1"],
|
|
63
|
+
"obj": InputPathType,
|
|
64
|
+
})
|
|
65
|
+
FixelfilterVariousFile1ParamsDict = _FixelfilterVariousFile1ParamsDictNoTag | FixelfilterVariousFile1ParamsDictTagged
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
_FixelfilterParamsDictNoTag = typing.TypedDict('_FixelfilterParamsDictNoTag', {
|
|
69
|
+
"matrix": InputPathType,
|
|
70
|
+
"threshold_value": typing.NotRequired[float | None],
|
|
71
|
+
"threshold_connectivity": typing.NotRequired[float | None],
|
|
72
|
+
"fwhm": typing.NotRequired[float | None],
|
|
73
|
+
"minweight": typing.NotRequired[float | None],
|
|
74
|
+
"mask": typing.NotRequired[InputPathType | None],
|
|
75
|
+
"info": bool,
|
|
76
|
+
"quiet": bool,
|
|
77
|
+
"debug": bool,
|
|
78
|
+
"force": bool,
|
|
79
|
+
"nthreads": typing.NotRequired[int | None],
|
|
80
|
+
"config": typing.NotRequired[list[FixelfilterConfigParamsDict] | None],
|
|
81
|
+
"help": bool,
|
|
82
|
+
"version": bool,
|
|
83
|
+
"input": typing.Union[FixelfilterVariousStringParamsDictTagged, FixelfilterVariousFileParamsDictTagged],
|
|
84
|
+
"filter": str,
|
|
85
|
+
"output": typing.Union[FixelfilterVariousString1ParamsDictTagged, FixelfilterVariousFile1ParamsDictTagged],
|
|
86
|
+
})
|
|
87
|
+
FixelfilterParamsDictTagged = typing.TypedDict('FixelfilterParamsDictTagged', {
|
|
88
|
+
"@type": typing.Literal["mrtrix/fixelfilter"],
|
|
89
|
+
"matrix": InputPathType,
|
|
90
|
+
"threshold_value": typing.NotRequired[float | None],
|
|
91
|
+
"threshold_connectivity": typing.NotRequired[float | None],
|
|
92
|
+
"fwhm": typing.NotRequired[float | None],
|
|
93
|
+
"minweight": typing.NotRequired[float | None],
|
|
94
|
+
"mask": typing.NotRequired[InputPathType | None],
|
|
95
|
+
"info": bool,
|
|
96
|
+
"quiet": bool,
|
|
97
|
+
"debug": bool,
|
|
98
|
+
"force": bool,
|
|
99
|
+
"nthreads": typing.NotRequired[int | None],
|
|
100
|
+
"config": typing.NotRequired[list[FixelfilterConfigParamsDict] | None],
|
|
101
|
+
"help": bool,
|
|
102
|
+
"version": bool,
|
|
103
|
+
"input": typing.Union[FixelfilterVariousStringParamsDictTagged, FixelfilterVariousFileParamsDictTagged],
|
|
104
|
+
"filter": str,
|
|
105
|
+
"output": typing.Union[FixelfilterVariousString1ParamsDictTagged, FixelfilterVariousFile1ParamsDictTagged],
|
|
106
|
+
})
|
|
107
|
+
FixelfilterParamsDict = _FixelfilterParamsDictNoTag | FixelfilterParamsDictTagged
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def fixelfilter_input_cargs_dyn_fn(
|
|
111
|
+
t: str,
|
|
112
|
+
) -> typing.Any:
|
|
113
|
+
"""
|
|
114
|
+
Get build cargs function by command type.
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
t: Command type.
|
|
118
|
+
Returns:
|
|
119
|
+
Build cargs function.
|
|
120
|
+
"""
|
|
121
|
+
return {
|
|
122
|
+
"VariousString": fixelfilter_various_string_cargs,
|
|
123
|
+
"VariousFile": fixelfilter_various_file_cargs,
|
|
124
|
+
}.get(t)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def fixelfilter_input_validate_dyn_fn(
|
|
128
|
+
t: str,
|
|
129
|
+
) -> typing.Any:
|
|
130
|
+
"""
|
|
131
|
+
Get validate params function by command type.
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
t: Command type.
|
|
135
|
+
Returns:
|
|
136
|
+
Validate params function.
|
|
137
|
+
"""
|
|
138
|
+
return {
|
|
139
|
+
"VariousString": fixelfilter_various_string_validate,
|
|
140
|
+
"VariousFile": fixelfilter_various_file_validate,
|
|
141
|
+
}.get(t)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def fixelfilter_output_cargs_dyn_fn(
|
|
145
|
+
t: str,
|
|
146
|
+
) -> typing.Any:
|
|
147
|
+
"""
|
|
148
|
+
Get build cargs function by command type.
|
|
149
|
+
|
|
150
|
+
Args:
|
|
151
|
+
t: Command type.
|
|
152
|
+
Returns:
|
|
153
|
+
Build cargs function.
|
|
154
|
+
"""
|
|
155
|
+
return {
|
|
156
|
+
"VariousString_1": fixelfilter_various_string_1_cargs,
|
|
157
|
+
"VariousFile_1": fixelfilter_various_file_1_cargs,
|
|
158
|
+
}.get(t)
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
def fixelfilter_output_validate_dyn_fn(
|
|
162
|
+
t: str,
|
|
163
|
+
) -> typing.Any:
|
|
164
|
+
"""
|
|
165
|
+
Get validate params function by command type.
|
|
166
|
+
|
|
167
|
+
Args:
|
|
168
|
+
t: Command type.
|
|
169
|
+
Returns:
|
|
170
|
+
Validate params function.
|
|
171
|
+
"""
|
|
172
|
+
return {
|
|
173
|
+
"VariousString_1": fixelfilter_various_string_1_validate,
|
|
174
|
+
"VariousFile_1": fixelfilter_various_file_1_validate,
|
|
175
|
+
}.get(t)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def fixelfilter_config(
|
|
179
|
+
key: str,
|
|
180
|
+
value: str,
|
|
181
|
+
) -> FixelfilterConfigParamsDictTagged:
|
|
182
|
+
"""
|
|
183
|
+
Build parameters.
|
|
184
|
+
|
|
185
|
+
Args:
|
|
186
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
187
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
188
|
+
Returns:
|
|
189
|
+
Parameter dictionary
|
|
190
|
+
"""
|
|
191
|
+
params = {
|
|
192
|
+
"@type": "config",
|
|
193
|
+
"key": key,
|
|
194
|
+
"value": value,
|
|
195
|
+
}
|
|
196
|
+
return params
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def fixelfilter_config_validate(
|
|
200
|
+
params: typing.Any,
|
|
201
|
+
) -> None:
|
|
202
|
+
"""
|
|
203
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
204
|
+
`FixelfilterConfigParamsDict` object.
|
|
205
|
+
|
|
206
|
+
Args:
|
|
207
|
+
params: The parameters object to validate.
|
|
208
|
+
"""
|
|
209
|
+
if params is None or not isinstance(params, dict):
|
|
210
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
211
|
+
if params.get("key", None) is None:
|
|
212
|
+
raise StyxValidationError("`key` must not be None")
|
|
213
|
+
if not isinstance(params["key"], str):
|
|
214
|
+
raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
|
|
215
|
+
if params.get("value", None) is None:
|
|
216
|
+
raise StyxValidationError("`value` must not be None")
|
|
217
|
+
if not isinstance(params["value"], str):
|
|
218
|
+
raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
def fixelfilter_config_cargs(
|
|
222
|
+
params: FixelfilterConfigParamsDict,
|
|
223
|
+
execution: Execution,
|
|
224
|
+
) -> list[str]:
|
|
225
|
+
"""
|
|
226
|
+
Build command-line arguments from parameters.
|
|
227
|
+
|
|
228
|
+
Args:
|
|
229
|
+
params: The parameters.
|
|
230
|
+
execution: The execution object for resolving input paths.
|
|
231
|
+
Returns:
|
|
232
|
+
Command-line arguments.
|
|
233
|
+
"""
|
|
234
|
+
cargs = []
|
|
235
|
+
cargs.append("-config")
|
|
236
|
+
cargs.append(params.get("key", None))
|
|
237
|
+
cargs.append(params.get("value", None))
|
|
238
|
+
return cargs
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def fixelfilter_various_string(
|
|
242
|
+
obj: str,
|
|
243
|
+
) -> FixelfilterVariousStringParamsDictTagged:
|
|
244
|
+
"""
|
|
245
|
+
Build parameters.
|
|
246
|
+
|
|
247
|
+
Args:
|
|
248
|
+
obj: String object.
|
|
249
|
+
Returns:
|
|
250
|
+
Parameter dictionary
|
|
251
|
+
"""
|
|
252
|
+
params = {
|
|
253
|
+
"@type": "VariousString",
|
|
254
|
+
"obj": obj,
|
|
255
|
+
}
|
|
256
|
+
return params
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def fixelfilter_various_string_validate(
|
|
260
|
+
params: typing.Any,
|
|
261
|
+
) -> None:
|
|
262
|
+
"""
|
|
263
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
264
|
+
`FixelfilterVariousStringParamsDict` object.
|
|
265
|
+
|
|
266
|
+
Args:
|
|
267
|
+
params: The parameters object to validate.
|
|
268
|
+
"""
|
|
269
|
+
if params is None or not isinstance(params, dict):
|
|
270
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
271
|
+
if params.get("obj", None) is None:
|
|
272
|
+
raise StyxValidationError("`obj` must not be None")
|
|
273
|
+
if not isinstance(params["obj"], str):
|
|
274
|
+
raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `str`')
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def fixelfilter_various_string_cargs(
|
|
278
|
+
params: FixelfilterVariousStringParamsDict,
|
|
279
|
+
execution: Execution,
|
|
280
|
+
) -> list[str]:
|
|
281
|
+
"""
|
|
282
|
+
Build command-line arguments from parameters.
|
|
283
|
+
|
|
284
|
+
Args:
|
|
285
|
+
params: The parameters.
|
|
286
|
+
execution: The execution object for resolving input paths.
|
|
287
|
+
Returns:
|
|
288
|
+
Command-line arguments.
|
|
289
|
+
"""
|
|
290
|
+
cargs = []
|
|
291
|
+
cargs.append(params.get("obj", None))
|
|
292
|
+
return cargs
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
def fixelfilter_various_file(
|
|
296
|
+
obj: InputPathType,
|
|
297
|
+
) -> FixelfilterVariousFileParamsDictTagged:
|
|
298
|
+
"""
|
|
299
|
+
Build parameters.
|
|
300
|
+
|
|
301
|
+
Args:
|
|
302
|
+
obj: File object.
|
|
303
|
+
Returns:
|
|
304
|
+
Parameter dictionary
|
|
305
|
+
"""
|
|
306
|
+
params = {
|
|
307
|
+
"@type": "VariousFile",
|
|
308
|
+
"obj": obj,
|
|
309
|
+
}
|
|
310
|
+
return params
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
def fixelfilter_various_file_validate(
|
|
314
|
+
params: typing.Any,
|
|
315
|
+
) -> None:
|
|
316
|
+
"""
|
|
317
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
318
|
+
`FixelfilterVariousFileParamsDict` object.
|
|
319
|
+
|
|
320
|
+
Args:
|
|
321
|
+
params: The parameters object to validate.
|
|
322
|
+
"""
|
|
323
|
+
if params is None or not isinstance(params, dict):
|
|
324
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
325
|
+
if params.get("obj", None) is None:
|
|
326
|
+
raise StyxValidationError("`obj` must not be None")
|
|
327
|
+
if not isinstance(params["obj"], (pathlib.Path, str)):
|
|
328
|
+
raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `InputPathType`')
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
def fixelfilter_various_file_cargs(
|
|
332
|
+
params: FixelfilterVariousFileParamsDict,
|
|
333
|
+
execution: Execution,
|
|
334
|
+
) -> list[str]:
|
|
335
|
+
"""
|
|
336
|
+
Build command-line arguments from parameters.
|
|
337
|
+
|
|
338
|
+
Args:
|
|
339
|
+
params: The parameters.
|
|
340
|
+
execution: The execution object for resolving input paths.
|
|
341
|
+
Returns:
|
|
342
|
+
Command-line arguments.
|
|
343
|
+
"""
|
|
344
|
+
cargs = []
|
|
345
|
+
cargs.append(execution.input_file(params.get("obj", None)))
|
|
346
|
+
return cargs
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
def fixelfilter_various_string_1(
|
|
350
|
+
obj: str,
|
|
351
|
+
) -> FixelfilterVariousString1ParamsDictTagged:
|
|
352
|
+
"""
|
|
353
|
+
Build parameters.
|
|
354
|
+
|
|
355
|
+
Args:
|
|
356
|
+
obj: String object.
|
|
357
|
+
Returns:
|
|
358
|
+
Parameter dictionary
|
|
359
|
+
"""
|
|
360
|
+
params = {
|
|
361
|
+
"@type": "VariousString_1",
|
|
362
|
+
"obj": obj,
|
|
363
|
+
}
|
|
364
|
+
return params
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
def fixelfilter_various_string_1_validate(
|
|
368
|
+
params: typing.Any,
|
|
369
|
+
) -> None:
|
|
370
|
+
"""
|
|
371
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
372
|
+
`FixelfilterVariousString1ParamsDict` object.
|
|
373
|
+
|
|
374
|
+
Args:
|
|
375
|
+
params: The parameters object to validate.
|
|
376
|
+
"""
|
|
377
|
+
if params is None or not isinstance(params, dict):
|
|
378
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
379
|
+
if params.get("obj", None) is None:
|
|
380
|
+
raise StyxValidationError("`obj` must not be None")
|
|
381
|
+
if not isinstance(params["obj"], str):
|
|
382
|
+
raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `str`')
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
def fixelfilter_various_string_1_cargs(
|
|
386
|
+
params: FixelfilterVariousString1ParamsDict,
|
|
387
|
+
execution: Execution,
|
|
388
|
+
) -> list[str]:
|
|
389
|
+
"""
|
|
390
|
+
Build command-line arguments from parameters.
|
|
391
|
+
|
|
392
|
+
Args:
|
|
393
|
+
params: The parameters.
|
|
394
|
+
execution: The execution object for resolving input paths.
|
|
395
|
+
Returns:
|
|
396
|
+
Command-line arguments.
|
|
397
|
+
"""
|
|
398
|
+
cargs = []
|
|
399
|
+
cargs.append(params.get("obj", None))
|
|
400
|
+
return cargs
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
def fixelfilter_various_file_1(
|
|
404
|
+
obj: InputPathType,
|
|
405
|
+
) -> FixelfilterVariousFile1ParamsDictTagged:
|
|
406
|
+
"""
|
|
407
|
+
Build parameters.
|
|
408
|
+
|
|
409
|
+
Args:
|
|
410
|
+
obj: File object.
|
|
411
|
+
Returns:
|
|
412
|
+
Parameter dictionary
|
|
413
|
+
"""
|
|
414
|
+
params = {
|
|
415
|
+
"@type": "VariousFile_1",
|
|
416
|
+
"obj": obj,
|
|
417
|
+
}
|
|
418
|
+
return params
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
def fixelfilter_various_file_1_validate(
|
|
422
|
+
params: typing.Any,
|
|
423
|
+
) -> None:
|
|
424
|
+
"""
|
|
425
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
426
|
+
`FixelfilterVariousFile1ParamsDict` object.
|
|
427
|
+
|
|
428
|
+
Args:
|
|
429
|
+
params: The parameters object to validate.
|
|
430
|
+
"""
|
|
431
|
+
if params is None or not isinstance(params, dict):
|
|
432
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
433
|
+
if params.get("obj", None) is None:
|
|
434
|
+
raise StyxValidationError("`obj` must not be None")
|
|
435
|
+
if not isinstance(params["obj"], (pathlib.Path, str)):
|
|
436
|
+
raise StyxValidationError(f'`obj` has the wrong type: Received `{type(params.get("obj", None))}` expected `InputPathType`')
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
def fixelfilter_various_file_1_cargs(
|
|
440
|
+
params: FixelfilterVariousFile1ParamsDict,
|
|
441
|
+
execution: Execution,
|
|
442
|
+
) -> list[str]:
|
|
443
|
+
"""
|
|
444
|
+
Build command-line arguments from parameters.
|
|
445
|
+
|
|
446
|
+
Args:
|
|
447
|
+
params: The parameters.
|
|
448
|
+
execution: The execution object for resolving input paths.
|
|
449
|
+
Returns:
|
|
450
|
+
Command-line arguments.
|
|
451
|
+
"""
|
|
452
|
+
cargs = []
|
|
453
|
+
cargs.append(execution.input_file(params.get("obj", None)))
|
|
454
|
+
return cargs
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
class FixelfilterOutputs(typing.NamedTuple):
|
|
458
|
+
"""
|
|
459
|
+
Output object returned when calling `FixelfilterParamsDict(...)`.
|
|
460
|
+
"""
|
|
461
|
+
root: OutputPathType
|
|
462
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
def fixelfilter_params(
|
|
466
|
+
matrix: InputPathType,
|
|
467
|
+
input_: typing.Union[FixelfilterVariousStringParamsDictTagged, FixelfilterVariousFileParamsDictTagged],
|
|
468
|
+
filter_: str,
|
|
469
|
+
output: typing.Union[FixelfilterVariousString1ParamsDictTagged, FixelfilterVariousFile1ParamsDictTagged],
|
|
470
|
+
threshold_value: float | None = None,
|
|
471
|
+
threshold_connectivity: float | None = None,
|
|
472
|
+
fwhm: float | None = None,
|
|
473
|
+
minweight: float | None = None,
|
|
474
|
+
mask: InputPathType | None = None,
|
|
475
|
+
info: bool = False,
|
|
476
|
+
quiet: bool = False,
|
|
477
|
+
debug: bool = False,
|
|
478
|
+
force: bool = False,
|
|
479
|
+
nthreads: int | None = None,
|
|
480
|
+
config: list[FixelfilterConfigParamsDict] | None = None,
|
|
481
|
+
help_: bool = False,
|
|
482
|
+
version: bool = False,
|
|
483
|
+
) -> FixelfilterParamsDictTagged:
|
|
484
|
+
"""
|
|
485
|
+
Build parameters.
|
|
486
|
+
|
|
487
|
+
Args:
|
|
488
|
+
matrix: provide a fixel-fixel connectivity matrix for filtering\
|
|
489
|
+
operations that require it.
|
|
490
|
+
input_: the input: either a fixel data file, or a fixel directory (see\
|
|
491
|
+
Description).
|
|
492
|
+
filter_: the filtering operation to perform; options are: connect,\
|
|
493
|
+
smooth.
|
|
494
|
+
output: the output: either a fixel data file, or a fixel directory (see\
|
|
495
|
+
Description).
|
|
496
|
+
threshold_value: specify a threshold for the input fixel data file\
|
|
497
|
+
values (default = 0.5).
|
|
498
|
+
threshold_connectivity: specify a fixel-fixel connectivity threshold\
|
|
499
|
+
for connected-component analysis (default = 0.10000000000000001).
|
|
500
|
+
fwhm: the full-width half-maximum (FWHM) of the spatial component of\
|
|
501
|
+
the smoothing filter (default = 10mm).
|
|
502
|
+
minweight: apply a minimum threshold to smoothing weights (default =\
|
|
503
|
+
0.01).
|
|
504
|
+
mask: only perform smoothing within a specified binary fixel mask.
|
|
505
|
+
info: display information messages.
|
|
506
|
+
quiet: do not display information messages or progress status;\
|
|
507
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
508
|
+
environment variable to a non-empty string.
|
|
509
|
+
debug: display debugging messages.
|
|
510
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
511
|
+
input and output might cause unexpected behaviour).
|
|
512
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
513
|
+
(set to 0 to disable multi-threading).
|
|
514
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
515
|
+
help_: display this information page and exit.
|
|
516
|
+
version: display version information and exit.
|
|
517
|
+
Returns:
|
|
518
|
+
Parameter dictionary
|
|
519
|
+
"""
|
|
520
|
+
params = {
|
|
521
|
+
"@type": "mrtrix/fixelfilter",
|
|
522
|
+
"matrix": matrix,
|
|
523
|
+
"info": info,
|
|
524
|
+
"quiet": quiet,
|
|
525
|
+
"debug": debug,
|
|
526
|
+
"force": force,
|
|
527
|
+
"help": help_,
|
|
528
|
+
"version": version,
|
|
529
|
+
"input": input_,
|
|
530
|
+
"filter": filter_,
|
|
531
|
+
"output": output,
|
|
532
|
+
}
|
|
533
|
+
if threshold_value is not None:
|
|
534
|
+
params["threshold_value"] = threshold_value
|
|
535
|
+
if threshold_connectivity is not None:
|
|
536
|
+
params["threshold_connectivity"] = threshold_connectivity
|
|
537
|
+
if fwhm is not None:
|
|
538
|
+
params["fwhm"] = fwhm
|
|
539
|
+
if minweight is not None:
|
|
540
|
+
params["minweight"] = minweight
|
|
541
|
+
if mask is not None:
|
|
542
|
+
params["mask"] = mask
|
|
543
|
+
if nthreads is not None:
|
|
544
|
+
params["nthreads"] = nthreads
|
|
545
|
+
if config is not None:
|
|
546
|
+
params["config"] = config
|
|
547
|
+
return params
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
def fixelfilter_validate(
|
|
551
|
+
params: typing.Any,
|
|
552
|
+
) -> None:
|
|
553
|
+
"""
|
|
554
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
555
|
+
`FixelfilterParamsDict` object.
|
|
556
|
+
|
|
557
|
+
Args:
|
|
558
|
+
params: The parameters object to validate.
|
|
559
|
+
"""
|
|
560
|
+
if params is None or not isinstance(params, dict):
|
|
561
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
562
|
+
if params.get("matrix", None) is None:
|
|
563
|
+
raise StyxValidationError("`matrix` must not be None")
|
|
564
|
+
if not isinstance(params["matrix"], (pathlib.Path, str)):
|
|
565
|
+
raise StyxValidationError(f'`matrix` has the wrong type: Received `{type(params.get("matrix", None))}` expected `InputPathType`')
|
|
566
|
+
if params.get("threshold_value", None) is not None:
|
|
567
|
+
if not isinstance(params["threshold_value"], (float, int)):
|
|
568
|
+
raise StyxValidationError(f'`threshold_value` has the wrong type: Received `{type(params.get("threshold_value", None))}` expected `float | None`')
|
|
569
|
+
if params.get("threshold_connectivity", None) is not None:
|
|
570
|
+
if not isinstance(params["threshold_connectivity"], (float, int)):
|
|
571
|
+
raise StyxValidationError(f'`threshold_connectivity` has the wrong type: Received `{type(params.get("threshold_connectivity", None))}` expected `float | None`')
|
|
572
|
+
if params.get("fwhm", None) is not None:
|
|
573
|
+
if not isinstance(params["fwhm"], (float, int)):
|
|
574
|
+
raise StyxValidationError(f'`fwhm` has the wrong type: Received `{type(params.get("fwhm", None))}` expected `float | None`')
|
|
575
|
+
if params.get("minweight", None) is not None:
|
|
576
|
+
if not isinstance(params["minweight"], (float, int)):
|
|
577
|
+
raise StyxValidationError(f'`minweight` has the wrong type: Received `{type(params.get("minweight", None))}` expected `float | None`')
|
|
578
|
+
if params.get("mask", None) is not None:
|
|
579
|
+
if not isinstance(params["mask"], (pathlib.Path, str)):
|
|
580
|
+
raise StyxValidationError(f'`mask` has the wrong type: Received `{type(params.get("mask", None))}` expected `InputPathType | None`')
|
|
581
|
+
if params.get("info", False) is None:
|
|
582
|
+
raise StyxValidationError("`info` must not be None")
|
|
583
|
+
if not isinstance(params["info"], bool):
|
|
584
|
+
raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
|
|
585
|
+
if params.get("quiet", False) is None:
|
|
586
|
+
raise StyxValidationError("`quiet` must not be None")
|
|
587
|
+
if not isinstance(params["quiet"], bool):
|
|
588
|
+
raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
|
|
589
|
+
if params.get("debug", False) is None:
|
|
590
|
+
raise StyxValidationError("`debug` must not be None")
|
|
591
|
+
if not isinstance(params["debug"], bool):
|
|
592
|
+
raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
|
|
593
|
+
if params.get("force", False) is None:
|
|
594
|
+
raise StyxValidationError("`force` must not be None")
|
|
595
|
+
if not isinstance(params["force"], bool):
|
|
596
|
+
raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
|
|
597
|
+
if params.get("nthreads", None) is not None:
|
|
598
|
+
if not isinstance(params["nthreads"], int):
|
|
599
|
+
raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
|
|
600
|
+
if params.get("config", None) is not None:
|
|
601
|
+
if not isinstance(params["config"], list):
|
|
602
|
+
raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[FixelfilterConfigParamsDict] | None`')
|
|
603
|
+
for e in params["config"]:
|
|
604
|
+
fixelfilter_config_validate(e)
|
|
605
|
+
if params.get("help", False) is None:
|
|
606
|
+
raise StyxValidationError("`help` must not be None")
|
|
607
|
+
if not isinstance(params["help"], bool):
|
|
608
|
+
raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
|
|
609
|
+
if params.get("version", False) is None:
|
|
610
|
+
raise StyxValidationError("`version` must not be None")
|
|
611
|
+
if not isinstance(params["version"], bool):
|
|
612
|
+
raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
|
|
613
|
+
if params.get("input", None) is None:
|
|
614
|
+
raise StyxValidationError("`input` must not be None")
|
|
615
|
+
if not isinstance(params["input"], dict):
|
|
616
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params["input"])}\'')
|
|
617
|
+
if "@type" not in params["input"]:
|
|
618
|
+
raise StyxValidationError("Params object is missing `@type`")
|
|
619
|
+
if params["input"]["@type"] not in ["VariousString", "VariousFile"]:
|
|
620
|
+
raise StyxValidationError("Parameter `input`s `@type` must be one of [\"VariousString\", \"VariousFile\"]")
|
|
621
|
+
fixelfilter_input_validate_dyn_fn(params["input"]["@type"])(params["input"])
|
|
622
|
+
if params.get("filter", None) is None:
|
|
623
|
+
raise StyxValidationError("`filter` must not be None")
|
|
624
|
+
if not isinstance(params["filter"], str):
|
|
625
|
+
raise StyxValidationError(f'`filter` has the wrong type: Received `{type(params.get("filter", None))}` expected `str`')
|
|
626
|
+
if params.get("output", None) is None:
|
|
627
|
+
raise StyxValidationError("`output` must not be None")
|
|
628
|
+
if not isinstance(params["output"], dict):
|
|
629
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params["output"])}\'')
|
|
630
|
+
if "@type" not in params["output"]:
|
|
631
|
+
raise StyxValidationError("Params object is missing `@type`")
|
|
632
|
+
if params["output"]["@type"] not in ["VariousString_1", "VariousFile_1"]:
|
|
633
|
+
raise StyxValidationError("Parameter `output`s `@type` must be one of [\"VariousString_1\", \"VariousFile_1\"]")
|
|
634
|
+
fixelfilter_output_validate_dyn_fn(params["output"]["@type"])(params["output"])
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
def fixelfilter_cargs(
|
|
638
|
+
params: FixelfilterParamsDict,
|
|
639
|
+
execution: Execution,
|
|
640
|
+
) -> list[str]:
|
|
641
|
+
"""
|
|
642
|
+
Build command-line arguments from parameters.
|
|
643
|
+
|
|
644
|
+
Args:
|
|
645
|
+
params: The parameters.
|
|
646
|
+
execution: The execution object for resolving input paths.
|
|
647
|
+
Returns:
|
|
648
|
+
Command-line arguments.
|
|
649
|
+
"""
|
|
650
|
+
cargs = []
|
|
651
|
+
cargs.append("fixelfilter")
|
|
652
|
+
cargs.extend([
|
|
653
|
+
"-matrix",
|
|
654
|
+
execution.input_file(params.get("matrix", None))
|
|
655
|
+
])
|
|
656
|
+
if params.get("threshold_value", None) is not None:
|
|
657
|
+
cargs.extend([
|
|
658
|
+
"-threshold_value",
|
|
659
|
+
str(params.get("threshold_value", None))
|
|
660
|
+
])
|
|
661
|
+
if params.get("threshold_connectivity", None) is not None:
|
|
662
|
+
cargs.extend([
|
|
663
|
+
"-threshold_connectivity",
|
|
664
|
+
str(params.get("threshold_connectivity", None))
|
|
665
|
+
])
|
|
666
|
+
if params.get("fwhm", None) is not None:
|
|
667
|
+
cargs.extend([
|
|
668
|
+
"-fwhm",
|
|
669
|
+
str(params.get("fwhm", None))
|
|
670
|
+
])
|
|
671
|
+
if params.get("minweight", None) is not None:
|
|
672
|
+
cargs.extend([
|
|
673
|
+
"-minweight",
|
|
674
|
+
str(params.get("minweight", None))
|
|
675
|
+
])
|
|
676
|
+
if params.get("mask", None) is not None:
|
|
677
|
+
cargs.extend([
|
|
678
|
+
"-mask",
|
|
679
|
+
execution.input_file(params.get("mask", None))
|
|
680
|
+
])
|
|
681
|
+
if params.get("info", False):
|
|
682
|
+
cargs.append("-info")
|
|
683
|
+
if params.get("quiet", False):
|
|
684
|
+
cargs.append("-quiet")
|
|
685
|
+
if params.get("debug", False):
|
|
686
|
+
cargs.append("-debug")
|
|
687
|
+
if params.get("force", False):
|
|
688
|
+
cargs.append("-force")
|
|
689
|
+
if params.get("nthreads", None) is not None:
|
|
690
|
+
cargs.extend([
|
|
691
|
+
"-nthreads",
|
|
692
|
+
str(params.get("nthreads", None))
|
|
693
|
+
])
|
|
694
|
+
if params.get("config", None) is not None:
|
|
695
|
+
cargs.extend([a for c in [fixelfilter_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
696
|
+
if params.get("help", False):
|
|
697
|
+
cargs.append("-help")
|
|
698
|
+
if params.get("version", False):
|
|
699
|
+
cargs.append("-version")
|
|
700
|
+
cargs.extend(fixelfilter_input_cargs_dyn_fn(params.get("input", None)["@type"])(params.get("input", None), execution))
|
|
701
|
+
cargs.append(params.get("filter", None))
|
|
702
|
+
cargs.extend(fixelfilter_output_cargs_dyn_fn(params.get("output", None)["@type"])(params.get("output", None), execution))
|
|
703
|
+
return cargs
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
def fixelfilter_outputs(
|
|
707
|
+
params: FixelfilterParamsDict,
|
|
708
|
+
execution: Execution,
|
|
709
|
+
) -> FixelfilterOutputs:
|
|
710
|
+
"""
|
|
711
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
712
|
+
|
|
713
|
+
Args:
|
|
714
|
+
params: The parameters.
|
|
715
|
+
execution: The execution object for resolving input paths.
|
|
716
|
+
Returns:
|
|
717
|
+
Outputs object.
|
|
718
|
+
"""
|
|
719
|
+
ret = FixelfilterOutputs(
|
|
720
|
+
root=execution.output_file("."),
|
|
721
|
+
)
|
|
722
|
+
return ret
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
def fixelfilter_execute(
|
|
726
|
+
params: FixelfilterParamsDict,
|
|
727
|
+
runner: Runner | None = None,
|
|
728
|
+
) -> FixelfilterOutputs:
|
|
729
|
+
"""
|
|
730
|
+
fixelfilter
|
|
731
|
+
|
|
732
|
+
Perform filtering operations on fixel-based data.
|
|
733
|
+
|
|
734
|
+
If the first input to the command is a specific fixel data file, then a
|
|
735
|
+
filtered version of only that file will be generated by the command.
|
|
736
|
+
Alternatively, if the input is the location of a fixel directory, then the
|
|
737
|
+
command will create a duplicate of the fixel directory, and apply the
|
|
738
|
+
specified filter operation to all fixel data files within the directory.
|
|
739
|
+
|
|
740
|
+
References:
|
|
741
|
+
|
|
742
|
+
.
|
|
743
|
+
|
|
744
|
+
Author: MRTrix3 Developers
|
|
745
|
+
|
|
746
|
+
URL: https://www.mrtrix.org/
|
|
747
|
+
|
|
748
|
+
Args:
|
|
749
|
+
params: The parameters.
|
|
750
|
+
runner: Command runner.
|
|
751
|
+
Returns:
|
|
752
|
+
NamedTuple of outputs (described in `FixelfilterOutputs`).
|
|
753
|
+
"""
|
|
754
|
+
fixelfilter_validate(params)
|
|
755
|
+
runner = runner or get_global_runner()
|
|
756
|
+
execution = runner.start_execution(FIXELFILTER_METADATA)
|
|
757
|
+
params = execution.params(params)
|
|
758
|
+
cargs = fixelfilter_cargs(params, execution)
|
|
759
|
+
ret = fixelfilter_outputs(params, execution)
|
|
760
|
+
execution.run(cargs)
|
|
761
|
+
return ret
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
def fixelfilter(
|
|
765
|
+
matrix: InputPathType,
|
|
766
|
+
input_: typing.Union[FixelfilterVariousStringParamsDictTagged, FixelfilterVariousFileParamsDictTagged],
|
|
767
|
+
filter_: str,
|
|
768
|
+
output: typing.Union[FixelfilterVariousString1ParamsDictTagged, FixelfilterVariousFile1ParamsDictTagged],
|
|
769
|
+
threshold_value: float | None = None,
|
|
770
|
+
threshold_connectivity: float | None = None,
|
|
771
|
+
fwhm: float | None = None,
|
|
772
|
+
minweight: float | None = None,
|
|
773
|
+
mask: InputPathType | None = None,
|
|
774
|
+
info: bool = False,
|
|
775
|
+
quiet: bool = False,
|
|
776
|
+
debug: bool = False,
|
|
777
|
+
force: bool = False,
|
|
778
|
+
nthreads: int | None = None,
|
|
779
|
+
config: list[FixelfilterConfigParamsDict] | None = None,
|
|
780
|
+
help_: bool = False,
|
|
781
|
+
version: bool = False,
|
|
782
|
+
runner: Runner | None = None,
|
|
783
|
+
) -> FixelfilterOutputs:
|
|
784
|
+
"""
|
|
785
|
+
fixelfilter
|
|
786
|
+
|
|
787
|
+
Perform filtering operations on fixel-based data.
|
|
788
|
+
|
|
789
|
+
If the first input to the command is a specific fixel data file, then a
|
|
790
|
+
filtered version of only that file will be generated by the command.
|
|
791
|
+
Alternatively, if the input is the location of a fixel directory, then the
|
|
792
|
+
command will create a duplicate of the fixel directory, and apply the
|
|
793
|
+
specified filter operation to all fixel data files within the directory.
|
|
794
|
+
|
|
795
|
+
References:
|
|
796
|
+
|
|
797
|
+
.
|
|
798
|
+
|
|
799
|
+
Author: MRTrix3 Developers
|
|
800
|
+
|
|
801
|
+
URL: https://www.mrtrix.org/
|
|
802
|
+
|
|
803
|
+
Args:
|
|
804
|
+
matrix: provide a fixel-fixel connectivity matrix for filtering\
|
|
805
|
+
operations that require it.
|
|
806
|
+
input_: the input: either a fixel data file, or a fixel directory (see\
|
|
807
|
+
Description).
|
|
808
|
+
filter_: the filtering operation to perform; options are: connect,\
|
|
809
|
+
smooth.
|
|
810
|
+
output: the output: either a fixel data file, or a fixel directory (see\
|
|
811
|
+
Description).
|
|
812
|
+
threshold_value: specify a threshold for the input fixel data file\
|
|
813
|
+
values (default = 0.5).
|
|
814
|
+
threshold_connectivity: specify a fixel-fixel connectivity threshold\
|
|
815
|
+
for connected-component analysis (default = 0.10000000000000001).
|
|
816
|
+
fwhm: the full-width half-maximum (FWHM) of the spatial component of\
|
|
817
|
+
the smoothing filter (default = 10mm).
|
|
818
|
+
minweight: apply a minimum threshold to smoothing weights (default =\
|
|
819
|
+
0.01).
|
|
820
|
+
mask: only perform smoothing within a specified binary fixel mask.
|
|
821
|
+
info: display information messages.
|
|
822
|
+
quiet: do not display information messages or progress status;\
|
|
823
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
824
|
+
environment variable to a non-empty string.
|
|
825
|
+
debug: display debugging messages.
|
|
826
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
827
|
+
input and output might cause unexpected behaviour).
|
|
828
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
829
|
+
(set to 0 to disable multi-threading).
|
|
830
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
831
|
+
help_: display this information page and exit.
|
|
832
|
+
version: display version information and exit.
|
|
833
|
+
runner: Command runner.
|
|
834
|
+
Returns:
|
|
835
|
+
NamedTuple of outputs (described in `FixelfilterOutputs`).
|
|
836
|
+
"""
|
|
837
|
+
params = fixelfilter_params(
|
|
838
|
+
matrix=matrix,
|
|
839
|
+
threshold_value=threshold_value,
|
|
840
|
+
threshold_connectivity=threshold_connectivity,
|
|
841
|
+
fwhm=fwhm,
|
|
842
|
+
minweight=minweight,
|
|
843
|
+
mask=mask,
|
|
844
|
+
info=info,
|
|
845
|
+
quiet=quiet,
|
|
846
|
+
debug=debug,
|
|
847
|
+
force=force,
|
|
848
|
+
nthreads=nthreads,
|
|
849
|
+
config=config,
|
|
850
|
+
help_=help_,
|
|
851
|
+
version=version,
|
|
852
|
+
input_=input_,
|
|
853
|
+
filter_=filter_,
|
|
854
|
+
output=output,
|
|
855
|
+
)
|
|
856
|
+
return fixelfilter_execute(params, runner)
|
|
857
|
+
|
|
858
|
+
|
|
859
|
+
__all__ = [
|
|
860
|
+
"FIXELFILTER_METADATA",
|
|
861
|
+
"FixelfilterConfigParamsDict",
|
|
862
|
+
"FixelfilterConfigParamsDictTagged",
|
|
863
|
+
"FixelfilterOutputs",
|
|
864
|
+
"FixelfilterParamsDict",
|
|
865
|
+
"FixelfilterParamsDictTagged",
|
|
866
|
+
"FixelfilterVariousFile1ParamsDict",
|
|
867
|
+
"FixelfilterVariousFile1ParamsDictTagged",
|
|
868
|
+
"FixelfilterVariousFileParamsDict",
|
|
869
|
+
"FixelfilterVariousFileParamsDictTagged",
|
|
870
|
+
"FixelfilterVariousString1ParamsDict",
|
|
871
|
+
"FixelfilterVariousString1ParamsDictTagged",
|
|
872
|
+
"FixelfilterVariousStringParamsDict",
|
|
873
|
+
"FixelfilterVariousStringParamsDictTagged",
|
|
874
|
+
"fixelfilter",
|
|
875
|
+
"fixelfilter_config",
|
|
876
|
+
"fixelfilter_execute",
|
|
877
|
+
"fixelfilter_params",
|
|
878
|
+
"fixelfilter_various_file",
|
|
879
|
+
"fixelfilter_various_file_1",
|
|
880
|
+
"fixelfilter_various_string",
|
|
881
|
+
"fixelfilter_various_string_1",
|
|
882
|
+
]
|