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,371 @@
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
+ FIXELCORRESPONDENCE_METADATA = Metadata(
9
+ id="fad1be9b8243f83bbbf677ed7d4db5308a7e3c5d.boutiques",
10
+ name="fixelcorrespondence",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ FixelcorrespondenceConfigParameters = typing.TypedDict('FixelcorrespondenceConfigParameters', {
17
+ "__STYX_TYPE__": typing.Literal["config"],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+
22
+
23
+ FixelcorrespondenceParameters = typing.TypedDict('FixelcorrespondenceParameters', {
24
+ "__STYX_TYPE__": typing.Literal["fixelcorrespondence"],
25
+ "angle": typing.NotRequired[float | None],
26
+ "info": bool,
27
+ "quiet": bool,
28
+ "debug": bool,
29
+ "force": bool,
30
+ "nthreads": typing.NotRequired[int | None],
31
+ "config": typing.NotRequired[list[FixelcorrespondenceConfigParameters] | None],
32
+ "help": bool,
33
+ "version": bool,
34
+ "subject_data": InputPathType,
35
+ "template_directory": InputPathType,
36
+ "output_directory": str,
37
+ "output_data": str,
38
+ })
39
+
40
+
41
+ def dyn_cargs(
42
+ t: str,
43
+ ) -> typing.Any:
44
+ """
45
+ Get build cargs function by command type.
46
+
47
+ Args:
48
+ t: Command type.
49
+ Returns:
50
+ Build cargs function.
51
+ """
52
+ return {
53
+ "fixelcorrespondence": fixelcorrespondence_cargs,
54
+ "config": fixelcorrespondence_config_cargs,
55
+ }.get(t)
56
+
57
+
58
+ def dyn_outputs(
59
+ t: str,
60
+ ) -> typing.Any:
61
+ """
62
+ Get build outputs function by command type.
63
+
64
+ Args:
65
+ t: Command type.
66
+ Returns:
67
+ Build outputs function.
68
+ """
69
+ return {
70
+ }.get(t)
71
+
72
+
73
+ def fixelcorrespondence_config_params(
74
+ key: str,
75
+ value: str,
76
+ ) -> FixelcorrespondenceConfigParameters:
77
+ """
78
+ Build parameters.
79
+
80
+ Args:
81
+ key: temporarily set the value of an MRtrix config file entry.
82
+ value: temporarily set the value of an MRtrix config file entry.
83
+ Returns:
84
+ Parameter dictionary
85
+ """
86
+ params = {
87
+ "__STYXTYPE__": "config",
88
+ "key": key,
89
+ "value": value,
90
+ }
91
+ return params
92
+
93
+
94
+ def fixelcorrespondence_config_cargs(
95
+ params: FixelcorrespondenceConfigParameters,
96
+ execution: Execution,
97
+ ) -> list[str]:
98
+ """
99
+ Build command-line arguments from parameters.
100
+
101
+ Args:
102
+ params: The parameters.
103
+ execution: The execution object for resolving input paths.
104
+ Returns:
105
+ Command-line arguments.
106
+ """
107
+ cargs = []
108
+ cargs.append("-config")
109
+ cargs.append(params.get("key"))
110
+ cargs.append(params.get("value"))
111
+ return cargs
112
+
113
+
114
+ class FixelcorrespondenceOutputs(typing.NamedTuple):
115
+ """
116
+ Output object returned when calling `fixelcorrespondence(...)`.
117
+ """
118
+ root: OutputPathType
119
+ """Output root folder. This is the root folder for all outputs."""
120
+
121
+
122
+ def fixelcorrespondence_params(
123
+ subject_data: InputPathType,
124
+ template_directory: InputPathType,
125
+ output_directory: str,
126
+ output_data: str,
127
+ angle: float | None = None,
128
+ info: bool = False,
129
+ quiet: bool = False,
130
+ debug: bool = False,
131
+ force: bool = False,
132
+ nthreads: int | None = None,
133
+ config: list[FixelcorrespondenceConfigParameters] | None = None,
134
+ help_: bool = False,
135
+ version: bool = False,
136
+ ) -> FixelcorrespondenceParameters:
137
+ """
138
+ Build parameters.
139
+
140
+ Args:
141
+ subject_data: the input subject fixel data file. This should be a file\
142
+ inside the fixel directory.
143
+ template_directory: the input template fixel directory.
144
+ output_directory: the fixel directory where the output file will be\
145
+ written.
146
+ output_data: the name of the output fixel data file. This will be\
147
+ placed in the output fixel directory.
148
+ angle: the max angle threshold for computing inter-subject fixel\
149
+ correspondence (Default: 45 degrees).
150
+ info: display information messages.
151
+ quiet: do not display information messages or progress status;\
152
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
153
+ environment variable to a non-empty string.
154
+ debug: display debugging messages.
155
+ force: force overwrite of output files (caution: using the same file as\
156
+ input and output might cause unexpected behaviour).
157
+ nthreads: use this number of threads in multi-threaded applications\
158
+ (set to 0 to disable multi-threading).
159
+ config: temporarily set the value of an MRtrix config file entry.
160
+ help_: display this information page and exit.
161
+ version: display version information and exit.
162
+ Returns:
163
+ Parameter dictionary
164
+ """
165
+ params = {
166
+ "__STYXTYPE__": "fixelcorrespondence",
167
+ "info": info,
168
+ "quiet": quiet,
169
+ "debug": debug,
170
+ "force": force,
171
+ "help": help_,
172
+ "version": version,
173
+ "subject_data": subject_data,
174
+ "template_directory": template_directory,
175
+ "output_directory": output_directory,
176
+ "output_data": output_data,
177
+ }
178
+ if angle is not None:
179
+ params["angle"] = angle
180
+ if nthreads is not None:
181
+ params["nthreads"] = nthreads
182
+ if config is not None:
183
+ params["config"] = config
184
+ return params
185
+
186
+
187
+ def fixelcorrespondence_cargs(
188
+ params: FixelcorrespondenceParameters,
189
+ execution: Execution,
190
+ ) -> list[str]:
191
+ """
192
+ Build command-line arguments from parameters.
193
+
194
+ Args:
195
+ params: The parameters.
196
+ execution: The execution object for resolving input paths.
197
+ Returns:
198
+ Command-line arguments.
199
+ """
200
+ cargs = []
201
+ cargs.append("fixelcorrespondence")
202
+ if params.get("angle") is not None:
203
+ cargs.extend([
204
+ "-angle",
205
+ str(params.get("angle"))
206
+ ])
207
+ if params.get("info"):
208
+ cargs.append("-info")
209
+ if params.get("quiet"):
210
+ cargs.append("-quiet")
211
+ if params.get("debug"):
212
+ cargs.append("-debug")
213
+ if params.get("force"):
214
+ cargs.append("-force")
215
+ if params.get("nthreads") is not None:
216
+ cargs.extend([
217
+ "-nthreads",
218
+ str(params.get("nthreads"))
219
+ ])
220
+ if params.get("config") is not None:
221
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
222
+ if params.get("help"):
223
+ cargs.append("-help")
224
+ if params.get("version"):
225
+ cargs.append("-version")
226
+ cargs.append(execution.input_file(params.get("subject_data")))
227
+ cargs.append(execution.input_file(params.get("template_directory")))
228
+ cargs.append(params.get("output_directory"))
229
+ cargs.append(params.get("output_data"))
230
+ return cargs
231
+
232
+
233
+ def fixelcorrespondence_outputs(
234
+ params: FixelcorrespondenceParameters,
235
+ execution: Execution,
236
+ ) -> FixelcorrespondenceOutputs:
237
+ """
238
+ Build outputs object containing output file paths and possibly stdout/stderr.
239
+
240
+ Args:
241
+ params: The parameters.
242
+ execution: The execution object for resolving input paths.
243
+ Returns:
244
+ Outputs object.
245
+ """
246
+ ret = FixelcorrespondenceOutputs(
247
+ root=execution.output_file("."),
248
+ )
249
+ return ret
250
+
251
+
252
+ def fixelcorrespondence_execute(
253
+ params: FixelcorrespondenceParameters,
254
+ execution: Execution,
255
+ ) -> FixelcorrespondenceOutputs:
256
+ """
257
+ Obtain fixel-fixel correpondence between a subject fixel image and a template
258
+ fixel mask.
259
+
260
+ It is assumed that the subject image has already been spatially normalised
261
+ and is aligned with the template. The output fixel image will have the same
262
+ fixels (and directions) of the template.
263
+
264
+ References:
265
+
266
+ .
267
+
268
+ Author: MRTrix3 Developers
269
+
270
+ URL: https://www.mrtrix.org/
271
+
272
+ Args:
273
+ params: The parameters.
274
+ execution: The execution object.
275
+ Returns:
276
+ NamedTuple of outputs (described in `FixelcorrespondenceOutputs`).
277
+ """
278
+ params = execution.params(params)
279
+ cargs = fixelcorrespondence_cargs(params, execution)
280
+ ret = fixelcorrespondence_outputs(params, execution)
281
+ execution.run(cargs)
282
+ return ret
283
+
284
+
285
+ def fixelcorrespondence(
286
+ subject_data: InputPathType,
287
+ template_directory: InputPathType,
288
+ output_directory: str,
289
+ output_data: str,
290
+ angle: float | None = None,
291
+ info: bool = False,
292
+ quiet: bool = False,
293
+ debug: bool = False,
294
+ force: bool = False,
295
+ nthreads: int | None = None,
296
+ config: list[FixelcorrespondenceConfigParameters] | None = None,
297
+ help_: bool = False,
298
+ version: bool = False,
299
+ runner: Runner | None = None,
300
+ ) -> FixelcorrespondenceOutputs:
301
+ """
302
+ Obtain fixel-fixel correpondence between a subject fixel image and a template
303
+ fixel mask.
304
+
305
+ It is assumed that the subject image has already been spatially normalised
306
+ and is aligned with the template. The output fixel image will have the same
307
+ fixels (and directions) of the template.
308
+
309
+ References:
310
+
311
+ .
312
+
313
+ Author: MRTrix3 Developers
314
+
315
+ URL: https://www.mrtrix.org/
316
+
317
+ Args:
318
+ subject_data: the input subject fixel data file. This should be a file\
319
+ inside the fixel directory.
320
+ template_directory: the input template fixel directory.
321
+ output_directory: the fixel directory where the output file will be\
322
+ written.
323
+ output_data: the name of the output fixel data file. This will be\
324
+ placed in the output fixel directory.
325
+ angle: the max angle threshold for computing inter-subject fixel\
326
+ correspondence (Default: 45 degrees).
327
+ info: display information messages.
328
+ quiet: do not display information messages or progress status;\
329
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
330
+ environment variable to a non-empty string.
331
+ debug: display debugging messages.
332
+ force: force overwrite of output files (caution: using the same file as\
333
+ input and output might cause unexpected behaviour).
334
+ nthreads: use this number of threads in multi-threaded applications\
335
+ (set to 0 to disable multi-threading).
336
+ config: temporarily set the value of an MRtrix config file entry.
337
+ help_: display this information page and exit.
338
+ version: display version information and exit.
339
+ runner: Command runner.
340
+ Returns:
341
+ NamedTuple of outputs (described in `FixelcorrespondenceOutputs`).
342
+ """
343
+ runner = runner or get_global_runner()
344
+ execution = runner.start_execution(FIXELCORRESPONDENCE_METADATA)
345
+ params = fixelcorrespondence_params(
346
+ angle=angle,
347
+ info=info,
348
+ quiet=quiet,
349
+ debug=debug,
350
+ force=force,
351
+ nthreads=nthreads,
352
+ config=config,
353
+ help_=help_,
354
+ version=version,
355
+ subject_data=subject_data,
356
+ template_directory=template_directory,
357
+ output_directory=output_directory,
358
+ output_data=output_data,
359
+ )
360
+ return fixelcorrespondence_execute(params, execution)
361
+
362
+
363
+ __all__ = [
364
+ "FIXELCORRESPONDENCE_METADATA",
365
+ "FixelcorrespondenceConfigParameters",
366
+ "FixelcorrespondenceOutputs",
367
+ "FixelcorrespondenceParameters",
368
+ "fixelcorrespondence",
369
+ "fixelcorrespondence_config_params",
370
+ "fixelcorrespondence_params",
371
+ ]
@@ -0,0 +1,348 @@
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
+ FIXELCROP_METADATA = Metadata(
9
+ id="df585f30c2a7738dc8886c2e7c7172b7e6cdc09c.boutiques",
10
+ name="fixelcrop",
11
+ package="mrtrix",
12
+ container_image_tag="mrtrix3/mrtrix3:3.0.4",
13
+ )
14
+
15
+
16
+ FixelcropConfigParameters = typing.TypedDict('FixelcropConfigParameters', {
17
+ "__STYX_TYPE__": typing.Literal["config"],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+
22
+
23
+ FixelcropParameters = typing.TypedDict('FixelcropParameters', {
24
+ "__STYX_TYPE__": typing.Literal["fixelcrop"],
25
+ "info": bool,
26
+ "quiet": bool,
27
+ "debug": bool,
28
+ "force": bool,
29
+ "nthreads": typing.NotRequired[int | None],
30
+ "config": typing.NotRequired[list[FixelcropConfigParameters] | None],
31
+ "help": bool,
32
+ "version": bool,
33
+ "input_fixel_directory": InputPathType,
34
+ "input_fixel_mask": InputPathType,
35
+ "output_fixel_directory": str,
36
+ })
37
+
38
+
39
+ def dyn_cargs(
40
+ t: str,
41
+ ) -> typing.Any:
42
+ """
43
+ Get build cargs function by command type.
44
+
45
+ Args:
46
+ t: Command type.
47
+ Returns:
48
+ Build cargs function.
49
+ """
50
+ return {
51
+ "fixelcrop": fixelcrop_cargs,
52
+ "config": fixelcrop_config_cargs,
53
+ }.get(t)
54
+
55
+
56
+ def dyn_outputs(
57
+ t: str,
58
+ ) -> typing.Any:
59
+ """
60
+ Get build outputs function by command type.
61
+
62
+ Args:
63
+ t: Command type.
64
+ Returns:
65
+ Build outputs function.
66
+ """
67
+ return {
68
+ "fixelcrop": fixelcrop_outputs,
69
+ }.get(t)
70
+
71
+
72
+ def fixelcrop_config_params(
73
+ key: str,
74
+ value: str,
75
+ ) -> FixelcropConfigParameters:
76
+ """
77
+ Build parameters.
78
+
79
+ Args:
80
+ key: temporarily set the value of an MRtrix config file entry.
81
+ value: temporarily set the value of an MRtrix config file entry.
82
+ Returns:
83
+ Parameter dictionary
84
+ """
85
+ params = {
86
+ "__STYXTYPE__": "config",
87
+ "key": key,
88
+ "value": value,
89
+ }
90
+ return params
91
+
92
+
93
+ def fixelcrop_config_cargs(
94
+ params: FixelcropConfigParameters,
95
+ execution: Execution,
96
+ ) -> list[str]:
97
+ """
98
+ Build command-line arguments from parameters.
99
+
100
+ Args:
101
+ params: The parameters.
102
+ execution: The execution object for resolving input paths.
103
+ Returns:
104
+ Command-line arguments.
105
+ """
106
+ cargs = []
107
+ cargs.append("-config")
108
+ cargs.append(params.get("key"))
109
+ cargs.append(params.get("value"))
110
+ return cargs
111
+
112
+
113
+ class FixelcropOutputs(typing.NamedTuple):
114
+ """
115
+ Output object returned when calling `fixelcrop(...)`.
116
+ """
117
+ root: OutputPathType
118
+ """Output root folder. This is the root folder for all outputs."""
119
+ output_fixel_directory: OutputPathType
120
+ """the output directory to store the cropped directions and data files"""
121
+
122
+
123
+ def fixelcrop_params(
124
+ input_fixel_directory: InputPathType,
125
+ input_fixel_mask: InputPathType,
126
+ output_fixel_directory: str,
127
+ info: bool = False,
128
+ quiet: bool = False,
129
+ debug: bool = False,
130
+ force: bool = False,
131
+ nthreads: int | None = None,
132
+ config: list[FixelcropConfigParameters] | None = None,
133
+ help_: bool = False,
134
+ version: bool = False,
135
+ ) -> FixelcropParameters:
136
+ """
137
+ Build parameters.
138
+
139
+ Args:
140
+ input_fixel_directory: input fixel directory, all data files and\
141
+ directions file will be cropped and saved in the output fixel directory.
142
+ input_fixel_mask: the input fixel data file defining which fixels to\
143
+ crop. Fixels with zero values will be removed.
144
+ output_fixel_directory: the output directory to store the cropped\
145
+ directions and data files.
146
+ info: display information messages.
147
+ quiet: do not display information messages or progress status;\
148
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
149
+ environment variable to a non-empty string.
150
+ debug: display debugging messages.
151
+ force: force overwrite of output files (caution: using the same file as\
152
+ input and output might cause unexpected behaviour).
153
+ nthreads: use this number of threads in multi-threaded applications\
154
+ (set to 0 to disable multi-threading).
155
+ config: temporarily set the value of an MRtrix config file entry.
156
+ help_: display this information page and exit.
157
+ version: display version information and exit.
158
+ Returns:
159
+ Parameter dictionary
160
+ """
161
+ params = {
162
+ "__STYXTYPE__": "fixelcrop",
163
+ "info": info,
164
+ "quiet": quiet,
165
+ "debug": debug,
166
+ "force": force,
167
+ "help": help_,
168
+ "version": version,
169
+ "input_fixel_directory": input_fixel_directory,
170
+ "input_fixel_mask": input_fixel_mask,
171
+ "output_fixel_directory": output_fixel_directory,
172
+ }
173
+ if nthreads is not None:
174
+ params["nthreads"] = nthreads
175
+ if config is not None:
176
+ params["config"] = config
177
+ return params
178
+
179
+
180
+ def fixelcrop_cargs(
181
+ params: FixelcropParameters,
182
+ execution: Execution,
183
+ ) -> list[str]:
184
+ """
185
+ Build command-line arguments from parameters.
186
+
187
+ Args:
188
+ params: The parameters.
189
+ execution: The execution object for resolving input paths.
190
+ Returns:
191
+ Command-line arguments.
192
+ """
193
+ cargs = []
194
+ cargs.append("fixelcrop")
195
+ if params.get("info"):
196
+ cargs.append("-info")
197
+ if params.get("quiet"):
198
+ cargs.append("-quiet")
199
+ if params.get("debug"):
200
+ cargs.append("-debug")
201
+ if params.get("force"):
202
+ cargs.append("-force")
203
+ if params.get("nthreads") is not None:
204
+ cargs.extend([
205
+ "-nthreads",
206
+ str(params.get("nthreads"))
207
+ ])
208
+ if params.get("config") is not None:
209
+ cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
210
+ if params.get("help"):
211
+ cargs.append("-help")
212
+ if params.get("version"):
213
+ cargs.append("-version")
214
+ cargs.append(execution.input_file(params.get("input_fixel_directory")))
215
+ cargs.append(execution.input_file(params.get("input_fixel_mask")))
216
+ cargs.append(params.get("output_fixel_directory"))
217
+ return cargs
218
+
219
+
220
+ def fixelcrop_outputs(
221
+ params: FixelcropParameters,
222
+ execution: Execution,
223
+ ) -> FixelcropOutputs:
224
+ """
225
+ Build outputs object containing output file paths and possibly stdout/stderr.
226
+
227
+ Args:
228
+ params: The parameters.
229
+ execution: The execution object for resolving input paths.
230
+ Returns:
231
+ Outputs object.
232
+ """
233
+ ret = FixelcropOutputs(
234
+ root=execution.output_file("."),
235
+ output_fixel_directory=execution.output_file(params.get("output_fixel_directory")),
236
+ )
237
+ return ret
238
+
239
+
240
+ def fixelcrop_execute(
241
+ params: FixelcropParameters,
242
+ execution: Execution,
243
+ ) -> FixelcropOutputs:
244
+ """
245
+ Crop/remove fixels from sparse fixel image using a binary fixel mask.
246
+
247
+ The mask must be input as a fixel data file the same dimensions as the fixel
248
+ data file(s) to be cropped.
249
+
250
+ References:
251
+
252
+ .
253
+
254
+ Author: MRTrix3 Developers
255
+
256
+ URL: https://www.mrtrix.org/
257
+
258
+ Args:
259
+ params: The parameters.
260
+ execution: The execution object.
261
+ Returns:
262
+ NamedTuple of outputs (described in `FixelcropOutputs`).
263
+ """
264
+ params = execution.params(params)
265
+ cargs = fixelcrop_cargs(params, execution)
266
+ ret = fixelcrop_outputs(params, execution)
267
+ execution.run(cargs)
268
+ return ret
269
+
270
+
271
+ def fixelcrop(
272
+ input_fixel_directory: InputPathType,
273
+ input_fixel_mask: InputPathType,
274
+ output_fixel_directory: str,
275
+ info: bool = False,
276
+ quiet: bool = False,
277
+ debug: bool = False,
278
+ force: bool = False,
279
+ nthreads: int | None = None,
280
+ config: list[FixelcropConfigParameters] | None = None,
281
+ help_: bool = False,
282
+ version: bool = False,
283
+ runner: Runner | None = None,
284
+ ) -> FixelcropOutputs:
285
+ """
286
+ Crop/remove fixels from sparse fixel image using a binary fixel mask.
287
+
288
+ The mask must be input as a fixel data file the same dimensions as the fixel
289
+ data file(s) to be cropped.
290
+
291
+ References:
292
+
293
+ .
294
+
295
+ Author: MRTrix3 Developers
296
+
297
+ URL: https://www.mrtrix.org/
298
+
299
+ Args:
300
+ input_fixel_directory: input fixel directory, all data files and\
301
+ directions file will be cropped and saved in the output fixel directory.
302
+ input_fixel_mask: the input fixel data file defining which fixels to\
303
+ crop. Fixels with zero values will be removed.
304
+ output_fixel_directory: the output directory to store the cropped\
305
+ directions and data files.
306
+ info: display information messages.
307
+ quiet: do not display information messages or progress status;\
308
+ alternatively, this can be achieved by setting the MRTRIX_QUIET\
309
+ environment variable to a non-empty string.
310
+ debug: display debugging messages.
311
+ force: force overwrite of output files (caution: using the same file as\
312
+ input and output might cause unexpected behaviour).
313
+ nthreads: use this number of threads in multi-threaded applications\
314
+ (set to 0 to disable multi-threading).
315
+ config: temporarily set the value of an MRtrix config file entry.
316
+ help_: display this information page and exit.
317
+ version: display version information and exit.
318
+ runner: Command runner.
319
+ Returns:
320
+ NamedTuple of outputs (described in `FixelcropOutputs`).
321
+ """
322
+ runner = runner or get_global_runner()
323
+ execution = runner.start_execution(FIXELCROP_METADATA)
324
+ params = fixelcrop_params(
325
+ info=info,
326
+ quiet=quiet,
327
+ debug=debug,
328
+ force=force,
329
+ nthreads=nthreads,
330
+ config=config,
331
+ help_=help_,
332
+ version=version,
333
+ input_fixel_directory=input_fixel_directory,
334
+ input_fixel_mask=input_fixel_mask,
335
+ output_fixel_directory=output_fixel_directory,
336
+ )
337
+ return fixelcrop_execute(params, execution)
338
+
339
+
340
+ __all__ = [
341
+ "FIXELCROP_METADATA",
342
+ "FixelcropConfigParameters",
343
+ "FixelcropOutputs",
344
+ "FixelcropParameters",
345
+ "fixelcrop",
346
+ "fixelcrop_config_params",
347
+ "fixelcrop_params",
348
+ ]