niwrap-mrtrix 0.8.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.
- niwrap_mrtrix/mrtrix/__init__.py +263 -0
- niwrap_mrtrix/mrtrix/afdconnectivity.py +527 -0
- niwrap_mrtrix/mrtrix/amp2response.py +560 -0
- niwrap_mrtrix/mrtrix/amp2sh.py +870 -0
- niwrap_mrtrix/mrtrix/connectome2tck.py +583 -0
- niwrap_mrtrix/mrtrix/connectomeedit.py +413 -0
- niwrap_mrtrix/mrtrix/connectomestats.py +956 -0
- niwrap_mrtrix/mrtrix/dcmedit.py +552 -0
- niwrap_mrtrix/mrtrix/dcminfo.py +529 -0
- niwrap_mrtrix/mrtrix/dirflip.py +440 -0
- niwrap_mrtrix/mrtrix/dirgen.py +514 -0
- niwrap_mrtrix/mrtrix/dirmerge.py +446 -0
- niwrap_mrtrix/mrtrix/dirorder.py +421 -0
- niwrap_mrtrix/mrtrix/dirsplit.py +436 -0
- niwrap_mrtrix/mrtrix/dirstat.py +640 -0
- niwrap_mrtrix/mrtrix/dwi2adc.py +531 -0
- niwrap_mrtrix/mrtrix/dwi2fod.py +1156 -0
- niwrap_mrtrix/mrtrix/dwi2mask.py +570 -0
- niwrap_mrtrix/mrtrix/dwi2response.py +1774 -0
- niwrap_mrtrix/mrtrix/dwi2tensor.py +715 -0
- niwrap_mrtrix/mrtrix/dwibiascorrect.py +673 -0
- niwrap_mrtrix/mrtrix/dwidenoise.py +570 -0
- niwrap_mrtrix/mrtrix/dwiextract.py +1111 -0
- niwrap_mrtrix/mrtrix/dwigradcheck.py +665 -0
- niwrap_mrtrix/mrtrix/fixel2peaks.py +613 -0
- niwrap_mrtrix/mrtrix/fixel2sh.py +430 -0
- niwrap_mrtrix/mrtrix/fixel2tsf.py +435 -0
- niwrap_mrtrix/mrtrix/fixel2voxel.py +523 -0
- niwrap_mrtrix/mrtrix/fixelcfestats.py +1179 -0
- niwrap_mrtrix/mrtrix/fixelconnectivity.py +477 -0
- niwrap_mrtrix/mrtrix/fixelconvert.py +850 -0
- niwrap_mrtrix/mrtrix/fixelcorrespondence.py +455 -0
- niwrap_mrtrix/mrtrix/fixelcrop.py +422 -0
- niwrap_mrtrix/mrtrix/fixelfilter.py +882 -0
- niwrap_mrtrix/mrtrix/fixelreorient.py +435 -0
- niwrap_mrtrix/mrtrix/fod2dec.py +571 -0
- niwrap_mrtrix/mrtrix/fod2fixel.py +646 -0
- niwrap_mrtrix/mrtrix/label2colour.py +426 -0
- niwrap_mrtrix/mrtrix/label2mesh.py +417 -0
- niwrap_mrtrix/mrtrix/labelconvert.py +460 -0
- niwrap_mrtrix/mrtrix/labelstats.py +418 -0
- niwrap_mrtrix/mrtrix/maskdump.py +404 -0
- niwrap_mrtrix/mrtrix/maskfilter.py +730 -0
- niwrap_mrtrix/mrtrix/mesh2voxel.py +422 -0
- niwrap_mrtrix/mrtrix/meshconvert.py +514 -0
- niwrap_mrtrix/mrtrix/meshfilter.py +452 -0
- niwrap_mrtrix/mrtrix/mraverageheader.py +485 -0
- niwrap_mrtrix/mrtrix/mrcalc.py +4302 -0
- niwrap_mrtrix/mrtrix/mrcat.py +467 -0
- niwrap_mrtrix/mrtrix/mrcentroid.py +418 -0
- niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +446 -0
- niwrap_mrtrix/mrtrix/mrclusterstats.py +930 -0
- niwrap_mrtrix/mrtrix/mrcolour.py +490 -0
- niwrap_mrtrix/mrtrix/mrconvert.py +1967 -0
- niwrap_mrtrix/mrtrix/mrdegibbs.py +535 -0
- niwrap_mrtrix/mrtrix/mrdump.py +423 -0
- niwrap_mrtrix/mrtrix/mredit.py +737 -0
- niwrap_mrtrix/mrtrix/mrfilter.py +971 -0
- niwrap_mrtrix/mrtrix/mrgrid.py +1079 -0
- niwrap_mrtrix/mrtrix/mrhistmatch.py +494 -0
- niwrap_mrtrix/mrtrix/mrhistogram.py +484 -0
- niwrap_mrtrix/mrtrix/mrinfo.py +1282 -0
- niwrap_mrtrix/mrtrix/mrmath.py +503 -0
- niwrap_mrtrix/mrtrix/mrmetric.py +525 -0
- niwrap_mrtrix/mrtrix/mrregister.py +2098 -0
- niwrap_mrtrix/mrtrix/mrstats.py +534 -0
- niwrap_mrtrix/mrtrix/mrthreshold.py +666 -0
- niwrap_mrtrix/mrtrix/mrtransform.py +1372 -0
- niwrap_mrtrix/mrtrix/mtnormalise.py +725 -0
- niwrap_mrtrix/mrtrix/peaks2amp.py +403 -0
- niwrap_mrtrix/mrtrix/peaks2fixel.py +422 -0
- niwrap_mrtrix/mrtrix/responsemean.py +385 -0
- niwrap_mrtrix/mrtrix/sh2amp.py +844 -0
- niwrap_mrtrix/mrtrix/sh2peaks.py +632 -0
- niwrap_mrtrix/mrtrix/sh2power.py +427 -0
- niwrap_mrtrix/mrtrix/sh2response.py +481 -0
- niwrap_mrtrix/mrtrix/shbasis.py +445 -0
- niwrap_mrtrix/mrtrix/shconv.py +661 -0
- niwrap_mrtrix/mrtrix/tck2connectome.py +727 -0
- niwrap_mrtrix/mrtrix/tck2fixel.py +447 -0
- niwrap_mrtrix/mrtrix/tckconvert.py +775 -0
- niwrap_mrtrix/mrtrix/tckdfc.py +684 -0
- niwrap_mrtrix/mrtrix/tckedit.py +1478 -0
- niwrap_mrtrix/mrtrix/tckgen.py +2733 -0
- niwrap_mrtrix/mrtrix/tckglobal.py +944 -0
- niwrap_mrtrix/mrtrix/tckinfo.py +402 -0
- niwrap_mrtrix/mrtrix/tckmap.py +1004 -0
- niwrap_mrtrix/mrtrix/tckresample.py +760 -0
- niwrap_mrtrix/mrtrix/tcksample.py +497 -0
- niwrap_mrtrix/mrtrix/tcksift.py +739 -0
- niwrap_mrtrix/mrtrix/tcksift2.py +902 -0
- niwrap_mrtrix/mrtrix/tckstats.py +550 -0
- niwrap_mrtrix/mrtrix/tcktransform.py +414 -0
- niwrap_mrtrix/mrtrix/tensor2metric.py +659 -0
- niwrap_mrtrix/mrtrix/transformcalc.py +421 -0
- niwrap_mrtrix/mrtrix/transformcompose.py +625 -0
- niwrap_mrtrix/mrtrix/transformconvert.py +423 -0
- niwrap_mrtrix/mrtrix/tsfdivide.py +414 -0
- niwrap_mrtrix/mrtrix/tsfinfo.py +421 -0
- niwrap_mrtrix/mrtrix/tsfmult.py +401 -0
- niwrap_mrtrix/mrtrix/tsfsmooth.py +420 -0
- niwrap_mrtrix/mrtrix/tsfthreshold.py +428 -0
- niwrap_mrtrix/mrtrix/tsfvalidate.py +398 -0
- niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +432 -0
- niwrap_mrtrix/mrtrix/v_5tt2vis.py +505 -0
- niwrap_mrtrix/mrtrix/v_5ttcheck.py +409 -0
- niwrap_mrtrix/mrtrix/v_5ttedit.py +513 -0
- niwrap_mrtrix/mrtrix/v_5ttgen.py +1107 -0
- niwrap_mrtrix/mrtrix/vectorstats.py +736 -0
- niwrap_mrtrix/mrtrix/voxel2fixel.py +430 -0
- niwrap_mrtrix/mrtrix/voxel2mesh.py +454 -0
- niwrap_mrtrix/mrtrix/warp2metric.py +556 -0
- niwrap_mrtrix/mrtrix/warpconvert.py +498 -0
- niwrap_mrtrix/mrtrix/warpcorrect.py +448 -0
- niwrap_mrtrix/mrtrix/warpinit.py +425 -0
- niwrap_mrtrix/mrtrix/warpinvert.py +448 -0
- niwrap_mrtrix-0.8.0.dist-info/METADATA +8 -0
- niwrap_mrtrix-0.8.0.dist-info/RECORD +119 -0
- niwrap_mrtrix-0.8.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,2098 @@
|
|
|
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
|
+
MRREGISTER_METADATA = Metadata(
|
|
9
|
+
id="33094a24a1ceaa262f78a671f02e86741a74a3db.boutiques",
|
|
10
|
+
name="mrregister",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
_MrregisterTransformedParamsDictNoTag = typing.TypedDict('_MrregisterTransformedParamsDictNoTag', {
|
|
17
|
+
"image": str,
|
|
18
|
+
})
|
|
19
|
+
MrregisterTransformedParamsDictTagged = typing.TypedDict('MrregisterTransformedParamsDictTagged', {
|
|
20
|
+
"@type": typing.Literal["transformed"],
|
|
21
|
+
"image": str,
|
|
22
|
+
})
|
|
23
|
+
MrregisterTransformedParamsDict = _MrregisterTransformedParamsDictNoTag | MrregisterTransformedParamsDictTagged
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
_MrregisterTransformedMidwayParamsDictNoTag = typing.TypedDict('_MrregisterTransformedMidwayParamsDictNoTag', {
|
|
27
|
+
"image1_transformed": str,
|
|
28
|
+
"image2_transformed": str,
|
|
29
|
+
})
|
|
30
|
+
MrregisterTransformedMidwayParamsDictTagged = typing.TypedDict('MrregisterTransformedMidwayParamsDictTagged', {
|
|
31
|
+
"@type": typing.Literal["transformed_midway"],
|
|
32
|
+
"image1_transformed": str,
|
|
33
|
+
"image2_transformed": str,
|
|
34
|
+
})
|
|
35
|
+
MrregisterTransformedMidwayParamsDict = _MrregisterTransformedMidwayParamsDictNoTag | MrregisterTransformedMidwayParamsDictTagged
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
_MrregisterNlWarpParamsDictNoTag = typing.TypedDict('_MrregisterNlWarpParamsDictNoTag', {
|
|
39
|
+
"warp1": str,
|
|
40
|
+
"warp2": str,
|
|
41
|
+
})
|
|
42
|
+
MrregisterNlWarpParamsDictTagged = typing.TypedDict('MrregisterNlWarpParamsDictTagged', {
|
|
43
|
+
"@type": typing.Literal["nl_warp"],
|
|
44
|
+
"warp1": str,
|
|
45
|
+
"warp2": str,
|
|
46
|
+
})
|
|
47
|
+
MrregisterNlWarpParamsDict = _MrregisterNlWarpParamsDictNoTag | MrregisterNlWarpParamsDictTagged
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
_MrregisterConfigParamsDictNoTag = typing.TypedDict('_MrregisterConfigParamsDictNoTag', {
|
|
51
|
+
"key": str,
|
|
52
|
+
"value": str,
|
|
53
|
+
})
|
|
54
|
+
MrregisterConfigParamsDictTagged = typing.TypedDict('MrregisterConfigParamsDictTagged', {
|
|
55
|
+
"@type": typing.Literal["config"],
|
|
56
|
+
"key": str,
|
|
57
|
+
"value": str,
|
|
58
|
+
})
|
|
59
|
+
MrregisterConfigParamsDict = _MrregisterConfigParamsDictNoTag | MrregisterConfigParamsDictTagged
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
_MrregisterParamsDictNoTag = typing.TypedDict('_MrregisterParamsDictNoTag', {
|
|
63
|
+
"type": typing.NotRequired[str | None],
|
|
64
|
+
"transformed": typing.NotRequired[list[MrregisterTransformedParamsDict] | None],
|
|
65
|
+
"transformed_midway": typing.NotRequired[list[MrregisterTransformedMidwayParamsDict] | None],
|
|
66
|
+
"mask1": typing.NotRequired[InputPathType | None],
|
|
67
|
+
"mask2": typing.NotRequired[InputPathType | None],
|
|
68
|
+
"nan": bool,
|
|
69
|
+
"rigid": typing.NotRequired[str | None],
|
|
70
|
+
"rigid_1tomidway": typing.NotRequired[str | None],
|
|
71
|
+
"rigid_2tomidway": typing.NotRequired[str | None],
|
|
72
|
+
"rigid_init_translation": typing.NotRequired[str | None],
|
|
73
|
+
"rigid_init_rotation": typing.NotRequired[str | None],
|
|
74
|
+
"rigid_init_matrix": typing.NotRequired[InputPathType | None],
|
|
75
|
+
"rigid_scale": typing.NotRequired[list[float] | None],
|
|
76
|
+
"rigid_niter": typing.NotRequired[list[int] | None],
|
|
77
|
+
"rigid_metric": typing.NotRequired[str | None],
|
|
78
|
+
"rigid_metric_diff_estimator": typing.NotRequired[str | None],
|
|
79
|
+
"rigid_lmax": typing.NotRequired[list[int] | None],
|
|
80
|
+
"rigid_log": typing.NotRequired[str | None],
|
|
81
|
+
"affine": typing.NotRequired[str | None],
|
|
82
|
+
"affine_1tomidway": typing.NotRequired[str | None],
|
|
83
|
+
"affine_2tomidway": typing.NotRequired[str | None],
|
|
84
|
+
"affine_init_translation": typing.NotRequired[str | None],
|
|
85
|
+
"affine_init_rotation": typing.NotRequired[str | None],
|
|
86
|
+
"affine_init_matrix": typing.NotRequired[InputPathType | None],
|
|
87
|
+
"affine_scale": typing.NotRequired[list[float] | None],
|
|
88
|
+
"affine_niter": typing.NotRequired[list[int] | None],
|
|
89
|
+
"affine_metric": typing.NotRequired[str | None],
|
|
90
|
+
"affine_metric_diff_estimator": typing.NotRequired[str | None],
|
|
91
|
+
"affine_lmax": typing.NotRequired[list[int] | None],
|
|
92
|
+
"affine_log": typing.NotRequired[str | None],
|
|
93
|
+
"init_translation_unmasked1": bool,
|
|
94
|
+
"init_translation_unmasked2": bool,
|
|
95
|
+
"init_rotation_unmasked1": bool,
|
|
96
|
+
"init_rotation_unmasked2": bool,
|
|
97
|
+
"init_rotation_search_angles": typing.NotRequired[list[float] | None],
|
|
98
|
+
"init_rotation_search_scale": typing.NotRequired[float | None],
|
|
99
|
+
"init_rotation_search_directions": typing.NotRequired[int | None],
|
|
100
|
+
"init_rotation_search_run_global": bool,
|
|
101
|
+
"init_rotation_search_global_iterations": typing.NotRequired[int | None],
|
|
102
|
+
"linstage_iterations": typing.NotRequired[list[int] | None],
|
|
103
|
+
"linstage_optimiser_first": typing.NotRequired[str | None],
|
|
104
|
+
"linstage_optimiser_last": typing.NotRequired[str | None],
|
|
105
|
+
"linstage_optimiser_default": typing.NotRequired[str | None],
|
|
106
|
+
"linstage_diagnostics_prefix": typing.NotRequired[str | None],
|
|
107
|
+
"nl_warp": typing.NotRequired[MrregisterNlWarpParamsDict | None],
|
|
108
|
+
"nl_warp_full": typing.NotRequired[str | None],
|
|
109
|
+
"nl_init": typing.NotRequired[InputPathType | None],
|
|
110
|
+
"nl_scale": typing.NotRequired[list[float] | None],
|
|
111
|
+
"nl_niter": typing.NotRequired[list[int] | None],
|
|
112
|
+
"nl_update_smooth": typing.NotRequired[float | None],
|
|
113
|
+
"nl_disp_smooth": typing.NotRequired[float | None],
|
|
114
|
+
"nl_grad_step": typing.NotRequired[float | None],
|
|
115
|
+
"nl_lmax": typing.NotRequired[list[int] | None],
|
|
116
|
+
"diagnostics_image": typing.NotRequired[str | None],
|
|
117
|
+
"directions": typing.NotRequired[InputPathType | None],
|
|
118
|
+
"noreorientation": bool,
|
|
119
|
+
"mc_weights": typing.NotRequired[list[float] | None],
|
|
120
|
+
"datatype": typing.NotRequired[str | None],
|
|
121
|
+
"info": bool,
|
|
122
|
+
"quiet": bool,
|
|
123
|
+
"debug": bool,
|
|
124
|
+
"force": bool,
|
|
125
|
+
"nthreads": typing.NotRequired[int | None],
|
|
126
|
+
"config": typing.NotRequired[list[MrregisterConfigParamsDict] | None],
|
|
127
|
+
"help": bool,
|
|
128
|
+
"version": bool,
|
|
129
|
+
"image1_image2": InputPathType,
|
|
130
|
+
"contrast1_contrast2": typing.NotRequired[list[InputPathType] | None],
|
|
131
|
+
})
|
|
132
|
+
MrregisterParamsDictTagged = typing.TypedDict('MrregisterParamsDictTagged', {
|
|
133
|
+
"@type": typing.Literal["mrtrix/mrregister"],
|
|
134
|
+
"type": typing.NotRequired[str | None],
|
|
135
|
+
"transformed": typing.NotRequired[list[MrregisterTransformedParamsDict] | None],
|
|
136
|
+
"transformed_midway": typing.NotRequired[list[MrregisterTransformedMidwayParamsDict] | None],
|
|
137
|
+
"mask1": typing.NotRequired[InputPathType | None],
|
|
138
|
+
"mask2": typing.NotRequired[InputPathType | None],
|
|
139
|
+
"nan": bool,
|
|
140
|
+
"rigid": typing.NotRequired[str | None],
|
|
141
|
+
"rigid_1tomidway": typing.NotRequired[str | None],
|
|
142
|
+
"rigid_2tomidway": typing.NotRequired[str | None],
|
|
143
|
+
"rigid_init_translation": typing.NotRequired[str | None],
|
|
144
|
+
"rigid_init_rotation": typing.NotRequired[str | None],
|
|
145
|
+
"rigid_init_matrix": typing.NotRequired[InputPathType | None],
|
|
146
|
+
"rigid_scale": typing.NotRequired[list[float] | None],
|
|
147
|
+
"rigid_niter": typing.NotRequired[list[int] | None],
|
|
148
|
+
"rigid_metric": typing.NotRequired[str | None],
|
|
149
|
+
"rigid_metric_diff_estimator": typing.NotRequired[str | None],
|
|
150
|
+
"rigid_lmax": typing.NotRequired[list[int] | None],
|
|
151
|
+
"rigid_log": typing.NotRequired[str | None],
|
|
152
|
+
"affine": typing.NotRequired[str | None],
|
|
153
|
+
"affine_1tomidway": typing.NotRequired[str | None],
|
|
154
|
+
"affine_2tomidway": typing.NotRequired[str | None],
|
|
155
|
+
"affine_init_translation": typing.NotRequired[str | None],
|
|
156
|
+
"affine_init_rotation": typing.NotRequired[str | None],
|
|
157
|
+
"affine_init_matrix": typing.NotRequired[InputPathType | None],
|
|
158
|
+
"affine_scale": typing.NotRequired[list[float] | None],
|
|
159
|
+
"affine_niter": typing.NotRequired[list[int] | None],
|
|
160
|
+
"affine_metric": typing.NotRequired[str | None],
|
|
161
|
+
"affine_metric_diff_estimator": typing.NotRequired[str | None],
|
|
162
|
+
"affine_lmax": typing.NotRequired[list[int] | None],
|
|
163
|
+
"affine_log": typing.NotRequired[str | None],
|
|
164
|
+
"init_translation_unmasked1": bool,
|
|
165
|
+
"init_translation_unmasked2": bool,
|
|
166
|
+
"init_rotation_unmasked1": bool,
|
|
167
|
+
"init_rotation_unmasked2": bool,
|
|
168
|
+
"init_rotation_search_angles": typing.NotRequired[list[float] | None],
|
|
169
|
+
"init_rotation_search_scale": typing.NotRequired[float | None],
|
|
170
|
+
"init_rotation_search_directions": typing.NotRequired[int | None],
|
|
171
|
+
"init_rotation_search_run_global": bool,
|
|
172
|
+
"init_rotation_search_global_iterations": typing.NotRequired[int | None],
|
|
173
|
+
"linstage_iterations": typing.NotRequired[list[int] | None],
|
|
174
|
+
"linstage_optimiser_first": typing.NotRequired[str | None],
|
|
175
|
+
"linstage_optimiser_last": typing.NotRequired[str | None],
|
|
176
|
+
"linstage_optimiser_default": typing.NotRequired[str | None],
|
|
177
|
+
"linstage_diagnostics_prefix": typing.NotRequired[str | None],
|
|
178
|
+
"nl_warp": typing.NotRequired[MrregisterNlWarpParamsDict | None],
|
|
179
|
+
"nl_warp_full": typing.NotRequired[str | None],
|
|
180
|
+
"nl_init": typing.NotRequired[InputPathType | None],
|
|
181
|
+
"nl_scale": typing.NotRequired[list[float] | None],
|
|
182
|
+
"nl_niter": typing.NotRequired[list[int] | None],
|
|
183
|
+
"nl_update_smooth": typing.NotRequired[float | None],
|
|
184
|
+
"nl_disp_smooth": typing.NotRequired[float | None],
|
|
185
|
+
"nl_grad_step": typing.NotRequired[float | None],
|
|
186
|
+
"nl_lmax": typing.NotRequired[list[int] | None],
|
|
187
|
+
"diagnostics_image": typing.NotRequired[str | None],
|
|
188
|
+
"directions": typing.NotRequired[InputPathType | None],
|
|
189
|
+
"noreorientation": bool,
|
|
190
|
+
"mc_weights": typing.NotRequired[list[float] | None],
|
|
191
|
+
"datatype": typing.NotRequired[str | None],
|
|
192
|
+
"info": bool,
|
|
193
|
+
"quiet": bool,
|
|
194
|
+
"debug": bool,
|
|
195
|
+
"force": bool,
|
|
196
|
+
"nthreads": typing.NotRequired[int | None],
|
|
197
|
+
"config": typing.NotRequired[list[MrregisterConfigParamsDict] | None],
|
|
198
|
+
"help": bool,
|
|
199
|
+
"version": bool,
|
|
200
|
+
"image1_image2": InputPathType,
|
|
201
|
+
"contrast1_contrast2": typing.NotRequired[list[InputPathType] | None],
|
|
202
|
+
})
|
|
203
|
+
MrregisterParamsDict = _MrregisterParamsDictNoTag | MrregisterParamsDictTagged
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
class MrregisterTransformedOutputs(typing.NamedTuple):
|
|
207
|
+
"""
|
|
208
|
+
Output object returned when calling `list[MrregisterTransformedParamsDict] | None(...)`.
|
|
209
|
+
"""
|
|
210
|
+
root: OutputPathType
|
|
211
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
212
|
+
image: OutputPathType
|
|
213
|
+
"""image1 after registration transformed and regridded to the space of
|
|
214
|
+
image2. Note that -transformed needs to be repeated for each contrast if
|
|
215
|
+
multi-contrast registration is used."""
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def mrregister_transformed(
|
|
219
|
+
image: str,
|
|
220
|
+
) -> MrregisterTransformedParamsDictTagged:
|
|
221
|
+
"""
|
|
222
|
+
Build parameters.
|
|
223
|
+
|
|
224
|
+
Args:
|
|
225
|
+
image: image1 after registration transformed and regridded to the space\
|
|
226
|
+
of image2. Note that -transformed needs to be repeated for each\
|
|
227
|
+
contrast if multi-contrast registration is used.
|
|
228
|
+
Returns:
|
|
229
|
+
Parameter dictionary
|
|
230
|
+
"""
|
|
231
|
+
params = {
|
|
232
|
+
"@type": "transformed",
|
|
233
|
+
"image": image,
|
|
234
|
+
}
|
|
235
|
+
return params
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
def mrregister_transformed_validate(
|
|
239
|
+
params: typing.Any,
|
|
240
|
+
) -> None:
|
|
241
|
+
"""
|
|
242
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
243
|
+
`MrregisterTransformedParamsDict` object.
|
|
244
|
+
|
|
245
|
+
Args:
|
|
246
|
+
params: The parameters object to validate.
|
|
247
|
+
"""
|
|
248
|
+
if params is None or not isinstance(params, dict):
|
|
249
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
250
|
+
if params.get("image", None) is None:
|
|
251
|
+
raise StyxValidationError("`image` must not be None")
|
|
252
|
+
if not isinstance(params["image"], str):
|
|
253
|
+
raise StyxValidationError(f'`image` has the wrong type: Received `{type(params.get("image", None))}` expected `str`')
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
def mrregister_transformed_cargs(
|
|
257
|
+
params: MrregisterTransformedParamsDict,
|
|
258
|
+
execution: Execution,
|
|
259
|
+
) -> list[str]:
|
|
260
|
+
"""
|
|
261
|
+
Build command-line arguments from parameters.
|
|
262
|
+
|
|
263
|
+
Args:
|
|
264
|
+
params: The parameters.
|
|
265
|
+
execution: The execution object for resolving input paths.
|
|
266
|
+
Returns:
|
|
267
|
+
Command-line arguments.
|
|
268
|
+
"""
|
|
269
|
+
cargs = []
|
|
270
|
+
cargs.append("-transformed")
|
|
271
|
+
cargs.append(params.get("image", None))
|
|
272
|
+
return cargs
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
def mrregister_transformed_outputs(
|
|
276
|
+
params: MrregisterTransformedParamsDict,
|
|
277
|
+
execution: Execution,
|
|
278
|
+
) -> MrregisterTransformedOutputs:
|
|
279
|
+
"""
|
|
280
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
281
|
+
|
|
282
|
+
Args:
|
|
283
|
+
params: The parameters.
|
|
284
|
+
execution: The execution object for resolving input paths.
|
|
285
|
+
Returns:
|
|
286
|
+
Outputs object.
|
|
287
|
+
"""
|
|
288
|
+
ret = MrregisterTransformedOutputs(
|
|
289
|
+
root=execution.output_file("."),
|
|
290
|
+
image=execution.output_file(params.get("image", None)),
|
|
291
|
+
)
|
|
292
|
+
return ret
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
class MrregisterTransformedMidwayOutputs(typing.NamedTuple):
|
|
296
|
+
"""
|
|
297
|
+
Output object returned when calling `list[MrregisterTransformedMidwayParamsDict] | None(...)`.
|
|
298
|
+
"""
|
|
299
|
+
root: OutputPathType
|
|
300
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
301
|
+
image1_transformed: OutputPathType
|
|
302
|
+
"""image1 and image2 after registration transformed and regridded to the
|
|
303
|
+
midway space. Note that -transformed_midway needs to be repeated for each
|
|
304
|
+
contrast if multi-contrast registration is used."""
|
|
305
|
+
image2_transformed: OutputPathType
|
|
306
|
+
"""image1 and image2 after registration transformed and regridded to the
|
|
307
|
+
midway space. Note that -transformed_midway needs to be repeated for each
|
|
308
|
+
contrast if multi-contrast registration is used."""
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
def mrregister_transformed_midway(
|
|
312
|
+
image1_transformed: str,
|
|
313
|
+
image2_transformed: str,
|
|
314
|
+
) -> MrregisterTransformedMidwayParamsDictTagged:
|
|
315
|
+
"""
|
|
316
|
+
Build parameters.
|
|
317
|
+
|
|
318
|
+
Args:
|
|
319
|
+
image1_transformed: image1 and image2 after registration transformed\
|
|
320
|
+
and regridded to the midway space. Note that -transformed_midway needs\
|
|
321
|
+
to be repeated for each contrast if multi-contrast registration is\
|
|
322
|
+
used.
|
|
323
|
+
image2_transformed: image1 and image2 after registration transformed\
|
|
324
|
+
and regridded to the midway space. Note that -transformed_midway needs\
|
|
325
|
+
to be repeated for each contrast if multi-contrast registration is\
|
|
326
|
+
used.
|
|
327
|
+
Returns:
|
|
328
|
+
Parameter dictionary
|
|
329
|
+
"""
|
|
330
|
+
params = {
|
|
331
|
+
"@type": "transformed_midway",
|
|
332
|
+
"image1_transformed": image1_transformed,
|
|
333
|
+
"image2_transformed": image2_transformed,
|
|
334
|
+
}
|
|
335
|
+
return params
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
def mrregister_transformed_midway_validate(
|
|
339
|
+
params: typing.Any,
|
|
340
|
+
) -> None:
|
|
341
|
+
"""
|
|
342
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
343
|
+
`MrregisterTransformedMidwayParamsDict` object.
|
|
344
|
+
|
|
345
|
+
Args:
|
|
346
|
+
params: The parameters object to validate.
|
|
347
|
+
"""
|
|
348
|
+
if params is None or not isinstance(params, dict):
|
|
349
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
350
|
+
if params.get("image1_transformed", None) is None:
|
|
351
|
+
raise StyxValidationError("`image1_transformed` must not be None")
|
|
352
|
+
if not isinstance(params["image1_transformed"], str):
|
|
353
|
+
raise StyxValidationError(f'`image1_transformed` has the wrong type: Received `{type(params.get("image1_transformed", None))}` expected `str`')
|
|
354
|
+
if params.get("image2_transformed", None) is None:
|
|
355
|
+
raise StyxValidationError("`image2_transformed` must not be None")
|
|
356
|
+
if not isinstance(params["image2_transformed"], str):
|
|
357
|
+
raise StyxValidationError(f'`image2_transformed` has the wrong type: Received `{type(params.get("image2_transformed", None))}` expected `str`')
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
def mrregister_transformed_midway_cargs(
|
|
361
|
+
params: MrregisterTransformedMidwayParamsDict,
|
|
362
|
+
execution: Execution,
|
|
363
|
+
) -> list[str]:
|
|
364
|
+
"""
|
|
365
|
+
Build command-line arguments from parameters.
|
|
366
|
+
|
|
367
|
+
Args:
|
|
368
|
+
params: The parameters.
|
|
369
|
+
execution: The execution object for resolving input paths.
|
|
370
|
+
Returns:
|
|
371
|
+
Command-line arguments.
|
|
372
|
+
"""
|
|
373
|
+
cargs = []
|
|
374
|
+
cargs.append("-transformed_midway")
|
|
375
|
+
cargs.append(params.get("image1_transformed", None))
|
|
376
|
+
cargs.append(params.get("image2_transformed", None))
|
|
377
|
+
return cargs
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
def mrregister_transformed_midway_outputs(
|
|
381
|
+
params: MrregisterTransformedMidwayParamsDict,
|
|
382
|
+
execution: Execution,
|
|
383
|
+
) -> MrregisterTransformedMidwayOutputs:
|
|
384
|
+
"""
|
|
385
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
386
|
+
|
|
387
|
+
Args:
|
|
388
|
+
params: The parameters.
|
|
389
|
+
execution: The execution object for resolving input paths.
|
|
390
|
+
Returns:
|
|
391
|
+
Outputs object.
|
|
392
|
+
"""
|
|
393
|
+
ret = MrregisterTransformedMidwayOutputs(
|
|
394
|
+
root=execution.output_file("."),
|
|
395
|
+
image1_transformed=execution.output_file(params.get("image1_transformed", None)),
|
|
396
|
+
image2_transformed=execution.output_file(params.get("image2_transformed", None)),
|
|
397
|
+
)
|
|
398
|
+
return ret
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
class MrregisterNlWarpOutputs(typing.NamedTuple):
|
|
402
|
+
"""
|
|
403
|
+
Output object returned when calling `MrregisterNlWarpParamsDict | None(...)`.
|
|
404
|
+
"""
|
|
405
|
+
root: OutputPathType
|
|
406
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
407
|
+
warp1: OutputPathType
|
|
408
|
+
"""the non-linear warp output defined as two deformation fields, where warp1
|
|
409
|
+
can be used to transform image1->image2 and warp2 to transform
|
|
410
|
+
image2->image1. The deformation fields also encapsulate any linear
|
|
411
|
+
transformation estimated prior to non-linear registration."""
|
|
412
|
+
warp2: OutputPathType
|
|
413
|
+
"""the non-linear warp output defined as two deformation fields, where warp1
|
|
414
|
+
can be used to transform image1->image2 and warp2 to transform
|
|
415
|
+
image2->image1. The deformation fields also encapsulate any linear
|
|
416
|
+
transformation estimated prior to non-linear registration."""
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
def mrregister_nl_warp(
|
|
420
|
+
warp1: str,
|
|
421
|
+
warp2: str,
|
|
422
|
+
) -> MrregisterNlWarpParamsDictTagged:
|
|
423
|
+
"""
|
|
424
|
+
Build parameters.
|
|
425
|
+
|
|
426
|
+
Args:
|
|
427
|
+
warp1: the non-linear warp output defined as two deformation fields,\
|
|
428
|
+
where warp1 can be used to transform image1->image2 and warp2 to\
|
|
429
|
+
transform image2->image1. The deformation fields also encapsulate any\
|
|
430
|
+
linear transformation estimated prior to non-linear registration.
|
|
431
|
+
warp2: the non-linear warp output defined as two deformation fields,\
|
|
432
|
+
where warp1 can be used to transform image1->image2 and warp2 to\
|
|
433
|
+
transform image2->image1. The deformation fields also encapsulate any\
|
|
434
|
+
linear transformation estimated prior to non-linear registration.
|
|
435
|
+
Returns:
|
|
436
|
+
Parameter dictionary
|
|
437
|
+
"""
|
|
438
|
+
params = {
|
|
439
|
+
"@type": "nl_warp",
|
|
440
|
+
"warp1": warp1,
|
|
441
|
+
"warp2": warp2,
|
|
442
|
+
}
|
|
443
|
+
return params
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
def mrregister_nl_warp_validate(
|
|
447
|
+
params: typing.Any,
|
|
448
|
+
) -> None:
|
|
449
|
+
"""
|
|
450
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
451
|
+
`MrregisterNlWarpParamsDict` object.
|
|
452
|
+
|
|
453
|
+
Args:
|
|
454
|
+
params: The parameters object to validate.
|
|
455
|
+
"""
|
|
456
|
+
if params is None or not isinstance(params, dict):
|
|
457
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
458
|
+
if params.get("warp1", None) is None:
|
|
459
|
+
raise StyxValidationError("`warp1` must not be None")
|
|
460
|
+
if not isinstance(params["warp1"], str):
|
|
461
|
+
raise StyxValidationError(f'`warp1` has the wrong type: Received `{type(params.get("warp1", None))}` expected `str`')
|
|
462
|
+
if params.get("warp2", None) is None:
|
|
463
|
+
raise StyxValidationError("`warp2` must not be None")
|
|
464
|
+
if not isinstance(params["warp2"], str):
|
|
465
|
+
raise StyxValidationError(f'`warp2` has the wrong type: Received `{type(params.get("warp2", None))}` expected `str`')
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
def mrregister_nl_warp_cargs(
|
|
469
|
+
params: MrregisterNlWarpParamsDict,
|
|
470
|
+
execution: Execution,
|
|
471
|
+
) -> list[str]:
|
|
472
|
+
"""
|
|
473
|
+
Build command-line arguments from parameters.
|
|
474
|
+
|
|
475
|
+
Args:
|
|
476
|
+
params: The parameters.
|
|
477
|
+
execution: The execution object for resolving input paths.
|
|
478
|
+
Returns:
|
|
479
|
+
Command-line arguments.
|
|
480
|
+
"""
|
|
481
|
+
cargs = []
|
|
482
|
+
cargs.append("-nl_warp")
|
|
483
|
+
cargs.append(params.get("warp1", None))
|
|
484
|
+
cargs.append(params.get("warp2", None))
|
|
485
|
+
return cargs
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
def mrregister_nl_warp_outputs(
|
|
489
|
+
params: MrregisterNlWarpParamsDict,
|
|
490
|
+
execution: Execution,
|
|
491
|
+
) -> MrregisterNlWarpOutputs:
|
|
492
|
+
"""
|
|
493
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
494
|
+
|
|
495
|
+
Args:
|
|
496
|
+
params: The parameters.
|
|
497
|
+
execution: The execution object for resolving input paths.
|
|
498
|
+
Returns:
|
|
499
|
+
Outputs object.
|
|
500
|
+
"""
|
|
501
|
+
ret = MrregisterNlWarpOutputs(
|
|
502
|
+
root=execution.output_file("."),
|
|
503
|
+
warp1=execution.output_file(params.get("warp1", None)),
|
|
504
|
+
warp2=execution.output_file(params.get("warp2", None)),
|
|
505
|
+
)
|
|
506
|
+
return ret
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
def mrregister_config(
|
|
510
|
+
key: str,
|
|
511
|
+
value: str,
|
|
512
|
+
) -> MrregisterConfigParamsDictTagged:
|
|
513
|
+
"""
|
|
514
|
+
Build parameters.
|
|
515
|
+
|
|
516
|
+
Args:
|
|
517
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
518
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
519
|
+
Returns:
|
|
520
|
+
Parameter dictionary
|
|
521
|
+
"""
|
|
522
|
+
params = {
|
|
523
|
+
"@type": "config",
|
|
524
|
+
"key": key,
|
|
525
|
+
"value": value,
|
|
526
|
+
}
|
|
527
|
+
return params
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
def mrregister_config_validate(
|
|
531
|
+
params: typing.Any,
|
|
532
|
+
) -> None:
|
|
533
|
+
"""
|
|
534
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
535
|
+
`MrregisterConfigParamsDict` object.
|
|
536
|
+
|
|
537
|
+
Args:
|
|
538
|
+
params: The parameters object to validate.
|
|
539
|
+
"""
|
|
540
|
+
if params is None or not isinstance(params, dict):
|
|
541
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
542
|
+
if params.get("key", None) is None:
|
|
543
|
+
raise StyxValidationError("`key` must not be None")
|
|
544
|
+
if not isinstance(params["key"], str):
|
|
545
|
+
raise StyxValidationError(f'`key` has the wrong type: Received `{type(params.get("key", None))}` expected `str`')
|
|
546
|
+
if params.get("value", None) is None:
|
|
547
|
+
raise StyxValidationError("`value` must not be None")
|
|
548
|
+
if not isinstance(params["value"], str):
|
|
549
|
+
raise StyxValidationError(f'`value` has the wrong type: Received `{type(params.get("value", None))}` expected `str`')
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
def mrregister_config_cargs(
|
|
553
|
+
params: MrregisterConfigParamsDict,
|
|
554
|
+
execution: Execution,
|
|
555
|
+
) -> list[str]:
|
|
556
|
+
"""
|
|
557
|
+
Build command-line arguments from parameters.
|
|
558
|
+
|
|
559
|
+
Args:
|
|
560
|
+
params: The parameters.
|
|
561
|
+
execution: The execution object for resolving input paths.
|
|
562
|
+
Returns:
|
|
563
|
+
Command-line arguments.
|
|
564
|
+
"""
|
|
565
|
+
cargs = []
|
|
566
|
+
cargs.append("-config")
|
|
567
|
+
cargs.append(params.get("key", None))
|
|
568
|
+
cargs.append(params.get("value", None))
|
|
569
|
+
return cargs
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
class MrregisterOutputs(typing.NamedTuple):
|
|
573
|
+
"""
|
|
574
|
+
Output object returned when calling `MrregisterParamsDict(...)`.
|
|
575
|
+
"""
|
|
576
|
+
root: OutputPathType
|
|
577
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
578
|
+
rigid: OutputPathType | None
|
|
579
|
+
"""the output text file containing the rigid transformation as a 4x4 matrix
|
|
580
|
+
"""
|
|
581
|
+
rigid_1tomidway: OutputPathType | None
|
|
582
|
+
"""the output text file containing the rigid transformation that aligns
|
|
583
|
+
image1 to image2 in their common midway space as a 4x4 matrix """
|
|
584
|
+
rigid_2tomidway: OutputPathType | None
|
|
585
|
+
"""the output text file containing the rigid transformation that aligns
|
|
586
|
+
image2 to image1 in their common midway space as a 4x4 matrix """
|
|
587
|
+
rigid_log: OutputPathType | None
|
|
588
|
+
"""write gradient descent parameter evolution to log file """
|
|
589
|
+
affine: OutputPathType | None
|
|
590
|
+
"""the output text file containing the affine transformation as a 4x4 matrix
|
|
591
|
+
"""
|
|
592
|
+
affine_1tomidway: OutputPathType | None
|
|
593
|
+
"""the output text file containing the affine transformation that aligns
|
|
594
|
+
image1 to image2 in their common midway space as a 4x4 matrix """
|
|
595
|
+
affine_2tomidway: OutputPathType | None
|
|
596
|
+
"""the output text file containing the affine transformation that aligns
|
|
597
|
+
image2 to image1 in their common midway space as a 4x4 matrix """
|
|
598
|
+
affine_log: OutputPathType | None
|
|
599
|
+
"""write gradient descent parameter evolution to log file """
|
|
600
|
+
nl_warp_full: OutputPathType | None
|
|
601
|
+
"""output all warps used during registration. This saves four different
|
|
602
|
+
warps that map each image to a midway space and their inverses in a single
|
|
603
|
+
5D image file. The 4th image dimension indexes the x,y,z component of the
|
|
604
|
+
deformation vector and the 5th dimension indexes the field in this order:
|
|
605
|
+
image1->midway, midway->image1, image2->midway, midway->image2. Where
|
|
606
|
+
image1->midway defines the field that maps image1 onto the midway space
|
|
607
|
+
using the reverse convention When linear registration is performed first,
|
|
608
|
+
the estimated linear transform will be included in the comments of the image
|
|
609
|
+
header, and therefore the entire linear and non-linear transform can be
|
|
610
|
+
applied (in either direction) using this output warp file with mrtransform
|
|
611
|
+
"""
|
|
612
|
+
transformed: list[MrregisterTransformedOutputs] | None
|
|
613
|
+
"""Outputs from `mrregister_transformed_outputs`.This is a list of outputs
|
|
614
|
+
with the same length and order as the inputs."""
|
|
615
|
+
transformed_midway: list[MrregisterTransformedMidwayOutputs] | None
|
|
616
|
+
"""Outputs from `mrregister_transformed_midway_outputs`.This is a list of
|
|
617
|
+
outputs with the same length and order as the inputs."""
|
|
618
|
+
nl_warp: MrregisterNlWarpOutputs | None
|
|
619
|
+
"""Outputs from `mrregister_nl_warp_outputs`."""
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
def mrregister_params(
|
|
623
|
+
image1_image2: InputPathType,
|
|
624
|
+
type_: str | None = None,
|
|
625
|
+
transformed: list[MrregisterTransformedParamsDict] | None = None,
|
|
626
|
+
transformed_midway: list[MrregisterTransformedMidwayParamsDict] | None = None,
|
|
627
|
+
mask1: InputPathType | None = None,
|
|
628
|
+
mask2: InputPathType | None = None,
|
|
629
|
+
nan: bool = False,
|
|
630
|
+
rigid: str | None = None,
|
|
631
|
+
rigid_1tomidway: str | None = None,
|
|
632
|
+
rigid_2tomidway: str | None = None,
|
|
633
|
+
rigid_init_translation: str | None = None,
|
|
634
|
+
rigid_init_rotation: str | None = None,
|
|
635
|
+
rigid_init_matrix: InputPathType | None = None,
|
|
636
|
+
rigid_scale: list[float] | None = None,
|
|
637
|
+
rigid_niter: list[int] | None = None,
|
|
638
|
+
rigid_metric: str | None = None,
|
|
639
|
+
rigid_metric_diff_estimator: str | None = None,
|
|
640
|
+
rigid_lmax: list[int] | None = None,
|
|
641
|
+
rigid_log: str | None = None,
|
|
642
|
+
affine: str | None = None,
|
|
643
|
+
affine_1tomidway: str | None = None,
|
|
644
|
+
affine_2tomidway: str | None = None,
|
|
645
|
+
affine_init_translation: str | None = None,
|
|
646
|
+
affine_init_rotation: str | None = None,
|
|
647
|
+
affine_init_matrix: InputPathType | None = None,
|
|
648
|
+
affine_scale: list[float] | None = None,
|
|
649
|
+
affine_niter: list[int] | None = None,
|
|
650
|
+
affine_metric: str | None = None,
|
|
651
|
+
affine_metric_diff_estimator: str | None = None,
|
|
652
|
+
affine_lmax: list[int] | None = None,
|
|
653
|
+
affine_log: str | None = None,
|
|
654
|
+
init_translation_unmasked1: bool = False,
|
|
655
|
+
init_translation_unmasked2: bool = False,
|
|
656
|
+
init_rotation_unmasked1: bool = False,
|
|
657
|
+
init_rotation_unmasked2: bool = False,
|
|
658
|
+
init_rotation_search_angles: list[float] | None = None,
|
|
659
|
+
init_rotation_search_scale: float | None = None,
|
|
660
|
+
init_rotation_search_directions: int | None = None,
|
|
661
|
+
init_rotation_search_run_global: bool = False,
|
|
662
|
+
init_rotation_search_global_iterations: int | None = None,
|
|
663
|
+
linstage_iterations: list[int] | None = None,
|
|
664
|
+
linstage_optimiser_first: str | None = None,
|
|
665
|
+
linstage_optimiser_last: str | None = None,
|
|
666
|
+
linstage_optimiser_default: str | None = None,
|
|
667
|
+
linstage_diagnostics_prefix: str | None = None,
|
|
668
|
+
nl_warp: MrregisterNlWarpParamsDict | None = None,
|
|
669
|
+
nl_warp_full: str | None = None,
|
|
670
|
+
nl_init: InputPathType | None = None,
|
|
671
|
+
nl_scale: list[float] | None = None,
|
|
672
|
+
nl_niter: list[int] | None = None,
|
|
673
|
+
nl_update_smooth: float | None = None,
|
|
674
|
+
nl_disp_smooth: float | None = None,
|
|
675
|
+
nl_grad_step: float | None = None,
|
|
676
|
+
nl_lmax: list[int] | None = None,
|
|
677
|
+
diagnostics_image: str | None = None,
|
|
678
|
+
directions: InputPathType | None = None,
|
|
679
|
+
noreorientation: bool = False,
|
|
680
|
+
mc_weights: list[float] | None = None,
|
|
681
|
+
datatype: str | None = None,
|
|
682
|
+
info: bool = False,
|
|
683
|
+
quiet: bool = False,
|
|
684
|
+
debug: bool = False,
|
|
685
|
+
force: bool = False,
|
|
686
|
+
nthreads: int | None = None,
|
|
687
|
+
config: list[MrregisterConfigParamsDict] | None = None,
|
|
688
|
+
help_: bool = False,
|
|
689
|
+
version: bool = False,
|
|
690
|
+
contrast1_contrast2: list[InputPathType] | None = None,
|
|
691
|
+
) -> MrregisterParamsDictTagged:
|
|
692
|
+
"""
|
|
693
|
+
Build parameters.
|
|
694
|
+
|
|
695
|
+
Args:
|
|
696
|
+
image1_image2: input image 1 ('moving') and input image 2 ('template').
|
|
697
|
+
type_: the registration type. Valid choices are: rigid, affine,\
|
|
698
|
+
nonlinear, rigid_affine, rigid_nonlinear, affine_nonlinear,\
|
|
699
|
+
rigid_affine_nonlinear (Default: affine_nonlinear).
|
|
700
|
+
transformed: image1 after registration transformed and regridded to the\
|
|
701
|
+
space of image2. Note that -transformed needs to be repeated for each\
|
|
702
|
+
contrast if multi-contrast registration is used.
|
|
703
|
+
transformed_midway: image1 and image2 after registration transformed\
|
|
704
|
+
and regridded to the midway space. Note that -transformed_midway needs\
|
|
705
|
+
to be repeated for each contrast if multi-contrast registration is\
|
|
706
|
+
used.
|
|
707
|
+
mask1: a mask to define the region of image1 to use for optimisation.
|
|
708
|
+
mask2: a mask to define the region of image2 to use for optimisation.
|
|
709
|
+
nan: use NaN as out of bounds value. (Default: 0.0).
|
|
710
|
+
rigid: the output text file containing the rigid transformation as a\
|
|
711
|
+
4x4 matrix.
|
|
712
|
+
rigid_1tomidway: the output text file containing the rigid\
|
|
713
|
+
transformation that aligns image1 to image2 in their common midway\
|
|
714
|
+
space as a 4x4 matrix.
|
|
715
|
+
rigid_2tomidway: the output text file containing the rigid\
|
|
716
|
+
transformation that aligns image2 to image1 in their common midway\
|
|
717
|
+
space as a 4x4 matrix.
|
|
718
|
+
rigid_init_translation: initialise the translation and centre of\
|
|
719
|
+
rotation\
|
|
720
|
+
Valid choices are:\
|
|
721
|
+
mass (aligns the centers of mass of both images, default),\
|
|
722
|
+
geometric (aligns geometric image centres) and none.
|
|
723
|
+
rigid_init_rotation: initialise the rotation Valid choices are:\
|
|
724
|
+
search (search for the best rotation using mean squared residuals),\
|
|
725
|
+
moments (rotation based on directions of intensity variance with\
|
|
726
|
+
respect to centre of mass),\
|
|
727
|
+
none (default).
|
|
728
|
+
rigid_init_matrix: initialise either the rigid, affine, or syn\
|
|
729
|
+
registration with the supplied rigid transformation (as a 4x4 matrix in\
|
|
730
|
+
scanner coordinates). Note that this overrides rigid_init_translation\
|
|
731
|
+
and rigid_init_rotation initialisation.
|
|
732
|
+
rigid_scale: use a multi-resolution scheme by defining a scale factor\
|
|
733
|
+
for each level using comma separated values (Default: 0.25,0.5,1.0).
|
|
734
|
+
rigid_niter: the maximum number of gradient descent iterations per\
|
|
735
|
+
stage. This can be specified either as a single number for all\
|
|
736
|
+
multi-resolution levels, or a single value for each level. (Default:\
|
|
737
|
+
1000).
|
|
738
|
+
rigid_metric: valid choices are: diff (intensity differences), Default:\
|
|
739
|
+
diff.
|
|
740
|
+
rigid_metric_diff_estimator: Valid choices are: l1 (least absolute:\
|
|
741
|
+
|x|), l2 (ordinary least squares), lp (least powers: |x|^1.2), Default:\
|
|
742
|
+
l2.
|
|
743
|
+
rigid_lmax: explicitly set the lmax to be used per scale factor in\
|
|
744
|
+
rigid FOD registration. By default FOD registration will use lmax 0,2,4\
|
|
745
|
+
with default scale factors 0.25,0.5,1.0 respectively. Note that no\
|
|
746
|
+
reorientation will be performed with lmax = 0.
|
|
747
|
+
rigid_log: write gradient descent parameter evolution to log file.
|
|
748
|
+
affine: the output text file containing the affine transformation as a\
|
|
749
|
+
4x4 matrix.
|
|
750
|
+
affine_1tomidway: the output text file containing the affine\
|
|
751
|
+
transformation that aligns image1 to image2 in their common midway\
|
|
752
|
+
space as a 4x4 matrix.
|
|
753
|
+
affine_2tomidway: the output text file containing the affine\
|
|
754
|
+
transformation that aligns image2 to image1 in their common midway\
|
|
755
|
+
space as a 4x4 matrix.
|
|
756
|
+
affine_init_translation: initialise the translation and centre of\
|
|
757
|
+
rotation\
|
|
758
|
+
Valid choices are:\
|
|
759
|
+
mass (aligns the centers of mass of both images),\
|
|
760
|
+
geometric (aligns geometric image centres) and none. (Default:\
|
|
761
|
+
mass).
|
|
762
|
+
affine_init_rotation: initialise the rotation Valid choices are:\
|
|
763
|
+
search (search for the best rotation using mean squared residuals),\
|
|
764
|
+
moments (rotation based on directions of intensity variance with\
|
|
765
|
+
respect to centre of mass),\
|
|
766
|
+
none (Default: none).
|
|
767
|
+
affine_init_matrix: initialise either the affine, or syn registration\
|
|
768
|
+
with the supplied affine transformation (as a 4x4 matrix in scanner\
|
|
769
|
+
coordinates). Note that this overrides affine_init_translation and\
|
|
770
|
+
affine_init_rotation initialisation.
|
|
771
|
+
affine_scale: use a multi-resolution scheme by defining a scale factor\
|
|
772
|
+
for each level using comma separated values (Default: 0.25,0.5,1.0).
|
|
773
|
+
affine_niter: the maximum number of gradient descent iterations per\
|
|
774
|
+
stage. This can be specified either as a single number for all\
|
|
775
|
+
multi-resolution levels, or a single value for each level. (Default:\
|
|
776
|
+
1000).
|
|
777
|
+
affine_metric: valid choices are: diff (intensity differences),\
|
|
778
|
+
Default: diff.
|
|
779
|
+
affine_metric_diff_estimator: Valid choices are: l1 (least absolute:\
|
|
780
|
+
|x|), l2 (ordinary least squares), lp (least powers: |x|^1.2), Default:\
|
|
781
|
+
l2.
|
|
782
|
+
affine_lmax: explicitly set the lmax to be used per scale factor in\
|
|
783
|
+
affine FOD registration. By default FOD registration will use lmax\
|
|
784
|
+
0,2,4 with default scale factors 0.25,0.5,1.0 respectively. Note that\
|
|
785
|
+
no reorientation will be performed with lmax = 0.
|
|
786
|
+
affine_log: write gradient descent parameter evolution to log file.
|
|
787
|
+
init_translation_unmasked1: disregard mask1 for the translation\
|
|
788
|
+
initialisation (affects 'mass').
|
|
789
|
+
init_translation_unmasked2: disregard mask2 for the translation\
|
|
790
|
+
initialisation (affects 'mass').
|
|
791
|
+
init_rotation_unmasked1: disregard mask1 for the rotation\
|
|
792
|
+
initialisation (affects 'search' and 'moments').
|
|
793
|
+
init_rotation_unmasked2: disregard mask2 for the rotation\
|
|
794
|
+
initialisation (affects 'search' and 'moments').
|
|
795
|
+
init_rotation_search_angles: rotation angles for the local search in\
|
|
796
|
+
degrees between 0 and 180. (Default: 2,5,10,15,20).
|
|
797
|
+
init_rotation_search_scale: relative size of the images used for the\
|
|
798
|
+
rotation search. (Default: 0.15).
|
|
799
|
+
init_rotation_search_directions: number of rotation axis for local\
|
|
800
|
+
search. (Default: 250).
|
|
801
|
+
init_rotation_search_run_global: perform a global search. (Default:\
|
|
802
|
+
local).
|
|
803
|
+
init_rotation_search_global_iterations: number of rotations to\
|
|
804
|
+
investigate (Default: 10000).
|
|
805
|
+
linstage_iterations: number of iterations for each registration stage,\
|
|
806
|
+
not to be confused with -rigid_niter or -affine_niter. This can be used\
|
|
807
|
+
to generate intermediate diagnostics images\
|
|
808
|
+
(-linstage.diagnostics.prefix) or to change the cost function optimiser\
|
|
809
|
+
during registration (without the need to repeatedly resize the images).\
|
|
810
|
+
(Default: 1 == no repetition).
|
|
811
|
+
linstage_optimiser_first: Cost function optimisation algorithm to use\
|
|
812
|
+
at first iteration of all stages. Valid choices: bbgd (Barzilai-Borwein\
|
|
813
|
+
gradient descent) or gd (simple gradient descent). (Default: bbgd).
|
|
814
|
+
linstage_optimiser_last: Cost function optimisation algorithm to use at\
|
|
815
|
+
last iteration of all stages (if there are more than one). Valid\
|
|
816
|
+
choices: bbgd (Barzilai-Borwein gradient descent) or gd (simple\
|
|
817
|
+
gradient descent). (Default: bbgd).
|
|
818
|
+
linstage_optimiser_default: Cost function optimisation algorithm to use\
|
|
819
|
+
at any stage iteration other than first or last iteration. Valid\
|
|
820
|
+
choices: bbgd (Barzilai-Borwein gradient descent) or gd (simple\
|
|
821
|
+
gradient descent). (Default: bbgd).
|
|
822
|
+
linstage_diagnostics_prefix: generate diagnostics images after every\
|
|
823
|
+
registration stage.
|
|
824
|
+
nl_warp: the non-linear warp output defined as two deformation fields,\
|
|
825
|
+
where warp1 can be used to transform image1->image2 and warp2 to\
|
|
826
|
+
transform image2->image1. The deformation fields also encapsulate any\
|
|
827
|
+
linear transformation estimated prior to non-linear registration.
|
|
828
|
+
nl_warp_full: output all warps used during registration. This saves\
|
|
829
|
+
four different warps that map each image to a midway space and their\
|
|
830
|
+
inverses in a single 5D image file. The 4th image dimension indexes the\
|
|
831
|
+
x,y,z component of the deformation vector and the 5th dimension indexes\
|
|
832
|
+
the field in this order: image1->midway, midway->image1,\
|
|
833
|
+
image2->midway, midway->image2. Where image1->midway defines the field\
|
|
834
|
+
that maps image1 onto the midway space using the reverse convention\
|
|
835
|
+
When linear registration is performed first, the estimated linear\
|
|
836
|
+
transform will be included in the comments of the image header, and\
|
|
837
|
+
therefore the entire linear and non-linear transform can be applied (in\
|
|
838
|
+
either direction) using this output warp file with mrtransform.
|
|
839
|
+
nl_init: initialise the non-linear registration with the supplied warp\
|
|
840
|
+
image. The supplied warp must be in the same format as output using the\
|
|
841
|
+
-nl_warp_full option (i.e. have 4 deformation fields with the linear\
|
|
842
|
+
transforms in the image header).
|
|
843
|
+
nl_scale: use a multi-resolution scheme by defining a scale factor for\
|
|
844
|
+
each level using comma separated values (Default: 0.25,0.5,1.0).
|
|
845
|
+
nl_niter: the maximum number of iterations. This can be specified\
|
|
846
|
+
either as a single number for all multi-resolution levels, or a single\
|
|
847
|
+
value for each level. (Default: 50).
|
|
848
|
+
nl_update_smooth: regularise the gradient update field with Gaussian\
|
|
849
|
+
smoothing (standard deviation in voxel units, Default 2.0).
|
|
850
|
+
nl_disp_smooth: regularise the displacement field with Gaussian\
|
|
851
|
+
smoothing (standard deviation in voxel units, Default 1.0).
|
|
852
|
+
nl_grad_step: the gradient step size for non-linear registration\
|
|
853
|
+
(Default: 0.5).
|
|
854
|
+
nl_lmax: explicitly set the lmax to be used per scale factor in\
|
|
855
|
+
non-linear FOD registration. By default FOD registration will use lmax\
|
|
856
|
+
0,2,4 with default scale factors 0.25,0.5,1.0 respectively. Note that\
|
|
857
|
+
no reorientation will be performed with lmax = 0.
|
|
858
|
+
diagnostics_image: write intermediate images for diagnostics purposes.
|
|
859
|
+
directions: the directions used for FOD reorientation using apodised\
|
|
860
|
+
point spread functions (Default: 60 directions).
|
|
861
|
+
noreorientation: turn off FOD reorientation. Reorientation is on by\
|
|
862
|
+
default if the number of volumes in the 4th dimension corresponds to\
|
|
863
|
+
the number of coefficients in an antipodally symmetric spherical\
|
|
864
|
+
harmonic series (i.e. 6, 15, 28, 45, 66 etc).
|
|
865
|
+
mc_weights: relative weight of images used for multi-contrast\
|
|
866
|
+
registration. Default: 1.0 (equal weighting).
|
|
867
|
+
datatype: specify output image data type. Valid choices are: float32,\
|
|
868
|
+
float32le, float32be, float64, float64le, float64be, int64, uint64,\
|
|
869
|
+
int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
|
|
870
|
+
int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
|
|
871
|
+
cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
|
|
872
|
+
int8, uint8, bit.
|
|
873
|
+
info: display information messages.
|
|
874
|
+
quiet: do not display information messages or progress status;\
|
|
875
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
876
|
+
environment variable to a non-empty string.
|
|
877
|
+
debug: display debugging messages.
|
|
878
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
879
|
+
input and output might cause unexpected behaviour).
|
|
880
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
881
|
+
(set to 0 to disable multi-threading).
|
|
882
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
883
|
+
help_: display this information page and exit.
|
|
884
|
+
version: display version information and exit.
|
|
885
|
+
contrast1_contrast2: optional list of additional input images used as\
|
|
886
|
+
additional contrasts. Can be used multiple times. contrastX and imageX\
|
|
887
|
+
must share the same coordinate system.
|
|
888
|
+
Returns:
|
|
889
|
+
Parameter dictionary
|
|
890
|
+
"""
|
|
891
|
+
params = {
|
|
892
|
+
"@type": "mrtrix/mrregister",
|
|
893
|
+
"nan": nan,
|
|
894
|
+
"init_translation_unmasked1": init_translation_unmasked1,
|
|
895
|
+
"init_translation_unmasked2": init_translation_unmasked2,
|
|
896
|
+
"init_rotation_unmasked1": init_rotation_unmasked1,
|
|
897
|
+
"init_rotation_unmasked2": init_rotation_unmasked2,
|
|
898
|
+
"init_rotation_search_run_global": init_rotation_search_run_global,
|
|
899
|
+
"noreorientation": noreorientation,
|
|
900
|
+
"info": info,
|
|
901
|
+
"quiet": quiet,
|
|
902
|
+
"debug": debug,
|
|
903
|
+
"force": force,
|
|
904
|
+
"help": help_,
|
|
905
|
+
"version": version,
|
|
906
|
+
"image1_image2": image1_image2,
|
|
907
|
+
}
|
|
908
|
+
if type_ is not None:
|
|
909
|
+
params["type"] = type_
|
|
910
|
+
if transformed is not None:
|
|
911
|
+
params["transformed"] = transformed
|
|
912
|
+
if transformed_midway is not None:
|
|
913
|
+
params["transformed_midway"] = transformed_midway
|
|
914
|
+
if mask1 is not None:
|
|
915
|
+
params["mask1"] = mask1
|
|
916
|
+
if mask2 is not None:
|
|
917
|
+
params["mask2"] = mask2
|
|
918
|
+
if rigid is not None:
|
|
919
|
+
params["rigid"] = rigid
|
|
920
|
+
if rigid_1tomidway is not None:
|
|
921
|
+
params["rigid_1tomidway"] = rigid_1tomidway
|
|
922
|
+
if rigid_2tomidway is not None:
|
|
923
|
+
params["rigid_2tomidway"] = rigid_2tomidway
|
|
924
|
+
if rigid_init_translation is not None:
|
|
925
|
+
params["rigid_init_translation"] = rigid_init_translation
|
|
926
|
+
if rigid_init_rotation is not None:
|
|
927
|
+
params["rigid_init_rotation"] = rigid_init_rotation
|
|
928
|
+
if rigid_init_matrix is not None:
|
|
929
|
+
params["rigid_init_matrix"] = rigid_init_matrix
|
|
930
|
+
if rigid_scale is not None:
|
|
931
|
+
params["rigid_scale"] = rigid_scale
|
|
932
|
+
if rigid_niter is not None:
|
|
933
|
+
params["rigid_niter"] = rigid_niter
|
|
934
|
+
if rigid_metric is not None:
|
|
935
|
+
params["rigid_metric"] = rigid_metric
|
|
936
|
+
if rigid_metric_diff_estimator is not None:
|
|
937
|
+
params["rigid_metric_diff_estimator"] = rigid_metric_diff_estimator
|
|
938
|
+
if rigid_lmax is not None:
|
|
939
|
+
params["rigid_lmax"] = rigid_lmax
|
|
940
|
+
if rigid_log is not None:
|
|
941
|
+
params["rigid_log"] = rigid_log
|
|
942
|
+
if affine is not None:
|
|
943
|
+
params["affine"] = affine
|
|
944
|
+
if affine_1tomidway is not None:
|
|
945
|
+
params["affine_1tomidway"] = affine_1tomidway
|
|
946
|
+
if affine_2tomidway is not None:
|
|
947
|
+
params["affine_2tomidway"] = affine_2tomidway
|
|
948
|
+
if affine_init_translation is not None:
|
|
949
|
+
params["affine_init_translation"] = affine_init_translation
|
|
950
|
+
if affine_init_rotation is not None:
|
|
951
|
+
params["affine_init_rotation"] = affine_init_rotation
|
|
952
|
+
if affine_init_matrix is not None:
|
|
953
|
+
params["affine_init_matrix"] = affine_init_matrix
|
|
954
|
+
if affine_scale is not None:
|
|
955
|
+
params["affine_scale"] = affine_scale
|
|
956
|
+
if affine_niter is not None:
|
|
957
|
+
params["affine_niter"] = affine_niter
|
|
958
|
+
if affine_metric is not None:
|
|
959
|
+
params["affine_metric"] = affine_metric
|
|
960
|
+
if affine_metric_diff_estimator is not None:
|
|
961
|
+
params["affine_metric_diff_estimator"] = affine_metric_diff_estimator
|
|
962
|
+
if affine_lmax is not None:
|
|
963
|
+
params["affine_lmax"] = affine_lmax
|
|
964
|
+
if affine_log is not None:
|
|
965
|
+
params["affine_log"] = affine_log
|
|
966
|
+
if init_rotation_search_angles is not None:
|
|
967
|
+
params["init_rotation_search_angles"] = init_rotation_search_angles
|
|
968
|
+
if init_rotation_search_scale is not None:
|
|
969
|
+
params["init_rotation_search_scale"] = init_rotation_search_scale
|
|
970
|
+
if init_rotation_search_directions is not None:
|
|
971
|
+
params["init_rotation_search_directions"] = init_rotation_search_directions
|
|
972
|
+
if init_rotation_search_global_iterations is not None:
|
|
973
|
+
params["init_rotation_search_global_iterations"] = init_rotation_search_global_iterations
|
|
974
|
+
if linstage_iterations is not None:
|
|
975
|
+
params["linstage_iterations"] = linstage_iterations
|
|
976
|
+
if linstage_optimiser_first is not None:
|
|
977
|
+
params["linstage_optimiser_first"] = linstage_optimiser_first
|
|
978
|
+
if linstage_optimiser_last is not None:
|
|
979
|
+
params["linstage_optimiser_last"] = linstage_optimiser_last
|
|
980
|
+
if linstage_optimiser_default is not None:
|
|
981
|
+
params["linstage_optimiser_default"] = linstage_optimiser_default
|
|
982
|
+
if linstage_diagnostics_prefix is not None:
|
|
983
|
+
params["linstage_diagnostics_prefix"] = linstage_diagnostics_prefix
|
|
984
|
+
if nl_warp is not None:
|
|
985
|
+
params["nl_warp"] = nl_warp
|
|
986
|
+
if nl_warp_full is not None:
|
|
987
|
+
params["nl_warp_full"] = nl_warp_full
|
|
988
|
+
if nl_init is not None:
|
|
989
|
+
params["nl_init"] = nl_init
|
|
990
|
+
if nl_scale is not None:
|
|
991
|
+
params["nl_scale"] = nl_scale
|
|
992
|
+
if nl_niter is not None:
|
|
993
|
+
params["nl_niter"] = nl_niter
|
|
994
|
+
if nl_update_smooth is not None:
|
|
995
|
+
params["nl_update_smooth"] = nl_update_smooth
|
|
996
|
+
if nl_disp_smooth is not None:
|
|
997
|
+
params["nl_disp_smooth"] = nl_disp_smooth
|
|
998
|
+
if nl_grad_step is not None:
|
|
999
|
+
params["nl_grad_step"] = nl_grad_step
|
|
1000
|
+
if nl_lmax is not None:
|
|
1001
|
+
params["nl_lmax"] = nl_lmax
|
|
1002
|
+
if diagnostics_image is not None:
|
|
1003
|
+
params["diagnostics_image"] = diagnostics_image
|
|
1004
|
+
if directions is not None:
|
|
1005
|
+
params["directions"] = directions
|
|
1006
|
+
if mc_weights is not None:
|
|
1007
|
+
params["mc_weights"] = mc_weights
|
|
1008
|
+
if datatype is not None:
|
|
1009
|
+
params["datatype"] = datatype
|
|
1010
|
+
if nthreads is not None:
|
|
1011
|
+
params["nthreads"] = nthreads
|
|
1012
|
+
if config is not None:
|
|
1013
|
+
params["config"] = config
|
|
1014
|
+
if contrast1_contrast2 is not None:
|
|
1015
|
+
params["contrast1_contrast2"] = contrast1_contrast2
|
|
1016
|
+
return params
|
|
1017
|
+
|
|
1018
|
+
|
|
1019
|
+
def mrregister_validate(
|
|
1020
|
+
params: typing.Any,
|
|
1021
|
+
) -> None:
|
|
1022
|
+
"""
|
|
1023
|
+
Validate parameters. Throws an error if `params` is not a valid
|
|
1024
|
+
`MrregisterParamsDict` object.
|
|
1025
|
+
|
|
1026
|
+
Args:
|
|
1027
|
+
params: The parameters object to validate.
|
|
1028
|
+
"""
|
|
1029
|
+
if params is None or not isinstance(params, dict):
|
|
1030
|
+
raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
|
|
1031
|
+
if params.get("type", None) is not None:
|
|
1032
|
+
if not isinstance(params["type"], str):
|
|
1033
|
+
raise StyxValidationError(f'`type` has the wrong type: Received `{type(params.get("type", None))}` expected `str | None`')
|
|
1034
|
+
if params.get("transformed", None) is not None:
|
|
1035
|
+
if not isinstance(params["transformed"], list):
|
|
1036
|
+
raise StyxValidationError(f'`transformed` has the wrong type: Received `{type(params.get("transformed", None))}` expected `list[MrregisterTransformedParamsDict] | None`')
|
|
1037
|
+
for e in params["transformed"]:
|
|
1038
|
+
mrregister_transformed_validate(e)
|
|
1039
|
+
if params.get("transformed_midway", None) is not None:
|
|
1040
|
+
if not isinstance(params["transformed_midway"], list):
|
|
1041
|
+
raise StyxValidationError(f'`transformed_midway` has the wrong type: Received `{type(params.get("transformed_midway", None))}` expected `list[MrregisterTransformedMidwayParamsDict] | None`')
|
|
1042
|
+
for e in params["transformed_midway"]:
|
|
1043
|
+
mrregister_transformed_midway_validate(e)
|
|
1044
|
+
if params.get("mask1", None) is not None:
|
|
1045
|
+
if not isinstance(params["mask1"], (pathlib.Path, str)):
|
|
1046
|
+
raise StyxValidationError(f'`mask1` has the wrong type: Received `{type(params.get("mask1", None))}` expected `InputPathType | None`')
|
|
1047
|
+
if params.get("mask2", None) is not None:
|
|
1048
|
+
if not isinstance(params["mask2"], (pathlib.Path, str)):
|
|
1049
|
+
raise StyxValidationError(f'`mask2` has the wrong type: Received `{type(params.get("mask2", None))}` expected `InputPathType | None`')
|
|
1050
|
+
if params.get("nan", False) is None:
|
|
1051
|
+
raise StyxValidationError("`nan` must not be None")
|
|
1052
|
+
if not isinstance(params["nan"], bool):
|
|
1053
|
+
raise StyxValidationError(f'`nan` has the wrong type: Received `{type(params.get("nan", False))}` expected `bool`')
|
|
1054
|
+
if params.get("rigid", None) is not None:
|
|
1055
|
+
if not isinstance(params["rigid"], str):
|
|
1056
|
+
raise StyxValidationError(f'`rigid` has the wrong type: Received `{type(params.get("rigid", None))}` expected `str | None`')
|
|
1057
|
+
if params.get("rigid_1tomidway", None) is not None:
|
|
1058
|
+
if not isinstance(params["rigid_1tomidway"], str):
|
|
1059
|
+
raise StyxValidationError(f'`rigid_1tomidway` has the wrong type: Received `{type(params.get("rigid_1tomidway", None))}` expected `str | None`')
|
|
1060
|
+
if params.get("rigid_2tomidway", None) is not None:
|
|
1061
|
+
if not isinstance(params["rigid_2tomidway"], str):
|
|
1062
|
+
raise StyxValidationError(f'`rigid_2tomidway` has the wrong type: Received `{type(params.get("rigid_2tomidway", None))}` expected `str | None`')
|
|
1063
|
+
if params.get("rigid_init_translation", None) is not None:
|
|
1064
|
+
if not isinstance(params["rigid_init_translation"], str):
|
|
1065
|
+
raise StyxValidationError(f'`rigid_init_translation` has the wrong type: Received `{type(params.get("rigid_init_translation", None))}` expected `str | None`')
|
|
1066
|
+
if params.get("rigid_init_rotation", None) is not None:
|
|
1067
|
+
if not isinstance(params["rigid_init_rotation"], str):
|
|
1068
|
+
raise StyxValidationError(f'`rigid_init_rotation` has the wrong type: Received `{type(params.get("rigid_init_rotation", None))}` expected `str | None`')
|
|
1069
|
+
if params.get("rigid_init_matrix", None) is not None:
|
|
1070
|
+
if not isinstance(params["rigid_init_matrix"], (pathlib.Path, str)):
|
|
1071
|
+
raise StyxValidationError(f'`rigid_init_matrix` has the wrong type: Received `{type(params.get("rigid_init_matrix", None))}` expected `InputPathType | None`')
|
|
1072
|
+
if params.get("rigid_scale", None) is not None:
|
|
1073
|
+
if not isinstance(params["rigid_scale"], list):
|
|
1074
|
+
raise StyxValidationError(f'`rigid_scale` has the wrong type: Received `{type(params.get("rigid_scale", None))}` expected `list[float] | None`')
|
|
1075
|
+
for e in params["rigid_scale"]:
|
|
1076
|
+
if not isinstance(e, (float, int)):
|
|
1077
|
+
raise StyxValidationError(f'`rigid_scale` has the wrong type: Received `{type(params.get("rigid_scale", None))}` expected `list[float] | None`')
|
|
1078
|
+
if params.get("rigid_niter", None) is not None:
|
|
1079
|
+
if not isinstance(params["rigid_niter"], list):
|
|
1080
|
+
raise StyxValidationError(f'`rigid_niter` has the wrong type: Received `{type(params.get("rigid_niter", None))}` expected `list[int] | None`')
|
|
1081
|
+
for e in params["rigid_niter"]:
|
|
1082
|
+
if not isinstance(e, int):
|
|
1083
|
+
raise StyxValidationError(f'`rigid_niter` has the wrong type: Received `{type(params.get("rigid_niter", None))}` expected `list[int] | None`')
|
|
1084
|
+
if params.get("rigid_metric", None) is not None:
|
|
1085
|
+
if not isinstance(params["rigid_metric"], str):
|
|
1086
|
+
raise StyxValidationError(f'`rigid_metric` has the wrong type: Received `{type(params.get("rigid_metric", None))}` expected `str | None`')
|
|
1087
|
+
if params.get("rigid_metric_diff_estimator", None) is not None:
|
|
1088
|
+
if not isinstance(params["rigid_metric_diff_estimator"], str):
|
|
1089
|
+
raise StyxValidationError(f'`rigid_metric_diff_estimator` has the wrong type: Received `{type(params.get("rigid_metric_diff_estimator", None))}` expected `str | None`')
|
|
1090
|
+
if params.get("rigid_lmax", None) is not None:
|
|
1091
|
+
if not isinstance(params["rigid_lmax"], list):
|
|
1092
|
+
raise StyxValidationError(f'`rigid_lmax` has the wrong type: Received `{type(params.get("rigid_lmax", None))}` expected `list[int] | None`')
|
|
1093
|
+
for e in params["rigid_lmax"]:
|
|
1094
|
+
if not isinstance(e, int):
|
|
1095
|
+
raise StyxValidationError(f'`rigid_lmax` has the wrong type: Received `{type(params.get("rigid_lmax", None))}` expected `list[int] | None`')
|
|
1096
|
+
if params.get("rigid_log", None) is not None:
|
|
1097
|
+
if not isinstance(params["rigid_log"], str):
|
|
1098
|
+
raise StyxValidationError(f'`rigid_log` has the wrong type: Received `{type(params.get("rigid_log", None))}` expected `str | None`')
|
|
1099
|
+
if params.get("affine", None) is not None:
|
|
1100
|
+
if not isinstance(params["affine"], str):
|
|
1101
|
+
raise StyxValidationError(f'`affine` has the wrong type: Received `{type(params.get("affine", None))}` expected `str | None`')
|
|
1102
|
+
if params.get("affine_1tomidway", None) is not None:
|
|
1103
|
+
if not isinstance(params["affine_1tomidway"], str):
|
|
1104
|
+
raise StyxValidationError(f'`affine_1tomidway` has the wrong type: Received `{type(params.get("affine_1tomidway", None))}` expected `str | None`')
|
|
1105
|
+
if params.get("affine_2tomidway", None) is not None:
|
|
1106
|
+
if not isinstance(params["affine_2tomidway"], str):
|
|
1107
|
+
raise StyxValidationError(f'`affine_2tomidway` has the wrong type: Received `{type(params.get("affine_2tomidway", None))}` expected `str | None`')
|
|
1108
|
+
if params.get("affine_init_translation", None) is not None:
|
|
1109
|
+
if not isinstance(params["affine_init_translation"], str):
|
|
1110
|
+
raise StyxValidationError(f'`affine_init_translation` has the wrong type: Received `{type(params.get("affine_init_translation", None))}` expected `str | None`')
|
|
1111
|
+
if params.get("affine_init_rotation", None) is not None:
|
|
1112
|
+
if not isinstance(params["affine_init_rotation"], str):
|
|
1113
|
+
raise StyxValidationError(f'`affine_init_rotation` has the wrong type: Received `{type(params.get("affine_init_rotation", None))}` expected `str | None`')
|
|
1114
|
+
if params.get("affine_init_matrix", None) is not None:
|
|
1115
|
+
if not isinstance(params["affine_init_matrix"], (pathlib.Path, str)):
|
|
1116
|
+
raise StyxValidationError(f'`affine_init_matrix` has the wrong type: Received `{type(params.get("affine_init_matrix", None))}` expected `InputPathType | None`')
|
|
1117
|
+
if params.get("affine_scale", None) is not None:
|
|
1118
|
+
if not isinstance(params["affine_scale"], list):
|
|
1119
|
+
raise StyxValidationError(f'`affine_scale` has the wrong type: Received `{type(params.get("affine_scale", None))}` expected `list[float] | None`')
|
|
1120
|
+
for e in params["affine_scale"]:
|
|
1121
|
+
if not isinstance(e, (float, int)):
|
|
1122
|
+
raise StyxValidationError(f'`affine_scale` has the wrong type: Received `{type(params.get("affine_scale", None))}` expected `list[float] | None`')
|
|
1123
|
+
if params.get("affine_niter", None) is not None:
|
|
1124
|
+
if not isinstance(params["affine_niter"], list):
|
|
1125
|
+
raise StyxValidationError(f'`affine_niter` has the wrong type: Received `{type(params.get("affine_niter", None))}` expected `list[int] | None`')
|
|
1126
|
+
for e in params["affine_niter"]:
|
|
1127
|
+
if not isinstance(e, int):
|
|
1128
|
+
raise StyxValidationError(f'`affine_niter` has the wrong type: Received `{type(params.get("affine_niter", None))}` expected `list[int] | None`')
|
|
1129
|
+
if params.get("affine_metric", None) is not None:
|
|
1130
|
+
if not isinstance(params["affine_metric"], str):
|
|
1131
|
+
raise StyxValidationError(f'`affine_metric` has the wrong type: Received `{type(params.get("affine_metric", None))}` expected `str | None`')
|
|
1132
|
+
if params.get("affine_metric_diff_estimator", None) is not None:
|
|
1133
|
+
if not isinstance(params["affine_metric_diff_estimator"], str):
|
|
1134
|
+
raise StyxValidationError(f'`affine_metric_diff_estimator` has the wrong type: Received `{type(params.get("affine_metric_diff_estimator", None))}` expected `str | None`')
|
|
1135
|
+
if params.get("affine_lmax", None) is not None:
|
|
1136
|
+
if not isinstance(params["affine_lmax"], list):
|
|
1137
|
+
raise StyxValidationError(f'`affine_lmax` has the wrong type: Received `{type(params.get("affine_lmax", None))}` expected `list[int] | None`')
|
|
1138
|
+
for e in params["affine_lmax"]:
|
|
1139
|
+
if not isinstance(e, int):
|
|
1140
|
+
raise StyxValidationError(f'`affine_lmax` has the wrong type: Received `{type(params.get("affine_lmax", None))}` expected `list[int] | None`')
|
|
1141
|
+
if params.get("affine_log", None) is not None:
|
|
1142
|
+
if not isinstance(params["affine_log"], str):
|
|
1143
|
+
raise StyxValidationError(f'`affine_log` has the wrong type: Received `{type(params.get("affine_log", None))}` expected `str | None`')
|
|
1144
|
+
if params.get("init_translation_unmasked1", False) is None:
|
|
1145
|
+
raise StyxValidationError("`init_translation_unmasked1` must not be None")
|
|
1146
|
+
if not isinstance(params["init_translation_unmasked1"], bool):
|
|
1147
|
+
raise StyxValidationError(f'`init_translation_unmasked1` has the wrong type: Received `{type(params.get("init_translation_unmasked1", False))}` expected `bool`')
|
|
1148
|
+
if params.get("init_translation_unmasked2", False) is None:
|
|
1149
|
+
raise StyxValidationError("`init_translation_unmasked2` must not be None")
|
|
1150
|
+
if not isinstance(params["init_translation_unmasked2"], bool):
|
|
1151
|
+
raise StyxValidationError(f'`init_translation_unmasked2` has the wrong type: Received `{type(params.get("init_translation_unmasked2", False))}` expected `bool`')
|
|
1152
|
+
if params.get("init_rotation_unmasked1", False) is None:
|
|
1153
|
+
raise StyxValidationError("`init_rotation_unmasked1` must not be None")
|
|
1154
|
+
if not isinstance(params["init_rotation_unmasked1"], bool):
|
|
1155
|
+
raise StyxValidationError(f'`init_rotation_unmasked1` has the wrong type: Received `{type(params.get("init_rotation_unmasked1", False))}` expected `bool`')
|
|
1156
|
+
if params.get("init_rotation_unmasked2", False) is None:
|
|
1157
|
+
raise StyxValidationError("`init_rotation_unmasked2` must not be None")
|
|
1158
|
+
if not isinstance(params["init_rotation_unmasked2"], bool):
|
|
1159
|
+
raise StyxValidationError(f'`init_rotation_unmasked2` has the wrong type: Received `{type(params.get("init_rotation_unmasked2", False))}` expected `bool`')
|
|
1160
|
+
if params.get("init_rotation_search_angles", None) is not None:
|
|
1161
|
+
if not isinstance(params["init_rotation_search_angles"], list):
|
|
1162
|
+
raise StyxValidationError(f'`init_rotation_search_angles` has the wrong type: Received `{type(params.get("init_rotation_search_angles", None))}` expected `list[float] | None`')
|
|
1163
|
+
for e in params["init_rotation_search_angles"]:
|
|
1164
|
+
if not isinstance(e, (float, int)):
|
|
1165
|
+
raise StyxValidationError(f'`init_rotation_search_angles` has the wrong type: Received `{type(params.get("init_rotation_search_angles", None))}` expected `list[float] | None`')
|
|
1166
|
+
if params.get("init_rotation_search_scale", None) is not None:
|
|
1167
|
+
if not isinstance(params["init_rotation_search_scale"], (float, int)):
|
|
1168
|
+
raise StyxValidationError(f'`init_rotation_search_scale` has the wrong type: Received `{type(params.get("init_rotation_search_scale", None))}` expected `float | None`')
|
|
1169
|
+
if params.get("init_rotation_search_directions", None) is not None:
|
|
1170
|
+
if not isinstance(params["init_rotation_search_directions"], int):
|
|
1171
|
+
raise StyxValidationError(f'`init_rotation_search_directions` has the wrong type: Received `{type(params.get("init_rotation_search_directions", None))}` expected `int | None`')
|
|
1172
|
+
if params.get("init_rotation_search_run_global", False) is None:
|
|
1173
|
+
raise StyxValidationError("`init_rotation_search_run_global` must not be None")
|
|
1174
|
+
if not isinstance(params["init_rotation_search_run_global"], bool):
|
|
1175
|
+
raise StyxValidationError(f'`init_rotation_search_run_global` has the wrong type: Received `{type(params.get("init_rotation_search_run_global", False))}` expected `bool`')
|
|
1176
|
+
if params.get("init_rotation_search_global_iterations", None) is not None:
|
|
1177
|
+
if not isinstance(params["init_rotation_search_global_iterations"], int):
|
|
1178
|
+
raise StyxValidationError(f'`init_rotation_search_global_iterations` has the wrong type: Received `{type(params.get("init_rotation_search_global_iterations", None))}` expected `int | None`')
|
|
1179
|
+
if params.get("linstage_iterations", None) is not None:
|
|
1180
|
+
if not isinstance(params["linstage_iterations"], list):
|
|
1181
|
+
raise StyxValidationError(f'`linstage_iterations` has the wrong type: Received `{type(params.get("linstage_iterations", None))}` expected `list[int] | None`')
|
|
1182
|
+
for e in params["linstage_iterations"]:
|
|
1183
|
+
if not isinstance(e, int):
|
|
1184
|
+
raise StyxValidationError(f'`linstage_iterations` has the wrong type: Received `{type(params.get("linstage_iterations", None))}` expected `list[int] | None`')
|
|
1185
|
+
if params.get("linstage_optimiser_first", None) is not None:
|
|
1186
|
+
if not isinstance(params["linstage_optimiser_first"], str):
|
|
1187
|
+
raise StyxValidationError(f'`linstage_optimiser_first` has the wrong type: Received `{type(params.get("linstage_optimiser_first", None))}` expected `str | None`')
|
|
1188
|
+
if params.get("linstage_optimiser_last", None) is not None:
|
|
1189
|
+
if not isinstance(params["linstage_optimiser_last"], str):
|
|
1190
|
+
raise StyxValidationError(f'`linstage_optimiser_last` has the wrong type: Received `{type(params.get("linstage_optimiser_last", None))}` expected `str | None`')
|
|
1191
|
+
if params.get("linstage_optimiser_default", None) is not None:
|
|
1192
|
+
if not isinstance(params["linstage_optimiser_default"], str):
|
|
1193
|
+
raise StyxValidationError(f'`linstage_optimiser_default` has the wrong type: Received `{type(params.get("linstage_optimiser_default", None))}` expected `str | None`')
|
|
1194
|
+
if params.get("linstage_diagnostics_prefix", None) is not None:
|
|
1195
|
+
if not isinstance(params["linstage_diagnostics_prefix"], str):
|
|
1196
|
+
raise StyxValidationError(f'`linstage_diagnostics_prefix` has the wrong type: Received `{type(params.get("linstage_diagnostics_prefix", None))}` expected `str | None`')
|
|
1197
|
+
if params.get("nl_warp", None) is not None:
|
|
1198
|
+
mrregister_nl_warp_validate(params["nl_warp"])
|
|
1199
|
+
if params.get("nl_warp_full", None) is not None:
|
|
1200
|
+
if not isinstance(params["nl_warp_full"], str):
|
|
1201
|
+
raise StyxValidationError(f'`nl_warp_full` has the wrong type: Received `{type(params.get("nl_warp_full", None))}` expected `str | None`')
|
|
1202
|
+
if params.get("nl_init", None) is not None:
|
|
1203
|
+
if not isinstance(params["nl_init"], (pathlib.Path, str)):
|
|
1204
|
+
raise StyxValidationError(f'`nl_init` has the wrong type: Received `{type(params.get("nl_init", None))}` expected `InputPathType | None`')
|
|
1205
|
+
if params.get("nl_scale", None) is not None:
|
|
1206
|
+
if not isinstance(params["nl_scale"], list):
|
|
1207
|
+
raise StyxValidationError(f'`nl_scale` has the wrong type: Received `{type(params.get("nl_scale", None))}` expected `list[float] | None`')
|
|
1208
|
+
for e in params["nl_scale"]:
|
|
1209
|
+
if not isinstance(e, (float, int)):
|
|
1210
|
+
raise StyxValidationError(f'`nl_scale` has the wrong type: Received `{type(params.get("nl_scale", None))}` expected `list[float] | None`')
|
|
1211
|
+
if params.get("nl_niter", None) is not None:
|
|
1212
|
+
if not isinstance(params["nl_niter"], list):
|
|
1213
|
+
raise StyxValidationError(f'`nl_niter` has the wrong type: Received `{type(params.get("nl_niter", None))}` expected `list[int] | None`')
|
|
1214
|
+
for e in params["nl_niter"]:
|
|
1215
|
+
if not isinstance(e, int):
|
|
1216
|
+
raise StyxValidationError(f'`nl_niter` has the wrong type: Received `{type(params.get("nl_niter", None))}` expected `list[int] | None`')
|
|
1217
|
+
if params.get("nl_update_smooth", None) is not None:
|
|
1218
|
+
if not isinstance(params["nl_update_smooth"], (float, int)):
|
|
1219
|
+
raise StyxValidationError(f'`nl_update_smooth` has the wrong type: Received `{type(params.get("nl_update_smooth", None))}` expected `float | None`')
|
|
1220
|
+
if params.get("nl_disp_smooth", None) is not None:
|
|
1221
|
+
if not isinstance(params["nl_disp_smooth"], (float, int)):
|
|
1222
|
+
raise StyxValidationError(f'`nl_disp_smooth` has the wrong type: Received `{type(params.get("nl_disp_smooth", None))}` expected `float | None`')
|
|
1223
|
+
if params.get("nl_grad_step", None) is not None:
|
|
1224
|
+
if not isinstance(params["nl_grad_step"], (float, int)):
|
|
1225
|
+
raise StyxValidationError(f'`nl_grad_step` has the wrong type: Received `{type(params.get("nl_grad_step", None))}` expected `float | None`')
|
|
1226
|
+
if params.get("nl_lmax", None) is not None:
|
|
1227
|
+
if not isinstance(params["nl_lmax"], list):
|
|
1228
|
+
raise StyxValidationError(f'`nl_lmax` has the wrong type: Received `{type(params.get("nl_lmax", None))}` expected `list[int] | None`')
|
|
1229
|
+
for e in params["nl_lmax"]:
|
|
1230
|
+
if not isinstance(e, int):
|
|
1231
|
+
raise StyxValidationError(f'`nl_lmax` has the wrong type: Received `{type(params.get("nl_lmax", None))}` expected `list[int] | None`')
|
|
1232
|
+
if params.get("diagnostics_image", None) is not None:
|
|
1233
|
+
if not isinstance(params["diagnostics_image"], str):
|
|
1234
|
+
raise StyxValidationError(f'`diagnostics_image` has the wrong type: Received `{type(params.get("diagnostics_image", None))}` expected `str | None`')
|
|
1235
|
+
if params.get("directions", None) is not None:
|
|
1236
|
+
if not isinstance(params["directions"], (pathlib.Path, str)):
|
|
1237
|
+
raise StyxValidationError(f'`directions` has the wrong type: Received `{type(params.get("directions", None))}` expected `InputPathType | None`')
|
|
1238
|
+
if params.get("noreorientation", False) is None:
|
|
1239
|
+
raise StyxValidationError("`noreorientation` must not be None")
|
|
1240
|
+
if not isinstance(params["noreorientation"], bool):
|
|
1241
|
+
raise StyxValidationError(f'`noreorientation` has the wrong type: Received `{type(params.get("noreorientation", False))}` expected `bool`')
|
|
1242
|
+
if params.get("mc_weights", None) is not None:
|
|
1243
|
+
if not isinstance(params["mc_weights"], list):
|
|
1244
|
+
raise StyxValidationError(f'`mc_weights` has the wrong type: Received `{type(params.get("mc_weights", None))}` expected `list[float] | None`')
|
|
1245
|
+
for e in params["mc_weights"]:
|
|
1246
|
+
if not isinstance(e, (float, int)):
|
|
1247
|
+
raise StyxValidationError(f'`mc_weights` has the wrong type: Received `{type(params.get("mc_weights", None))}` expected `list[float] | None`')
|
|
1248
|
+
if params.get("datatype", None) is not None:
|
|
1249
|
+
if not isinstance(params["datatype"], str):
|
|
1250
|
+
raise StyxValidationError(f'`datatype` has the wrong type: Received `{type(params.get("datatype", None))}` expected `str | None`')
|
|
1251
|
+
if params.get("info", False) is None:
|
|
1252
|
+
raise StyxValidationError("`info` must not be None")
|
|
1253
|
+
if not isinstance(params["info"], bool):
|
|
1254
|
+
raise StyxValidationError(f'`info` has the wrong type: Received `{type(params.get("info", False))}` expected `bool`')
|
|
1255
|
+
if params.get("quiet", False) is None:
|
|
1256
|
+
raise StyxValidationError("`quiet` must not be None")
|
|
1257
|
+
if not isinstance(params["quiet"], bool):
|
|
1258
|
+
raise StyxValidationError(f'`quiet` has the wrong type: Received `{type(params.get("quiet", False))}` expected `bool`')
|
|
1259
|
+
if params.get("debug", False) is None:
|
|
1260
|
+
raise StyxValidationError("`debug` must not be None")
|
|
1261
|
+
if not isinstance(params["debug"], bool):
|
|
1262
|
+
raise StyxValidationError(f'`debug` has the wrong type: Received `{type(params.get("debug", False))}` expected `bool`')
|
|
1263
|
+
if params.get("force", False) is None:
|
|
1264
|
+
raise StyxValidationError("`force` must not be None")
|
|
1265
|
+
if not isinstance(params["force"], bool):
|
|
1266
|
+
raise StyxValidationError(f'`force` has the wrong type: Received `{type(params.get("force", False))}` expected `bool`')
|
|
1267
|
+
if params.get("nthreads", None) is not None:
|
|
1268
|
+
if not isinstance(params["nthreads"], int):
|
|
1269
|
+
raise StyxValidationError(f'`nthreads` has the wrong type: Received `{type(params.get("nthreads", None))}` expected `int | None`')
|
|
1270
|
+
if params.get("config", None) is not None:
|
|
1271
|
+
if not isinstance(params["config"], list):
|
|
1272
|
+
raise StyxValidationError(f'`config` has the wrong type: Received `{type(params.get("config", None))}` expected `list[MrregisterConfigParamsDict] | None`')
|
|
1273
|
+
for e in params["config"]:
|
|
1274
|
+
mrregister_config_validate(e)
|
|
1275
|
+
if params.get("help", False) is None:
|
|
1276
|
+
raise StyxValidationError("`help` must not be None")
|
|
1277
|
+
if not isinstance(params["help"], bool):
|
|
1278
|
+
raise StyxValidationError(f'`help` has the wrong type: Received `{type(params.get("help", False))}` expected `bool`')
|
|
1279
|
+
if params.get("version", False) is None:
|
|
1280
|
+
raise StyxValidationError("`version` must not be None")
|
|
1281
|
+
if not isinstance(params["version"], bool):
|
|
1282
|
+
raise StyxValidationError(f'`version` has the wrong type: Received `{type(params.get("version", False))}` expected `bool`')
|
|
1283
|
+
if params.get("image1_image2", None) is None:
|
|
1284
|
+
raise StyxValidationError("`image1_image2` must not be None")
|
|
1285
|
+
if not isinstance(params["image1_image2"], (pathlib.Path, str)):
|
|
1286
|
+
raise StyxValidationError(f'`image1_image2` has the wrong type: Received `{type(params.get("image1_image2", None))}` expected `InputPathType`')
|
|
1287
|
+
if params.get("contrast1_contrast2", None) is not None:
|
|
1288
|
+
if not isinstance(params["contrast1_contrast2"], list):
|
|
1289
|
+
raise StyxValidationError(f'`contrast1_contrast2` has the wrong type: Received `{type(params.get("contrast1_contrast2", None))}` expected `list[InputPathType] | None`')
|
|
1290
|
+
for e in params["contrast1_contrast2"]:
|
|
1291
|
+
if not isinstance(e, (pathlib.Path, str)):
|
|
1292
|
+
raise StyxValidationError(f'`contrast1_contrast2` has the wrong type: Received `{type(params.get("contrast1_contrast2", None))}` expected `list[InputPathType] | None`')
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
def mrregister_cargs(
|
|
1296
|
+
params: MrregisterParamsDict,
|
|
1297
|
+
execution: Execution,
|
|
1298
|
+
) -> list[str]:
|
|
1299
|
+
"""
|
|
1300
|
+
Build command-line arguments from parameters.
|
|
1301
|
+
|
|
1302
|
+
Args:
|
|
1303
|
+
params: The parameters.
|
|
1304
|
+
execution: The execution object for resolving input paths.
|
|
1305
|
+
Returns:
|
|
1306
|
+
Command-line arguments.
|
|
1307
|
+
"""
|
|
1308
|
+
cargs = []
|
|
1309
|
+
cargs.append("mrregister")
|
|
1310
|
+
if params.get("type", None) is not None:
|
|
1311
|
+
cargs.extend([
|
|
1312
|
+
"-type",
|
|
1313
|
+
params.get("type", None)
|
|
1314
|
+
])
|
|
1315
|
+
if params.get("transformed", None) is not None:
|
|
1316
|
+
cargs.extend([a for c in [mrregister_transformed_cargs(s, execution) for s in params.get("transformed", None)] for a in c])
|
|
1317
|
+
if params.get("transformed_midway", None) is not None:
|
|
1318
|
+
cargs.extend([a for c in [mrregister_transformed_midway_cargs(s, execution) for s in params.get("transformed_midway", None)] for a in c])
|
|
1319
|
+
if params.get("mask1", None) is not None:
|
|
1320
|
+
cargs.extend([
|
|
1321
|
+
"-mask1",
|
|
1322
|
+
execution.input_file(params.get("mask1", None))
|
|
1323
|
+
])
|
|
1324
|
+
if params.get("mask2", None) is not None:
|
|
1325
|
+
cargs.extend([
|
|
1326
|
+
"-mask2",
|
|
1327
|
+
execution.input_file(params.get("mask2", None))
|
|
1328
|
+
])
|
|
1329
|
+
if params.get("nan", False):
|
|
1330
|
+
cargs.append("-nan")
|
|
1331
|
+
if params.get("rigid", None) is not None:
|
|
1332
|
+
cargs.extend([
|
|
1333
|
+
"-rigid",
|
|
1334
|
+
params.get("rigid", None)
|
|
1335
|
+
])
|
|
1336
|
+
if params.get("rigid_1tomidway", None) is not None:
|
|
1337
|
+
cargs.extend([
|
|
1338
|
+
"-rigid_1tomidway",
|
|
1339
|
+
params.get("rigid_1tomidway", None)
|
|
1340
|
+
])
|
|
1341
|
+
if params.get("rigid_2tomidway", None) is not None:
|
|
1342
|
+
cargs.extend([
|
|
1343
|
+
"-rigid_2tomidway",
|
|
1344
|
+
params.get("rigid_2tomidway", None)
|
|
1345
|
+
])
|
|
1346
|
+
if params.get("rigid_init_translation", None) is not None:
|
|
1347
|
+
cargs.extend([
|
|
1348
|
+
"-rigid_init_translation",
|
|
1349
|
+
params.get("rigid_init_translation", None)
|
|
1350
|
+
])
|
|
1351
|
+
if params.get("rigid_init_rotation", None) is not None:
|
|
1352
|
+
cargs.extend([
|
|
1353
|
+
"-rigid_init_rotation",
|
|
1354
|
+
params.get("rigid_init_rotation", None)
|
|
1355
|
+
])
|
|
1356
|
+
if params.get("rigid_init_matrix", None) is not None:
|
|
1357
|
+
cargs.extend([
|
|
1358
|
+
"-rigid_init_matrix",
|
|
1359
|
+
execution.input_file(params.get("rigid_init_matrix", None))
|
|
1360
|
+
])
|
|
1361
|
+
if params.get("rigid_scale", None) is not None:
|
|
1362
|
+
cargs.extend([
|
|
1363
|
+
"-rigid_scale",
|
|
1364
|
+
*map(str, params.get("rigid_scale", None))
|
|
1365
|
+
])
|
|
1366
|
+
if params.get("rigid_niter", None) is not None:
|
|
1367
|
+
cargs.extend([
|
|
1368
|
+
"-rigid_niter",
|
|
1369
|
+
*map(str, params.get("rigid_niter", None))
|
|
1370
|
+
])
|
|
1371
|
+
if params.get("rigid_metric", None) is not None:
|
|
1372
|
+
cargs.extend([
|
|
1373
|
+
"-rigid_metric",
|
|
1374
|
+
params.get("rigid_metric", None)
|
|
1375
|
+
])
|
|
1376
|
+
if params.get("rigid_metric_diff_estimator", None) is not None:
|
|
1377
|
+
cargs.extend([
|
|
1378
|
+
"-rigid_metric.diff.estimator",
|
|
1379
|
+
params.get("rigid_metric_diff_estimator", None)
|
|
1380
|
+
])
|
|
1381
|
+
if params.get("rigid_lmax", None) is not None:
|
|
1382
|
+
cargs.extend([
|
|
1383
|
+
"-rigid_lmax",
|
|
1384
|
+
*map(str, params.get("rigid_lmax", None))
|
|
1385
|
+
])
|
|
1386
|
+
if params.get("rigid_log", None) is not None:
|
|
1387
|
+
cargs.extend([
|
|
1388
|
+
"-rigid_log",
|
|
1389
|
+
params.get("rigid_log", None)
|
|
1390
|
+
])
|
|
1391
|
+
if params.get("affine", None) is not None:
|
|
1392
|
+
cargs.extend([
|
|
1393
|
+
"-affine",
|
|
1394
|
+
params.get("affine", None)
|
|
1395
|
+
])
|
|
1396
|
+
if params.get("affine_1tomidway", None) is not None:
|
|
1397
|
+
cargs.extend([
|
|
1398
|
+
"-affine_1tomidway",
|
|
1399
|
+
params.get("affine_1tomidway", None)
|
|
1400
|
+
])
|
|
1401
|
+
if params.get("affine_2tomidway", None) is not None:
|
|
1402
|
+
cargs.extend([
|
|
1403
|
+
"-affine_2tomidway",
|
|
1404
|
+
params.get("affine_2tomidway", None)
|
|
1405
|
+
])
|
|
1406
|
+
if params.get("affine_init_translation", None) is not None:
|
|
1407
|
+
cargs.extend([
|
|
1408
|
+
"-affine_init_translation",
|
|
1409
|
+
params.get("affine_init_translation", None)
|
|
1410
|
+
])
|
|
1411
|
+
if params.get("affine_init_rotation", None) is not None:
|
|
1412
|
+
cargs.extend([
|
|
1413
|
+
"-affine_init_rotation",
|
|
1414
|
+
params.get("affine_init_rotation", None)
|
|
1415
|
+
])
|
|
1416
|
+
if params.get("affine_init_matrix", None) is not None:
|
|
1417
|
+
cargs.extend([
|
|
1418
|
+
"-affine_init_matrix",
|
|
1419
|
+
execution.input_file(params.get("affine_init_matrix", None))
|
|
1420
|
+
])
|
|
1421
|
+
if params.get("affine_scale", None) is not None:
|
|
1422
|
+
cargs.extend([
|
|
1423
|
+
"-affine_scale",
|
|
1424
|
+
*map(str, params.get("affine_scale", None))
|
|
1425
|
+
])
|
|
1426
|
+
if params.get("affine_niter", None) is not None:
|
|
1427
|
+
cargs.extend([
|
|
1428
|
+
"-affine_niter",
|
|
1429
|
+
*map(str, params.get("affine_niter", None))
|
|
1430
|
+
])
|
|
1431
|
+
if params.get("affine_metric", None) is not None:
|
|
1432
|
+
cargs.extend([
|
|
1433
|
+
"-affine_metric",
|
|
1434
|
+
params.get("affine_metric", None)
|
|
1435
|
+
])
|
|
1436
|
+
if params.get("affine_metric_diff_estimator", None) is not None:
|
|
1437
|
+
cargs.extend([
|
|
1438
|
+
"-affine_metric.diff.estimator",
|
|
1439
|
+
params.get("affine_metric_diff_estimator", None)
|
|
1440
|
+
])
|
|
1441
|
+
if params.get("affine_lmax", None) is not None:
|
|
1442
|
+
cargs.extend([
|
|
1443
|
+
"-affine_lmax",
|
|
1444
|
+
*map(str, params.get("affine_lmax", None))
|
|
1445
|
+
])
|
|
1446
|
+
if params.get("affine_log", None) is not None:
|
|
1447
|
+
cargs.extend([
|
|
1448
|
+
"-affine_log",
|
|
1449
|
+
params.get("affine_log", None)
|
|
1450
|
+
])
|
|
1451
|
+
if params.get("init_translation_unmasked1", False):
|
|
1452
|
+
cargs.append("-init_translation.unmasked1")
|
|
1453
|
+
if params.get("init_translation_unmasked2", False):
|
|
1454
|
+
cargs.append("-init_translation.unmasked2")
|
|
1455
|
+
if params.get("init_rotation_unmasked1", False):
|
|
1456
|
+
cargs.append("-init_rotation.unmasked1")
|
|
1457
|
+
if params.get("init_rotation_unmasked2", False):
|
|
1458
|
+
cargs.append("-init_rotation.unmasked2")
|
|
1459
|
+
if params.get("init_rotation_search_angles", None) is not None:
|
|
1460
|
+
cargs.extend([
|
|
1461
|
+
"-init_rotation.search.angles",
|
|
1462
|
+
*map(str, params.get("init_rotation_search_angles", None))
|
|
1463
|
+
])
|
|
1464
|
+
if params.get("init_rotation_search_scale", None) is not None:
|
|
1465
|
+
cargs.extend([
|
|
1466
|
+
"-init_rotation.search.scale",
|
|
1467
|
+
str(params.get("init_rotation_search_scale", None))
|
|
1468
|
+
])
|
|
1469
|
+
if params.get("init_rotation_search_directions", None) is not None:
|
|
1470
|
+
cargs.extend([
|
|
1471
|
+
"-init_rotation.search.directions",
|
|
1472
|
+
str(params.get("init_rotation_search_directions", None))
|
|
1473
|
+
])
|
|
1474
|
+
if params.get("init_rotation_search_run_global", False):
|
|
1475
|
+
cargs.append("-init_rotation.search.run_global")
|
|
1476
|
+
if params.get("init_rotation_search_global_iterations", None) is not None:
|
|
1477
|
+
cargs.extend([
|
|
1478
|
+
"-init_rotation.search.global.iterations",
|
|
1479
|
+
str(params.get("init_rotation_search_global_iterations", None))
|
|
1480
|
+
])
|
|
1481
|
+
if params.get("linstage_iterations", None) is not None:
|
|
1482
|
+
cargs.extend([
|
|
1483
|
+
"-linstage.iterations",
|
|
1484
|
+
*map(str, params.get("linstage_iterations", None))
|
|
1485
|
+
])
|
|
1486
|
+
if params.get("linstage_optimiser_first", None) is not None:
|
|
1487
|
+
cargs.extend([
|
|
1488
|
+
"-linstage.optimiser.first",
|
|
1489
|
+
params.get("linstage_optimiser_first", None)
|
|
1490
|
+
])
|
|
1491
|
+
if params.get("linstage_optimiser_last", None) is not None:
|
|
1492
|
+
cargs.extend([
|
|
1493
|
+
"-linstage.optimiser.last",
|
|
1494
|
+
params.get("linstage_optimiser_last", None)
|
|
1495
|
+
])
|
|
1496
|
+
if params.get("linstage_optimiser_default", None) is not None:
|
|
1497
|
+
cargs.extend([
|
|
1498
|
+
"-linstage.optimiser.default",
|
|
1499
|
+
params.get("linstage_optimiser_default", None)
|
|
1500
|
+
])
|
|
1501
|
+
if params.get("linstage_diagnostics_prefix", None) is not None:
|
|
1502
|
+
cargs.extend([
|
|
1503
|
+
"-linstage.diagnostics.prefix",
|
|
1504
|
+
params.get("linstage_diagnostics_prefix", None)
|
|
1505
|
+
])
|
|
1506
|
+
if params.get("nl_warp", None) is not None:
|
|
1507
|
+
cargs.extend(mrregister_nl_warp_cargs(params.get("nl_warp", None), execution))
|
|
1508
|
+
if params.get("nl_warp_full", None) is not None:
|
|
1509
|
+
cargs.extend([
|
|
1510
|
+
"-nl_warp_full",
|
|
1511
|
+
params.get("nl_warp_full", None)
|
|
1512
|
+
])
|
|
1513
|
+
if params.get("nl_init", None) is not None:
|
|
1514
|
+
cargs.extend([
|
|
1515
|
+
"-nl_init",
|
|
1516
|
+
execution.input_file(params.get("nl_init", None))
|
|
1517
|
+
])
|
|
1518
|
+
if params.get("nl_scale", None) is not None:
|
|
1519
|
+
cargs.extend([
|
|
1520
|
+
"-nl_scale",
|
|
1521
|
+
*map(str, params.get("nl_scale", None))
|
|
1522
|
+
])
|
|
1523
|
+
if params.get("nl_niter", None) is not None:
|
|
1524
|
+
cargs.extend([
|
|
1525
|
+
"-nl_niter",
|
|
1526
|
+
*map(str, params.get("nl_niter", None))
|
|
1527
|
+
])
|
|
1528
|
+
if params.get("nl_update_smooth", None) is not None:
|
|
1529
|
+
cargs.extend([
|
|
1530
|
+
"-nl_update_smooth",
|
|
1531
|
+
str(params.get("nl_update_smooth", None))
|
|
1532
|
+
])
|
|
1533
|
+
if params.get("nl_disp_smooth", None) is not None:
|
|
1534
|
+
cargs.extend([
|
|
1535
|
+
"-nl_disp_smooth",
|
|
1536
|
+
str(params.get("nl_disp_smooth", None))
|
|
1537
|
+
])
|
|
1538
|
+
if params.get("nl_grad_step", None) is not None:
|
|
1539
|
+
cargs.extend([
|
|
1540
|
+
"-nl_grad_step",
|
|
1541
|
+
str(params.get("nl_grad_step", None))
|
|
1542
|
+
])
|
|
1543
|
+
if params.get("nl_lmax", None) is not None:
|
|
1544
|
+
cargs.extend([
|
|
1545
|
+
"-nl_lmax",
|
|
1546
|
+
*map(str, params.get("nl_lmax", None))
|
|
1547
|
+
])
|
|
1548
|
+
if params.get("diagnostics_image", None) is not None:
|
|
1549
|
+
cargs.extend([
|
|
1550
|
+
"-diagnostics_image",
|
|
1551
|
+
params.get("diagnostics_image", None)
|
|
1552
|
+
])
|
|
1553
|
+
if params.get("directions", None) is not None:
|
|
1554
|
+
cargs.extend([
|
|
1555
|
+
"-directions",
|
|
1556
|
+
execution.input_file(params.get("directions", None))
|
|
1557
|
+
])
|
|
1558
|
+
if params.get("noreorientation", False):
|
|
1559
|
+
cargs.append("-noreorientation")
|
|
1560
|
+
if params.get("mc_weights", None) is not None:
|
|
1561
|
+
cargs.extend([
|
|
1562
|
+
"-mc_weights",
|
|
1563
|
+
*map(str, params.get("mc_weights", None))
|
|
1564
|
+
])
|
|
1565
|
+
if params.get("datatype", None) is not None:
|
|
1566
|
+
cargs.extend([
|
|
1567
|
+
"-datatype",
|
|
1568
|
+
params.get("datatype", None)
|
|
1569
|
+
])
|
|
1570
|
+
if params.get("info", False):
|
|
1571
|
+
cargs.append("-info")
|
|
1572
|
+
if params.get("quiet", False):
|
|
1573
|
+
cargs.append("-quiet")
|
|
1574
|
+
if params.get("debug", False):
|
|
1575
|
+
cargs.append("-debug")
|
|
1576
|
+
if params.get("force", False):
|
|
1577
|
+
cargs.append("-force")
|
|
1578
|
+
if params.get("nthreads", None) is not None:
|
|
1579
|
+
cargs.extend([
|
|
1580
|
+
"-nthreads",
|
|
1581
|
+
str(params.get("nthreads", None))
|
|
1582
|
+
])
|
|
1583
|
+
if params.get("config", None) is not None:
|
|
1584
|
+
cargs.extend([a for c in [mrregister_config_cargs(s, execution) for s in params.get("config", None)] for a in c])
|
|
1585
|
+
if params.get("help", False):
|
|
1586
|
+
cargs.append("-help")
|
|
1587
|
+
if params.get("version", False):
|
|
1588
|
+
cargs.append("-version")
|
|
1589
|
+
cargs.append(execution.input_file(params.get("image1_image2", None)))
|
|
1590
|
+
if params.get("contrast1_contrast2", None) is not None:
|
|
1591
|
+
cargs.extend([execution.input_file(f) for f in params.get("contrast1_contrast2", None)])
|
|
1592
|
+
return cargs
|
|
1593
|
+
|
|
1594
|
+
|
|
1595
|
+
def mrregister_outputs(
|
|
1596
|
+
params: MrregisterParamsDict,
|
|
1597
|
+
execution: Execution,
|
|
1598
|
+
) -> MrregisterOutputs:
|
|
1599
|
+
"""
|
|
1600
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
1601
|
+
|
|
1602
|
+
Args:
|
|
1603
|
+
params: The parameters.
|
|
1604
|
+
execution: The execution object for resolving input paths.
|
|
1605
|
+
Returns:
|
|
1606
|
+
Outputs object.
|
|
1607
|
+
"""
|
|
1608
|
+
ret = MrregisterOutputs(
|
|
1609
|
+
root=execution.output_file("."),
|
|
1610
|
+
rigid=execution.output_file(params.get("rigid", None)) if (params.get("rigid") is not None) else None,
|
|
1611
|
+
rigid_1tomidway=execution.output_file(params.get("rigid_1tomidway", None)) if (params.get("rigid_1tomidway") is not None) else None,
|
|
1612
|
+
rigid_2tomidway=execution.output_file(params.get("rigid_2tomidway", None)) if (params.get("rigid_2tomidway") is not None) else None,
|
|
1613
|
+
rigid_log=execution.output_file(params.get("rigid_log", None)) if (params.get("rigid_log") is not None) else None,
|
|
1614
|
+
affine=execution.output_file(params.get("affine", None)) if (params.get("affine") is not None) else None,
|
|
1615
|
+
affine_1tomidway=execution.output_file(params.get("affine_1tomidway", None)) if (params.get("affine_1tomidway") is not None) else None,
|
|
1616
|
+
affine_2tomidway=execution.output_file(params.get("affine_2tomidway", None)) if (params.get("affine_2tomidway") is not None) else None,
|
|
1617
|
+
affine_log=execution.output_file(params.get("affine_log", None)) if (params.get("affine_log") is not None) else None,
|
|
1618
|
+
nl_warp_full=execution.output_file(params.get("nl_warp_full", None)) if (params.get("nl_warp_full") is not None) else None,
|
|
1619
|
+
transformed=[mrregister_transformed_outputs(i, execution) if mrregister_transformed_outputs else None for i in params.get("transformed")] if params.get("transformed") else None,
|
|
1620
|
+
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,
|
|
1621
|
+
nl_warp=mrregister_nl_warp_outputs(params.get("nl_warp"), execution) if params.get("nl_warp") else None,
|
|
1622
|
+
)
|
|
1623
|
+
return ret
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
def mrregister_execute(
|
|
1627
|
+
params: MrregisterParamsDict,
|
|
1628
|
+
runner: Runner | None = None,
|
|
1629
|
+
) -> MrregisterOutputs:
|
|
1630
|
+
"""
|
|
1631
|
+
mrregister
|
|
1632
|
+
|
|
1633
|
+
Register two images together using a symmetric rigid, affine or non-linear
|
|
1634
|
+
transformation model.
|
|
1635
|
+
|
|
1636
|
+
By default this application will perform an affine, followed by non-linear
|
|
1637
|
+
registration.
|
|
1638
|
+
|
|
1639
|
+
FOD registration (with apodised point spread reorientation) will be
|
|
1640
|
+
performed by default if the number of volumes in the 4th dimension equals
|
|
1641
|
+
the number of coefficients in an antipodally symmetric spherical harmonic
|
|
1642
|
+
series (e.g. 6, 15, 28 etc). The -no_reorientation option can be used to
|
|
1643
|
+
force reorientation off if required.
|
|
1644
|
+
|
|
1645
|
+
Non-linear registration computes warps to map from both image1->image2 and
|
|
1646
|
+
image2->image1. Similar to Avants (2008) Med Image Anal. 12(1): 26–41,
|
|
1647
|
+
registration is performed by matching both the image1 and image2 in a
|
|
1648
|
+
'midway space'. Warps can be saved as two deformation fields that map
|
|
1649
|
+
directly between image1->image2 and image2->image1, or if using
|
|
1650
|
+
-nl_warp_full as a single 5D file that stores all 4 warps
|
|
1651
|
+
image1->mid->image2, and image2->mid->image1. The 5D warp format stores
|
|
1652
|
+
x,y,z deformations in the 4th dimension, and uses the 5th dimension to index
|
|
1653
|
+
the 4 warps. The affine transforms estimated (to midway space) are also
|
|
1654
|
+
stored as comments in the image header. The 5D warp file can be used to
|
|
1655
|
+
reinitialise subsequent registrations, in addition to transforming images to
|
|
1656
|
+
midway space (e.g. for intra-subject alignment in a 2-time-point
|
|
1657
|
+
longitudinal analysis).
|
|
1658
|
+
|
|
1659
|
+
References:
|
|
1660
|
+
|
|
1661
|
+
* If FOD registration is being performed:
|
|
1662
|
+
Raffelt, D.; Tournier, J.-D.; Fripp, J; Crozier, S.; Connelly, A. & Salvado,
|
|
1663
|
+
O. Symmetric diffeomorphic registration of fibre orientation distributions.
|
|
1664
|
+
NeuroImage, 2011, 56(3), 1171-1180
|
|
1665
|
+
|
|
1666
|
+
Raffelt, D.; Tournier, J.-D.; Crozier, S.; Connelly, A. & Salvado, O.
|
|
1667
|
+
Reorientation of fiber orientation distributions using apodized point spread
|
|
1668
|
+
functions. Magnetic Resonance in Medicine, 2012, 67, 844-855.
|
|
1669
|
+
|
|
1670
|
+
Author: MRTrix3 Developers
|
|
1671
|
+
|
|
1672
|
+
URL: https://www.mrtrix.org/
|
|
1673
|
+
|
|
1674
|
+
Args:
|
|
1675
|
+
params: The parameters.
|
|
1676
|
+
runner: Command runner.
|
|
1677
|
+
Returns:
|
|
1678
|
+
NamedTuple of outputs (described in `MrregisterOutputs`).
|
|
1679
|
+
"""
|
|
1680
|
+
mrregister_validate(params)
|
|
1681
|
+
runner = runner or get_global_runner()
|
|
1682
|
+
execution = runner.start_execution(MRREGISTER_METADATA)
|
|
1683
|
+
params = execution.params(params)
|
|
1684
|
+
cargs = mrregister_cargs(params, execution)
|
|
1685
|
+
ret = mrregister_outputs(params, execution)
|
|
1686
|
+
execution.run(cargs)
|
|
1687
|
+
return ret
|
|
1688
|
+
|
|
1689
|
+
|
|
1690
|
+
def mrregister(
|
|
1691
|
+
image1_image2: InputPathType,
|
|
1692
|
+
type_: str | None = None,
|
|
1693
|
+
transformed: list[MrregisterTransformedParamsDict] | None = None,
|
|
1694
|
+
transformed_midway: list[MrregisterTransformedMidwayParamsDict] | None = None,
|
|
1695
|
+
mask1: InputPathType | None = None,
|
|
1696
|
+
mask2: InputPathType | None = None,
|
|
1697
|
+
nan: bool = False,
|
|
1698
|
+
rigid: str | None = None,
|
|
1699
|
+
rigid_1tomidway: str | None = None,
|
|
1700
|
+
rigid_2tomidway: str | None = None,
|
|
1701
|
+
rigid_init_translation: str | None = None,
|
|
1702
|
+
rigid_init_rotation: str | None = None,
|
|
1703
|
+
rigid_init_matrix: InputPathType | None = None,
|
|
1704
|
+
rigid_scale: list[float] | None = None,
|
|
1705
|
+
rigid_niter: list[int] | None = None,
|
|
1706
|
+
rigid_metric: str | None = None,
|
|
1707
|
+
rigid_metric_diff_estimator: str | None = None,
|
|
1708
|
+
rigid_lmax: list[int] | None = None,
|
|
1709
|
+
rigid_log: str | None = None,
|
|
1710
|
+
affine: str | None = None,
|
|
1711
|
+
affine_1tomidway: str | None = None,
|
|
1712
|
+
affine_2tomidway: str | None = None,
|
|
1713
|
+
affine_init_translation: str | None = None,
|
|
1714
|
+
affine_init_rotation: str | None = None,
|
|
1715
|
+
affine_init_matrix: InputPathType | None = None,
|
|
1716
|
+
affine_scale: list[float] | None = None,
|
|
1717
|
+
affine_niter: list[int] | None = None,
|
|
1718
|
+
affine_metric: str | None = None,
|
|
1719
|
+
affine_metric_diff_estimator: str | None = None,
|
|
1720
|
+
affine_lmax: list[int] | None = None,
|
|
1721
|
+
affine_log: str | None = None,
|
|
1722
|
+
init_translation_unmasked1: bool = False,
|
|
1723
|
+
init_translation_unmasked2: bool = False,
|
|
1724
|
+
init_rotation_unmasked1: bool = False,
|
|
1725
|
+
init_rotation_unmasked2: bool = False,
|
|
1726
|
+
init_rotation_search_angles: list[float] | None = None,
|
|
1727
|
+
init_rotation_search_scale: float | None = None,
|
|
1728
|
+
init_rotation_search_directions: int | None = None,
|
|
1729
|
+
init_rotation_search_run_global: bool = False,
|
|
1730
|
+
init_rotation_search_global_iterations: int | None = None,
|
|
1731
|
+
linstage_iterations: list[int] | None = None,
|
|
1732
|
+
linstage_optimiser_first: str | None = None,
|
|
1733
|
+
linstage_optimiser_last: str | None = None,
|
|
1734
|
+
linstage_optimiser_default: str | None = None,
|
|
1735
|
+
linstage_diagnostics_prefix: str | None = None,
|
|
1736
|
+
nl_warp: MrregisterNlWarpParamsDict | None = None,
|
|
1737
|
+
nl_warp_full: str | None = None,
|
|
1738
|
+
nl_init: InputPathType | None = None,
|
|
1739
|
+
nl_scale: list[float] | None = None,
|
|
1740
|
+
nl_niter: list[int] | None = None,
|
|
1741
|
+
nl_update_smooth: float | None = None,
|
|
1742
|
+
nl_disp_smooth: float | None = None,
|
|
1743
|
+
nl_grad_step: float | None = None,
|
|
1744
|
+
nl_lmax: list[int] | None = None,
|
|
1745
|
+
diagnostics_image: str | None = None,
|
|
1746
|
+
directions: InputPathType | None = None,
|
|
1747
|
+
noreorientation: bool = False,
|
|
1748
|
+
mc_weights: list[float] | None = None,
|
|
1749
|
+
datatype: str | None = None,
|
|
1750
|
+
info: bool = False,
|
|
1751
|
+
quiet: bool = False,
|
|
1752
|
+
debug: bool = False,
|
|
1753
|
+
force: bool = False,
|
|
1754
|
+
nthreads: int | None = None,
|
|
1755
|
+
config: list[MrregisterConfigParamsDict] | None = None,
|
|
1756
|
+
help_: bool = False,
|
|
1757
|
+
version: bool = False,
|
|
1758
|
+
contrast1_contrast2: list[InputPathType] | None = None,
|
|
1759
|
+
runner: Runner | None = None,
|
|
1760
|
+
) -> MrregisterOutputs:
|
|
1761
|
+
"""
|
|
1762
|
+
mrregister
|
|
1763
|
+
|
|
1764
|
+
Register two images together using a symmetric rigid, affine or non-linear
|
|
1765
|
+
transformation model.
|
|
1766
|
+
|
|
1767
|
+
By default this application will perform an affine, followed by non-linear
|
|
1768
|
+
registration.
|
|
1769
|
+
|
|
1770
|
+
FOD registration (with apodised point spread reorientation) will be
|
|
1771
|
+
performed by default if the number of volumes in the 4th dimension equals
|
|
1772
|
+
the number of coefficients in an antipodally symmetric spherical harmonic
|
|
1773
|
+
series (e.g. 6, 15, 28 etc). The -no_reorientation option can be used to
|
|
1774
|
+
force reorientation off if required.
|
|
1775
|
+
|
|
1776
|
+
Non-linear registration computes warps to map from both image1->image2 and
|
|
1777
|
+
image2->image1. Similar to Avants (2008) Med Image Anal. 12(1): 26–41,
|
|
1778
|
+
registration is performed by matching both the image1 and image2 in a
|
|
1779
|
+
'midway space'. Warps can be saved as two deformation fields that map
|
|
1780
|
+
directly between image1->image2 and image2->image1, or if using
|
|
1781
|
+
-nl_warp_full as a single 5D file that stores all 4 warps
|
|
1782
|
+
image1->mid->image2, and image2->mid->image1. The 5D warp format stores
|
|
1783
|
+
x,y,z deformations in the 4th dimension, and uses the 5th dimension to index
|
|
1784
|
+
the 4 warps. The affine transforms estimated (to midway space) are also
|
|
1785
|
+
stored as comments in the image header. The 5D warp file can be used to
|
|
1786
|
+
reinitialise subsequent registrations, in addition to transforming images to
|
|
1787
|
+
midway space (e.g. for intra-subject alignment in a 2-time-point
|
|
1788
|
+
longitudinal analysis).
|
|
1789
|
+
|
|
1790
|
+
References:
|
|
1791
|
+
|
|
1792
|
+
* If FOD registration is being performed:
|
|
1793
|
+
Raffelt, D.; Tournier, J.-D.; Fripp, J; Crozier, S.; Connelly, A. & Salvado,
|
|
1794
|
+
O. Symmetric diffeomorphic registration of fibre orientation distributions.
|
|
1795
|
+
NeuroImage, 2011, 56(3), 1171-1180
|
|
1796
|
+
|
|
1797
|
+
Raffelt, D.; Tournier, J.-D.; Crozier, S.; Connelly, A. & Salvado, O.
|
|
1798
|
+
Reorientation of fiber orientation distributions using apodized point spread
|
|
1799
|
+
functions. Magnetic Resonance in Medicine, 2012, 67, 844-855.
|
|
1800
|
+
|
|
1801
|
+
Author: MRTrix3 Developers
|
|
1802
|
+
|
|
1803
|
+
URL: https://www.mrtrix.org/
|
|
1804
|
+
|
|
1805
|
+
Args:
|
|
1806
|
+
image1_image2: input image 1 ('moving') and input image 2 ('template').
|
|
1807
|
+
type_: the registration type. Valid choices are: rigid, affine,\
|
|
1808
|
+
nonlinear, rigid_affine, rigid_nonlinear, affine_nonlinear,\
|
|
1809
|
+
rigid_affine_nonlinear (Default: affine_nonlinear).
|
|
1810
|
+
transformed: image1 after registration transformed and regridded to the\
|
|
1811
|
+
space of image2. Note that -transformed needs to be repeated for each\
|
|
1812
|
+
contrast if multi-contrast registration is used.
|
|
1813
|
+
transformed_midway: image1 and image2 after registration transformed\
|
|
1814
|
+
and regridded to the midway space. Note that -transformed_midway needs\
|
|
1815
|
+
to be repeated for each contrast if multi-contrast registration is\
|
|
1816
|
+
used.
|
|
1817
|
+
mask1: a mask to define the region of image1 to use for optimisation.
|
|
1818
|
+
mask2: a mask to define the region of image2 to use for optimisation.
|
|
1819
|
+
nan: use NaN as out of bounds value. (Default: 0.0).
|
|
1820
|
+
rigid: the output text file containing the rigid transformation as a\
|
|
1821
|
+
4x4 matrix.
|
|
1822
|
+
rigid_1tomidway: the output text file containing the rigid\
|
|
1823
|
+
transformation that aligns image1 to image2 in their common midway\
|
|
1824
|
+
space as a 4x4 matrix.
|
|
1825
|
+
rigid_2tomidway: the output text file containing the rigid\
|
|
1826
|
+
transformation that aligns image2 to image1 in their common midway\
|
|
1827
|
+
space as a 4x4 matrix.
|
|
1828
|
+
rigid_init_translation: initialise the translation and centre of\
|
|
1829
|
+
rotation\
|
|
1830
|
+
Valid choices are:\
|
|
1831
|
+
mass (aligns the centers of mass of both images, default),\
|
|
1832
|
+
geometric (aligns geometric image centres) and none.
|
|
1833
|
+
rigid_init_rotation: initialise the rotation Valid choices are:\
|
|
1834
|
+
search (search for the best rotation using mean squared residuals),\
|
|
1835
|
+
moments (rotation based on directions of intensity variance with\
|
|
1836
|
+
respect to centre of mass),\
|
|
1837
|
+
none (default).
|
|
1838
|
+
rigid_init_matrix: initialise either the rigid, affine, or syn\
|
|
1839
|
+
registration with the supplied rigid transformation (as a 4x4 matrix in\
|
|
1840
|
+
scanner coordinates). Note that this overrides rigid_init_translation\
|
|
1841
|
+
and rigid_init_rotation initialisation.
|
|
1842
|
+
rigid_scale: use a multi-resolution scheme by defining a scale factor\
|
|
1843
|
+
for each level using comma separated values (Default: 0.25,0.5,1.0).
|
|
1844
|
+
rigid_niter: the maximum number of gradient descent iterations per\
|
|
1845
|
+
stage. This can be specified either as a single number for all\
|
|
1846
|
+
multi-resolution levels, or a single value for each level. (Default:\
|
|
1847
|
+
1000).
|
|
1848
|
+
rigid_metric: valid choices are: diff (intensity differences), Default:\
|
|
1849
|
+
diff.
|
|
1850
|
+
rigid_metric_diff_estimator: Valid choices are: l1 (least absolute:\
|
|
1851
|
+
|x|), l2 (ordinary least squares), lp (least powers: |x|^1.2), Default:\
|
|
1852
|
+
l2.
|
|
1853
|
+
rigid_lmax: explicitly set the lmax to be used per scale factor in\
|
|
1854
|
+
rigid FOD registration. By default FOD registration will use lmax 0,2,4\
|
|
1855
|
+
with default scale factors 0.25,0.5,1.0 respectively. Note that no\
|
|
1856
|
+
reorientation will be performed with lmax = 0.
|
|
1857
|
+
rigid_log: write gradient descent parameter evolution to log file.
|
|
1858
|
+
affine: the output text file containing the affine transformation as a\
|
|
1859
|
+
4x4 matrix.
|
|
1860
|
+
affine_1tomidway: the output text file containing the affine\
|
|
1861
|
+
transformation that aligns image1 to image2 in their common midway\
|
|
1862
|
+
space as a 4x4 matrix.
|
|
1863
|
+
affine_2tomidway: the output text file containing the affine\
|
|
1864
|
+
transformation that aligns image2 to image1 in their common midway\
|
|
1865
|
+
space as a 4x4 matrix.
|
|
1866
|
+
affine_init_translation: initialise the translation and centre of\
|
|
1867
|
+
rotation\
|
|
1868
|
+
Valid choices are:\
|
|
1869
|
+
mass (aligns the centers of mass of both images),\
|
|
1870
|
+
geometric (aligns geometric image centres) and none. (Default:\
|
|
1871
|
+
mass).
|
|
1872
|
+
affine_init_rotation: initialise the rotation Valid choices are:\
|
|
1873
|
+
search (search for the best rotation using mean squared residuals),\
|
|
1874
|
+
moments (rotation based on directions of intensity variance with\
|
|
1875
|
+
respect to centre of mass),\
|
|
1876
|
+
none (Default: none).
|
|
1877
|
+
affine_init_matrix: initialise either the affine, or syn registration\
|
|
1878
|
+
with the supplied affine transformation (as a 4x4 matrix in scanner\
|
|
1879
|
+
coordinates). Note that this overrides affine_init_translation and\
|
|
1880
|
+
affine_init_rotation initialisation.
|
|
1881
|
+
affine_scale: use a multi-resolution scheme by defining a scale factor\
|
|
1882
|
+
for each level using comma separated values (Default: 0.25,0.5,1.0).
|
|
1883
|
+
affine_niter: the maximum number of gradient descent iterations per\
|
|
1884
|
+
stage. This can be specified either as a single number for all\
|
|
1885
|
+
multi-resolution levels, or a single value for each level. (Default:\
|
|
1886
|
+
1000).
|
|
1887
|
+
affine_metric: valid choices are: diff (intensity differences),\
|
|
1888
|
+
Default: diff.
|
|
1889
|
+
affine_metric_diff_estimator: Valid choices are: l1 (least absolute:\
|
|
1890
|
+
|x|), l2 (ordinary least squares), lp (least powers: |x|^1.2), Default:\
|
|
1891
|
+
l2.
|
|
1892
|
+
affine_lmax: explicitly set the lmax to be used per scale factor in\
|
|
1893
|
+
affine FOD registration. By default FOD registration will use lmax\
|
|
1894
|
+
0,2,4 with default scale factors 0.25,0.5,1.0 respectively. Note that\
|
|
1895
|
+
no reorientation will be performed with lmax = 0.
|
|
1896
|
+
affine_log: write gradient descent parameter evolution to log file.
|
|
1897
|
+
init_translation_unmasked1: disregard mask1 for the translation\
|
|
1898
|
+
initialisation (affects 'mass').
|
|
1899
|
+
init_translation_unmasked2: disregard mask2 for the translation\
|
|
1900
|
+
initialisation (affects 'mass').
|
|
1901
|
+
init_rotation_unmasked1: disregard mask1 for the rotation\
|
|
1902
|
+
initialisation (affects 'search' and 'moments').
|
|
1903
|
+
init_rotation_unmasked2: disregard mask2 for the rotation\
|
|
1904
|
+
initialisation (affects 'search' and 'moments').
|
|
1905
|
+
init_rotation_search_angles: rotation angles for the local search in\
|
|
1906
|
+
degrees between 0 and 180. (Default: 2,5,10,15,20).
|
|
1907
|
+
init_rotation_search_scale: relative size of the images used for the\
|
|
1908
|
+
rotation search. (Default: 0.15).
|
|
1909
|
+
init_rotation_search_directions: number of rotation axis for local\
|
|
1910
|
+
search. (Default: 250).
|
|
1911
|
+
init_rotation_search_run_global: perform a global search. (Default:\
|
|
1912
|
+
local).
|
|
1913
|
+
init_rotation_search_global_iterations: number of rotations to\
|
|
1914
|
+
investigate (Default: 10000).
|
|
1915
|
+
linstage_iterations: number of iterations for each registration stage,\
|
|
1916
|
+
not to be confused with -rigid_niter or -affine_niter. This can be used\
|
|
1917
|
+
to generate intermediate diagnostics images\
|
|
1918
|
+
(-linstage.diagnostics.prefix) or to change the cost function optimiser\
|
|
1919
|
+
during registration (without the need to repeatedly resize the images).\
|
|
1920
|
+
(Default: 1 == no repetition).
|
|
1921
|
+
linstage_optimiser_first: Cost function optimisation algorithm to use\
|
|
1922
|
+
at first iteration of all stages. Valid choices: bbgd (Barzilai-Borwein\
|
|
1923
|
+
gradient descent) or gd (simple gradient descent). (Default: bbgd).
|
|
1924
|
+
linstage_optimiser_last: Cost function optimisation algorithm to use at\
|
|
1925
|
+
last iteration of all stages (if there are more than one). Valid\
|
|
1926
|
+
choices: bbgd (Barzilai-Borwein gradient descent) or gd (simple\
|
|
1927
|
+
gradient descent). (Default: bbgd).
|
|
1928
|
+
linstage_optimiser_default: Cost function optimisation algorithm to use\
|
|
1929
|
+
at any stage iteration other than first or last iteration. Valid\
|
|
1930
|
+
choices: bbgd (Barzilai-Borwein gradient descent) or gd (simple\
|
|
1931
|
+
gradient descent). (Default: bbgd).
|
|
1932
|
+
linstage_diagnostics_prefix: generate diagnostics images after every\
|
|
1933
|
+
registration stage.
|
|
1934
|
+
nl_warp: the non-linear warp output defined as two deformation fields,\
|
|
1935
|
+
where warp1 can be used to transform image1->image2 and warp2 to\
|
|
1936
|
+
transform image2->image1. The deformation fields also encapsulate any\
|
|
1937
|
+
linear transformation estimated prior to non-linear registration.
|
|
1938
|
+
nl_warp_full: output all warps used during registration. This saves\
|
|
1939
|
+
four different warps that map each image to a midway space and their\
|
|
1940
|
+
inverses in a single 5D image file. The 4th image dimension indexes the\
|
|
1941
|
+
x,y,z component of the deformation vector and the 5th dimension indexes\
|
|
1942
|
+
the field in this order: image1->midway, midway->image1,\
|
|
1943
|
+
image2->midway, midway->image2. Where image1->midway defines the field\
|
|
1944
|
+
that maps image1 onto the midway space using the reverse convention\
|
|
1945
|
+
When linear registration is performed first, the estimated linear\
|
|
1946
|
+
transform will be included in the comments of the image header, and\
|
|
1947
|
+
therefore the entire linear and non-linear transform can be applied (in\
|
|
1948
|
+
either direction) using this output warp file with mrtransform.
|
|
1949
|
+
nl_init: initialise the non-linear registration with the supplied warp\
|
|
1950
|
+
image. The supplied warp must be in the same format as output using the\
|
|
1951
|
+
-nl_warp_full option (i.e. have 4 deformation fields with the linear\
|
|
1952
|
+
transforms in the image header).
|
|
1953
|
+
nl_scale: use a multi-resolution scheme by defining a scale factor for\
|
|
1954
|
+
each level using comma separated values (Default: 0.25,0.5,1.0).
|
|
1955
|
+
nl_niter: the maximum number of iterations. This can be specified\
|
|
1956
|
+
either as a single number for all multi-resolution levels, or a single\
|
|
1957
|
+
value for each level. (Default: 50).
|
|
1958
|
+
nl_update_smooth: regularise the gradient update field with Gaussian\
|
|
1959
|
+
smoothing (standard deviation in voxel units, Default 2.0).
|
|
1960
|
+
nl_disp_smooth: regularise the displacement field with Gaussian\
|
|
1961
|
+
smoothing (standard deviation in voxel units, Default 1.0).
|
|
1962
|
+
nl_grad_step: the gradient step size for non-linear registration\
|
|
1963
|
+
(Default: 0.5).
|
|
1964
|
+
nl_lmax: explicitly set the lmax to be used per scale factor in\
|
|
1965
|
+
non-linear FOD registration. By default FOD registration will use lmax\
|
|
1966
|
+
0,2,4 with default scale factors 0.25,0.5,1.0 respectively. Note that\
|
|
1967
|
+
no reorientation will be performed with lmax = 0.
|
|
1968
|
+
diagnostics_image: write intermediate images for diagnostics purposes.
|
|
1969
|
+
directions: the directions used for FOD reorientation using apodised\
|
|
1970
|
+
point spread functions (Default: 60 directions).
|
|
1971
|
+
noreorientation: turn off FOD reorientation. Reorientation is on by\
|
|
1972
|
+
default if the number of volumes in the 4th dimension corresponds to\
|
|
1973
|
+
the number of coefficients in an antipodally symmetric spherical\
|
|
1974
|
+
harmonic series (i.e. 6, 15, 28, 45, 66 etc).
|
|
1975
|
+
mc_weights: relative weight of images used for multi-contrast\
|
|
1976
|
+
registration. Default: 1.0 (equal weighting).
|
|
1977
|
+
datatype: specify output image data type. Valid choices are: float32,\
|
|
1978
|
+
float32le, float32be, float64, float64le, float64be, int64, uint64,\
|
|
1979
|
+
int64le, uint64le, int64be, uint64be, int32, uint32, int32le, uint32le,\
|
|
1980
|
+
int32be, uint32be, int16, uint16, int16le, uint16le, int16be, uint16be,\
|
|
1981
|
+
cfloat32, cfloat32le, cfloat32be, cfloat64, cfloat64le, cfloat64be,\
|
|
1982
|
+
int8, uint8, bit.
|
|
1983
|
+
info: display information messages.
|
|
1984
|
+
quiet: do not display information messages or progress status;\
|
|
1985
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
1986
|
+
environment variable to a non-empty string.
|
|
1987
|
+
debug: display debugging messages.
|
|
1988
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
1989
|
+
input and output might cause unexpected behaviour).
|
|
1990
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
1991
|
+
(set to 0 to disable multi-threading).
|
|
1992
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
1993
|
+
help_: display this information page and exit.
|
|
1994
|
+
version: display version information and exit.
|
|
1995
|
+
contrast1_contrast2: optional list of additional input images used as\
|
|
1996
|
+
additional contrasts. Can be used multiple times. contrastX and imageX\
|
|
1997
|
+
must share the same coordinate system.
|
|
1998
|
+
runner: Command runner.
|
|
1999
|
+
Returns:
|
|
2000
|
+
NamedTuple of outputs (described in `MrregisterOutputs`).
|
|
2001
|
+
"""
|
|
2002
|
+
params = mrregister_params(
|
|
2003
|
+
type_=type_,
|
|
2004
|
+
transformed=transformed,
|
|
2005
|
+
transformed_midway=transformed_midway,
|
|
2006
|
+
mask1=mask1,
|
|
2007
|
+
mask2=mask2,
|
|
2008
|
+
nan=nan,
|
|
2009
|
+
rigid=rigid,
|
|
2010
|
+
rigid_1tomidway=rigid_1tomidway,
|
|
2011
|
+
rigid_2tomidway=rigid_2tomidway,
|
|
2012
|
+
rigid_init_translation=rigid_init_translation,
|
|
2013
|
+
rigid_init_rotation=rigid_init_rotation,
|
|
2014
|
+
rigid_init_matrix=rigid_init_matrix,
|
|
2015
|
+
rigid_scale=rigid_scale,
|
|
2016
|
+
rigid_niter=rigid_niter,
|
|
2017
|
+
rigid_metric=rigid_metric,
|
|
2018
|
+
rigid_metric_diff_estimator=rigid_metric_diff_estimator,
|
|
2019
|
+
rigid_lmax=rigid_lmax,
|
|
2020
|
+
rigid_log=rigid_log,
|
|
2021
|
+
affine=affine,
|
|
2022
|
+
affine_1tomidway=affine_1tomidway,
|
|
2023
|
+
affine_2tomidway=affine_2tomidway,
|
|
2024
|
+
affine_init_translation=affine_init_translation,
|
|
2025
|
+
affine_init_rotation=affine_init_rotation,
|
|
2026
|
+
affine_init_matrix=affine_init_matrix,
|
|
2027
|
+
affine_scale=affine_scale,
|
|
2028
|
+
affine_niter=affine_niter,
|
|
2029
|
+
affine_metric=affine_metric,
|
|
2030
|
+
affine_metric_diff_estimator=affine_metric_diff_estimator,
|
|
2031
|
+
affine_lmax=affine_lmax,
|
|
2032
|
+
affine_log=affine_log,
|
|
2033
|
+
init_translation_unmasked1=init_translation_unmasked1,
|
|
2034
|
+
init_translation_unmasked2=init_translation_unmasked2,
|
|
2035
|
+
init_rotation_unmasked1=init_rotation_unmasked1,
|
|
2036
|
+
init_rotation_unmasked2=init_rotation_unmasked2,
|
|
2037
|
+
init_rotation_search_angles=init_rotation_search_angles,
|
|
2038
|
+
init_rotation_search_scale=init_rotation_search_scale,
|
|
2039
|
+
init_rotation_search_directions=init_rotation_search_directions,
|
|
2040
|
+
init_rotation_search_run_global=init_rotation_search_run_global,
|
|
2041
|
+
init_rotation_search_global_iterations=init_rotation_search_global_iterations,
|
|
2042
|
+
linstage_iterations=linstage_iterations,
|
|
2043
|
+
linstage_optimiser_first=linstage_optimiser_first,
|
|
2044
|
+
linstage_optimiser_last=linstage_optimiser_last,
|
|
2045
|
+
linstage_optimiser_default=linstage_optimiser_default,
|
|
2046
|
+
linstage_diagnostics_prefix=linstage_diagnostics_prefix,
|
|
2047
|
+
nl_warp=nl_warp,
|
|
2048
|
+
nl_warp_full=nl_warp_full,
|
|
2049
|
+
nl_init=nl_init,
|
|
2050
|
+
nl_scale=nl_scale,
|
|
2051
|
+
nl_niter=nl_niter,
|
|
2052
|
+
nl_update_smooth=nl_update_smooth,
|
|
2053
|
+
nl_disp_smooth=nl_disp_smooth,
|
|
2054
|
+
nl_grad_step=nl_grad_step,
|
|
2055
|
+
nl_lmax=nl_lmax,
|
|
2056
|
+
diagnostics_image=diagnostics_image,
|
|
2057
|
+
directions=directions,
|
|
2058
|
+
noreorientation=noreorientation,
|
|
2059
|
+
mc_weights=mc_weights,
|
|
2060
|
+
datatype=datatype,
|
|
2061
|
+
info=info,
|
|
2062
|
+
quiet=quiet,
|
|
2063
|
+
debug=debug,
|
|
2064
|
+
force=force,
|
|
2065
|
+
nthreads=nthreads,
|
|
2066
|
+
config=config,
|
|
2067
|
+
help_=help_,
|
|
2068
|
+
version=version,
|
|
2069
|
+
image1_image2=image1_image2,
|
|
2070
|
+
contrast1_contrast2=contrast1_contrast2,
|
|
2071
|
+
)
|
|
2072
|
+
return mrregister_execute(params, runner)
|
|
2073
|
+
|
|
2074
|
+
|
|
2075
|
+
__all__ = [
|
|
2076
|
+
"MRREGISTER_METADATA",
|
|
2077
|
+
"MrregisterConfigParamsDict",
|
|
2078
|
+
"MrregisterConfigParamsDictTagged",
|
|
2079
|
+
"MrregisterNlWarpOutputs",
|
|
2080
|
+
"MrregisterNlWarpParamsDict",
|
|
2081
|
+
"MrregisterNlWarpParamsDictTagged",
|
|
2082
|
+
"MrregisterOutputs",
|
|
2083
|
+
"MrregisterParamsDict",
|
|
2084
|
+
"MrregisterParamsDictTagged",
|
|
2085
|
+
"MrregisterTransformedMidwayOutputs",
|
|
2086
|
+
"MrregisterTransformedMidwayParamsDict",
|
|
2087
|
+
"MrregisterTransformedMidwayParamsDictTagged",
|
|
2088
|
+
"MrregisterTransformedOutputs",
|
|
2089
|
+
"MrregisterTransformedParamsDict",
|
|
2090
|
+
"MrregisterTransformedParamsDictTagged",
|
|
2091
|
+
"mrregister",
|
|
2092
|
+
"mrregister_config",
|
|
2093
|
+
"mrregister_execute",
|
|
2094
|
+
"mrregister_nl_warp",
|
|
2095
|
+
"mrregister_params",
|
|
2096
|
+
"mrregister_transformed",
|
|
2097
|
+
"mrregister_transformed_midway",
|
|
2098
|
+
]
|