niwrap-mrtrix 0.6.3__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.
- niwrap_mrtrix/mrtrix/__init__.py +133 -0
- niwrap_mrtrix/mrtrix/afdconnectivity.py +59 -68
- niwrap_mrtrix/mrtrix/amp2response.py +72 -77
- niwrap_mrtrix/mrtrix/amp2sh.py +109 -74
- niwrap_mrtrix/mrtrix/connectome2tck.py +77 -79
- niwrap_mrtrix/mrtrix/connectomeedit.py +52 -62
- niwrap_mrtrix/mrtrix/connectomestats.py +117 -104
- niwrap_mrtrix/mrtrix/dcmedit.py +68 -73
- niwrap_mrtrix/mrtrix/dcminfo.py +67 -72
- niwrap_mrtrix/mrtrix/dirflip.py +56 -66
- niwrap_mrtrix/mrtrix/dirgen.py +68 -75
- niwrap_mrtrix/mrtrix/dirmerge.py +56 -66
- niwrap_mrtrix/mrtrix/dirorder.py +53 -64
- niwrap_mrtrix/mrtrix/dirsplit.py +56 -66
- niwrap_mrtrix/mrtrix/dirstat.py +70 -75
- niwrap_mrtrix/mrtrix/dwi2adc.py +67 -74
- niwrap_mrtrix/mrtrix/dwi2fod.py +141 -96
- niwrap_mrtrix/mrtrix/dwi2mask.py +70 -76
- niwrap_mrtrix/mrtrix/dwi2response.py +238 -157
- niwrap_mrtrix/mrtrix/dwi2tensor.py +87 -88
- niwrap_mrtrix/mrtrix/dwibiascorrect.py +97 -95
- niwrap_mrtrix/mrtrix/dwidenoise.py +67 -74
- niwrap_mrtrix/mrtrix/dwiextract.py +143 -99
- niwrap_mrtrix/mrtrix/dwigradcheck.py +89 -91
- niwrap_mrtrix/mrtrix/fixel2peaks.py +77 -51
- niwrap_mrtrix/mrtrix/fixel2sh.py +54 -65
- niwrap_mrtrix/mrtrix/fixel2tsf.py +56 -66
- niwrap_mrtrix/mrtrix/fixel2voxel.py +62 -70
- niwrap_mrtrix/mrtrix/fixelcfestats.py +145 -93
- niwrap_mrtrix/mrtrix/fixelconnectivity.py +62 -70
- niwrap_mrtrix/mrtrix/fixelconvert.py +136 -69
- niwrap_mrtrix/mrtrix/fixelcorrespondence.py +61 -69
- niwrap_mrtrix/mrtrix/fixelcrop.py +53 -64
- niwrap_mrtrix/mrtrix/fixelfilter.py +139 -71
- niwrap_mrtrix/mrtrix/fixelreorient.py +53 -64
- niwrap_mrtrix/mrtrix/fod2dec.py +70 -75
- niwrap_mrtrix/mrtrix/fod2fixel.py +84 -85
- niwrap_mrtrix/mrtrix/label2colour.py +58 -67
- niwrap_mrtrix/mrtrix/label2mesh.py +53 -64
- niwrap_mrtrix/mrtrix/labelconvert.py +58 -67
- niwrap_mrtrix/mrtrix/labelstats.py +53 -63
- niwrap_mrtrix/mrtrix/maskdump.py +52 -64
- niwrap_mrtrix/mrtrix/maskfilter.py +93 -61
- niwrap_mrtrix/mrtrix/mesh2voxel.py +53 -64
- niwrap_mrtrix/mrtrix/meshconvert.py +66 -73
- niwrap_mrtrix/mrtrix/meshfilter.py +59 -68
- niwrap_mrtrix/mrtrix/mraverageheader.py +62 -70
- niwrap_mrtrix/mrtrix/mrcalc.py +522 -397
- niwrap_mrtrix/mrtrix/mrcat.py +59 -68
- niwrap_mrtrix/mrtrix/mrcentroid.py +53 -63
- niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +58 -67
- niwrap_mrtrix/mrtrix/mrclusterstats.py +119 -105
- niwrap_mrtrix/mrtrix/mrcolour.py +62 -70
- niwrap_mrtrix/mrtrix/mrconvert.py +275 -173
- niwrap_mrtrix/mrtrix/mrdegibbs.py +66 -73
- niwrap_mrtrix/mrtrix/mrdump.py +55 -66
- niwrap_mrtrix/mrtrix/mredit.py +97 -94
- niwrap_mrtrix/mrtrix/mrfilter.py +124 -81
- niwrap_mrtrix/mrtrix/mrgrid.py +131 -88
- niwrap_mrtrix/mrtrix/mrhistmatch.py +64 -71
- niwrap_mrtrix/mrtrix/mrhistogram.py +64 -71
- niwrap_mrtrix/mrtrix/mrinfo.py +160 -137
- niwrap_mrtrix/mrtrix/mrmath.py +65 -73
- niwrap_mrtrix/mrtrix/mrmetric.py +69 -73
- niwrap_mrtrix/mrtrix/mrregister.py +263 -212
- niwrap_mrtrix/mrtrix/mrstats.py +66 -72
- niwrap_mrtrix/mrtrix/mrthreshold.py +80 -81
- niwrap_mrtrix/mrtrix/mrtransform.py +162 -109
- niwrap_mrtrix/mrtrix/mtnormalise.py +85 -88
- niwrap_mrtrix/mrtrix/peaks2amp.py +51 -63
- niwrap_mrtrix/mrtrix/peaks2fixel.py +54 -65
- niwrap_mrtrix/mrtrix/responsemean.py +51 -62
- niwrap_mrtrix/mrtrix/sh2amp.py +98 -65
- niwrap_mrtrix/mrtrix/sh2peaks.py +81 -83
- niwrap_mrtrix/mrtrix/sh2power.py +53 -64
- niwrap_mrtrix/mrtrix/sh2response.py +62 -70
- niwrap_mrtrix/mrtrix/shbasis.py +51 -62
- niwrap_mrtrix/mrtrix/shconv.py +78 -52
- niwrap_mrtrix/mrtrix/tck2connectome.py +93 -88
- niwrap_mrtrix/mrtrix/tck2fixel.py +57 -65
- niwrap_mrtrix/mrtrix/tckconvert.py +99 -65
- niwrap_mrtrix/mrtrix/tckdfc.py +82 -83
- niwrap_mrtrix/mrtrix/tckedit.py +240 -122
- niwrap_mrtrix/mrtrix/tckgen.py +364 -207
- niwrap_mrtrix/mrtrix/tckglobal.py +127 -115
- niwrap_mrtrix/mrtrix/tckinfo.py +50 -61
- niwrap_mrtrix/mrtrix/tckmap.py +121 -79
- niwrap_mrtrix/mrtrix/tckresample.py +97 -93
- niwrap_mrtrix/mrtrix/tcksample.py +62 -69
- niwrap_mrtrix/mrtrix/tcksift.py +102 -97
- niwrap_mrtrix/mrtrix/tcksift2.py +119 -107
- niwrap_mrtrix/mrtrix/tckstats.py +72 -78
- niwrap_mrtrix/mrtrix/tcktransform.py +53 -64
- niwrap_mrtrix/mrtrix/tensor2metric.py +93 -94
- niwrap_mrtrix/mrtrix/transformcalc.py +53 -64
- niwrap_mrtrix/mrtrix/transformcompose.py +74 -48
- niwrap_mrtrix/mrtrix/transformconvert.py +53 -64
- niwrap_mrtrix/mrtrix/tsfdivide.py +53 -64
- niwrap_mrtrix/mrtrix/tsfinfo.py +53 -63
- niwrap_mrtrix/mrtrix/tsfmult.py +51 -63
- niwrap_mrtrix/mrtrix/tsfsmooth.py +54 -65
- niwrap_mrtrix/mrtrix/tsfthreshold.py +55 -65
- niwrap_mrtrix/mrtrix/tsfvalidate.py +50 -61
- niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +54 -65
- niwrap_mrtrix/mrtrix/v_5tt2vis.py +69 -75
- niwrap_mrtrix/mrtrix/v_5ttcheck.py +51 -62
- niwrap_mrtrix/mrtrix/v_5ttedit.py +73 -79
- niwrap_mrtrix/mrtrix/v_5ttgen.py +132 -86
- niwrap_mrtrix/mrtrix/vectorstats.py +92 -88
- niwrap_mrtrix/mrtrix/voxel2fixel.py +54 -63
- niwrap_mrtrix/mrtrix/voxel2mesh.py +56 -66
- niwrap_mrtrix/mrtrix/warp2metric.py +71 -77
- niwrap_mrtrix/mrtrix/warpconvert.py +61 -69
- niwrap_mrtrix/mrtrix/warpcorrect.py +61 -71
- niwrap_mrtrix/mrtrix/warpinit.py +51 -63
- niwrap_mrtrix/mrtrix/warpinvert.py +56 -66
- niwrap_mrtrix-0.7.0.dist-info/METADATA +8 -0
- niwrap_mrtrix-0.7.0.dist-info/RECORD +119 -0
- niwrap_mrtrix-0.7.0.dist-info/WHEEL +4 -0
- niwrap_mrtrix-0.6.3.dist-info/METADATA +0 -8
- niwrap_mrtrix-0.6.3.dist-info/RECORD +0 -119
- niwrap_mrtrix-0.6.3.dist-info/WHEEL +0 -4
|
@@ -6,7 +6,7 @@ import pathlib
|
|
|
6
6
|
from styxdefs import *
|
|
7
7
|
|
|
8
8
|
MRREGISTER_METADATA = Metadata(
|
|
9
|
-
id="
|
|
9
|
+
id="33094a24a1ceaa262f78a671f02e86741a74a3db.boutiques",
|
|
10
10
|
name="mrregister",
|
|
11
11
|
package="mrtrix",
|
|
12
12
|
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
@@ -14,34 +14,124 @@ MRREGISTER_METADATA = Metadata(
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
MrregisterTransformedParameters = typing.TypedDict('MrregisterTransformedParameters', {
|
|
17
|
-
"
|
|
17
|
+
"@type": typing.NotRequired[typing.Literal["transformed"]],
|
|
18
|
+
"image": str,
|
|
19
|
+
})
|
|
20
|
+
MrregisterTransformedParametersTagged = typing.TypedDict('MrregisterTransformedParametersTagged', {
|
|
21
|
+
"@type": typing.Literal["transformed"],
|
|
18
22
|
"image": str,
|
|
19
23
|
})
|
|
20
24
|
|
|
21
25
|
|
|
22
26
|
MrregisterTransformedMidwayParameters = typing.TypedDict('MrregisterTransformedMidwayParameters', {
|
|
23
|
-
"
|
|
27
|
+
"@type": typing.NotRequired[typing.Literal["transformed_midway"]],
|
|
28
|
+
"image1_transformed": str,
|
|
29
|
+
"image2_transformed": str,
|
|
30
|
+
})
|
|
31
|
+
MrregisterTransformedMidwayParametersTagged = typing.TypedDict('MrregisterTransformedMidwayParametersTagged', {
|
|
32
|
+
"@type": typing.Literal["transformed_midway"],
|
|
24
33
|
"image1_transformed": str,
|
|
25
34
|
"image2_transformed": str,
|
|
26
35
|
})
|
|
27
36
|
|
|
28
37
|
|
|
29
38
|
MrregisterNlWarpParameters = typing.TypedDict('MrregisterNlWarpParameters', {
|
|
30
|
-
"
|
|
39
|
+
"@type": typing.NotRequired[typing.Literal["nl_warp"]],
|
|
40
|
+
"warp1": str,
|
|
41
|
+
"warp2": str,
|
|
42
|
+
})
|
|
43
|
+
MrregisterNlWarpParametersTagged = typing.TypedDict('MrregisterNlWarpParametersTagged', {
|
|
44
|
+
"@type": typing.Literal["nl_warp"],
|
|
31
45
|
"warp1": str,
|
|
32
46
|
"warp2": str,
|
|
33
47
|
})
|
|
34
48
|
|
|
35
49
|
|
|
36
50
|
MrregisterConfigParameters = typing.TypedDict('MrregisterConfigParameters', {
|
|
37
|
-
"
|
|
51
|
+
"@type": typing.NotRequired[typing.Literal["config"]],
|
|
52
|
+
"key": str,
|
|
53
|
+
"value": str,
|
|
54
|
+
})
|
|
55
|
+
MrregisterConfigParametersTagged = typing.TypedDict('MrregisterConfigParametersTagged', {
|
|
56
|
+
"@type": typing.Literal["config"],
|
|
38
57
|
"key": str,
|
|
39
58
|
"value": str,
|
|
40
59
|
})
|
|
41
60
|
|
|
42
61
|
|
|
43
62
|
MrregisterParameters = typing.TypedDict('MrregisterParameters', {
|
|
44
|
-
"
|
|
63
|
+
"@type": typing.NotRequired[typing.Literal["mrtrix/mrregister"]],
|
|
64
|
+
"type": typing.NotRequired[str | None],
|
|
65
|
+
"transformed": typing.NotRequired[list[MrregisterTransformedParameters] | None],
|
|
66
|
+
"transformed_midway": typing.NotRequired[list[MrregisterTransformedMidwayParameters] | None],
|
|
67
|
+
"mask1": typing.NotRequired[InputPathType | None],
|
|
68
|
+
"mask2": typing.NotRequired[InputPathType | None],
|
|
69
|
+
"nan": bool,
|
|
70
|
+
"rigid": typing.NotRequired[str | None],
|
|
71
|
+
"rigid_1tomidway": typing.NotRequired[str | None],
|
|
72
|
+
"rigid_2tomidway": typing.NotRequired[str | None],
|
|
73
|
+
"rigid_init_translation": typing.NotRequired[str | None],
|
|
74
|
+
"rigid_init_rotation": typing.NotRequired[str | None],
|
|
75
|
+
"rigid_init_matrix": typing.NotRequired[InputPathType | None],
|
|
76
|
+
"rigid_scale": typing.NotRequired[list[float] | None],
|
|
77
|
+
"rigid_niter": typing.NotRequired[list[int] | None],
|
|
78
|
+
"rigid_metric": typing.NotRequired[str | None],
|
|
79
|
+
"rigid_metric_diff_estimator": typing.NotRequired[str | None],
|
|
80
|
+
"rigid_lmax": typing.NotRequired[list[int] | None],
|
|
81
|
+
"rigid_log": typing.NotRequired[str | None],
|
|
82
|
+
"affine": typing.NotRequired[str | None],
|
|
83
|
+
"affine_1tomidway": typing.NotRequired[str | None],
|
|
84
|
+
"affine_2tomidway": typing.NotRequired[str | None],
|
|
85
|
+
"affine_init_translation": typing.NotRequired[str | None],
|
|
86
|
+
"affine_init_rotation": typing.NotRequired[str | None],
|
|
87
|
+
"affine_init_matrix": typing.NotRequired[InputPathType | None],
|
|
88
|
+
"affine_scale": typing.NotRequired[list[float] | None],
|
|
89
|
+
"affine_niter": typing.NotRequired[list[int] | None],
|
|
90
|
+
"affine_metric": typing.NotRequired[str | None],
|
|
91
|
+
"affine_metric_diff_estimator": typing.NotRequired[str | None],
|
|
92
|
+
"affine_lmax": typing.NotRequired[list[int] | None],
|
|
93
|
+
"affine_log": typing.NotRequired[str | None],
|
|
94
|
+
"init_translation_unmasked1": bool,
|
|
95
|
+
"init_translation_unmasked2": bool,
|
|
96
|
+
"init_rotation_unmasked1": bool,
|
|
97
|
+
"init_rotation_unmasked2": bool,
|
|
98
|
+
"init_rotation_search_angles": typing.NotRequired[list[float] | None],
|
|
99
|
+
"init_rotation_search_scale": typing.NotRequired[float | None],
|
|
100
|
+
"init_rotation_search_directions": typing.NotRequired[int | None],
|
|
101
|
+
"init_rotation_search_run_global": bool,
|
|
102
|
+
"init_rotation_search_global_iterations": typing.NotRequired[int | None],
|
|
103
|
+
"linstage_iterations": typing.NotRequired[list[int] | None],
|
|
104
|
+
"linstage_optimiser_first": typing.NotRequired[str | None],
|
|
105
|
+
"linstage_optimiser_last": typing.NotRequired[str | None],
|
|
106
|
+
"linstage_optimiser_default": typing.NotRequired[str | None],
|
|
107
|
+
"linstage_diagnostics_prefix": typing.NotRequired[str | None],
|
|
108
|
+
"nl_warp": typing.NotRequired[MrregisterNlWarpParameters | None],
|
|
109
|
+
"nl_warp_full": typing.NotRequired[str | None],
|
|
110
|
+
"nl_init": typing.NotRequired[InputPathType | None],
|
|
111
|
+
"nl_scale": typing.NotRequired[list[float] | None],
|
|
112
|
+
"nl_niter": typing.NotRequired[list[int] | None],
|
|
113
|
+
"nl_update_smooth": typing.NotRequired[float | None],
|
|
114
|
+
"nl_disp_smooth": typing.NotRequired[float | None],
|
|
115
|
+
"nl_grad_step": typing.NotRequired[float | None],
|
|
116
|
+
"nl_lmax": typing.NotRequired[list[int] | None],
|
|
117
|
+
"diagnostics_image": typing.NotRequired[str | None],
|
|
118
|
+
"directions": typing.NotRequired[InputPathType | None],
|
|
119
|
+
"noreorientation": bool,
|
|
120
|
+
"mc_weights": typing.NotRequired[list[float] | None],
|
|
121
|
+
"datatype": typing.NotRequired[str | None],
|
|
122
|
+
"info": bool,
|
|
123
|
+
"quiet": bool,
|
|
124
|
+
"debug": bool,
|
|
125
|
+
"force": bool,
|
|
126
|
+
"nthreads": typing.NotRequired[int | None],
|
|
127
|
+
"config": typing.NotRequired[list[MrregisterConfigParameters] | None],
|
|
128
|
+
"help": bool,
|
|
129
|
+
"version": bool,
|
|
130
|
+
"image1_image2": InputPathType,
|
|
131
|
+
"contrast1_contrast2": typing.NotRequired[list[InputPathType] | None],
|
|
132
|
+
})
|
|
133
|
+
MrregisterParametersTagged = typing.TypedDict('MrregisterParametersTagged', {
|
|
134
|
+
"@type": typing.Literal["mrtrix/mrregister"],
|
|
45
135
|
"type": typing.NotRequired[str | None],
|
|
46
136
|
"transformed": typing.NotRequired[list[MrregisterTransformedParameters] | None],
|
|
47
137
|
"transformed_midway": typing.NotRequired[list[MrregisterTransformedMidwayParameters] | None],
|
|
@@ -111,45 +201,6 @@ MrregisterParameters = typing.TypedDict('MrregisterParameters', {
|
|
|
111
201
|
"image1_image2": InputPathType,
|
|
112
202
|
"contrast1_contrast2": typing.NotRequired[list[InputPathType] | None],
|
|
113
203
|
})
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def dyn_cargs(
|
|
117
|
-
t: str,
|
|
118
|
-
) -> typing.Any:
|
|
119
|
-
"""
|
|
120
|
-
Get build cargs function by command type.
|
|
121
|
-
|
|
122
|
-
Args:
|
|
123
|
-
t: Command type.
|
|
124
|
-
Returns:
|
|
125
|
-
Build cargs function.
|
|
126
|
-
"""
|
|
127
|
-
return {
|
|
128
|
-
"mrregister": mrregister_cargs,
|
|
129
|
-
"transformed": mrregister_transformed_cargs,
|
|
130
|
-
"transformed_midway": mrregister_transformed_midway_cargs,
|
|
131
|
-
"nl_warp": mrregister_nl_warp_cargs,
|
|
132
|
-
"config": mrregister_config_cargs,
|
|
133
|
-
}.get(t)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
def dyn_outputs(
|
|
137
|
-
t: str,
|
|
138
|
-
) -> typing.Any:
|
|
139
|
-
"""
|
|
140
|
-
Get build outputs function by command type.
|
|
141
|
-
|
|
142
|
-
Args:
|
|
143
|
-
t: Command type.
|
|
144
|
-
Returns:
|
|
145
|
-
Build outputs function.
|
|
146
|
-
"""
|
|
147
|
-
return {
|
|
148
|
-
"mrregister": mrregister_outputs,
|
|
149
|
-
"transformed": mrregister_transformed_outputs,
|
|
150
|
-
"transformed_midway": mrregister_transformed_midway_outputs,
|
|
151
|
-
"nl_warp": mrregister_nl_warp_outputs,
|
|
152
|
-
}.get(t)
|
|
153
204
|
|
|
154
205
|
|
|
155
206
|
class MrregisterTransformedOutputs(typing.NamedTuple):
|
|
@@ -166,7 +217,7 @@ class MrregisterTransformedOutputs(typing.NamedTuple):
|
|
|
166
217
|
|
|
167
218
|
def mrregister_transformed_params(
|
|
168
219
|
image: str,
|
|
169
|
-
) ->
|
|
220
|
+
) -> MrregisterTransformedParametersTagged:
|
|
170
221
|
"""
|
|
171
222
|
Build parameters.
|
|
172
223
|
|
|
@@ -178,7 +229,7 @@ def mrregister_transformed_params(
|
|
|
178
229
|
Parameter dictionary
|
|
179
230
|
"""
|
|
180
231
|
params = {
|
|
181
|
-
"
|
|
232
|
+
"@type": "transformed",
|
|
182
233
|
"image": image,
|
|
183
234
|
}
|
|
184
235
|
return params
|
|
@@ -199,7 +250,7 @@ def mrregister_transformed_cargs(
|
|
|
199
250
|
"""
|
|
200
251
|
cargs = []
|
|
201
252
|
cargs.append("-transformed")
|
|
202
|
-
cargs.append(params.get("image"))
|
|
253
|
+
cargs.append(params.get("image", None))
|
|
203
254
|
return cargs
|
|
204
255
|
|
|
205
256
|
|
|
@@ -218,7 +269,7 @@ def mrregister_transformed_outputs(
|
|
|
218
269
|
"""
|
|
219
270
|
ret = MrregisterTransformedOutputs(
|
|
220
271
|
root=execution.output_file("."),
|
|
221
|
-
image=execution.output_file(params.get("image")),
|
|
272
|
+
image=execution.output_file(params.get("image", None)),
|
|
222
273
|
)
|
|
223
274
|
return ret
|
|
224
275
|
|
|
@@ -242,7 +293,7 @@ class MrregisterTransformedMidwayOutputs(typing.NamedTuple):
|
|
|
242
293
|
def mrregister_transformed_midway_params(
|
|
243
294
|
image1_transformed: str,
|
|
244
295
|
image2_transformed: str,
|
|
245
|
-
) ->
|
|
296
|
+
) -> MrregisterTransformedMidwayParametersTagged:
|
|
246
297
|
"""
|
|
247
298
|
Build parameters.
|
|
248
299
|
|
|
@@ -259,7 +310,7 @@ def mrregister_transformed_midway_params(
|
|
|
259
310
|
Parameter dictionary
|
|
260
311
|
"""
|
|
261
312
|
params = {
|
|
262
|
-
"
|
|
313
|
+
"@type": "transformed_midway",
|
|
263
314
|
"image1_transformed": image1_transformed,
|
|
264
315
|
"image2_transformed": image2_transformed,
|
|
265
316
|
}
|
|
@@ -281,8 +332,8 @@ def mrregister_transformed_midway_cargs(
|
|
|
281
332
|
"""
|
|
282
333
|
cargs = []
|
|
283
334
|
cargs.append("-transformed_midway")
|
|
284
|
-
cargs.append(params.get("image1_transformed"))
|
|
285
|
-
cargs.append(params.get("image2_transformed"))
|
|
335
|
+
cargs.append(params.get("image1_transformed", None))
|
|
336
|
+
cargs.append(params.get("image2_transformed", None))
|
|
286
337
|
return cargs
|
|
287
338
|
|
|
288
339
|
|
|
@@ -301,8 +352,8 @@ def mrregister_transformed_midway_outputs(
|
|
|
301
352
|
"""
|
|
302
353
|
ret = MrregisterTransformedMidwayOutputs(
|
|
303
354
|
root=execution.output_file("."),
|
|
304
|
-
image1_transformed=execution.output_file(params.get("image1_transformed")),
|
|
305
|
-
image2_transformed=execution.output_file(params.get("image2_transformed")),
|
|
355
|
+
image1_transformed=execution.output_file(params.get("image1_transformed", None)),
|
|
356
|
+
image2_transformed=execution.output_file(params.get("image2_transformed", None)),
|
|
306
357
|
)
|
|
307
358
|
return ret
|
|
308
359
|
|
|
@@ -328,7 +379,7 @@ class MrregisterNlWarpOutputs(typing.NamedTuple):
|
|
|
328
379
|
def mrregister_nl_warp_params(
|
|
329
380
|
warp1: str,
|
|
330
381
|
warp2: str,
|
|
331
|
-
) ->
|
|
382
|
+
) -> MrregisterNlWarpParametersTagged:
|
|
332
383
|
"""
|
|
333
384
|
Build parameters.
|
|
334
385
|
|
|
@@ -345,7 +396,7 @@ def mrregister_nl_warp_params(
|
|
|
345
396
|
Parameter dictionary
|
|
346
397
|
"""
|
|
347
398
|
params = {
|
|
348
|
-
"
|
|
399
|
+
"@type": "nl_warp",
|
|
349
400
|
"warp1": warp1,
|
|
350
401
|
"warp2": warp2,
|
|
351
402
|
}
|
|
@@ -367,8 +418,8 @@ def mrregister_nl_warp_cargs(
|
|
|
367
418
|
"""
|
|
368
419
|
cargs = []
|
|
369
420
|
cargs.append("-nl_warp")
|
|
370
|
-
cargs.append(params.get("warp1"))
|
|
371
|
-
cargs.append(params.get("warp2"))
|
|
421
|
+
cargs.append(params.get("warp1", None))
|
|
422
|
+
cargs.append(params.get("warp2", None))
|
|
372
423
|
return cargs
|
|
373
424
|
|
|
374
425
|
|
|
@@ -387,8 +438,8 @@ def mrregister_nl_warp_outputs(
|
|
|
387
438
|
"""
|
|
388
439
|
ret = MrregisterNlWarpOutputs(
|
|
389
440
|
root=execution.output_file("."),
|
|
390
|
-
warp1=execution.output_file(params.get("warp1")),
|
|
391
|
-
warp2=execution.output_file(params.get("warp2")),
|
|
441
|
+
warp1=execution.output_file(params.get("warp1", None)),
|
|
442
|
+
warp2=execution.output_file(params.get("warp2", None)),
|
|
392
443
|
)
|
|
393
444
|
return ret
|
|
394
445
|
|
|
@@ -396,7 +447,7 @@ def mrregister_nl_warp_outputs(
|
|
|
396
447
|
def mrregister_config_params(
|
|
397
448
|
key: str,
|
|
398
449
|
value: str,
|
|
399
|
-
) ->
|
|
450
|
+
) -> MrregisterConfigParametersTagged:
|
|
400
451
|
"""
|
|
401
452
|
Build parameters.
|
|
402
453
|
|
|
@@ -407,7 +458,7 @@ def mrregister_config_params(
|
|
|
407
458
|
Parameter dictionary
|
|
408
459
|
"""
|
|
409
460
|
params = {
|
|
410
|
-
"
|
|
461
|
+
"@type": "config",
|
|
411
462
|
"key": key,
|
|
412
463
|
"value": value,
|
|
413
464
|
}
|
|
@@ -429,14 +480,14 @@ def mrregister_config_cargs(
|
|
|
429
480
|
"""
|
|
430
481
|
cargs = []
|
|
431
482
|
cargs.append("-config")
|
|
432
|
-
cargs.append(params.get("key"))
|
|
433
|
-
cargs.append(params.get("value"))
|
|
483
|
+
cargs.append(params.get("key", None))
|
|
484
|
+
cargs.append(params.get("value", None))
|
|
434
485
|
return cargs
|
|
435
486
|
|
|
436
487
|
|
|
437
488
|
class MrregisterOutputs(typing.NamedTuple):
|
|
438
489
|
"""
|
|
439
|
-
Output object returned when calling `
|
|
490
|
+
Output object returned when calling `MrregisterParameters(...)`.
|
|
440
491
|
"""
|
|
441
492
|
root: OutputPathType
|
|
442
493
|
"""Output root folder. This is the root folder for all outputs."""
|
|
@@ -553,7 +604,7 @@ def mrregister_params(
|
|
|
553
604
|
help_: bool = False,
|
|
554
605
|
version: bool = False,
|
|
555
606
|
contrast1_contrast2: list[InputPathType] | None = None,
|
|
556
|
-
) ->
|
|
607
|
+
) -> MrregisterParametersTagged:
|
|
557
608
|
"""
|
|
558
609
|
Build parameters.
|
|
559
610
|
|
|
@@ -754,7 +805,7 @@ def mrregister_params(
|
|
|
754
805
|
Parameter dictionary
|
|
755
806
|
"""
|
|
756
807
|
params = {
|
|
757
|
-
"
|
|
808
|
+
"@type": "mrtrix/mrregister",
|
|
758
809
|
"nan": nan,
|
|
759
810
|
"init_translation_unmasked1": init_translation_unmasked1,
|
|
760
811
|
"init_translation_unmasked2": init_translation_unmasked2,
|
|
@@ -896,288 +947,288 @@ def mrregister_cargs(
|
|
|
896
947
|
"""
|
|
897
948
|
cargs = []
|
|
898
949
|
cargs.append("mrregister")
|
|
899
|
-
if params.get("type") is not None:
|
|
950
|
+
if params.get("type", None) is not None:
|
|
900
951
|
cargs.extend([
|
|
901
952
|
"-type",
|
|
902
|
-
params.get("type")
|
|
953
|
+
params.get("type", None)
|
|
903
954
|
])
|
|
904
|
-
if params.get("transformed") is not None:
|
|
905
|
-
cargs.extend([a for c in [
|
|
906
|
-
if params.get("transformed_midway") is not None:
|
|
907
|
-
cargs.extend([a for c in [
|
|
908
|
-
if params.get("mask1") is not None:
|
|
955
|
+
if params.get("transformed", None) is not None:
|
|
956
|
+
cargs.extend([a for c in [mrregister_transformed_cargs(s, execution) for s in params.get("transformed", None)] for a in c])
|
|
957
|
+
if params.get("transformed_midway", None) is not None:
|
|
958
|
+
cargs.extend([a for c in [mrregister_transformed_midway_cargs(s, execution) for s in params.get("transformed_midway", None)] for a in c])
|
|
959
|
+
if params.get("mask1", None) is not None:
|
|
909
960
|
cargs.extend([
|
|
910
961
|
"-mask1",
|
|
911
|
-
execution.input_file(params.get("mask1"))
|
|
962
|
+
execution.input_file(params.get("mask1", None))
|
|
912
963
|
])
|
|
913
|
-
if params.get("mask2") is not None:
|
|
964
|
+
if params.get("mask2", None) is not None:
|
|
914
965
|
cargs.extend([
|
|
915
966
|
"-mask2",
|
|
916
|
-
execution.input_file(params.get("mask2"))
|
|
967
|
+
execution.input_file(params.get("mask2", None))
|
|
917
968
|
])
|
|
918
|
-
if params.get("nan"):
|
|
969
|
+
if params.get("nan", False):
|
|
919
970
|
cargs.append("-nan")
|
|
920
|
-
if params.get("rigid") is not None:
|
|
971
|
+
if params.get("rigid", None) is not None:
|
|
921
972
|
cargs.extend([
|
|
922
973
|
"-rigid",
|
|
923
|
-
params.get("rigid")
|
|
974
|
+
params.get("rigid", None)
|
|
924
975
|
])
|
|
925
|
-
if params.get("rigid_1tomidway") is not None:
|
|
976
|
+
if params.get("rigid_1tomidway", None) is not None:
|
|
926
977
|
cargs.extend([
|
|
927
978
|
"-rigid_1tomidway",
|
|
928
|
-
params.get("rigid_1tomidway")
|
|
979
|
+
params.get("rigid_1tomidway", None)
|
|
929
980
|
])
|
|
930
|
-
if params.get("rigid_2tomidway") is not None:
|
|
981
|
+
if params.get("rigid_2tomidway", None) is not None:
|
|
931
982
|
cargs.extend([
|
|
932
983
|
"-rigid_2tomidway",
|
|
933
|
-
params.get("rigid_2tomidway")
|
|
984
|
+
params.get("rigid_2tomidway", None)
|
|
934
985
|
])
|
|
935
|
-
if params.get("rigid_init_translation") is not None:
|
|
986
|
+
if params.get("rigid_init_translation", None) is not None:
|
|
936
987
|
cargs.extend([
|
|
937
988
|
"-rigid_init_translation",
|
|
938
|
-
params.get("rigid_init_translation")
|
|
989
|
+
params.get("rigid_init_translation", None)
|
|
939
990
|
])
|
|
940
|
-
if params.get("rigid_init_rotation") is not None:
|
|
991
|
+
if params.get("rigid_init_rotation", None) is not None:
|
|
941
992
|
cargs.extend([
|
|
942
993
|
"-rigid_init_rotation",
|
|
943
|
-
params.get("rigid_init_rotation")
|
|
994
|
+
params.get("rigid_init_rotation", None)
|
|
944
995
|
])
|
|
945
|
-
if params.get("rigid_init_matrix") is not None:
|
|
996
|
+
if params.get("rigid_init_matrix", None) is not None:
|
|
946
997
|
cargs.extend([
|
|
947
998
|
"-rigid_init_matrix",
|
|
948
|
-
execution.input_file(params.get("rigid_init_matrix"))
|
|
999
|
+
execution.input_file(params.get("rigid_init_matrix", None))
|
|
949
1000
|
])
|
|
950
|
-
if params.get("rigid_scale") is not None:
|
|
1001
|
+
if params.get("rigid_scale", None) is not None:
|
|
951
1002
|
cargs.extend([
|
|
952
1003
|
"-rigid_scale",
|
|
953
|
-
*map(str, params.get("rigid_scale"))
|
|
1004
|
+
*map(str, params.get("rigid_scale", None))
|
|
954
1005
|
])
|
|
955
|
-
if params.get("rigid_niter") is not None:
|
|
1006
|
+
if params.get("rigid_niter", None) is not None:
|
|
956
1007
|
cargs.extend([
|
|
957
1008
|
"-rigid_niter",
|
|
958
|
-
*map(str, params.get("rigid_niter"))
|
|
1009
|
+
*map(str, params.get("rigid_niter", None))
|
|
959
1010
|
])
|
|
960
|
-
if params.get("rigid_metric") is not None:
|
|
1011
|
+
if params.get("rigid_metric", None) is not None:
|
|
961
1012
|
cargs.extend([
|
|
962
1013
|
"-rigid_metric",
|
|
963
|
-
params.get("rigid_metric")
|
|
1014
|
+
params.get("rigid_metric", None)
|
|
964
1015
|
])
|
|
965
|
-
if params.get("rigid_metric_diff_estimator") is not None:
|
|
1016
|
+
if params.get("rigid_metric_diff_estimator", None) is not None:
|
|
966
1017
|
cargs.extend([
|
|
967
1018
|
"-rigid_metric.diff.estimator",
|
|
968
|
-
params.get("rigid_metric_diff_estimator")
|
|
1019
|
+
params.get("rigid_metric_diff_estimator", None)
|
|
969
1020
|
])
|
|
970
|
-
if params.get("rigid_lmax") is not None:
|
|
1021
|
+
if params.get("rigid_lmax", None) is not None:
|
|
971
1022
|
cargs.extend([
|
|
972
1023
|
"-rigid_lmax",
|
|
973
|
-
*map(str, params.get("rigid_lmax"))
|
|
1024
|
+
*map(str, params.get("rigid_lmax", None))
|
|
974
1025
|
])
|
|
975
|
-
if params.get("rigid_log") is not None:
|
|
1026
|
+
if params.get("rigid_log", None) is not None:
|
|
976
1027
|
cargs.extend([
|
|
977
1028
|
"-rigid_log",
|
|
978
|
-
params.get("rigid_log")
|
|
1029
|
+
params.get("rigid_log", None)
|
|
979
1030
|
])
|
|
980
|
-
if params.get("affine") is not None:
|
|
1031
|
+
if params.get("affine", None) is not None:
|
|
981
1032
|
cargs.extend([
|
|
982
1033
|
"-affine",
|
|
983
|
-
params.get("affine")
|
|
1034
|
+
params.get("affine", None)
|
|
984
1035
|
])
|
|
985
|
-
if params.get("affine_1tomidway") is not None:
|
|
1036
|
+
if params.get("affine_1tomidway", None) is not None:
|
|
986
1037
|
cargs.extend([
|
|
987
1038
|
"-affine_1tomidway",
|
|
988
|
-
params.get("affine_1tomidway")
|
|
1039
|
+
params.get("affine_1tomidway", None)
|
|
989
1040
|
])
|
|
990
|
-
if params.get("affine_2tomidway") is not None:
|
|
1041
|
+
if params.get("affine_2tomidway", None) is not None:
|
|
991
1042
|
cargs.extend([
|
|
992
1043
|
"-affine_2tomidway",
|
|
993
|
-
params.get("affine_2tomidway")
|
|
1044
|
+
params.get("affine_2tomidway", None)
|
|
994
1045
|
])
|
|
995
|
-
if params.get("affine_init_translation") is not None:
|
|
1046
|
+
if params.get("affine_init_translation", None) is not None:
|
|
996
1047
|
cargs.extend([
|
|
997
1048
|
"-affine_init_translation",
|
|
998
|
-
params.get("affine_init_translation")
|
|
1049
|
+
params.get("affine_init_translation", None)
|
|
999
1050
|
])
|
|
1000
|
-
if params.get("affine_init_rotation") is not None:
|
|
1051
|
+
if params.get("affine_init_rotation", None) is not None:
|
|
1001
1052
|
cargs.extend([
|
|
1002
1053
|
"-affine_init_rotation",
|
|
1003
|
-
params.get("affine_init_rotation")
|
|
1054
|
+
params.get("affine_init_rotation", None)
|
|
1004
1055
|
])
|
|
1005
|
-
if params.get("affine_init_matrix") is not None:
|
|
1056
|
+
if params.get("affine_init_matrix", None) is not None:
|
|
1006
1057
|
cargs.extend([
|
|
1007
1058
|
"-affine_init_matrix",
|
|
1008
|
-
execution.input_file(params.get("affine_init_matrix"))
|
|
1059
|
+
execution.input_file(params.get("affine_init_matrix", None))
|
|
1009
1060
|
])
|
|
1010
|
-
if params.get("affine_scale") is not None:
|
|
1061
|
+
if params.get("affine_scale", None) is not None:
|
|
1011
1062
|
cargs.extend([
|
|
1012
1063
|
"-affine_scale",
|
|
1013
|
-
*map(str, params.get("affine_scale"))
|
|
1064
|
+
*map(str, params.get("affine_scale", None))
|
|
1014
1065
|
])
|
|
1015
|
-
if params.get("affine_niter") is not None:
|
|
1066
|
+
if params.get("affine_niter", None) is not None:
|
|
1016
1067
|
cargs.extend([
|
|
1017
1068
|
"-affine_niter",
|
|
1018
|
-
*map(str, params.get("affine_niter"))
|
|
1069
|
+
*map(str, params.get("affine_niter", None))
|
|
1019
1070
|
])
|
|
1020
|
-
if params.get("affine_metric") is not None:
|
|
1071
|
+
if params.get("affine_metric", None) is not None:
|
|
1021
1072
|
cargs.extend([
|
|
1022
1073
|
"-affine_metric",
|
|
1023
|
-
params.get("affine_metric")
|
|
1074
|
+
params.get("affine_metric", None)
|
|
1024
1075
|
])
|
|
1025
|
-
if params.get("affine_metric_diff_estimator") is not None:
|
|
1076
|
+
if params.get("affine_metric_diff_estimator", None) is not None:
|
|
1026
1077
|
cargs.extend([
|
|
1027
1078
|
"-affine_metric.diff.estimator",
|
|
1028
|
-
params.get("affine_metric_diff_estimator")
|
|
1079
|
+
params.get("affine_metric_diff_estimator", None)
|
|
1029
1080
|
])
|
|
1030
|
-
if params.get("affine_lmax") is not None:
|
|
1081
|
+
if params.get("affine_lmax", None) is not None:
|
|
1031
1082
|
cargs.extend([
|
|
1032
1083
|
"-affine_lmax",
|
|
1033
|
-
*map(str, params.get("affine_lmax"))
|
|
1084
|
+
*map(str, params.get("affine_lmax", None))
|
|
1034
1085
|
])
|
|
1035
|
-
if params.get("affine_log") is not None:
|
|
1086
|
+
if params.get("affine_log", None) is not None:
|
|
1036
1087
|
cargs.extend([
|
|
1037
1088
|
"-affine_log",
|
|
1038
|
-
params.get("affine_log")
|
|
1089
|
+
params.get("affine_log", None)
|
|
1039
1090
|
])
|
|
1040
|
-
if params.get("init_translation_unmasked1"):
|
|
1091
|
+
if params.get("init_translation_unmasked1", False):
|
|
1041
1092
|
cargs.append("-init_translation.unmasked1")
|
|
1042
|
-
if params.get("init_translation_unmasked2"):
|
|
1093
|
+
if params.get("init_translation_unmasked2", False):
|
|
1043
1094
|
cargs.append("-init_translation.unmasked2")
|
|
1044
|
-
if params.get("init_rotation_unmasked1"):
|
|
1095
|
+
if params.get("init_rotation_unmasked1", False):
|
|
1045
1096
|
cargs.append("-init_rotation.unmasked1")
|
|
1046
|
-
if params.get("init_rotation_unmasked2"):
|
|
1097
|
+
if params.get("init_rotation_unmasked2", False):
|
|
1047
1098
|
cargs.append("-init_rotation.unmasked2")
|
|
1048
|
-
if params.get("init_rotation_search_angles") is not None:
|
|
1099
|
+
if params.get("init_rotation_search_angles", None) is not None:
|
|
1049
1100
|
cargs.extend([
|
|
1050
1101
|
"-init_rotation.search.angles",
|
|
1051
|
-
*map(str, params.get("init_rotation_search_angles"))
|
|
1102
|
+
*map(str, params.get("init_rotation_search_angles", None))
|
|
1052
1103
|
])
|
|
1053
|
-
if params.get("init_rotation_search_scale") is not None:
|
|
1104
|
+
if params.get("init_rotation_search_scale", None) is not None:
|
|
1054
1105
|
cargs.extend([
|
|
1055
1106
|
"-init_rotation.search.scale",
|
|
1056
|
-
str(params.get("init_rotation_search_scale"))
|
|
1107
|
+
str(params.get("init_rotation_search_scale", None))
|
|
1057
1108
|
])
|
|
1058
|
-
if params.get("init_rotation_search_directions") is not None:
|
|
1109
|
+
if params.get("init_rotation_search_directions", None) is not None:
|
|
1059
1110
|
cargs.extend([
|
|
1060
1111
|
"-init_rotation.search.directions",
|
|
1061
|
-
str(params.get("init_rotation_search_directions"))
|
|
1112
|
+
str(params.get("init_rotation_search_directions", None))
|
|
1062
1113
|
])
|
|
1063
|
-
if params.get("init_rotation_search_run_global"):
|
|
1114
|
+
if params.get("init_rotation_search_run_global", False):
|
|
1064
1115
|
cargs.append("-init_rotation.search.run_global")
|
|
1065
|
-
if params.get("init_rotation_search_global_iterations") is not None:
|
|
1116
|
+
if params.get("init_rotation_search_global_iterations", None) is not None:
|
|
1066
1117
|
cargs.extend([
|
|
1067
1118
|
"-init_rotation.search.global.iterations",
|
|
1068
|
-
str(params.get("init_rotation_search_global_iterations"))
|
|
1119
|
+
str(params.get("init_rotation_search_global_iterations", None))
|
|
1069
1120
|
])
|
|
1070
|
-
if params.get("linstage_iterations") is not None:
|
|
1121
|
+
if params.get("linstage_iterations", None) is not None:
|
|
1071
1122
|
cargs.extend([
|
|
1072
1123
|
"-linstage.iterations",
|
|
1073
|
-
*map(str, params.get("linstage_iterations"))
|
|
1124
|
+
*map(str, params.get("linstage_iterations", None))
|
|
1074
1125
|
])
|
|
1075
|
-
if params.get("linstage_optimiser_first") is not None:
|
|
1126
|
+
if params.get("linstage_optimiser_first", None) is not None:
|
|
1076
1127
|
cargs.extend([
|
|
1077
1128
|
"-linstage.optimiser.first",
|
|
1078
|
-
params.get("linstage_optimiser_first")
|
|
1129
|
+
params.get("linstage_optimiser_first", None)
|
|
1079
1130
|
])
|
|
1080
|
-
if params.get("linstage_optimiser_last") is not None:
|
|
1131
|
+
if params.get("linstage_optimiser_last", None) is not None:
|
|
1081
1132
|
cargs.extend([
|
|
1082
1133
|
"-linstage.optimiser.last",
|
|
1083
|
-
params.get("linstage_optimiser_last")
|
|
1134
|
+
params.get("linstage_optimiser_last", None)
|
|
1084
1135
|
])
|
|
1085
|
-
if params.get("linstage_optimiser_default") is not None:
|
|
1136
|
+
if params.get("linstage_optimiser_default", None) is not None:
|
|
1086
1137
|
cargs.extend([
|
|
1087
1138
|
"-linstage.optimiser.default",
|
|
1088
|
-
params.get("linstage_optimiser_default")
|
|
1139
|
+
params.get("linstage_optimiser_default", None)
|
|
1089
1140
|
])
|
|
1090
|
-
if params.get("linstage_diagnostics_prefix") is not None:
|
|
1141
|
+
if params.get("linstage_diagnostics_prefix", None) is not None:
|
|
1091
1142
|
cargs.extend([
|
|
1092
1143
|
"-linstage.diagnostics.prefix",
|
|
1093
|
-
params.get("linstage_diagnostics_prefix")
|
|
1144
|
+
params.get("linstage_diagnostics_prefix", None)
|
|
1094
1145
|
])
|
|
1095
|
-
if params.get("nl_warp") is not None:
|
|
1096
|
-
cargs.extend(
|
|
1097
|
-
if params.get("nl_warp_full") is not None:
|
|
1146
|
+
if params.get("nl_warp", None) is not None:
|
|
1147
|
+
cargs.extend(mrregister_nl_warp_cargs(params.get("nl_warp", None), execution))
|
|
1148
|
+
if params.get("nl_warp_full", None) is not None:
|
|
1098
1149
|
cargs.extend([
|
|
1099
1150
|
"-nl_warp_full",
|
|
1100
|
-
params.get("nl_warp_full")
|
|
1151
|
+
params.get("nl_warp_full", None)
|
|
1101
1152
|
])
|
|
1102
|
-
if params.get("nl_init") is not None:
|
|
1153
|
+
if params.get("nl_init", None) is not None:
|
|
1103
1154
|
cargs.extend([
|
|
1104
1155
|
"-nl_init",
|
|
1105
|
-
execution.input_file(params.get("nl_init"))
|
|
1156
|
+
execution.input_file(params.get("nl_init", None))
|
|
1106
1157
|
])
|
|
1107
|
-
if params.get("nl_scale") is not None:
|
|
1158
|
+
if params.get("nl_scale", None) is not None:
|
|
1108
1159
|
cargs.extend([
|
|
1109
1160
|
"-nl_scale",
|
|
1110
|
-
*map(str, params.get("nl_scale"))
|
|
1161
|
+
*map(str, params.get("nl_scale", None))
|
|
1111
1162
|
])
|
|
1112
|
-
if params.get("nl_niter") is not None:
|
|
1163
|
+
if params.get("nl_niter", None) is not None:
|
|
1113
1164
|
cargs.extend([
|
|
1114
1165
|
"-nl_niter",
|
|
1115
|
-
*map(str, params.get("nl_niter"))
|
|
1166
|
+
*map(str, params.get("nl_niter", None))
|
|
1116
1167
|
])
|
|
1117
|
-
if params.get("nl_update_smooth") is not None:
|
|
1168
|
+
if params.get("nl_update_smooth", None) is not None:
|
|
1118
1169
|
cargs.extend([
|
|
1119
1170
|
"-nl_update_smooth",
|
|
1120
|
-
str(params.get("nl_update_smooth"))
|
|
1171
|
+
str(params.get("nl_update_smooth", None))
|
|
1121
1172
|
])
|
|
1122
|
-
if params.get("nl_disp_smooth") is not None:
|
|
1173
|
+
if params.get("nl_disp_smooth", None) is not None:
|
|
1123
1174
|
cargs.extend([
|
|
1124
1175
|
"-nl_disp_smooth",
|
|
1125
|
-
str(params.get("nl_disp_smooth"))
|
|
1176
|
+
str(params.get("nl_disp_smooth", None))
|
|
1126
1177
|
])
|
|
1127
|
-
if params.get("nl_grad_step") is not None:
|
|
1178
|
+
if params.get("nl_grad_step", None) is not None:
|
|
1128
1179
|
cargs.extend([
|
|
1129
1180
|
"-nl_grad_step",
|
|
1130
|
-
str(params.get("nl_grad_step"))
|
|
1181
|
+
str(params.get("nl_grad_step", None))
|
|
1131
1182
|
])
|
|
1132
|
-
if params.get("nl_lmax") is not None:
|
|
1183
|
+
if params.get("nl_lmax", None) is not None:
|
|
1133
1184
|
cargs.extend([
|
|
1134
1185
|
"-nl_lmax",
|
|
1135
|
-
*map(str, params.get("nl_lmax"))
|
|
1186
|
+
*map(str, params.get("nl_lmax", None))
|
|
1136
1187
|
])
|
|
1137
|
-
if params.get("diagnostics_image") is not None:
|
|
1188
|
+
if params.get("diagnostics_image", None) is not None:
|
|
1138
1189
|
cargs.extend([
|
|
1139
1190
|
"-diagnostics_image",
|
|
1140
|
-
params.get("diagnostics_image")
|
|
1191
|
+
params.get("diagnostics_image", None)
|
|
1141
1192
|
])
|
|
1142
|
-
if params.get("directions") is not None:
|
|
1193
|
+
if params.get("directions", None) is not None:
|
|
1143
1194
|
cargs.extend([
|
|
1144
1195
|
"-directions",
|
|
1145
|
-
execution.input_file(params.get("directions"))
|
|
1196
|
+
execution.input_file(params.get("directions", None))
|
|
1146
1197
|
])
|
|
1147
|
-
if params.get("noreorientation"):
|
|
1198
|
+
if params.get("noreorientation", False):
|
|
1148
1199
|
cargs.append("-noreorientation")
|
|
1149
|
-
if params.get("mc_weights") is not None:
|
|
1200
|
+
if params.get("mc_weights", None) is not None:
|
|
1150
1201
|
cargs.extend([
|
|
1151
1202
|
"-mc_weights",
|
|
1152
|
-
*map(str, params.get("mc_weights"))
|
|
1203
|
+
*map(str, params.get("mc_weights", None))
|
|
1153
1204
|
])
|
|
1154
|
-
if params.get("datatype") is not None:
|
|
1205
|
+
if params.get("datatype", None) is not None:
|
|
1155
1206
|
cargs.extend([
|
|
1156
1207
|
"-datatype",
|
|
1157
|
-
params.get("datatype")
|
|
1208
|
+
params.get("datatype", None)
|
|
1158
1209
|
])
|
|
1159
|
-
if params.get("info"):
|
|
1210
|
+
if params.get("info", False):
|
|
1160
1211
|
cargs.append("-info")
|
|
1161
|
-
if params.get("quiet"):
|
|
1212
|
+
if params.get("quiet", False):
|
|
1162
1213
|
cargs.append("-quiet")
|
|
1163
|
-
if params.get("debug"):
|
|
1214
|
+
if params.get("debug", False):
|
|
1164
1215
|
cargs.append("-debug")
|
|
1165
|
-
if params.get("force"):
|
|
1216
|
+
if params.get("force", False):
|
|
1166
1217
|
cargs.append("-force")
|
|
1167
|
-
if params.get("nthreads") is not None:
|
|
1218
|
+
if params.get("nthreads", None) is not None:
|
|
1168
1219
|
cargs.extend([
|
|
1169
1220
|
"-nthreads",
|
|
1170
|
-
str(params.get("nthreads"))
|
|
1221
|
+
str(params.get("nthreads", None))
|
|
1171
1222
|
])
|
|
1172
|
-
if params.get("config") is not None:
|
|
1173
|
-
cargs.extend([a for c in [
|
|
1174
|
-
if params.get("help"):
|
|
1223
|
+
if params.get("config", None) is not None:
|
|
1224
|
+
cargs.extend([a for c in [mrregister_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
1225
|
+
if params.get("help", False):
|
|
1175
1226
|
cargs.append("-help")
|
|
1176
|
-
if params.get("version"):
|
|
1227
|
+
if params.get("version", False):
|
|
1177
1228
|
cargs.append("-version")
|
|
1178
|
-
cargs.append(execution.input_file(params.get("image1_image2")))
|
|
1179
|
-
if params.get("contrast1_contrast2") is not None:
|
|
1180
|
-
cargs.extend([execution.input_file(f) for f in params.get("contrast1_contrast2")])
|
|
1229
|
+
cargs.append(execution.input_file(params.get("image1_image2", None)))
|
|
1230
|
+
if params.get("contrast1_contrast2", None) is not None:
|
|
1231
|
+
cargs.extend([execution.input_file(f) for f in params.get("contrast1_contrast2", None)])
|
|
1181
1232
|
return cargs
|
|
1182
1233
|
|
|
1183
1234
|
|
|
@@ -1196,27 +1247,29 @@ def mrregister_outputs(
|
|
|
1196
1247
|
"""
|
|
1197
1248
|
ret = MrregisterOutputs(
|
|
1198
1249
|
root=execution.output_file("."),
|
|
1199
|
-
rigid=execution.output_file(params.get("rigid")) if (params.get("rigid") is not None) else None,
|
|
1200
|
-
rigid_1tomidway=execution.output_file(params.get("rigid_1tomidway")) if (params.get("rigid_1tomidway") is not None) else None,
|
|
1201
|
-
rigid_2tomidway=execution.output_file(params.get("rigid_2tomidway")) if (params.get("rigid_2tomidway") is not None) else None,
|
|
1202
|
-
rigid_log=execution.output_file(params.get("rigid_log")) if (params.get("rigid_log") is not None) else None,
|
|
1203
|
-
affine=execution.output_file(params.get("affine")) if (params.get("affine") is not None) else None,
|
|
1204
|
-
affine_1tomidway=execution.output_file(params.get("affine_1tomidway")) if (params.get("affine_1tomidway") is not None) else None,
|
|
1205
|
-
affine_2tomidway=execution.output_file(params.get("affine_2tomidway")) if (params.get("affine_2tomidway") is not None) else None,
|
|
1206
|
-
affine_log=execution.output_file(params.get("affine_log")) if (params.get("affine_log") is not None) else None,
|
|
1207
|
-
nl_warp_full=execution.output_file(params.get("nl_warp_full")) if (params.get("nl_warp_full") is not None) else None,
|
|
1208
|
-
transformed=[
|
|
1209
|
-
transformed_midway=[
|
|
1210
|
-
nl_warp=
|
|
1250
|
+
rigid=execution.output_file(params.get("rigid", None)) if (params.get("rigid") is not None) else None,
|
|
1251
|
+
rigid_1tomidway=execution.output_file(params.get("rigid_1tomidway", None)) if (params.get("rigid_1tomidway") is not None) else None,
|
|
1252
|
+
rigid_2tomidway=execution.output_file(params.get("rigid_2tomidway", None)) if (params.get("rigid_2tomidway") is not None) else None,
|
|
1253
|
+
rigid_log=execution.output_file(params.get("rigid_log", None)) if (params.get("rigid_log") is not None) else None,
|
|
1254
|
+
affine=execution.output_file(params.get("affine", None)) if (params.get("affine") is not None) else None,
|
|
1255
|
+
affine_1tomidway=execution.output_file(params.get("affine_1tomidway", None)) if (params.get("affine_1tomidway") is not None) else None,
|
|
1256
|
+
affine_2tomidway=execution.output_file(params.get("affine_2tomidway", None)) if (params.get("affine_2tomidway") is not None) else None,
|
|
1257
|
+
affine_log=execution.output_file(params.get("affine_log", None)) if (params.get("affine_log") is not None) else None,
|
|
1258
|
+
nl_warp_full=execution.output_file(params.get("nl_warp_full", None)) if (params.get("nl_warp_full") is not None) else None,
|
|
1259
|
+
transformed=[mrregister_transformed_outputs(i, execution) if mrregister_transformed_outputs else None for i in params.get("transformed")] if params.get("transformed") else None,
|
|
1260
|
+
transformed_midway=[mrregister_transformed_midway_outputs(i, execution) if mrregister_transformed_midway_outputs else None for i in params.get("transformed_midway")] if params.get("transformed_midway") else None,
|
|
1261
|
+
nl_warp=mrregister_nl_warp_outputs(params.get("nl_warp"), execution) if params.get("nl_warp") else None,
|
|
1211
1262
|
)
|
|
1212
1263
|
return ret
|
|
1213
1264
|
|
|
1214
1265
|
|
|
1215
1266
|
def mrregister_execute(
|
|
1216
1267
|
params: MrregisterParameters,
|
|
1217
|
-
|
|
1268
|
+
runner: Runner | None = None,
|
|
1218
1269
|
) -> MrregisterOutputs:
|
|
1219
1270
|
"""
|
|
1271
|
+
mrregister
|
|
1272
|
+
|
|
1220
1273
|
Register two images together using a symmetric rigid, affine or non-linear
|
|
1221
1274
|
transformation model.
|
|
1222
1275
|
|
|
@@ -1260,10 +1313,12 @@ def mrregister_execute(
|
|
|
1260
1313
|
|
|
1261
1314
|
Args:
|
|
1262
1315
|
params: The parameters.
|
|
1263
|
-
|
|
1316
|
+
runner: Command runner.
|
|
1264
1317
|
Returns:
|
|
1265
1318
|
NamedTuple of outputs (described in `MrregisterOutputs`).
|
|
1266
1319
|
"""
|
|
1320
|
+
runner = runner or get_global_runner()
|
|
1321
|
+
execution = runner.start_execution(MRREGISTER_METADATA)
|
|
1267
1322
|
params = execution.params(params)
|
|
1268
1323
|
cargs = mrregister_cargs(params, execution)
|
|
1269
1324
|
ret = mrregister_outputs(params, execution)
|
|
@@ -1343,6 +1398,8 @@ def mrregister(
|
|
|
1343
1398
|
runner: Runner | None = None,
|
|
1344
1399
|
) -> MrregisterOutputs:
|
|
1345
1400
|
"""
|
|
1401
|
+
mrregister
|
|
1402
|
+
|
|
1346
1403
|
Register two images together using a symmetric rigid, affine or non-linear
|
|
1347
1404
|
transformation model.
|
|
1348
1405
|
|
|
@@ -1581,8 +1638,6 @@ def mrregister(
|
|
|
1581
1638
|
Returns:
|
|
1582
1639
|
NamedTuple of outputs (described in `MrregisterOutputs`).
|
|
1583
1640
|
"""
|
|
1584
|
-
runner = runner or get_global_runner()
|
|
1585
|
-
execution = runner.start_execution(MRREGISTER_METADATA)
|
|
1586
1641
|
params = mrregister_params(
|
|
1587
1642
|
type_=type_,
|
|
1588
1643
|
transformed=transformed,
|
|
@@ -1653,22 +1708,18 @@ def mrregister(
|
|
|
1653
1708
|
image1_image2=image1_image2,
|
|
1654
1709
|
contrast1_contrast2=contrast1_contrast2,
|
|
1655
1710
|
)
|
|
1656
|
-
return mrregister_execute(params,
|
|
1711
|
+
return mrregister_execute(params, runner)
|
|
1657
1712
|
|
|
1658
1713
|
|
|
1659
1714
|
__all__ = [
|
|
1660
1715
|
"MRREGISTER_METADATA",
|
|
1661
|
-
"MrregisterConfigParameters",
|
|
1662
1716
|
"MrregisterNlWarpOutputs",
|
|
1663
|
-
"MrregisterNlWarpParameters",
|
|
1664
1717
|
"MrregisterOutputs",
|
|
1665
|
-
"MrregisterParameters",
|
|
1666
1718
|
"MrregisterTransformedMidwayOutputs",
|
|
1667
|
-
"MrregisterTransformedMidwayParameters",
|
|
1668
1719
|
"MrregisterTransformedOutputs",
|
|
1669
|
-
"MrregisterTransformedParameters",
|
|
1670
1720
|
"mrregister",
|
|
1671
1721
|
"mrregister_config_params",
|
|
1722
|
+
"mrregister_execute",
|
|
1672
1723
|
"mrregister_nl_warp_params",
|
|
1673
1724
|
"mrregister_params",
|
|
1674
1725
|
"mrregister_transformed_midway_params",
|