I’ve played a bit with the inverse transform. Here’s a small test case:
So on the first column you can see the blobs, and the image to which it is registered on the second column. The registration is done with the composition of a rigid transform followed by a bspline transform:
elastix -f blobs-warp.tif -m blobs.tif -p euler.txt -p bspline.txt -out folder_out
The third column shows the result of this first registration, which is bad, but that doesn’t matter, it’s actually better to test if the invert computation works. To compute the inverse transform (which I choose to be a spline, as specified in the file
invRegParameters.txt), I execute:
elastix -f grid.tif -m grid.tif -t0 TransformParameters.1.txt -p invRegParameters.txt -out folder_out_inv
I believe the choice of the image (
grid.tif) is not important. It’s just helpful to specify the region on which the computation will take place.
TransformParameters.1.txt is the last transform file generated be the first registration.
This computation yields the file
TransformParameters.0.txt. In this file you need to change the initial transform to
NoInitialTransform, and then the file can be used to invert the transform given by the first registration: as you can see on the fourth column, this works nicely.
Here’s the files used, just in case you want to reproduce this sequence:
elastixinvreg.zip (1.1 MB)