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,463 @@
|
|
|
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
|
+
DWI2MASK_METADATA = Metadata(
|
|
9
|
+
id="e651be545db3db1ef7ebcf19117cf1ddd7e6b8f2.boutiques",
|
|
10
|
+
name="dwi2mask",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Dwi2maskFslgradParameters = typing.TypedDict('Dwi2maskFslgradParameters', {
|
|
17
|
+
"__STYX_TYPE__": typing.Literal["fslgrad"],
|
|
18
|
+
"bvecs": InputPathType,
|
|
19
|
+
"bvals": InputPathType,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
Dwi2maskConfigParameters = typing.TypedDict('Dwi2maskConfigParameters', {
|
|
24
|
+
"__STYX_TYPE__": typing.Literal["config"],
|
|
25
|
+
"key": str,
|
|
26
|
+
"value": str,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
Dwi2maskParameters = typing.TypedDict('Dwi2maskParameters', {
|
|
31
|
+
"__STYX_TYPE__": typing.Literal["dwi2mask"],
|
|
32
|
+
"clean_scale": typing.NotRequired[int | None],
|
|
33
|
+
"grad": typing.NotRequired[InputPathType | None],
|
|
34
|
+
"fslgrad": typing.NotRequired[Dwi2maskFslgradParameters | None],
|
|
35
|
+
"info": bool,
|
|
36
|
+
"quiet": bool,
|
|
37
|
+
"debug": bool,
|
|
38
|
+
"force": bool,
|
|
39
|
+
"nthreads": typing.NotRequired[int | None],
|
|
40
|
+
"config": typing.NotRequired[list[Dwi2maskConfigParameters] | None],
|
|
41
|
+
"help": bool,
|
|
42
|
+
"version": bool,
|
|
43
|
+
"input": InputPathType,
|
|
44
|
+
"output": str,
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def dyn_cargs(
|
|
49
|
+
t: str,
|
|
50
|
+
) -> typing.Any:
|
|
51
|
+
"""
|
|
52
|
+
Get build cargs function by command type.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
t: Command type.
|
|
56
|
+
Returns:
|
|
57
|
+
Build cargs function.
|
|
58
|
+
"""
|
|
59
|
+
return {
|
|
60
|
+
"dwi2mask": dwi2mask_cargs,
|
|
61
|
+
"fslgrad": dwi2mask_fslgrad_cargs,
|
|
62
|
+
"config": dwi2mask_config_cargs,
|
|
63
|
+
}.get(t)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def dyn_outputs(
|
|
67
|
+
t: str,
|
|
68
|
+
) -> typing.Any:
|
|
69
|
+
"""
|
|
70
|
+
Get build outputs function by command type.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
t: Command type.
|
|
74
|
+
Returns:
|
|
75
|
+
Build outputs function.
|
|
76
|
+
"""
|
|
77
|
+
return {
|
|
78
|
+
"dwi2mask": dwi2mask_outputs,
|
|
79
|
+
}.get(t)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def dwi2mask_fslgrad_params(
|
|
83
|
+
bvecs: InputPathType,
|
|
84
|
+
bvals: InputPathType,
|
|
85
|
+
) -> Dwi2maskFslgradParameters:
|
|
86
|
+
"""
|
|
87
|
+
Build parameters.
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
bvecs: Provide the diffusion-weighted gradient scheme used in the\
|
|
91
|
+
acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
|
|
92
|
+
scheme is present in the input image header, the data provided with\
|
|
93
|
+
this option will be instead used.
|
|
94
|
+
bvals: Provide the diffusion-weighted gradient scheme used in the\
|
|
95
|
+
acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
|
|
96
|
+
scheme is present in the input image header, the data provided with\
|
|
97
|
+
this option will be instead used.
|
|
98
|
+
Returns:
|
|
99
|
+
Parameter dictionary
|
|
100
|
+
"""
|
|
101
|
+
params = {
|
|
102
|
+
"__STYXTYPE__": "fslgrad",
|
|
103
|
+
"bvecs": bvecs,
|
|
104
|
+
"bvals": bvals,
|
|
105
|
+
}
|
|
106
|
+
return params
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def dwi2mask_fslgrad_cargs(
|
|
110
|
+
params: Dwi2maskFslgradParameters,
|
|
111
|
+
execution: Execution,
|
|
112
|
+
) -> list[str]:
|
|
113
|
+
"""
|
|
114
|
+
Build command-line arguments from parameters.
|
|
115
|
+
|
|
116
|
+
Args:
|
|
117
|
+
params: The parameters.
|
|
118
|
+
execution: The execution object for resolving input paths.
|
|
119
|
+
Returns:
|
|
120
|
+
Command-line arguments.
|
|
121
|
+
"""
|
|
122
|
+
cargs = []
|
|
123
|
+
cargs.append("-fslgrad")
|
|
124
|
+
cargs.append(execution.input_file(params.get("bvecs")))
|
|
125
|
+
cargs.append(execution.input_file(params.get("bvals")))
|
|
126
|
+
return cargs
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def dwi2mask_config_params(
|
|
130
|
+
key: str,
|
|
131
|
+
value: str,
|
|
132
|
+
) -> Dwi2maskConfigParameters:
|
|
133
|
+
"""
|
|
134
|
+
Build parameters.
|
|
135
|
+
|
|
136
|
+
Args:
|
|
137
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
138
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
139
|
+
Returns:
|
|
140
|
+
Parameter dictionary
|
|
141
|
+
"""
|
|
142
|
+
params = {
|
|
143
|
+
"__STYXTYPE__": "config",
|
|
144
|
+
"key": key,
|
|
145
|
+
"value": value,
|
|
146
|
+
}
|
|
147
|
+
return params
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def dwi2mask_config_cargs(
|
|
151
|
+
params: Dwi2maskConfigParameters,
|
|
152
|
+
execution: Execution,
|
|
153
|
+
) -> list[str]:
|
|
154
|
+
"""
|
|
155
|
+
Build command-line arguments from parameters.
|
|
156
|
+
|
|
157
|
+
Args:
|
|
158
|
+
params: The parameters.
|
|
159
|
+
execution: The execution object for resolving input paths.
|
|
160
|
+
Returns:
|
|
161
|
+
Command-line arguments.
|
|
162
|
+
"""
|
|
163
|
+
cargs = []
|
|
164
|
+
cargs.append("-config")
|
|
165
|
+
cargs.append(params.get("key"))
|
|
166
|
+
cargs.append(params.get("value"))
|
|
167
|
+
return cargs
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
class Dwi2maskOutputs(typing.NamedTuple):
|
|
171
|
+
"""
|
|
172
|
+
Output object returned when calling `dwi2mask(...)`.
|
|
173
|
+
"""
|
|
174
|
+
root: OutputPathType
|
|
175
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
176
|
+
output: OutputPathType
|
|
177
|
+
"""the output whole-brain mask image"""
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def dwi2mask_params(
|
|
181
|
+
input_: InputPathType,
|
|
182
|
+
output: str,
|
|
183
|
+
clean_scale: int | None = None,
|
|
184
|
+
grad: InputPathType | None = None,
|
|
185
|
+
fslgrad: Dwi2maskFslgradParameters | None = None,
|
|
186
|
+
info: bool = False,
|
|
187
|
+
quiet: bool = False,
|
|
188
|
+
debug: bool = False,
|
|
189
|
+
force: bool = False,
|
|
190
|
+
nthreads: int | None = None,
|
|
191
|
+
config: list[Dwi2maskConfigParameters] | None = None,
|
|
192
|
+
help_: bool = False,
|
|
193
|
+
version: bool = False,
|
|
194
|
+
) -> Dwi2maskParameters:
|
|
195
|
+
"""
|
|
196
|
+
Build parameters.
|
|
197
|
+
|
|
198
|
+
Args:
|
|
199
|
+
input_: the input DWI image containing volumes that are both diffusion\
|
|
200
|
+
weighted and b=0.
|
|
201
|
+
output: the output whole-brain mask image.
|
|
202
|
+
clean_scale: the maximum scale used to cut bridges. A certain maximum\
|
|
203
|
+
scale cuts bridges up to a width (in voxels) of 2x the provided scale.\
|
|
204
|
+
Setting this to 0 disables the mask cleaning step. (Default: 2).
|
|
205
|
+
grad: Provide the diffusion-weighted gradient scheme used in the\
|
|
206
|
+
acquisition in a text file. This should be supplied as a 4xN text file\
|
|
207
|
+
with each line is in the format [ X Y Z b ], where [ X Y Z ] describe\
|
|
208
|
+
the direction of the applied gradient, and b gives the b-value in units\
|
|
209
|
+
of s/mm^2. If a diffusion gradient scheme is present in the input image\
|
|
210
|
+
header, the data provided with this option will be instead used.
|
|
211
|
+
fslgrad: Provide the diffusion-weighted gradient scheme used in the\
|
|
212
|
+
acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
|
|
213
|
+
scheme is present in the input image header, the data provided with\
|
|
214
|
+
this option will be instead used.
|
|
215
|
+
info: display information messages.
|
|
216
|
+
quiet: do not display information messages or progress status;\
|
|
217
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
218
|
+
environment variable to a non-empty string.
|
|
219
|
+
debug: display debugging messages.
|
|
220
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
221
|
+
input and output might cause unexpected behaviour).
|
|
222
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
223
|
+
(set to 0 to disable multi-threading).
|
|
224
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
225
|
+
help_: display this information page and exit.
|
|
226
|
+
version: display version information and exit.
|
|
227
|
+
Returns:
|
|
228
|
+
Parameter dictionary
|
|
229
|
+
"""
|
|
230
|
+
params = {
|
|
231
|
+
"__STYXTYPE__": "dwi2mask",
|
|
232
|
+
"info": info,
|
|
233
|
+
"quiet": quiet,
|
|
234
|
+
"debug": debug,
|
|
235
|
+
"force": force,
|
|
236
|
+
"help": help_,
|
|
237
|
+
"version": version,
|
|
238
|
+
"input": input_,
|
|
239
|
+
"output": output,
|
|
240
|
+
}
|
|
241
|
+
if clean_scale is not None:
|
|
242
|
+
params["clean_scale"] = clean_scale
|
|
243
|
+
if grad is not None:
|
|
244
|
+
params["grad"] = grad
|
|
245
|
+
if fslgrad is not None:
|
|
246
|
+
params["fslgrad"] = fslgrad
|
|
247
|
+
if nthreads is not None:
|
|
248
|
+
params["nthreads"] = nthreads
|
|
249
|
+
if config is not None:
|
|
250
|
+
params["config"] = config
|
|
251
|
+
return params
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def dwi2mask_cargs(
|
|
255
|
+
params: Dwi2maskParameters,
|
|
256
|
+
execution: Execution,
|
|
257
|
+
) -> list[str]:
|
|
258
|
+
"""
|
|
259
|
+
Build command-line arguments from parameters.
|
|
260
|
+
|
|
261
|
+
Args:
|
|
262
|
+
params: The parameters.
|
|
263
|
+
execution: The execution object for resolving input paths.
|
|
264
|
+
Returns:
|
|
265
|
+
Command-line arguments.
|
|
266
|
+
"""
|
|
267
|
+
cargs = []
|
|
268
|
+
cargs.append("dwi2mask")
|
|
269
|
+
if params.get("clean_scale") is not None:
|
|
270
|
+
cargs.extend([
|
|
271
|
+
"-clean_scale",
|
|
272
|
+
str(params.get("clean_scale"))
|
|
273
|
+
])
|
|
274
|
+
if params.get("grad") is not None:
|
|
275
|
+
cargs.extend([
|
|
276
|
+
"-grad",
|
|
277
|
+
execution.input_file(params.get("grad"))
|
|
278
|
+
])
|
|
279
|
+
if params.get("fslgrad") is not None:
|
|
280
|
+
cargs.extend(dyn_cargs(params.get("fslgrad")["__STYXTYPE__"])(params.get("fslgrad"), execution))
|
|
281
|
+
if params.get("info"):
|
|
282
|
+
cargs.append("-info")
|
|
283
|
+
if params.get("quiet"):
|
|
284
|
+
cargs.append("-quiet")
|
|
285
|
+
if params.get("debug"):
|
|
286
|
+
cargs.append("-debug")
|
|
287
|
+
if params.get("force"):
|
|
288
|
+
cargs.append("-force")
|
|
289
|
+
if params.get("nthreads") is not None:
|
|
290
|
+
cargs.extend([
|
|
291
|
+
"-nthreads",
|
|
292
|
+
str(params.get("nthreads"))
|
|
293
|
+
])
|
|
294
|
+
if params.get("config") is not None:
|
|
295
|
+
cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
|
|
296
|
+
if params.get("help"):
|
|
297
|
+
cargs.append("-help")
|
|
298
|
+
if params.get("version"):
|
|
299
|
+
cargs.append("-version")
|
|
300
|
+
cargs.append(execution.input_file(params.get("input")))
|
|
301
|
+
cargs.append(params.get("output"))
|
|
302
|
+
return cargs
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
def dwi2mask_outputs(
|
|
306
|
+
params: Dwi2maskParameters,
|
|
307
|
+
execution: Execution,
|
|
308
|
+
) -> Dwi2maskOutputs:
|
|
309
|
+
"""
|
|
310
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
311
|
+
|
|
312
|
+
Args:
|
|
313
|
+
params: The parameters.
|
|
314
|
+
execution: The execution object for resolving input paths.
|
|
315
|
+
Returns:
|
|
316
|
+
Outputs object.
|
|
317
|
+
"""
|
|
318
|
+
ret = Dwi2maskOutputs(
|
|
319
|
+
root=execution.output_file("."),
|
|
320
|
+
output=execution.output_file(params.get("output")),
|
|
321
|
+
)
|
|
322
|
+
return ret
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
def dwi2mask_execute(
|
|
326
|
+
params: Dwi2maskParameters,
|
|
327
|
+
execution: Execution,
|
|
328
|
+
) -> Dwi2maskOutputs:
|
|
329
|
+
"""
|
|
330
|
+
Generates a whole brain mask from a DWI image.
|
|
331
|
+
|
|
332
|
+
All diffusion weighted and b=0 volumes are used to obtain a mask that
|
|
333
|
+
includes both brain tissue and CSF.
|
|
334
|
+
|
|
335
|
+
In a second step peninsula-like extensions, where the peninsula itself is
|
|
336
|
+
wider than the bridge connecting it to the mask, are removed. This may help
|
|
337
|
+
removing artefacts and non-brain parts, e.g. eyes, from the mask.
|
|
338
|
+
|
|
339
|
+
References:
|
|
340
|
+
|
|
341
|
+
Dhollander T, Raffelt D, Connelly A. Unsupervised 3-tissue response function
|
|
342
|
+
estimation from single-shell or multi-shell diffusion MR data without a
|
|
343
|
+
co-registered T1 image. ISMRM Workshop on Breaking the Barriers of Diffusion
|
|
344
|
+
MRI, 2016, 5.
|
|
345
|
+
|
|
346
|
+
Author: MRTrix3 Developers
|
|
347
|
+
|
|
348
|
+
URL: https://www.mrtrix.org/
|
|
349
|
+
|
|
350
|
+
Args:
|
|
351
|
+
params: The parameters.
|
|
352
|
+
execution: The execution object.
|
|
353
|
+
Returns:
|
|
354
|
+
NamedTuple of outputs (described in `Dwi2maskOutputs`).
|
|
355
|
+
"""
|
|
356
|
+
params = execution.params(params)
|
|
357
|
+
cargs = dwi2mask_cargs(params, execution)
|
|
358
|
+
ret = dwi2mask_outputs(params, execution)
|
|
359
|
+
execution.run(cargs)
|
|
360
|
+
return ret
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
def dwi2mask(
|
|
364
|
+
input_: InputPathType,
|
|
365
|
+
output: str,
|
|
366
|
+
clean_scale: int | None = None,
|
|
367
|
+
grad: InputPathType | None = None,
|
|
368
|
+
fslgrad: Dwi2maskFslgradParameters | None = None,
|
|
369
|
+
info: bool = False,
|
|
370
|
+
quiet: bool = False,
|
|
371
|
+
debug: bool = False,
|
|
372
|
+
force: bool = False,
|
|
373
|
+
nthreads: int | None = None,
|
|
374
|
+
config: list[Dwi2maskConfigParameters] | None = None,
|
|
375
|
+
help_: bool = False,
|
|
376
|
+
version: bool = False,
|
|
377
|
+
runner: Runner | None = None,
|
|
378
|
+
) -> Dwi2maskOutputs:
|
|
379
|
+
"""
|
|
380
|
+
Generates a whole brain mask from a DWI image.
|
|
381
|
+
|
|
382
|
+
All diffusion weighted and b=0 volumes are used to obtain a mask that
|
|
383
|
+
includes both brain tissue and CSF.
|
|
384
|
+
|
|
385
|
+
In a second step peninsula-like extensions, where the peninsula itself is
|
|
386
|
+
wider than the bridge connecting it to the mask, are removed. This may help
|
|
387
|
+
removing artefacts and non-brain parts, e.g. eyes, from the mask.
|
|
388
|
+
|
|
389
|
+
References:
|
|
390
|
+
|
|
391
|
+
Dhollander T, Raffelt D, Connelly A. Unsupervised 3-tissue response function
|
|
392
|
+
estimation from single-shell or multi-shell diffusion MR data without a
|
|
393
|
+
co-registered T1 image. ISMRM Workshop on Breaking the Barriers of Diffusion
|
|
394
|
+
MRI, 2016, 5.
|
|
395
|
+
|
|
396
|
+
Author: MRTrix3 Developers
|
|
397
|
+
|
|
398
|
+
URL: https://www.mrtrix.org/
|
|
399
|
+
|
|
400
|
+
Args:
|
|
401
|
+
input_: the input DWI image containing volumes that are both diffusion\
|
|
402
|
+
weighted and b=0.
|
|
403
|
+
output: the output whole-brain mask image.
|
|
404
|
+
clean_scale: the maximum scale used to cut bridges. A certain maximum\
|
|
405
|
+
scale cuts bridges up to a width (in voxels) of 2x the provided scale.\
|
|
406
|
+
Setting this to 0 disables the mask cleaning step. (Default: 2).
|
|
407
|
+
grad: Provide the diffusion-weighted gradient scheme used in the\
|
|
408
|
+
acquisition in a text file. This should be supplied as a 4xN text file\
|
|
409
|
+
with each line is in the format [ X Y Z b ], where [ X Y Z ] describe\
|
|
410
|
+
the direction of the applied gradient, and b gives the b-value in units\
|
|
411
|
+
of s/mm^2. If a diffusion gradient scheme is present in the input image\
|
|
412
|
+
header, the data provided with this option will be instead used.
|
|
413
|
+
fslgrad: Provide the diffusion-weighted gradient scheme used in the\
|
|
414
|
+
acquisition in FSL bvecs/bvals format files. If a diffusion gradient\
|
|
415
|
+
scheme is present in the input image header, the data provided with\
|
|
416
|
+
this option will be instead used.
|
|
417
|
+
info: display information messages.
|
|
418
|
+
quiet: do not display information messages or progress status;\
|
|
419
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
420
|
+
environment variable to a non-empty string.
|
|
421
|
+
debug: display debugging messages.
|
|
422
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
423
|
+
input and output might cause unexpected behaviour).
|
|
424
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
425
|
+
(set to 0 to disable multi-threading).
|
|
426
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
427
|
+
help_: display this information page and exit.
|
|
428
|
+
version: display version information and exit.
|
|
429
|
+
runner: Command runner.
|
|
430
|
+
Returns:
|
|
431
|
+
NamedTuple of outputs (described in `Dwi2maskOutputs`).
|
|
432
|
+
"""
|
|
433
|
+
runner = runner or get_global_runner()
|
|
434
|
+
execution = runner.start_execution(DWI2MASK_METADATA)
|
|
435
|
+
params = dwi2mask_params(
|
|
436
|
+
clean_scale=clean_scale,
|
|
437
|
+
grad=grad,
|
|
438
|
+
fslgrad=fslgrad,
|
|
439
|
+
info=info,
|
|
440
|
+
quiet=quiet,
|
|
441
|
+
debug=debug,
|
|
442
|
+
force=force,
|
|
443
|
+
nthreads=nthreads,
|
|
444
|
+
config=config,
|
|
445
|
+
help_=help_,
|
|
446
|
+
version=version,
|
|
447
|
+
input_=input_,
|
|
448
|
+
output=output,
|
|
449
|
+
)
|
|
450
|
+
return dwi2mask_execute(params, execution)
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
__all__ = [
|
|
454
|
+
"DWI2MASK_METADATA",
|
|
455
|
+
"Dwi2maskConfigParameters",
|
|
456
|
+
"Dwi2maskFslgradParameters",
|
|
457
|
+
"Dwi2maskOutputs",
|
|
458
|
+
"Dwi2maskParameters",
|
|
459
|
+
"dwi2mask",
|
|
460
|
+
"dwi2mask_config_params",
|
|
461
|
+
"dwi2mask_fslgrad_params",
|
|
462
|
+
"dwi2mask_params",
|
|
463
|
+
]
|