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,767 @@
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
+ CONNECTOMESTATS_METADATA = Metadata(
9
+ id="a535681290f66c0887d4200e46496cba897c8f9a.boutiques",
10
+ name="connectomestats",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ ConnectomestatsColumnParameters = typing.TypedDict('ConnectomestatsColumnParameters', {
17
+ "__STYX_TYPE__": typing.Literal["column"],
18
+ "path": InputPathType,
19
+ })
20
+
21
+
22
+ ConnectomestatsConfigParameters = typing.TypedDict('ConnectomestatsConfigParameters', {
23
+ "__STYX_TYPE__": typing.Literal["config"],
24
+ "key": str,
25
+ "value": str,
26
+ })
27
+
28
+
29
+ ConnectomestatsParameters = typing.TypedDict('ConnectomestatsParameters', {
30
+ "__STYX_TYPE__": typing.Literal["connectomestats"],
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[ConnectomestatsColumnParameters] | None],
49
+ "threshold": typing.NotRequired[float | None],
50
+ "info": bool,
51
+ "quiet": bool,
52
+ "debug": bool,
53
+ "force": bool,
54
+ "nthreads": typing.NotRequired[int | None],
55
+ "config": typing.NotRequired[list[ConnectomestatsConfigParameters] | None],
56
+ "help": bool,
57
+ "version": bool,
58
+ "input": InputPathType,
59
+ "algorithm": str,
60
+ "design": InputPathType,
61
+ "contrast": InputPathType,
62
+ "output": str,
63
+ })
64
+
65
+
66
+ def dyn_cargs(
67
+ t: str,
68
+ ) -> typing.Any:
69
+ """
70
+ Get build cargs function by command type.
71
+
72
+ Args:
73
+ t: Command type.
74
+ Returns:
75
+ Build cargs function.
76
+ """
77
+ return {
78
+ "connectomestats": connectomestats_cargs,
79
+ "column": connectomestats_column_cargs,
80
+ "config": connectomestats_config_cargs,
81
+ }.get(t)
82
+
83
+
84
+ def dyn_outputs(
85
+ t: str,
86
+ ) -> typing.Any:
87
+ """
88
+ Get build outputs function by command type.
89
+
90
+ Args:
91
+ t: Command type.
92
+ Returns:
93
+ Build outputs function.
94
+ """
95
+ return {
96
+ }.get(t)
97
+
98
+
99
+ def connectomestats_column_params(
100
+ path: InputPathType,
101
+ ) -> ConnectomestatsColumnParameters:
102
+ """
103
+ Build parameters.
104
+
105
+ Args:
106
+ path: add a column to the design matrix corresponding to subject\
107
+ edge-wise values (note that the contrast matrix must include an\
108
+ additional column for each use of this option); the text file provided\
109
+ via this option should contain a file name for each subject.
110
+ Returns:
111
+ Parameter dictionary
112
+ """
113
+ params = {
114
+ "__STYXTYPE__": "column",
115
+ "path": path,
116
+ }
117
+ return params
118
+
119
+
120
+ def connectomestats_column_cargs(
121
+ params: ConnectomestatsColumnParameters,
122
+ execution: Execution,
123
+ ) -> list[str]:
124
+ """
125
+ Build command-line arguments from parameters.
126
+
127
+ Args:
128
+ params: The parameters.
129
+ execution: The execution object for resolving input paths.
130
+ Returns:
131
+ Command-line arguments.
132
+ """
133
+ cargs = []
134
+ cargs.append("-column")
135
+ cargs.append(execution.input_file(params.get("path")))
136
+ return cargs
137
+
138
+
139
+ def connectomestats_config_params(
140
+ key: str,
141
+ value: str,
142
+ ) -> ConnectomestatsConfigParameters:
143
+ """
144
+ Build parameters.
145
+
146
+ Args:
147
+ key: temporarily set the value of an MRtrix config file entry.
148
+ value: temporarily set the value of an MRtrix config file entry.
149
+ Returns:
150
+ Parameter dictionary
151
+ """
152
+ params = {
153
+ "__STYXTYPE__": "config",
154
+ "key": key,
155
+ "value": value,
156
+ }
157
+ return params
158
+
159
+
160
+ def connectomestats_config_cargs(
161
+ params: ConnectomestatsConfigParameters,
162
+ execution: Execution,
163
+ ) -> list[str]:
164
+ """
165
+ Build command-line arguments from parameters.
166
+
167
+ Args:
168
+ params: The parameters.
169
+ execution: The execution object for resolving input paths.
170
+ Returns:
171
+ Command-line arguments.
172
+ """
173
+ cargs = []
174
+ cargs.append("-config")
175
+ cargs.append(params.get("key"))
176
+ cargs.append(params.get("value"))
177
+ return cargs
178
+
179
+
180
+ class ConnectomestatsOutputs(typing.NamedTuple):
181
+ """
182
+ Output object returned when calling `connectomestats(...)`.
183
+ """
184
+ root: OutputPathType
185
+ """Output root folder. This is the root folder for all outputs."""
186
+
187
+
188
+ def connectomestats_params(
189
+ input_: InputPathType,
190
+ algorithm: str,
191
+ design: InputPathType,
192
+ contrast: InputPathType,
193
+ output: str,
194
+ notest: bool = False,
195
+ errors: str | None = None,
196
+ exchange_within: InputPathType | None = None,
197
+ exchange_whole: InputPathType | None = None,
198
+ strong: bool = False,
199
+ nshuffles: int | None = None,
200
+ permutations: InputPathType | None = None,
201
+ nonstationarity: bool = False,
202
+ skew_nonstationarity: float | None = None,
203
+ nshuffles_nonstationarity: int | None = None,
204
+ permutations_nonstationarity: InputPathType | None = None,
205
+ tfce_dh: float | None = None,
206
+ tfce_e: float | None = None,
207
+ tfce_h: float | None = None,
208
+ variance: InputPathType | None = None,
209
+ ftests: InputPathType | None = None,
210
+ fonly: bool = False,
211
+ column: list[ConnectomestatsColumnParameters] | None = None,
212
+ threshold: float | None = None,
213
+ info: bool = False,
214
+ quiet: bool = False,
215
+ debug: bool = False,
216
+ force: bool = False,
217
+ nthreads: int | None = None,
218
+ config: list[ConnectomestatsConfigParameters] | None = None,
219
+ help_: bool = False,
220
+ version: bool = False,
221
+ ) -> ConnectomestatsParameters:
222
+ """
223
+ Build parameters.
224
+
225
+ Args:
226
+ input_: a text file listing the file names of the input connectomes.
227
+ algorithm: the algorithm to use in network-based\
228
+ clustering/enhancement. Options are: nbs, tfnbs, none.
229
+ design: the design matrix.
230
+ contrast: the contrast matrix.
231
+ output: the filename prefix for all output.
232
+ notest: don't perform statistical inference; only output population\
233
+ statistics (effect size, stdev etc).
234
+ errors: specify nature of errors for shuffling; options are:\
235
+ ee,ise,both (default: ee).
236
+ exchange_within: specify blocks of observations within each of which\
237
+ data may undergo restricted exchange.
238
+ exchange_whole: specify blocks of observations that may be exchanged\
239
+ with one another (for independent and symmetric errors, sign-flipping\
240
+ will occur block-wise).
241
+ strong: use strong familywise error control across multiple hypotheses.
242
+ nshuffles: the number of shuffles (default: 5000).
243
+ permutations: manually define the permutations (relabelling). The input\
244
+ should be a text file defining a m x n matrix, where each relabelling\
245
+ is defined as a column vector of size m, and the number of columns, n,\
246
+ defines the number of permutations. Can be generated with the\
247
+ palm_quickperms function in PALM\
248
+ (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM). Overrides the -nshuffles\
249
+ option.
250
+ nonstationarity: perform non-stationarity correction.
251
+ skew_nonstationarity: specify the skew parameter for empirical\
252
+ statistic calculation (default for this command is 1).
253
+ nshuffles_nonstationarity: the number of shuffles to use when\
254
+ precomputing the empirical statistic image for non-stationarity\
255
+ correction (default: 5000).
256
+ permutations_nonstationarity: manually define the permutations\
257
+ (relabelling) for computing the emprical statistics for\
258
+ non-stationarity correction. The input should be a text file defining a\
259
+ m x n matrix, where each relabelling is defined as a column vector of\
260
+ size m, and the number of columns, n, defines the number of\
261
+ permutations. Can be generated with the palm_quickperms function in\
262
+ PALM (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM) Overrides the\
263
+ -nshuffles_nonstationarity option.
264
+ tfce_dh: the height increment used in the tfce integration (default:\
265
+ 0.1).
266
+ tfce_e: tfce extent exponent (default: 0.4).
267
+ tfce_h: tfce height exponent (default: 3).
268
+ variance: define variance groups for the G-statistic; measurements for\
269
+ which the expected variance is equivalent should contain the same index.
270
+ ftests: perform F-tests; input text file should contain, for each\
271
+ F-test, a row containing ones and zeros, where ones indicate the rows\
272
+ of the contrast matrix to be included in the F-test.
273
+ fonly: only assess F-tests; do not perform statistical inference on\
274
+ entries in the contrast matrix.
275
+ column: add a column to the design matrix corresponding to subject\
276
+ edge-wise values (note that the contrast matrix must include an\
277
+ additional column for each use of this option); the text file provided\
278
+ via this option should contain a file name for each subject.
279
+ threshold: the t-statistic value to use in threshold-based clustering\
280
+ algorithms.
281
+ info: display information messages.
282
+ quiet: do not display information messages or progress status;\
283
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
284
+ environment variable to a non-empty string.
285
+ debug: display debugging messages.
286
+ force: force overwrite of output files (caution: using the same file as\
287
+ input and output might cause unexpected behaviour).
288
+ nthreads: use this number of threads in multi-threaded applications\
289
+ (set to 0 to disable multi-threading).
290
+ config: temporarily set the value of an MRtrix config file entry.
291
+ help_: display this information page and exit.
292
+ version: display version information and exit.
293
+ Returns:
294
+ Parameter dictionary
295
+ """
296
+ params = {
297
+ "__STYXTYPE__": "connectomestats",
298
+ "notest": notest,
299
+ "strong": strong,
300
+ "nonstationarity": nonstationarity,
301
+ "fonly": fonly,
302
+ "info": info,
303
+ "quiet": quiet,
304
+ "debug": debug,
305
+ "force": force,
306
+ "help": help_,
307
+ "version": version,
308
+ "input": input_,
309
+ "algorithm": algorithm,
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 skew_nonstationarity is not None:
325
+ params["skew_nonstationarity"] = skew_nonstationarity
326
+ if nshuffles_nonstationarity is not None:
327
+ params["nshuffles_nonstationarity"] = nshuffles_nonstationarity
328
+ if permutations_nonstationarity is not None:
329
+ params["permutations_nonstationarity"] = permutations_nonstationarity
330
+ if tfce_dh is not None:
331
+ params["tfce_dh"] = tfce_dh
332
+ if tfce_e is not None:
333
+ params["tfce_e"] = tfce_e
334
+ if tfce_h is not None:
335
+ params["tfce_h"] = tfce_h
336
+ if variance is not None:
337
+ params["variance"] = variance
338
+ if ftests is not None:
339
+ params["ftests"] = ftests
340
+ if column is not None:
341
+ params["column"] = column
342
+ if threshold is not None:
343
+ params["threshold"] = threshold
344
+ if nthreads is not None:
345
+ params["nthreads"] = nthreads
346
+ if config is not None:
347
+ params["config"] = config
348
+ return params
349
+
350
+
351
+ def connectomestats_cargs(
352
+ params: ConnectomestatsParameters,
353
+ execution: Execution,
354
+ ) -> list[str]:
355
+ """
356
+ Build command-line arguments from parameters.
357
+
358
+ Args:
359
+ params: The parameters.
360
+ execution: The execution object for resolving input paths.
361
+ Returns:
362
+ Command-line arguments.
363
+ """
364
+ cargs = []
365
+ cargs.append("connectomestats")
366
+ if params.get("notest"):
367
+ cargs.append("-notest")
368
+ if params.get("errors") is not None:
369
+ cargs.extend([
370
+ "-errors",
371
+ params.get("errors")
372
+ ])
373
+ if params.get("exchange_within") is not None:
374
+ cargs.extend([
375
+ "-exchange_within",
376
+ execution.input_file(params.get("exchange_within"))
377
+ ])
378
+ if params.get("exchange_whole") is not None:
379
+ cargs.extend([
380
+ "-exchange_whole",
381
+ execution.input_file(params.get("exchange_whole"))
382
+ ])
383
+ if params.get("strong"):
384
+ cargs.append("-strong")
385
+ if params.get("nshuffles") is not None:
386
+ cargs.extend([
387
+ "-nshuffles",
388
+ str(params.get("nshuffles"))
389
+ ])
390
+ if params.get("permutations") is not None:
391
+ cargs.extend([
392
+ "-permutations",
393
+ execution.input_file(params.get("permutations"))
394
+ ])
395
+ if params.get("nonstationarity"):
396
+ cargs.append("-nonstationarity")
397
+ if params.get("skew_nonstationarity") is not None:
398
+ cargs.extend([
399
+ "-skew_nonstationarity",
400
+ str(params.get("skew_nonstationarity"))
401
+ ])
402
+ if params.get("nshuffles_nonstationarity") is not None:
403
+ cargs.extend([
404
+ "-nshuffles_nonstationarity",
405
+ str(params.get("nshuffles_nonstationarity"))
406
+ ])
407
+ if params.get("permutations_nonstationarity") is not None:
408
+ cargs.extend([
409
+ "-permutations_nonstationarity",
410
+ execution.input_file(params.get("permutations_nonstationarity"))
411
+ ])
412
+ if params.get("tfce_dh") is not None:
413
+ cargs.extend([
414
+ "-tfce_dh",
415
+ str(params.get("tfce_dh"))
416
+ ])
417
+ if params.get("tfce_e") is not None:
418
+ cargs.extend([
419
+ "-tfce_e",
420
+ str(params.get("tfce_e"))
421
+ ])
422
+ if params.get("tfce_h") is not None:
423
+ cargs.extend([
424
+ "-tfce_h",
425
+ str(params.get("tfce_h"))
426
+ ])
427
+ if params.get("variance") is not None:
428
+ cargs.extend([
429
+ "-variance",
430
+ execution.input_file(params.get("variance"))
431
+ ])
432
+ if params.get("ftests") is not None:
433
+ cargs.extend([
434
+ "-ftests",
435
+ execution.input_file(params.get("ftests"))
436
+ ])
437
+ if params.get("fonly"):
438
+ cargs.append("-fonly")
439
+ if params.get("column") is not None:
440
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("column")] for a in c])
441
+ if params.get("threshold") is not None:
442
+ cargs.extend([
443
+ "-threshold",
444
+ str(params.get("threshold"))
445
+ ])
446
+ if params.get("info"):
447
+ cargs.append("-info")
448
+ if params.get("quiet"):
449
+ cargs.append("-quiet")
450
+ if params.get("debug"):
451
+ cargs.append("-debug")
452
+ if params.get("force"):
453
+ cargs.append("-force")
454
+ if params.get("nthreads") is not None:
455
+ cargs.extend([
456
+ "-nthreads",
457
+ str(params.get("nthreads"))
458
+ ])
459
+ if params.get("config") is not None:
460
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
461
+ if params.get("help"):
462
+ cargs.append("-help")
463
+ if params.get("version"):
464
+ cargs.append("-version")
465
+ cargs.append(execution.input_file(params.get("input")))
466
+ cargs.append(params.get("algorithm"))
467
+ cargs.append(execution.input_file(params.get("design")))
468
+ cargs.append(execution.input_file(params.get("contrast")))
469
+ cargs.append(params.get("output"))
470
+ return cargs
471
+
472
+
473
+ def connectomestats_outputs(
474
+ params: ConnectomestatsParameters,
475
+ execution: Execution,
476
+ ) -> ConnectomestatsOutputs:
477
+ """
478
+ Build outputs object containing output file paths and possibly stdout/stderr.
479
+
480
+ Args:
481
+ params: The parameters.
482
+ execution: The execution object for resolving input paths.
483
+ Returns:
484
+ Outputs object.
485
+ """
486
+ ret = ConnectomestatsOutputs(
487
+ root=execution.output_file("."),
488
+ )
489
+ return ret
490
+
491
+
492
+ def connectomestats_execute(
493
+ params: ConnectomestatsParameters,
494
+ execution: Execution,
495
+ ) -> ConnectomestatsOutputs:
496
+ """
497
+ Connectome group-wise statistics at the edge level using non-parametric
498
+ permutation testing.
499
+
500
+ For the TFNBS algorithm, default parameters for statistical enhancement have
501
+ been set based on the work in:
502
+ Vinokur, L.; Zalesky, A.; Raffelt, D.; Smith, R.E. & Connelly, A. A Novel
503
+ Threshold-Free Network-Based Statistics Method: Demonstration using
504
+ Simulated Pathology. OHBM, 2015, 4144;
505
+ and:
506
+ Vinokur, L.; Zalesky, A.; Raffelt, D.; Smith, R.E. & Connelly, A. A novel
507
+ threshold-free network-based statistical method: Demonstration and parameter
508
+ optimisation using in vivo simulated pathology. In Proc ISMRM, 2015, 2846.
509
+ Note however that not only was the optimisation of these parameters not very
510
+ precise, but the outcomes of statistical inference (for both this algorithm
511
+ and the NBS method) can vary markedly for even small changes to enhancement
512
+ parameters. Therefore the specificity of results obtained using either of
513
+ these methods should be interpreted with caution.
514
+
515
+ In some software packages, a column of ones is automatically added to the
516
+ GLM design matrix; the purpose of this column is to estimate the "global
517
+ intercept", which is the predicted value of the observed variable if all
518
+ explanatory variables were to be zero. However there are rare situations
519
+ where including such a column would not be appropriate for a particular
520
+ experimental design. Hence, in MRtrix3 statistical inference commands, it is
521
+ up to the user to determine whether or not this column of ones should be
522
+ included in their design matrix, and add it explicitly if necessary. The
523
+ contrast matrix must also reflect the presence of this additional column.
524
+
525
+ References:
526
+
527
+ * If using the NBS algorithm:
528
+ Zalesky, A.; Fornito, A. & Bullmore, E. T. Network-based statistic:
529
+ Identifying differences in brain networks.
530
+ NeuroImage, 2010, 53, 1197-1207
531
+
532
+ * If using the TFNBS algorithm:
533
+ Baggio, H.C.; Abos, A.; Segura, B.; Campabadal, A.; Garcia-Diaz, A.; Uribe,
534
+ C.; Compta, Y.; Marti, M.J.; Valldeoriola, F.; Junque, C. Statistical
535
+ inference in brain graphs using threshold-free network-based statistics.HBM,
536
+ 2018, 39, 2289-2302
537
+
538
+ * If using the -nonstationary option:
539
+ Salimi-Khorshidi, G.; Smith, S.M. & Nichols, T.E. Adjusting the effect of
540
+ nonstationarity in cluster-based and TFCE inference.
541
+ Neuroimage, 2011, 54(3), 2006-19.
542
+
543
+ Author: MRTrix3 Developers
544
+
545
+ URL: https://www.mrtrix.org/
546
+
547
+ Args:
548
+ params: The parameters.
549
+ execution: The execution object.
550
+ Returns:
551
+ NamedTuple of outputs (described in `ConnectomestatsOutputs`).
552
+ """
553
+ params = execution.params(params)
554
+ cargs = connectomestats_cargs(params, execution)
555
+ ret = connectomestats_outputs(params, execution)
556
+ execution.run(cargs)
557
+ return ret
558
+
559
+
560
+ def connectomestats(
561
+ input_: InputPathType,
562
+ algorithm: str,
563
+ design: InputPathType,
564
+ contrast: InputPathType,
565
+ output: str,
566
+ notest: bool = False,
567
+ errors: str | None = None,
568
+ exchange_within: InputPathType | None = None,
569
+ exchange_whole: InputPathType | None = None,
570
+ strong: bool = False,
571
+ nshuffles: int | None = None,
572
+ permutations: InputPathType | None = None,
573
+ nonstationarity: bool = False,
574
+ skew_nonstationarity: float | None = None,
575
+ nshuffles_nonstationarity: int | None = None,
576
+ permutations_nonstationarity: InputPathType | None = None,
577
+ tfce_dh: float | None = None,
578
+ tfce_e: float | None = None,
579
+ tfce_h: float | None = None,
580
+ variance: InputPathType | None = None,
581
+ ftests: InputPathType | None = None,
582
+ fonly: bool = False,
583
+ column: list[ConnectomestatsColumnParameters] | None = None,
584
+ threshold: float | None = None,
585
+ info: bool = False,
586
+ quiet: bool = False,
587
+ debug: bool = False,
588
+ force: bool = False,
589
+ nthreads: int | None = None,
590
+ config: list[ConnectomestatsConfigParameters] | None = None,
591
+ help_: bool = False,
592
+ version: bool = False,
593
+ runner: Runner | None = None,
594
+ ) -> ConnectomestatsOutputs:
595
+ """
596
+ Connectome group-wise statistics at the edge level using non-parametric
597
+ permutation testing.
598
+
599
+ For the TFNBS algorithm, default parameters for statistical enhancement have
600
+ been set based on the work in:
601
+ Vinokur, L.; Zalesky, A.; Raffelt, D.; Smith, R.E. & Connelly, A. A Novel
602
+ Threshold-Free Network-Based Statistics Method: Demonstration using
603
+ Simulated Pathology. OHBM, 2015, 4144;
604
+ and:
605
+ Vinokur, L.; Zalesky, A.; Raffelt, D.; Smith, R.E. & Connelly, A. A novel
606
+ threshold-free network-based statistical method: Demonstration and parameter
607
+ optimisation using in vivo simulated pathology. In Proc ISMRM, 2015, 2846.
608
+ Note however that not only was the optimisation of these parameters not very
609
+ precise, but the outcomes of statistical inference (for both this algorithm
610
+ and the NBS method) can vary markedly for even small changes to enhancement
611
+ parameters. Therefore the specificity of results obtained using either of
612
+ these methods should be interpreted with caution.
613
+
614
+ In some software packages, a column of ones is automatically added to the
615
+ GLM design matrix; the purpose of this column is to estimate the "global
616
+ intercept", which is the predicted value of the observed variable if all
617
+ explanatory variables were to be zero. However there are rare situations
618
+ where including such a column would not be appropriate for a particular
619
+ experimental design. Hence, in MRtrix3 statistical inference commands, it is
620
+ up to the user to determine whether or not this column of ones should be
621
+ included in their design matrix, and add it explicitly if necessary. The
622
+ contrast matrix must also reflect the presence of this additional column.
623
+
624
+ References:
625
+
626
+ * If using the NBS algorithm:
627
+ Zalesky, A.; Fornito, A. & Bullmore, E. T. Network-based statistic:
628
+ Identifying differences in brain networks.
629
+ NeuroImage, 2010, 53, 1197-1207
630
+
631
+ * If using the TFNBS algorithm:
632
+ Baggio, H.C.; Abos, A.; Segura, B.; Campabadal, A.; Garcia-Diaz, A.; Uribe,
633
+ C.; Compta, Y.; Marti, M.J.; Valldeoriola, F.; Junque, C. Statistical
634
+ inference in brain graphs using threshold-free network-based statistics.HBM,
635
+ 2018, 39, 2289-2302
636
+
637
+ * If using the -nonstationary option:
638
+ Salimi-Khorshidi, G.; Smith, S.M. & Nichols, T.E. Adjusting the effect of
639
+ nonstationarity in cluster-based and TFCE inference.
640
+ Neuroimage, 2011, 54(3), 2006-19.
641
+
642
+ Author: MRTrix3 Developers
643
+
644
+ URL: https://www.mrtrix.org/
645
+
646
+ Args:
647
+ input_: a text file listing the file names of the input connectomes.
648
+ algorithm: the algorithm to use in network-based\
649
+ clustering/enhancement. Options are: nbs, tfnbs, none.
650
+ design: the design matrix.
651
+ contrast: the contrast matrix.
652
+ output: the filename prefix for all output.
653
+ notest: don't perform statistical inference; only output population\
654
+ statistics (effect size, stdev etc).
655
+ errors: specify nature of errors for shuffling; options are:\
656
+ ee,ise,both (default: ee).
657
+ exchange_within: specify blocks of observations within each of which\
658
+ data may undergo restricted exchange.
659
+ exchange_whole: specify blocks of observations that may be exchanged\
660
+ with one another (for independent and symmetric errors, sign-flipping\
661
+ will occur block-wise).
662
+ strong: use strong familywise error control across multiple hypotheses.
663
+ nshuffles: the number of shuffles (default: 5000).
664
+ permutations: manually define the permutations (relabelling). The input\
665
+ should be a text file defining a m x n matrix, where each relabelling\
666
+ is defined as a column vector of size m, and the number of columns, n,\
667
+ defines the number of permutations. Can be generated with the\
668
+ palm_quickperms function in PALM\
669
+ (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM). Overrides the -nshuffles\
670
+ option.
671
+ nonstationarity: perform non-stationarity correction.
672
+ skew_nonstationarity: specify the skew parameter for empirical\
673
+ statistic calculation (default for this command is 1).
674
+ nshuffles_nonstationarity: the number of shuffles to use when\
675
+ precomputing the empirical statistic image for non-stationarity\
676
+ correction (default: 5000).
677
+ permutations_nonstationarity: manually define the permutations\
678
+ (relabelling) for computing the emprical statistics for\
679
+ non-stationarity correction. The input should be a text file defining a\
680
+ m x n matrix, where each relabelling is defined as a column vector of\
681
+ size m, and the number of columns, n, defines the number of\
682
+ permutations. Can be generated with the palm_quickperms function in\
683
+ PALM (http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/PALM) Overrides the\
684
+ -nshuffles_nonstationarity option.
685
+ tfce_dh: the height increment used in the tfce integration (default:\
686
+ 0.1).
687
+ tfce_e: tfce extent exponent (default: 0.4).
688
+ tfce_h: tfce height exponent (default: 3).
689
+ variance: define variance groups for the G-statistic; measurements for\
690
+ which the expected variance is equivalent should contain the same index.
691
+ ftests: perform F-tests; input text file should contain, for each\
692
+ F-test, a row containing ones and zeros, where ones indicate the rows\
693
+ of the contrast matrix to be included in the F-test.
694
+ fonly: only assess F-tests; do not perform statistical inference on\
695
+ entries in the contrast matrix.
696
+ column: add a column to the design matrix corresponding to subject\
697
+ edge-wise values (note that the contrast matrix must include an\
698
+ additional column for each use of this option); the text file provided\
699
+ via this option should contain a file name for each subject.
700
+ threshold: the t-statistic value to use in threshold-based clustering\
701
+ algorithms.
702
+ info: display information messages.
703
+ quiet: do not display information messages or progress status;\
704
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
705
+ environment variable to a non-empty string.
706
+ debug: display debugging messages.
707
+ force: force overwrite of output files (caution: using the same file as\
708
+ input and output might cause unexpected behaviour).
709
+ nthreads: use this number of threads in multi-threaded applications\
710
+ (set to 0 to disable multi-threading).
711
+ config: temporarily set the value of an MRtrix config file entry.
712
+ help_: display this information page and exit.
713
+ version: display version information and exit.
714
+ runner: Command runner.
715
+ Returns:
716
+ NamedTuple of outputs (described in `ConnectomestatsOutputs`).
717
+ """
718
+ runner = runner or get_global_runner()
719
+ execution = runner.start_execution(CONNECTOMESTATS_METADATA)
720
+ params = connectomestats_params(
721
+ notest=notest,
722
+ errors=errors,
723
+ exchange_within=exchange_within,
724
+ exchange_whole=exchange_whole,
725
+ strong=strong,
726
+ nshuffles=nshuffles,
727
+ permutations=permutations,
728
+ nonstationarity=nonstationarity,
729
+ skew_nonstationarity=skew_nonstationarity,
730
+ nshuffles_nonstationarity=nshuffles_nonstationarity,
731
+ permutations_nonstationarity=permutations_nonstationarity,
732
+ tfce_dh=tfce_dh,
733
+ tfce_e=tfce_e,
734
+ tfce_h=tfce_h,
735
+ variance=variance,
736
+ ftests=ftests,
737
+ fonly=fonly,
738
+ column=column,
739
+ threshold=threshold,
740
+ info=info,
741
+ quiet=quiet,
742
+ debug=debug,
743
+ force=force,
744
+ nthreads=nthreads,
745
+ config=config,
746
+ help_=help_,
747
+ version=version,
748
+ input_=input_,
749
+ algorithm=algorithm,
750
+ design=design,
751
+ contrast=contrast,
752
+ output=output,
753
+ )
754
+ return connectomestats_execute(params, execution)
755
+
756
+
757
+ __all__ = [
758
+ "CONNECTOMESTATS_METADATA",
759
+ "ConnectomestatsColumnParameters",
760
+ "ConnectomestatsConfigParameters",
761
+ "ConnectomestatsOutputs",
762
+ "ConnectomestatsParameters",
763
+ "connectomestats",
764
+ "connectomestats_column_params",
765
+ "connectomestats_config_params",
766
+ "connectomestats_params",
767
+ ]