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.

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