3D registration results not consistent between two metrics

I recently started using ITKv3 for 3D registration based on ImageRegistraton8.cxx
Note that ITK is interfaced to another software for image processing.
For testing purpose, I started with the 3D images (brainweb1e1a10f20.mha and brainweb1e1a10f20Rot10Tx15.mha) as described in the manual.
If I use the default metric i.e. MeanSquaresImageToImageMetric I got the expected translation and rotation values as follows
Result =
versor X = 0.000003
versor Y = -0.000067
versor Z = -0.087025
Translation X = 2.418170
Translation Y = -17.306444
Translation Z = 0.000000
Iterations = 118
Metric value = 48.648984
Matrix =
0.984853 0.173390 -0.000134
-0.173390 0.984853 0.000005
0.000133 0.000018 1.000000
Offset = [-14.932855 -0.065922 -0.013900 ]

However, if I change the metric to MattesMutualInformationImageToImageMetric without changing anything else in the code, the values are off as you can see:
Result =
versor X = -0.007452
versor Y = 0.090020
versor Z = 0.003222
Translation X = -0.069399
Translation Y = -0.071802
Translation Z = 0.000000
Iterations = 103
Metric value = -0.574851
Matrix =
0.983772 -0.007759 0.179255
0.005076 0.999868 0.015424
-0.179351 -0.014264 0.983682
Offset = [-13.724556 -1.887127 19.134393 ]

My code is basically a copy of ImageRegistration8.cxx (under ITKv3) except that I am using SetImportPointer to import the images from the buffer.
I would appreciate if anyone have any idea on what could be wrong or how to troubleshoot this strange issue.
Thanks much,

Do you mean this example from ITKv3 or this test from ITKv5?

How do these differences look visually? How different are they?

I am using the example from the first link which uses typedef and StartRegistration.
The output image using MMI is not correct as you can see

With mean square metric, I got the aligned image


ITKv3 was release about 10 years ago. It is no longer supported. Many fixes have been made to ITK since then. Please update your code to ITKv5. The v4->v5 migration guide is provided.

Unfortunately I cannot update ITK in the software I am using since the provided library are already compiled.

What is the name of that old software? What does it do? There is a good chance that there are now free, open-source applications that offer the same features.

After days of troubleshooting, I found my mistake related to using SetImportPointer - the same slice was propagated to all slices to form the 3D images. Now MMI works. Thanks!

1 Like