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.
Files changed (119) hide show
  1. niwrap_mrtrix/mrtrix/__init__.py +263 -0
  2. niwrap_mrtrix/mrtrix/afdconnectivity.py +527 -0
  3. niwrap_mrtrix/mrtrix/amp2response.py +560 -0
  4. niwrap_mrtrix/mrtrix/amp2sh.py +870 -0
  5. niwrap_mrtrix/mrtrix/connectome2tck.py +583 -0
  6. niwrap_mrtrix/mrtrix/connectomeedit.py +413 -0
  7. niwrap_mrtrix/mrtrix/connectomestats.py +956 -0
  8. niwrap_mrtrix/mrtrix/dcmedit.py +552 -0
  9. niwrap_mrtrix/mrtrix/dcminfo.py +529 -0
  10. niwrap_mrtrix/mrtrix/dirflip.py +440 -0
  11. niwrap_mrtrix/mrtrix/dirgen.py +514 -0
  12. niwrap_mrtrix/mrtrix/dirmerge.py +446 -0
  13. niwrap_mrtrix/mrtrix/dirorder.py +421 -0
  14. niwrap_mrtrix/mrtrix/dirsplit.py +436 -0
  15. niwrap_mrtrix/mrtrix/dirstat.py +640 -0
  16. niwrap_mrtrix/mrtrix/dwi2adc.py +531 -0
  17. niwrap_mrtrix/mrtrix/dwi2fod.py +1156 -0
  18. niwrap_mrtrix/mrtrix/dwi2mask.py +570 -0
  19. niwrap_mrtrix/mrtrix/dwi2response.py +1774 -0
  20. niwrap_mrtrix/mrtrix/dwi2tensor.py +715 -0
  21. niwrap_mrtrix/mrtrix/dwibiascorrect.py +673 -0
  22. niwrap_mrtrix/mrtrix/dwidenoise.py +570 -0
  23. niwrap_mrtrix/mrtrix/dwiextract.py +1111 -0
  24. niwrap_mrtrix/mrtrix/dwigradcheck.py +665 -0
  25. niwrap_mrtrix/mrtrix/fixel2peaks.py +613 -0
  26. niwrap_mrtrix/mrtrix/fixel2sh.py +430 -0
  27. niwrap_mrtrix/mrtrix/fixel2tsf.py +435 -0
  28. niwrap_mrtrix/mrtrix/fixel2voxel.py +523 -0
  29. niwrap_mrtrix/mrtrix/fixelcfestats.py +1179 -0
  30. niwrap_mrtrix/mrtrix/fixelconnectivity.py +477 -0
  31. niwrap_mrtrix/mrtrix/fixelconvert.py +850 -0
  32. niwrap_mrtrix/mrtrix/fixelcorrespondence.py +455 -0
  33. niwrap_mrtrix/mrtrix/fixelcrop.py +422 -0
  34. niwrap_mrtrix/mrtrix/fixelfilter.py +882 -0
  35. niwrap_mrtrix/mrtrix/fixelreorient.py +435 -0
  36. niwrap_mrtrix/mrtrix/fod2dec.py +571 -0
  37. niwrap_mrtrix/mrtrix/fod2fixel.py +646 -0
  38. niwrap_mrtrix/mrtrix/label2colour.py +426 -0
  39. niwrap_mrtrix/mrtrix/label2mesh.py +417 -0
  40. niwrap_mrtrix/mrtrix/labelconvert.py +460 -0
  41. niwrap_mrtrix/mrtrix/labelstats.py +418 -0
  42. niwrap_mrtrix/mrtrix/maskdump.py +404 -0
  43. niwrap_mrtrix/mrtrix/maskfilter.py +730 -0
  44. niwrap_mrtrix/mrtrix/mesh2voxel.py +422 -0
  45. niwrap_mrtrix/mrtrix/meshconvert.py +514 -0
  46. niwrap_mrtrix/mrtrix/meshfilter.py +452 -0
  47. niwrap_mrtrix/mrtrix/mraverageheader.py +485 -0
  48. niwrap_mrtrix/mrtrix/mrcalc.py +4302 -0
  49. niwrap_mrtrix/mrtrix/mrcat.py +467 -0
  50. niwrap_mrtrix/mrtrix/mrcentroid.py +418 -0
  51. niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +446 -0
  52. niwrap_mrtrix/mrtrix/mrclusterstats.py +930 -0
  53. niwrap_mrtrix/mrtrix/mrcolour.py +490 -0
  54. niwrap_mrtrix/mrtrix/mrconvert.py +1967 -0
  55. niwrap_mrtrix/mrtrix/mrdegibbs.py +535 -0
  56. niwrap_mrtrix/mrtrix/mrdump.py +423 -0
  57. niwrap_mrtrix/mrtrix/mredit.py +737 -0
  58. niwrap_mrtrix/mrtrix/mrfilter.py +971 -0
  59. niwrap_mrtrix/mrtrix/mrgrid.py +1079 -0
  60. niwrap_mrtrix/mrtrix/mrhistmatch.py +494 -0
  61. niwrap_mrtrix/mrtrix/mrhistogram.py +484 -0
  62. niwrap_mrtrix/mrtrix/mrinfo.py +1282 -0
  63. niwrap_mrtrix/mrtrix/mrmath.py +503 -0
  64. niwrap_mrtrix/mrtrix/mrmetric.py +525 -0
  65. niwrap_mrtrix/mrtrix/mrregister.py +2098 -0
  66. niwrap_mrtrix/mrtrix/mrstats.py +534 -0
  67. niwrap_mrtrix/mrtrix/mrthreshold.py +666 -0
  68. niwrap_mrtrix/mrtrix/mrtransform.py +1372 -0
  69. niwrap_mrtrix/mrtrix/mtnormalise.py +725 -0
  70. niwrap_mrtrix/mrtrix/peaks2amp.py +403 -0
  71. niwrap_mrtrix/mrtrix/peaks2fixel.py +422 -0
  72. niwrap_mrtrix/mrtrix/responsemean.py +385 -0
  73. niwrap_mrtrix/mrtrix/sh2amp.py +844 -0
  74. niwrap_mrtrix/mrtrix/sh2peaks.py +632 -0
  75. niwrap_mrtrix/mrtrix/sh2power.py +427 -0
  76. niwrap_mrtrix/mrtrix/sh2response.py +481 -0
  77. niwrap_mrtrix/mrtrix/shbasis.py +445 -0
  78. niwrap_mrtrix/mrtrix/shconv.py +661 -0
  79. niwrap_mrtrix/mrtrix/tck2connectome.py +727 -0
  80. niwrap_mrtrix/mrtrix/tck2fixel.py +447 -0
  81. niwrap_mrtrix/mrtrix/tckconvert.py +775 -0
  82. niwrap_mrtrix/mrtrix/tckdfc.py +684 -0
  83. niwrap_mrtrix/mrtrix/tckedit.py +1478 -0
  84. niwrap_mrtrix/mrtrix/tckgen.py +2733 -0
  85. niwrap_mrtrix/mrtrix/tckglobal.py +944 -0
  86. niwrap_mrtrix/mrtrix/tckinfo.py +402 -0
  87. niwrap_mrtrix/mrtrix/tckmap.py +1004 -0
  88. niwrap_mrtrix/mrtrix/tckresample.py +760 -0
  89. niwrap_mrtrix/mrtrix/tcksample.py +497 -0
  90. niwrap_mrtrix/mrtrix/tcksift.py +739 -0
  91. niwrap_mrtrix/mrtrix/tcksift2.py +902 -0
  92. niwrap_mrtrix/mrtrix/tckstats.py +550 -0
  93. niwrap_mrtrix/mrtrix/tcktransform.py +414 -0
  94. niwrap_mrtrix/mrtrix/tensor2metric.py +659 -0
  95. niwrap_mrtrix/mrtrix/transformcalc.py +421 -0
  96. niwrap_mrtrix/mrtrix/transformcompose.py +625 -0
  97. niwrap_mrtrix/mrtrix/transformconvert.py +423 -0
  98. niwrap_mrtrix/mrtrix/tsfdivide.py +414 -0
  99. niwrap_mrtrix/mrtrix/tsfinfo.py +421 -0
  100. niwrap_mrtrix/mrtrix/tsfmult.py +401 -0
  101. niwrap_mrtrix/mrtrix/tsfsmooth.py +420 -0
  102. niwrap_mrtrix/mrtrix/tsfthreshold.py +428 -0
  103. niwrap_mrtrix/mrtrix/tsfvalidate.py +398 -0
  104. niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +432 -0
  105. niwrap_mrtrix/mrtrix/v_5tt2vis.py +505 -0
  106. niwrap_mrtrix/mrtrix/v_5ttcheck.py +409 -0
  107. niwrap_mrtrix/mrtrix/v_5ttedit.py +513 -0
  108. niwrap_mrtrix/mrtrix/v_5ttgen.py +1107 -0
  109. niwrap_mrtrix/mrtrix/vectorstats.py +736 -0
  110. niwrap_mrtrix/mrtrix/voxel2fixel.py +430 -0
  111. niwrap_mrtrix/mrtrix/voxel2mesh.py +454 -0
  112. niwrap_mrtrix/mrtrix/warp2metric.py +556 -0
  113. niwrap_mrtrix/mrtrix/warpconvert.py +498 -0
  114. niwrap_mrtrix/mrtrix/warpcorrect.py +448 -0
  115. niwrap_mrtrix/mrtrix/warpinit.py +425 -0
  116. niwrap_mrtrix/mrtrix/warpinvert.py +448 -0
  117. niwrap_mrtrix-0.8.0.dist-info/METADATA +8 -0
  118. niwrap_mrtrix-0.8.0.dist-info/RECORD +119 -0
  119. niwrap_mrtrix-0.8.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,736 @@
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
+ VECTORSTATS_METADATA = Metadata(
9
+ id="bb3edd72079d87de8242594d71273892006e9def.boutiques",
10
+ name="vectorstats",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ _VectorstatsColumnParamsDictNoTag = typing.TypedDict('_VectorstatsColumnParamsDictNoTag', {
17
+ "path": InputPathType,
18
+ })
19
+ VectorstatsColumnParamsDictTagged = typing.TypedDict('VectorstatsColumnParamsDictTagged', {
20
+ "@type": typing.Literal["column"],
21
+ "path": InputPathType,
22
+ })
23
+ VectorstatsColumnParamsDict = _VectorstatsColumnParamsDictNoTag | VectorstatsColumnParamsDictTagged
24
+
25
+
26
+ _VectorstatsConfigParamsDictNoTag = typing.TypedDict('_VectorstatsConfigParamsDictNoTag', {
27
+ "key": str,
28
+ "value": str,
29
+ })
30
+ VectorstatsConfigParamsDictTagged = typing.TypedDict('VectorstatsConfigParamsDictTagged', {
31
+ "@type": typing.Literal["config"],
32
+ "key": str,
33
+ "value": str,
34
+ })
35
+ VectorstatsConfigParamsDict = _VectorstatsConfigParamsDictNoTag | VectorstatsConfigParamsDictTagged
36
+
37
+
38
+ _VectorstatsParamsDictNoTag = typing.TypedDict('_VectorstatsParamsDictNoTag', {
39
+ "notest": bool,
40
+ "errors": typing.NotRequired[str | None],
41
+ "exchange_within": typing.NotRequired[InputPathType | None],
42
+ "exchange_whole": typing.NotRequired[InputPathType | None],
43
+ "strong": bool,
44
+ "nshuffles": typing.NotRequired[int | None],
45
+ "permutations": typing.NotRequired[InputPathType | None],
46
+ "variance": typing.NotRequired[InputPathType | None],
47
+ "ftests": typing.NotRequired[InputPathType | None],
48
+ "fonly": bool,
49
+ "column": typing.NotRequired[list[VectorstatsColumnParamsDict] | None],
50
+ "info": bool,
51
+ "quiet": bool,
52
+ "debug": bool,
53
+ "force": bool,
54
+ "nthreads": typing.NotRequired[int | None],
55
+ "config": typing.NotRequired[list[VectorstatsConfigParamsDict] | None],
56
+ "help": bool,
57
+ "version": bool,
58
+ "input": InputPathType,
59
+ "design": InputPathType,
60
+ "contrast": InputPathType,
61
+ "output": str,
62
+ })
63
+ VectorstatsParamsDictTagged = typing.TypedDict('VectorstatsParamsDictTagged', {
64
+ "@type": typing.Literal["mrtrix/vectorstats"],
65
+ "notest": bool,
66
+ "errors": typing.NotRequired[str | None],
67
+ "exchange_within": typing.NotRequired[InputPathType | None],
68
+ "exchange_whole": typing.NotRequired[InputPathType | None],
69
+ "strong": bool,
70
+ "nshuffles": typing.NotRequired[int | None],
71
+ "permutations": typing.NotRequired[InputPathType | None],
72
+ "variance": typing.NotRequired[InputPathType | None],
73
+ "ftests": typing.NotRequired[InputPathType | None],
74
+ "fonly": bool,
75
+ "column": typing.NotRequired[list[VectorstatsColumnParamsDict] | None],
76
+ "info": bool,
77
+ "quiet": bool,
78
+ "debug": bool,
79
+ "force": bool,
80
+ "nthreads": typing.NotRequired[int | None],
81
+ "config": typing.NotRequired[list[VectorstatsConfigParamsDict] | None],
82
+ "help": bool,
83
+ "version": bool,
84
+ "input": InputPathType,
85
+ "design": InputPathType,
86
+ "contrast": InputPathType,
87
+ "output": str,
88
+ })
89
+ VectorstatsParamsDict = _VectorstatsParamsDictNoTag | VectorstatsParamsDictTagged
90
+
91
+
92
+ def vectorstats_column(
93
+ path: InputPathType,
94
+ ) -> VectorstatsColumnParamsDictTagged:
95
+ """
96
+ Build parameters.
97
+
98
+ Args:
99
+ path: add a column to the design matrix corresponding to subject\
100
+ element-wise values (note that the contrast matrix must include an\
101
+ additional column for each use of this option); the text file provided\
102
+ via this option should contain a file name for each subject.
103
+ Returns:
104
+ Parameter dictionary
105
+ """
106
+ params = {
107
+ "@type": "column",
108
+ "path": path,
109
+ }
110
+ return params
111
+
112
+
113
+ def vectorstats_column_validate(
114
+ params: typing.Any,
115
+ ) -> None:
116
+ """
117
+ Validate parameters. Throws an error if `params` is not a valid
118
+ `VectorstatsColumnParamsDict` object.
119
+
120
+ Args:
121
+ params: The parameters object to validate.
122
+ """
123
+ if params is None or not isinstance(params, dict):
124
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
125
+ if params.get("path", None) is None:
126
+ raise StyxValidationError("`path` must not be None")
127
+ if not isinstance(params["path"], (pathlib.Path, str)):
128
+ raise StyxValidationError(f'`path` has the wrong type: Received `{type(params.get("path", None))}` expected `InputPathType`')
129
+
130
+
131
+ def vectorstats_column_cargs(
132
+ params: VectorstatsColumnParamsDict,
133
+ execution: Execution,
134
+ ) -> list[str]:
135
+ """
136
+ Build command-line arguments from parameters.
137
+
138
+ Args:
139
+ params: The parameters.
140
+ execution: The execution object for resolving input paths.
141
+ Returns:
142
+ Command-line arguments.
143
+ """
144
+ cargs = []
145
+ cargs.append("-column")
146
+ cargs.append(execution.input_file(params.get("path", None)))
147
+ return cargs
148
+
149
+
150
+ def vectorstats_config(
151
+ key: str,
152
+ value: str,
153
+ ) -> VectorstatsConfigParamsDictTagged:
154
+ """
155
+ Build parameters.
156
+
157
+ Args:
158
+ key: temporarily set the value of an MRtrix config file entry.
159
+ value: temporarily set the value of an MRtrix config file entry.
160
+ Returns:
161
+ Parameter dictionary
162
+ """
163
+ params = {
164
+ "@type": "config",
165
+ "key": key,
166
+ "value": value,
167
+ }
168
+ return params
169
+
170
+
171
+ def vectorstats_config_validate(
172
+ params: typing.Any,
173
+ ) -> None:
174
+ """
175
+ Validate parameters. Throws an error if `params` is not a valid
176
+ `VectorstatsConfigParamsDict` object.
177
+
178
+ Args:
179
+ params: The parameters object to validate.
180
+ """
181
+ if params is None or not isinstance(params, dict):
182
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
183
+ if params.get("key", None) is None:
184
+ raise StyxValidationError("`key` must not be None")
185
+ if not isinstance(params["key"], str):
186
+ raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
187
+ if params.get("value", None) is None:
188
+ raise StyxValidationError("`value` must not be None")
189
+ if not isinstance(params["value"], str):
190
+ raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
191
+
192
+
193
+ def vectorstats_config_cargs(
194
+ params: VectorstatsConfigParamsDict,
195
+ execution: Execution,
196
+ ) -> list[str]:
197
+ """
198
+ Build command-line arguments from parameters.
199
+
200
+ Args:
201
+ params: The parameters.
202
+ execution: The execution object for resolving input paths.
203
+ Returns:
204
+ Command-line arguments.
205
+ """
206
+ cargs = []
207
+ cargs.append("-config")
208
+ cargs.append(params.get("key", None))
209
+ cargs.append(params.get("value", None))
210
+ return cargs
211
+
212
+
213
+ class VectorstatsOutputs(typing.NamedTuple):
214
+ """
215
+ Output object returned when calling `VectorstatsParamsDict(...)`.
216
+ """
217
+ root: OutputPathType
218
+ """Output root folder. This is the root folder for all outputs."""
219
+
220
+
221
+ def vectorstats_params(
222
+ input_: InputPathType,
223
+ design: InputPathType,
224
+ contrast: InputPathType,
225
+ output: str,
226
+ notest: bool = False,
227
+ errors: str | None = None,
228
+ exchange_within: InputPathType | None = None,
229
+ exchange_whole: InputPathType | None = None,
230
+ strong: bool = False,
231
+ nshuffles: int | None = None,
232
+ permutations: InputPathType | None = None,
233
+ variance: InputPathType | None = None,
234
+ ftests: InputPathType | None = None,
235
+ fonly: bool = False,
236
+ column: list[VectorstatsColumnParamsDict] | None = None,
237
+ info: bool = False,
238
+ quiet: bool = False,
239
+ debug: bool = False,
240
+ force: bool = False,
241
+ nthreads: int | None = None,
242
+ config: list[VectorstatsConfigParamsDict] | None = None,
243
+ help_: bool = False,
244
+ version: bool = False,
245
+ ) -> VectorstatsParamsDictTagged:
246
+ """
247
+ Build parameters.
248
+
249
+ Args:
250
+ input_: a text file listing the file names of the input subject data.
251
+ design: the design matrix.
252
+ contrast: the contrast matrix.
253
+ output: the filename prefix for all output.
254
+ notest: don't perform statistical inference; only output population\
255
+ statistics (effect size, stdev etc).
256
+ errors: specify nature of errors for shuffling; options are:\
257
+ ee,ise,both (default: ee).
258
+ exchange_within: specify blocks of observations within each of which\
259
+ data may undergo restricted exchange.
260
+ exchange_whole: specify blocks of observations that may be exchanged\
261
+ with one another (for independent and symmetric errors, sign-flipping\
262
+ will occur block-wise).
263
+ strong: use strong familywise error control across multiple hypotheses.
264
+ nshuffles: the number of shuffles (default: 5000).
265
+ permutations: manually define the permutations (relabelling). The input\
266
+ should be a text file defining a m x n matrix, where each relabelling\
267
+ is defined as a column vector of size m, and the number of columns, n,\
268
+ defines the number of permutations. Can be generated with the\
269
+ palm_quickperms function in PALM\
270
+ (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM). Overrides the -nshuffles\
271
+ option.
272
+ variance: define variance groups for the G-statistic; measurements for\
273
+ which the expected variance is equivalent should contain the same index.
274
+ ftests: perform F-tests; input text file should contain, for each\
275
+ F-test, a row containing ones and zeros, where ones indicate the rows\
276
+ of the contrast matrix to be included in the F-test.
277
+ fonly: only assess F-tests; do not perform statistical inference on\
278
+ entries in the contrast matrix.
279
+ column: add a column to the design matrix corresponding to subject\
280
+ element-wise values (note that the contrast matrix must include an\
281
+ additional column for each use of this option); the text file provided\
282
+ via this option should contain a file name for each subject.
283
+ info: display information messages.
284
+ quiet: do not display information messages or progress status;\
285
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
286
+ environment variable to a non-empty string.
287
+ debug: display debugging messages.
288
+ force: force overwrite of output files (caution: using the same file as\
289
+ input and output might cause unexpected behaviour).
290
+ nthreads: use this number of threads in multi-threaded applications\
291
+ (set to 0 to disable multi-threading).
292
+ config: temporarily set the value of an MRtrix config file entry.
293
+ help_: display this information page and exit.
294
+ version: display version information and exit.
295
+ Returns:
296
+ Parameter dictionary
297
+ """
298
+ params = {
299
+ "@type": "mrtrix/vectorstats",
300
+ "notest": notest,
301
+ "strong": strong,
302
+ "fonly": fonly,
303
+ "info": info,
304
+ "quiet": quiet,
305
+ "debug": debug,
306
+ "force": force,
307
+ "help": help_,
308
+ "version": version,
309
+ "input": input_,
310
+ "design": design,
311
+ "contrast": contrast,
312
+ "output": output,
313
+ }
314
+ if errors is not None:
315
+ params["errors"] = errors
316
+ if exchange_within is not None:
317
+ params["exchange_within"] = exchange_within
318
+ if exchange_whole is not None:
319
+ params["exchange_whole"] = exchange_whole
320
+ if nshuffles is not None:
321
+ params["nshuffles"] = nshuffles
322
+ if permutations is not None:
323
+ params["permutations"] = permutations
324
+ if variance is not None:
325
+ params["variance"] = variance
326
+ if ftests is not None:
327
+ params["ftests"] = ftests
328
+ if column is not None:
329
+ params["column"] = column
330
+ if nthreads is not None:
331
+ params["nthreads"] = nthreads
332
+ if config is not None:
333
+ params["config"] = config
334
+ return params
335
+
336
+
337
+ def vectorstats_validate(
338
+ params: typing.Any,
339
+ ) -> None:
340
+ """
341
+ Validate parameters. Throws an error if `params` is not a valid
342
+ `VectorstatsParamsDict` object.
343
+
344
+ Args:
345
+ params: The parameters object to validate.
346
+ """
347
+ if params is None or not isinstance(params, dict):
348
+ raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
349
+ if params.get("notest", False) is None:
350
+ raise StyxValidationError("`notest` must not be None")
351
+ if not isinstance(params["notest"], bool):
352
+ raise StyxValidationError(f'`notest` has the wrong type: Received `{type(params.get("notest", False))}` expected `bool`')
353
+ if params.get("errors", None) is not None:
354
+ if not isinstance(params["errors"], str):
355
+ raise StyxValidationError(f'`errors` has the wrong type: Received `{type(params.get("errors", None))}` expected `str | None`')
356
+ if params.get("exchange_within", None) is not None:
357
+ if not isinstance(params["exchange_within"], (pathlib.Path, str)):
358
+ raise StyxValidationError(f'`exchange_within` has the wrong type: Received `{type(params.get("exchange_within", None))}` expected `InputPathType | None`')
359
+ if params.get("exchange_whole", None) is not None:
360
+ if not isinstance(params["exchange_whole"], (pathlib.Path, str)):
361
+ raise StyxValidationError(f'`exchange_whole` has the wrong type: Received `{type(params.get("exchange_whole", None))}` expected `InputPathType | None`')
362
+ if params.get("strong", False) is None:
363
+ raise StyxValidationError("`strong` must not be None")
364
+ if not isinstance(params["strong"], bool):
365
+ raise StyxValidationError(f'`strong` has the wrong type: Received `{type(params.get("strong", False))}` expected `bool`')
366
+ if params.get("nshuffles", None) is not None:
367
+ if not isinstance(params["nshuffles"], int):
368
+ raise StyxValidationError(f'`nshuffles` has the wrong type: Received `{type(params.get("nshuffles", None))}` expected `int | None`')
369
+ if params.get("permutations", None) is not None:
370
+ if not isinstance(params["permutations"], (pathlib.Path, str)):
371
+ raise StyxValidationError(f'`permutations` has the wrong type: Received `{type(params.get("permutations", None))}` expected `InputPathType | None`')
372
+ if params.get("variance", None) is not None:
373
+ if not isinstance(params["variance"], (pathlib.Path, str)):
374
+ raise StyxValidationError(f'`variance` has the wrong type: Received `{type(params.get("variance", None))}` expected `InputPathType | None`')
375
+ if params.get("ftests", None) is not None:
376
+ if not isinstance(params["ftests"], (pathlib.Path, str)):
377
+ raise StyxValidationError(f'`ftests` has the wrong type: Received `{type(params.get("ftests", None))}` expected `InputPathType | None`')
378
+ if params.get("fonly", False) is None:
379
+ raise StyxValidationError("`fonly` must not be None")
380
+ if not isinstance(params["fonly"], bool):
381
+ raise StyxValidationError(f'`fonly` has the wrong type: Received `{type(params.get("fonly", False))}` expected `bool`')
382
+ if params.get("column", None) is not None:
383
+ if not isinstance(params["column"], list):
384
+ raise StyxValidationError(f'`column` has the wrong type: Received `{type(params.get("column", None))}` expected `list[VectorstatsColumnParamsDict] | None`')
385
+ for e in params["column"]:
386
+ vectorstats_column_validate(e)
387
+ if params.get("info", False) is None:
388
+ raise StyxValidationError("`info` must not be None")
389
+ if not isinstance(params["info"], bool):
390
+ raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
391
+ if params.get("quiet", False) is None:
392
+ raise StyxValidationError("`quiet` must not be None")
393
+ if not isinstance(params["quiet"], bool):
394
+ raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
395
+ if params.get("debug", False) is None:
396
+ raise StyxValidationError("`debug` must not be None")
397
+ if not isinstance(params["debug"], bool):
398
+ raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
399
+ if params.get("force", False) is None:
400
+ raise StyxValidationError("`force` must not be None")
401
+ if not isinstance(params["force"], bool):
402
+ raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
403
+ if params.get("nthreads", None) is not None:
404
+ if not isinstance(params["nthreads"], int):
405
+ raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
406
+ if params.get("config", None) is not None:
407
+ if not isinstance(params["config"], list):
408
+ raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[VectorstatsConfigParamsDict] | None`')
409
+ for e in params["config"]:
410
+ vectorstats_config_validate(e)
411
+ if params.get("help", False) is None:
412
+ raise StyxValidationError("`help` must not be None")
413
+ if not isinstance(params["help"], bool):
414
+ raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
415
+ if params.get("version", False) is None:
416
+ raise StyxValidationError("`version` must not be None")
417
+ if not isinstance(params["version"], bool):
418
+ raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
419
+ if params.get("input", None) is None:
420
+ raise StyxValidationError("`input` must not be None")
421
+ if not isinstance(params["input"], (pathlib.Path, str)):
422
+ raise StyxValidationError(f'`input` has the wrong type: Received `{type(params.get("input", None))}` expected `InputPathType`')
423
+ if params.get("design", None) is None:
424
+ raise StyxValidationError("`design` must not be None")
425
+ if not isinstance(params["design"], (pathlib.Path, str)):
426
+ raise StyxValidationError(f'`design` has the wrong type: Received `{type(params.get("design", None))}` expected `InputPathType`')
427
+ if params.get("contrast", None) is None:
428
+ raise StyxValidationError("`contrast` must not be None")
429
+ if not isinstance(params["contrast"], (pathlib.Path, str)):
430
+ raise StyxValidationError(f'`contrast` has the wrong type: Received `{type(params.get("contrast", None))}` expected `InputPathType`')
431
+ if params.get("output", None) is None:
432
+ raise StyxValidationError("`output` must not be None")
433
+ if not isinstance(params["output"], str):
434
+ raise StyxValidationError(f'`output` has the wrong type: Received `{type(params.get("output", None))}` expected `str`')
435
+
436
+
437
+ def vectorstats_cargs(
438
+ params: VectorstatsParamsDict,
439
+ execution: Execution,
440
+ ) -> list[str]:
441
+ """
442
+ Build command-line arguments from parameters.
443
+
444
+ Args:
445
+ params: The parameters.
446
+ execution: The execution object for resolving input paths.
447
+ Returns:
448
+ Command-line arguments.
449
+ """
450
+ cargs = []
451
+ cargs.append("vectorstats")
452
+ if params.get("notest", False):
453
+ cargs.append("-notest")
454
+ if params.get("errors", None) is not None:
455
+ cargs.extend([
456
+ "-errors",
457
+ params.get("errors", None)
458
+ ])
459
+ if params.get("exchange_within", None) is not None:
460
+ cargs.extend([
461
+ "-exchange_within",
462
+ execution.input_file(params.get("exchange_within", None))
463
+ ])
464
+ if params.get("exchange_whole", None) is not None:
465
+ cargs.extend([
466
+ "-exchange_whole",
467
+ execution.input_file(params.get("exchange_whole", None))
468
+ ])
469
+ if params.get("strong", False):
470
+ cargs.append("-strong")
471
+ if params.get("nshuffles", None) is not None:
472
+ cargs.extend([
473
+ "-nshuffles",
474
+ str(params.get("nshuffles", None))
475
+ ])
476
+ if params.get("permutations", None) is not None:
477
+ cargs.extend([
478
+ "-permutations",
479
+ execution.input_file(params.get("permutations", None))
480
+ ])
481
+ if params.get("variance", None) is not None:
482
+ cargs.extend([
483
+ "-variance",
484
+ execution.input_file(params.get("variance", None))
485
+ ])
486
+ if params.get("ftests", None) is not None:
487
+ cargs.extend([
488
+ "-ftests",
489
+ execution.input_file(params.get("ftests", None))
490
+ ])
491
+ if params.get("fonly", False):
492
+ cargs.append("-fonly")
493
+ if params.get("column", None) is not None:
494
+ cargs.extend([a for c in [vectorstats_column_cargs(s, execution) for s in params.get("column", None)] for a in c])
495
+ if params.get("info", False):
496
+ cargs.append("-info")
497
+ if params.get("quiet", False):
498
+ cargs.append("-quiet")
499
+ if params.get("debug", False):
500
+ cargs.append("-debug")
501
+ if params.get("force", False):
502
+ cargs.append("-force")
503
+ if params.get("nthreads", None) is not None:
504
+ cargs.extend([
505
+ "-nthreads",
506
+ str(params.get("nthreads", None))
507
+ ])
508
+ if params.get("config", None) is not None:
509
+ cargs.extend([a for c in [vectorstats_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
510
+ if params.get("help", False):
511
+ cargs.append("-help")
512
+ if params.get("version", False):
513
+ cargs.append("-version")
514
+ cargs.append(execution.input_file(params.get("input", None)))
515
+ cargs.append(execution.input_file(params.get("design", None)))
516
+ cargs.append(execution.input_file(params.get("contrast", None)))
517
+ cargs.append(params.get("output", None))
518
+ return cargs
519
+
520
+
521
+ def vectorstats_outputs(
522
+ params: VectorstatsParamsDict,
523
+ execution: Execution,
524
+ ) -> VectorstatsOutputs:
525
+ """
526
+ Build outputs object containing output file paths and possibly stdout/stderr.
527
+
528
+ Args:
529
+ params: The parameters.
530
+ execution: The execution object for resolving input paths.
531
+ Returns:
532
+ Outputs object.
533
+ """
534
+ ret = VectorstatsOutputs(
535
+ root=execution.output_file("."),
536
+ )
537
+ return ret
538
+
539
+
540
+ def vectorstats_execute(
541
+ params: VectorstatsParamsDict,
542
+ runner: Runner | None = None,
543
+ ) -> VectorstatsOutputs:
544
+ """
545
+ vectorstats
546
+
547
+ Statistical testing of vector data using non-parametric permutation testing.
548
+
549
+ This command can be used to perform permutation testing of any form of data.
550
+ The data for each input subject must be stored in a text file, with one
551
+ value per row. The data for each row across subjects will be tested
552
+ independently, i.e. there is no statistical enhancement that occurs between
553
+ the data; however family-wise error control will be used.
554
+
555
+ In some software packages, a column of ones is automatically added to the
556
+ GLM design matrix; the purpose of this column is to estimate the "global
557
+ intercept", which is the predicted value of the observed variable if all
558
+ explanatory variables were to be zero. However there are rare situations
559
+ where including such a column would not be appropriate for a particular
560
+ experimental design. Hence, in MRtrix3 statistical inference commands, it is
561
+ up to the user to determine whether or not this column of ones should be
562
+ included in their design matrix, and add it explicitly if necessary. The
563
+ contrast matrix must also reflect the presence of this additional column.
564
+
565
+ References:
566
+
567
+ .
568
+
569
+ Author: MRTrix3 Developers
570
+
571
+ URL: https://www.mrtrix.org/
572
+
573
+ Args:
574
+ params: The parameters.
575
+ runner: Command runner.
576
+ Returns:
577
+ NamedTuple of outputs (described in `VectorstatsOutputs`).
578
+ """
579
+ vectorstats_validate(params)
580
+ runner = runner or get_global_runner()
581
+ execution = runner.start_execution(VECTORSTATS_METADATA)
582
+ params = execution.params(params)
583
+ cargs = vectorstats_cargs(params, execution)
584
+ ret = vectorstats_outputs(params, execution)
585
+ execution.run(cargs)
586
+ return ret
587
+
588
+
589
+ def vectorstats(
590
+ input_: InputPathType,
591
+ design: InputPathType,
592
+ contrast: InputPathType,
593
+ output: str,
594
+ notest: bool = False,
595
+ errors: str | None = None,
596
+ exchange_within: InputPathType | None = None,
597
+ exchange_whole: InputPathType | None = None,
598
+ strong: bool = False,
599
+ nshuffles: int | None = None,
600
+ permutations: InputPathType | None = None,
601
+ variance: InputPathType | None = None,
602
+ ftests: InputPathType | None = None,
603
+ fonly: bool = False,
604
+ column: list[VectorstatsColumnParamsDict] | None = None,
605
+ info: bool = False,
606
+ quiet: bool = False,
607
+ debug: bool = False,
608
+ force: bool = False,
609
+ nthreads: int | None = None,
610
+ config: list[VectorstatsConfigParamsDict] | None = None,
611
+ help_: bool = False,
612
+ version: bool = False,
613
+ runner: Runner | None = None,
614
+ ) -> VectorstatsOutputs:
615
+ """
616
+ vectorstats
617
+
618
+ Statistical testing of vector data using non-parametric permutation testing.
619
+
620
+ This command can be used to perform permutation testing of any form of data.
621
+ The data for each input subject must be stored in a text file, with one
622
+ value per row. The data for each row across subjects will be tested
623
+ independently, i.e. there is no statistical enhancement that occurs between
624
+ the data; however family-wise error control will be used.
625
+
626
+ In some software packages, a column of ones is automatically added to the
627
+ GLM design matrix; the purpose of this column is to estimate the "global
628
+ intercept", which is the predicted value of the observed variable if all
629
+ explanatory variables were to be zero. However there are rare situations
630
+ where including such a column would not be appropriate for a particular
631
+ experimental design. Hence, in MRtrix3 statistical inference commands, it is
632
+ up to the user to determine whether or not this column of ones should be
633
+ included in their design matrix, and add it explicitly if necessary. The
634
+ contrast matrix must also reflect the presence of this additional column.
635
+
636
+ References:
637
+
638
+ .
639
+
640
+ Author: MRTrix3 Developers
641
+
642
+ URL: https://www.mrtrix.org/
643
+
644
+ Args:
645
+ input_: a text file listing the file names of the input subject data.
646
+ design: the design matrix.
647
+ contrast: the contrast matrix.
648
+ output: the filename prefix for all output.
649
+ notest: don't perform statistical inference; only output population\
650
+ statistics (effect size, stdev etc).
651
+ errors: specify nature of errors for shuffling; options are:\
652
+ ee,ise,both (default: ee).
653
+ exchange_within: specify blocks of observations within each of which\
654
+ data may undergo restricted exchange.
655
+ exchange_whole: specify blocks of observations that may be exchanged\
656
+ with one another (for independent and symmetric errors, sign-flipping\
657
+ will occur block-wise).
658
+ strong: use strong familywise error control across multiple hypotheses.
659
+ nshuffles: the number of shuffles (default: 5000).
660
+ permutations: manually define the permutations (relabelling). The input\
661
+ should be a text file defining a m x n matrix, where each relabelling\
662
+ is defined as a column vector of size m, and the number of columns, n,\
663
+ defines the number of permutations. Can be generated with the\
664
+ palm_quickperms function in PALM\
665
+ (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM). Overrides the -nshuffles\
666
+ option.
667
+ variance: define variance groups for the G-statistic; measurements for\
668
+ which the expected variance is equivalent should contain the same index.
669
+ ftests: perform F-tests; input text file should contain, for each\
670
+ F-test, a row containing ones and zeros, where ones indicate the rows\
671
+ of the contrast matrix to be included in the F-test.
672
+ fonly: only assess F-tests; do not perform statistical inference on\
673
+ entries in the contrast matrix.
674
+ column: add a column to the design matrix corresponding to subject\
675
+ element-wise values (note that the contrast matrix must include an\
676
+ additional column for each use of this option); the text file provided\
677
+ via this option should contain a file name for each subject.
678
+ info: display information messages.
679
+ quiet: do not display information messages or progress status;\
680
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
681
+ environment variable to a non-empty string.
682
+ debug: display debugging messages.
683
+ force: force overwrite of output files (caution: using the same file as\
684
+ input and output might cause unexpected behaviour).
685
+ nthreads: use this number of threads in multi-threaded applications\
686
+ (set to 0 to disable multi-threading).
687
+ config: temporarily set the value of an MRtrix config file entry.
688
+ help_: display this information page and exit.
689
+ version: display version information and exit.
690
+ runner: Command runner.
691
+ Returns:
692
+ NamedTuple of outputs (described in `VectorstatsOutputs`).
693
+ """
694
+ params = vectorstats_params(
695
+ notest=notest,
696
+ errors=errors,
697
+ exchange_within=exchange_within,
698
+ exchange_whole=exchange_whole,
699
+ strong=strong,
700
+ nshuffles=nshuffles,
701
+ permutations=permutations,
702
+ variance=variance,
703
+ ftests=ftests,
704
+ fonly=fonly,
705
+ column=column,
706
+ info=info,
707
+ quiet=quiet,
708
+ debug=debug,
709
+ force=force,
710
+ nthreads=nthreads,
711
+ config=config,
712
+ help_=help_,
713
+ version=version,
714
+ input_=input_,
715
+ design=design,
716
+ contrast=contrast,
717
+ output=output,
718
+ )
719
+ return vectorstats_execute(params, runner)
720
+
721
+
722
+ __all__ = [
723
+ "VECTORSTATS_METADATA",
724
+ "VectorstatsColumnParamsDict",
725
+ "VectorstatsColumnParamsDictTagged",
726
+ "VectorstatsConfigParamsDict",
727
+ "VectorstatsConfigParamsDictTagged",
728
+ "VectorstatsOutputs",
729
+ "VectorstatsParamsDict",
730
+ "VectorstatsParamsDictTagged",
731
+ "vectorstats",
732
+ "vectorstats_column",
733
+ "vectorstats_config",
734
+ "vectorstats_execute",
735
+ "vectorstats_params",
736
+ ]