niwrap-mrtrix 0.6.2__py3-none-any.whl → 0.7.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 (122) hide show
  1. niwrap_mrtrix/mrtrix/__init__.py +133 -0
  2. niwrap_mrtrix/mrtrix/afdconnectivity.py +59 -68
  3. niwrap_mrtrix/mrtrix/amp2response.py +72 -77
  4. niwrap_mrtrix/mrtrix/amp2sh.py +109 -74
  5. niwrap_mrtrix/mrtrix/connectome2tck.py +77 -79
  6. niwrap_mrtrix/mrtrix/connectomeedit.py +52 -62
  7. niwrap_mrtrix/mrtrix/connectomestats.py +117 -104
  8. niwrap_mrtrix/mrtrix/dcmedit.py +68 -73
  9. niwrap_mrtrix/mrtrix/dcminfo.py +67 -72
  10. niwrap_mrtrix/mrtrix/dirflip.py +56 -66
  11. niwrap_mrtrix/mrtrix/dirgen.py +68 -75
  12. niwrap_mrtrix/mrtrix/dirmerge.py +56 -66
  13. niwrap_mrtrix/mrtrix/dirorder.py +53 -64
  14. niwrap_mrtrix/mrtrix/dirsplit.py +56 -66
  15. niwrap_mrtrix/mrtrix/dirstat.py +70 -75
  16. niwrap_mrtrix/mrtrix/dwi2adc.py +67 -74
  17. niwrap_mrtrix/mrtrix/dwi2fod.py +141 -96
  18. niwrap_mrtrix/mrtrix/dwi2mask.py +70 -76
  19. niwrap_mrtrix/mrtrix/dwi2response.py +238 -157
  20. niwrap_mrtrix/mrtrix/dwi2tensor.py +87 -88
  21. niwrap_mrtrix/mrtrix/dwibiascorrect.py +97 -95
  22. niwrap_mrtrix/mrtrix/dwidenoise.py +67 -74
  23. niwrap_mrtrix/mrtrix/dwiextract.py +143 -99
  24. niwrap_mrtrix/mrtrix/dwigradcheck.py +89 -91
  25. niwrap_mrtrix/mrtrix/fixel2peaks.py +77 -51
  26. niwrap_mrtrix/mrtrix/fixel2sh.py +54 -65
  27. niwrap_mrtrix/mrtrix/fixel2tsf.py +56 -66
  28. niwrap_mrtrix/mrtrix/fixel2voxel.py +62 -70
  29. niwrap_mrtrix/mrtrix/fixelcfestats.py +145 -93
  30. niwrap_mrtrix/mrtrix/fixelconnectivity.py +62 -70
  31. niwrap_mrtrix/mrtrix/fixelconvert.py +136 -69
  32. niwrap_mrtrix/mrtrix/fixelcorrespondence.py +61 -69
  33. niwrap_mrtrix/mrtrix/fixelcrop.py +53 -64
  34. niwrap_mrtrix/mrtrix/fixelfilter.py +139 -71
  35. niwrap_mrtrix/mrtrix/fixelreorient.py +53 -64
  36. niwrap_mrtrix/mrtrix/fod2dec.py +70 -75
  37. niwrap_mrtrix/mrtrix/fod2fixel.py +84 -85
  38. niwrap_mrtrix/mrtrix/label2colour.py +58 -67
  39. niwrap_mrtrix/mrtrix/label2mesh.py +53 -64
  40. niwrap_mrtrix/mrtrix/labelconvert.py +58 -67
  41. niwrap_mrtrix/mrtrix/labelstats.py +53 -63
  42. niwrap_mrtrix/mrtrix/maskdump.py +52 -64
  43. niwrap_mrtrix/mrtrix/maskfilter.py +93 -61
  44. niwrap_mrtrix/mrtrix/mesh2voxel.py +53 -64
  45. niwrap_mrtrix/mrtrix/meshconvert.py +66 -73
  46. niwrap_mrtrix/mrtrix/meshfilter.py +59 -68
  47. niwrap_mrtrix/mrtrix/mraverageheader.py +62 -70
  48. niwrap_mrtrix/mrtrix/mrcalc.py +522 -397
  49. niwrap_mrtrix/mrtrix/mrcat.py +59 -68
  50. niwrap_mrtrix/mrtrix/mrcentroid.py +53 -63
  51. niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +58 -67
  52. niwrap_mrtrix/mrtrix/mrclusterstats.py +119 -105
  53. niwrap_mrtrix/mrtrix/mrcolour.py +62 -70
  54. niwrap_mrtrix/mrtrix/mrconvert.py +275 -173
  55. niwrap_mrtrix/mrtrix/mrdegibbs.py +66 -73
  56. niwrap_mrtrix/mrtrix/mrdump.py +55 -66
  57. niwrap_mrtrix/mrtrix/mredit.py +97 -94
  58. niwrap_mrtrix/mrtrix/mrfilter.py +124 -81
  59. niwrap_mrtrix/mrtrix/mrgrid.py +131 -88
  60. niwrap_mrtrix/mrtrix/mrhistmatch.py +64 -71
  61. niwrap_mrtrix/mrtrix/mrhistogram.py +64 -71
  62. niwrap_mrtrix/mrtrix/mrinfo.py +160 -137
  63. niwrap_mrtrix/mrtrix/mrmath.py +65 -73
  64. niwrap_mrtrix/mrtrix/mrmetric.py +69 -73
  65. niwrap_mrtrix/mrtrix/mrregister.py +263 -212
  66. niwrap_mrtrix/mrtrix/mrstats.py +66 -72
  67. niwrap_mrtrix/mrtrix/mrthreshold.py +80 -81
  68. niwrap_mrtrix/mrtrix/mrtransform.py +162 -109
  69. niwrap_mrtrix/mrtrix/mtnormalise.py +85 -88
  70. niwrap_mrtrix/mrtrix/peaks2amp.py +51 -63
  71. niwrap_mrtrix/mrtrix/peaks2fixel.py +54 -65
  72. niwrap_mrtrix/mrtrix/responsemean.py +51 -62
  73. niwrap_mrtrix/mrtrix/sh2amp.py +98 -65
  74. niwrap_mrtrix/mrtrix/sh2peaks.py +81 -83
  75. niwrap_mrtrix/mrtrix/sh2power.py +53 -64
  76. niwrap_mrtrix/mrtrix/sh2response.py +62 -70
  77. niwrap_mrtrix/mrtrix/shbasis.py +51 -62
  78. niwrap_mrtrix/mrtrix/shconv.py +78 -52
  79. niwrap_mrtrix/mrtrix/tck2connectome.py +93 -88
  80. niwrap_mrtrix/mrtrix/tck2fixel.py +57 -65
  81. niwrap_mrtrix/mrtrix/tckconvert.py +99 -65
  82. niwrap_mrtrix/mrtrix/tckdfc.py +82 -83
  83. niwrap_mrtrix/mrtrix/tckedit.py +240 -122
  84. niwrap_mrtrix/mrtrix/tckgen.py +364 -207
  85. niwrap_mrtrix/mrtrix/tckglobal.py +127 -115
  86. niwrap_mrtrix/mrtrix/tckinfo.py +50 -61
  87. niwrap_mrtrix/mrtrix/tckmap.py +121 -79
  88. niwrap_mrtrix/mrtrix/tckresample.py +97 -93
  89. niwrap_mrtrix/mrtrix/tcksample.py +62 -69
  90. niwrap_mrtrix/mrtrix/tcksift.py +102 -97
  91. niwrap_mrtrix/mrtrix/tcksift2.py +119 -107
  92. niwrap_mrtrix/mrtrix/tckstats.py +72 -78
  93. niwrap_mrtrix/mrtrix/tcktransform.py +53 -64
  94. niwrap_mrtrix/mrtrix/tensor2metric.py +93 -94
  95. niwrap_mrtrix/mrtrix/transformcalc.py +53 -64
  96. niwrap_mrtrix/mrtrix/transformcompose.py +74 -48
  97. niwrap_mrtrix/mrtrix/transformconvert.py +53 -64
  98. niwrap_mrtrix/mrtrix/tsfdivide.py +53 -64
  99. niwrap_mrtrix/mrtrix/tsfinfo.py +53 -63
  100. niwrap_mrtrix/mrtrix/tsfmult.py +51 -63
  101. niwrap_mrtrix/mrtrix/tsfsmooth.py +54 -65
  102. niwrap_mrtrix/mrtrix/tsfthreshold.py +55 -65
  103. niwrap_mrtrix/mrtrix/tsfvalidate.py +50 -61
  104. niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +54 -65
  105. niwrap_mrtrix/mrtrix/v_5tt2vis.py +69 -75
  106. niwrap_mrtrix/mrtrix/v_5ttcheck.py +51 -62
  107. niwrap_mrtrix/mrtrix/v_5ttedit.py +73 -79
  108. niwrap_mrtrix/mrtrix/v_5ttgen.py +132 -86
  109. niwrap_mrtrix/mrtrix/vectorstats.py +92 -88
  110. niwrap_mrtrix/mrtrix/voxel2fixel.py +54 -63
  111. niwrap_mrtrix/mrtrix/voxel2mesh.py +56 -66
  112. niwrap_mrtrix/mrtrix/warp2metric.py +71 -77
  113. niwrap_mrtrix/mrtrix/warpconvert.py +61 -69
  114. niwrap_mrtrix/mrtrix/warpcorrect.py +61 -71
  115. niwrap_mrtrix/mrtrix/warpinit.py +51 -63
  116. niwrap_mrtrix/mrtrix/warpinvert.py +56 -66
  117. niwrap_mrtrix-0.7.0.dist-info/METADATA +8 -0
  118. niwrap_mrtrix-0.7.0.dist-info/RECORD +119 -0
  119. niwrap_mrtrix-0.7.0.dist-info/WHEEL +4 -0
  120. niwrap_mrtrix-0.6.2.dist-info/METADATA +0 -8
  121. niwrap_mrtrix-0.6.2.dist-info/RECORD +0 -119
  122. niwrap_mrtrix-0.6.2.dist-info/WHEEL +0 -4
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  PEAKS2FIXEL_METADATA = Metadata(
9
- id="29d2deba28f1ab844d280ad2e340fd82fd9f1c8f.boutiques",
9
+ id="78a8247aa596b63f8645ea73cd9578aefa56efef.boutiques",
10
10
  name="peaks2fixel",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,14 +14,33 @@ PEAKS2FIXEL_METADATA = Metadata(
14
14
 
15
15
 
16
16
  Peaks2fixelConfigParameters = typing.TypedDict('Peaks2fixelConfigParameters', {
17
- "__STYXTYPE__": typing.Literal["config"],
17
+ "@type": typing.NotRequired[typing.Literal["config"]],
18
+ "key": str,
19
+ "value": str,
20
+ })
21
+ Peaks2fixelConfigParametersTagged = typing.TypedDict('Peaks2fixelConfigParametersTagged', {
22
+ "@type": typing.Literal["config"],
18
23
  "key": str,
19
24
  "value": str,
20
25
  })
21
26
 
22
27
 
23
28
  Peaks2fixelParameters = typing.TypedDict('Peaks2fixelParameters', {
24
- "__STYXTYPE__": typing.Literal["peaks2fixel"],
29
+ "@type": typing.NotRequired[typing.Literal["mrtrix/peaks2fixel"]],
30
+ "dataname": typing.NotRequired[str | None],
31
+ "info": bool,
32
+ "quiet": bool,
33
+ "debug": bool,
34
+ "force": bool,
35
+ "nthreads": typing.NotRequired[int | None],
36
+ "config": typing.NotRequired[list[Peaks2fixelConfigParameters] | None],
37
+ "help": bool,
38
+ "version": bool,
39
+ "directions": InputPathType,
40
+ "fixels": str,
41
+ })
42
+ Peaks2fixelParametersTagged = typing.TypedDict('Peaks2fixelParametersTagged', {
43
+ "@type": typing.Literal["mrtrix/peaks2fixel"],
25
44
  "dataname": typing.NotRequired[str | None],
26
45
  "info": bool,
27
46
  "quiet": bool,
@@ -34,45 +53,12 @@ Peaks2fixelParameters = typing.TypedDict('Peaks2fixelParameters', {
34
53
  "directions": InputPathType,
35
54
  "fixels": str,
36
55
  })
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
- "peaks2fixel": peaks2fixel_cargs,
52
- "config": peaks2fixel_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
- "peaks2fixel": peaks2fixel_outputs,
69
- }.get(t)
70
56
 
71
57
 
72
58
  def peaks2fixel_config_params(
73
59
  key: str,
74
60
  value: str,
75
- ) -> Peaks2fixelConfigParameters:
61
+ ) -> Peaks2fixelConfigParametersTagged:
76
62
  """
77
63
  Build parameters.
78
64
 
@@ -83,7 +69,7 @@ def peaks2fixel_config_params(
83
69
  Parameter dictionary
84
70
  """
85
71
  params = {
86
- "__STYXTYPE__": "config",
72
+ "@type": "config",
87
73
  "key": key,
88
74
  "value": value,
89
75
  }
@@ -105,14 +91,14 @@ def peaks2fixel_config_cargs(
105
91
  """
106
92
  cargs = []
107
93
  cargs.append("-config")
108
- cargs.append(params.get("key"))
109
- cargs.append(params.get("value"))
94
+ cargs.append(params.get("key", None))
95
+ cargs.append(params.get("value", None))
110
96
  return cargs
111
97
 
112
98
 
113
99
  class Peaks2fixelOutputs(typing.NamedTuple):
114
100
  """
115
- Output object returned when calling `peaks2fixel(...)`.
101
+ Output object returned when calling `Peaks2fixelParameters(...)`.
116
102
  """
117
103
  root: OutputPathType
118
104
  """Output root folder. This is the root folder for all outputs."""
@@ -132,7 +118,7 @@ def peaks2fixel_params(
132
118
  config: list[Peaks2fixelConfigParameters] | None = None,
133
119
  help_: bool = False,
134
120
  version: bool = False,
135
- ) -> Peaks2fixelParameters:
121
+ ) -> Peaks2fixelParametersTagged:
136
122
  """
137
123
  Build parameters.
138
124
 
@@ -158,7 +144,7 @@ def peaks2fixel_params(
158
144
  Parameter dictionary
159
145
  """
160
146
  params = {
161
- "__STYXTYPE__": "peaks2fixel",
147
+ "@type": "mrtrix/peaks2fixel",
162
148
  "info": info,
163
149
  "quiet": quiet,
164
150
  "debug": debug,
@@ -192,32 +178,32 @@ def peaks2fixel_cargs(
192
178
  """
193
179
  cargs = []
194
180
  cargs.append("peaks2fixel")
195
- if params.get("dataname") is not None:
181
+ if params.get("dataname", None) is not None:
196
182
  cargs.extend([
197
183
  "-dataname",
198
- params.get("dataname")
184
+ params.get("dataname", None)
199
185
  ])
200
- if params.get("info"):
186
+ if params.get("info", False):
201
187
  cargs.append("-info")
202
- if params.get("quiet"):
188
+ if params.get("quiet", False):
203
189
  cargs.append("-quiet")
204
- if params.get("debug"):
190
+ if params.get("debug", False):
205
191
  cargs.append("-debug")
206
- if params.get("force"):
192
+ if params.get("force", False):
207
193
  cargs.append("-force")
208
- if params.get("nthreads") is not None:
194
+ if params.get("nthreads", None) is not None:
209
195
  cargs.extend([
210
196
  "-nthreads",
211
- str(params.get("nthreads"))
197
+ str(params.get("nthreads", None))
212
198
  ])
213
- if params.get("config") is not None:
214
- cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
215
- if params.get("help"):
199
+ if params.get("config", None) is not None:
200
+ cargs.extend([a for c in [peaks2fixel_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
201
+ if params.get("help", False):
216
202
  cargs.append("-help")
217
- if params.get("version"):
203
+ if params.get("version", False):
218
204
  cargs.append("-version")
219
- cargs.append(execution.input_file(params.get("directions")))
220
- cargs.append(params.get("fixels"))
205
+ cargs.append(execution.input_file(params.get("directions", None)))
206
+ cargs.append(params.get("fixels", None))
221
207
  return cargs
222
208
 
223
209
 
@@ -236,16 +222,18 @@ def peaks2fixel_outputs(
236
222
  """
237
223
  ret = Peaks2fixelOutputs(
238
224
  root=execution.output_file("."),
239
- fixels=execution.output_file(params.get("fixels")),
225
+ fixels=execution.output_file(params.get("fixels", None)),
240
226
  )
241
227
  return ret
242
228
 
243
229
 
244
230
  def peaks2fixel_execute(
245
231
  params: Peaks2fixelParameters,
246
- execution: Execution,
232
+ runner: Runner | None = None,
247
233
  ) -> Peaks2fixelOutputs:
248
234
  """
235
+ peaks2fixel
236
+
249
237
  Convert peak directions image to a fixel directory.
250
238
 
251
239
 
@@ -260,10 +248,12 @@ def peaks2fixel_execute(
260
248
 
261
249
  Args:
262
250
  params: The parameters.
263
- execution: The execution object.
251
+ runner: Command runner.
264
252
  Returns:
265
253
  NamedTuple of outputs (described in `Peaks2fixelOutputs`).
266
254
  """
255
+ runner = runner or get_global_runner()
256
+ execution = runner.start_execution(PEAKS2FIXEL_METADATA)
267
257
  params = execution.params(params)
268
258
  cargs = peaks2fixel_cargs(params, execution)
269
259
  ret = peaks2fixel_outputs(params, execution)
@@ -286,6 +276,8 @@ def peaks2fixel(
286
276
  runner: Runner | None = None,
287
277
  ) -> Peaks2fixelOutputs:
288
278
  """
279
+ peaks2fixel
280
+
289
281
  Convert peak directions image to a fixel directory.
290
282
 
291
283
 
@@ -320,8 +312,6 @@ def peaks2fixel(
320
312
  Returns:
321
313
  NamedTuple of outputs (described in `Peaks2fixelOutputs`).
322
314
  """
323
- runner = runner or get_global_runner()
324
- execution = runner.start_execution(PEAKS2FIXEL_METADATA)
325
315
  params = peaks2fixel_params(
326
316
  dataname=dataname,
327
317
  info=info,
@@ -335,15 +325,14 @@ def peaks2fixel(
335
325
  directions=directions,
336
326
  fixels=fixels,
337
327
  )
338
- return peaks2fixel_execute(params, execution)
328
+ return peaks2fixel_execute(params, runner)
339
329
 
340
330
 
341
331
  __all__ = [
342
332
  "PEAKS2FIXEL_METADATA",
343
- "Peaks2fixelConfigParameters",
344
333
  "Peaks2fixelOutputs",
345
- "Peaks2fixelParameters",
346
334
  "peaks2fixel",
347
335
  "peaks2fixel_config_params",
336
+ "peaks2fixel_execute",
348
337
  "peaks2fixel_params",
349
338
  ]
@@ -6,7 +6,7 @@ import pathlib
6
6
  from styxdefs import *
7
7
 
8
8
  RESPONSEMEAN_METADATA = Metadata(
9
- id="81ec998971b969a494c27142aa2c763ec1e1ab0f.boutiques",
9
+ id="580e677d66de76d497b1d37c93d76dd82a169d45.boutiques",
10
10
  name="responsemean",
11
11
  package="mrtrix",
12
12
  container_image_tag="mrtrix3/mrtrix3:3.0.4",
@@ -14,7 +14,24 @@ RESPONSEMEAN_METADATA = Metadata(
14
14
 
15
15
 
16
16
  ResponsemeanParameters = typing.TypedDict('ResponsemeanParameters', {
17
- "__STYXTYPE__": typing.Literal["responsemean"],
17
+ "@type": typing.NotRequired[typing.Literal["mrtrix/responsemean"]],
18
+ "input_response": list[InputPathType],
19
+ "output_response": str,
20
+ "legacy": bool,
21
+ "nocleanup": bool,
22
+ "scratch_dir": typing.NotRequired[InputPathType | None],
23
+ "continue_scratch_dir": typing.NotRequired[list[InputPathType] | None],
24
+ "info": bool,
25
+ "quiet": bool,
26
+ "debug": bool,
27
+ "force": bool,
28
+ "nthreads": typing.NotRequired[float | None],
29
+ "config": typing.NotRequired[list[str] | None],
30
+ "help": bool,
31
+ "version": bool,
32
+ })
33
+ ResponsemeanParametersTagged = typing.TypedDict('ResponsemeanParametersTagged', {
34
+ "@type": typing.Literal["mrtrix/responsemean"],
18
35
  "input_response": list[InputPathType],
19
36
  "output_response": str,
20
37
  "legacy": bool,
@@ -30,43 +47,11 @@ ResponsemeanParameters = typing.TypedDict('ResponsemeanParameters', {
30
47
  "help": bool,
31
48
  "version": bool,
32
49
  })
33
-
34
-
35
- def dyn_cargs(
36
- t: str,
37
- ) -> typing.Any:
38
- """
39
- Get build cargs function by command type.
40
-
41
- Args:
42
- t: Command type.
43
- Returns:
44
- Build cargs function.
45
- """
46
- return {
47
- "responsemean": responsemean_cargs,
48
- }.get(t)
49
-
50
-
51
- def dyn_outputs(
52
- t: str,
53
- ) -> typing.Any:
54
- """
55
- Get build outputs function by command type.
56
-
57
- Args:
58
- t: Command type.
59
- Returns:
60
- Build outputs function.
61
- """
62
- return {
63
- "responsemean": responsemean_outputs,
64
- }.get(t)
65
50
 
66
51
 
67
52
  class ResponsemeanOutputs(typing.NamedTuple):
68
53
  """
69
- Output object returned when calling `responsemean(...)`.
54
+ Output object returned when calling `ResponsemeanParameters(...)`.
70
55
  """
71
56
  root: OutputPathType
72
57
  """Output root folder. This is the root folder for all outputs."""
@@ -89,7 +74,7 @@ def responsemean_params(
89
74
  config: list[str] | None = None,
90
75
  help_: bool = False,
91
76
  version: bool = False,
92
- ) -> ResponsemeanParameters:
77
+ ) -> ResponsemeanParametersTagged:
93
78
  """
94
79
  Build parameters.
95
80
 
@@ -116,7 +101,7 @@ def responsemean_params(
116
101
  Parameter dictionary
117
102
  """
118
103
  params = {
119
- "__STYXTYPE__": "responsemean",
104
+ "@type": "mrtrix/responsemean",
120
105
  "input_response": input_response,
121
106
  "output_response": output_response,
122
107
  "legacy": legacy,
@@ -154,43 +139,43 @@ def responsemean_cargs(
154
139
  """
155
140
  cargs = []
156
141
  cargs.append("responsemean")
157
- cargs.extend([execution.input_file(f) for f in params.get("input_response")])
158
- cargs.append(params.get("output_response"))
159
- if params.get("legacy"):
142
+ cargs.extend([execution.input_file(f) for f in params.get("input_response", None)])
143
+ cargs.append(params.get("output_response", None))
144
+ if params.get("legacy", False):
160
145
  cargs.append("-legacy")
161
- if params.get("nocleanup"):
146
+ if params.get("nocleanup", False):
162
147
  cargs.append("-nocleanup")
163
- if params.get("scratch_dir") is not None:
148
+ if params.get("scratch_dir", None) is not None:
164
149
  cargs.extend([
165
150
  "-scratch",
166
- execution.input_file(params.get("scratch_dir"))
151
+ execution.input_file(params.get("scratch_dir", None))
167
152
  ])
168
- if params.get("continue_scratch_dir") is not None:
153
+ if params.get("continue_scratch_dir", None) is not None:
169
154
  cargs.extend([
170
155
  "-continue",
171
- *[execution.input_file(f) for f in params.get("continue_scratch_dir")]
156
+ *[execution.input_file(f) for f in params.get("continue_scratch_dir", None)]
172
157
  ])
173
- if params.get("info"):
158
+ if params.get("info", False):
174
159
  cargs.append("-info")
175
- if params.get("quiet"):
160
+ if params.get("quiet", False):
176
161
  cargs.append("-quiet")
177
- if params.get("debug"):
162
+ if params.get("debug", False):
178
163
  cargs.append("-debug")
179
- if params.get("force"):
164
+ if params.get("force", False):
180
165
  cargs.append("-force")
181
- if params.get("nthreads") is not None:
166
+ if params.get("nthreads", None) is not None:
182
167
  cargs.extend([
183
168
  "-nthreads",
184
- str(params.get("nthreads"))
169
+ str(params.get("nthreads", None))
185
170
  ])
186
- if params.get("config") is not None:
171
+ if params.get("config", None) is not None:
187
172
  cargs.extend([
188
173
  "-config",
189
- *params.get("config")
174
+ *params.get("config", None)
190
175
  ])
191
- if params.get("help"):
176
+ if params.get("help", False):
192
177
  cargs.append("-help")
193
- if params.get("version"):
178
+ if params.get("version", False):
194
179
  cargs.append("-version")
195
180
  return cargs
196
181
 
@@ -210,16 +195,18 @@ def responsemean_outputs(
210
195
  """
211
196
  ret = ResponsemeanOutputs(
212
197
  root=execution.output_file("."),
213
- output_response_file=execution.output_file(params.get("output_response")),
198
+ output_response_file=execution.output_file(params.get("output_response", None)),
214
199
  )
215
200
  return ret
216
201
 
217
202
 
218
203
  def responsemean_execute(
219
204
  params: ResponsemeanParameters,
220
- execution: Execution,
205
+ runner: Runner | None = None,
221
206
  ) -> ResponsemeanOutputs:
222
207
  """
208
+ responsemean
209
+
223
210
  Calculate the mean response function from a set of text files.
224
211
 
225
212
  Author: MRTrix3 Developers
@@ -228,10 +215,12 @@ def responsemean_execute(
228
215
 
229
216
  Args:
230
217
  params: The parameters.
231
- execution: The execution object.
218
+ runner: Command runner.
232
219
  Returns:
233
220
  NamedTuple of outputs (described in `ResponsemeanOutputs`).
234
221
  """
222
+ runner = runner or get_global_runner()
223
+ execution = runner.start_execution(RESPONSEMEAN_METADATA)
235
224
  params = execution.params(params)
236
225
  cargs = responsemean_cargs(params, execution)
237
226
  ret = responsemean_outputs(params, execution)
@@ -257,6 +246,8 @@ def responsemean(
257
246
  runner: Runner | None = None,
258
247
  ) -> ResponsemeanOutputs:
259
248
  """
249
+ responsemean
250
+
260
251
  Calculate the mean response function from a set of text files.
261
252
 
262
253
  Author: MRTrix3 Developers
@@ -286,8 +277,6 @@ def responsemean(
286
277
  Returns:
287
278
  NamedTuple of outputs (described in `ResponsemeanOutputs`).
288
279
  """
289
- runner = runner or get_global_runner()
290
- execution = runner.start_execution(RESPONSEMEAN_METADATA)
291
280
  params = responsemean_params(
292
281
  input_response=input_response,
293
282
  output_response=output_response,
@@ -304,13 +293,13 @@ def responsemean(
304
293
  help_=help_,
305
294
  version=version,
306
295
  )
307
- return responsemean_execute(params, execution)
296
+ return responsemean_execute(params, runner)
308
297
 
309
298
 
310
299
  __all__ = [
311
300
  "RESPONSEMEAN_METADATA",
312
301
  "ResponsemeanOutputs",
313
- "ResponsemeanParameters",
314
302
  "responsemean",
303
+ "responsemean_execute",
315
304
  "responsemean_params",
316
305
  ]