SuperElastix / elastix

Official elastix repository
http://elastix.dev
Apache License 2.0
457 stars 113 forks source link

elastix 5.0 different results and twice as slow on iteration steps with respect to elastix 4.9 using bspline transfrom and advancedmattesmutualinformation metric #251

Open HainBuche opened 4 years ago

HainBuche commented 4 years ago

Hi everyone,

I just tried out the new elastix 5.0 version vs the previously installed elastix 4.9 version on the same data with the same parameter file performing a bspline transformation using AdvancedMattisMutualInformation metric and the calculation takes about twice as long as before, mainly due to iteration steps taking twice as long. Also when applying the resulting TransformParameters file on the same inputfile, the output (created by transformix) is quite different from elastix 5.0 with respect to 4.9. Especially strange to me is that the inputpoint position that was formerly exactly matching the inputpoint index is now totally off, before only the output points had deformations applied to it. I tried with precompiled as well as self-compiled version on my original Ubuntu 16 machine and on another Ubuntu 17 machine, speed always same slow. Interestingly using a precompiled elastix 4.9 version on the Ubuntu 17 machine, the calculation time was exactly as slow as using elastix 5.0 on the same machine, while on my original Ubuntu 16 machine elastix 4.9 was performing twice as fast. But the result of elastix 4.9 on both machines was the same, just taking longer on Ubuntu 17, while actually using more CPU power (almost twice as much). Elastix 5.0 is using less than half of the CPU as elastix 4.9 on both machines. If I use the option (UseMultiThreadingForMetrics "false"), elastix 5.0 actually performs with the same fast speed as elastix 4.9 on the original Ubuntu 16 machine, while still yielding utterly different results with respect to the transformation, metric values are quite similar. Is there maybe a new offset for the indices of an image in elastix 5.0 or what am I missing? Any ideas on what might be causing this? Please tell me if you need more information.

Best regards and thanks in advance !

mstaring commented 3 years ago

We fixed some performance issues in the ITK related to this. We think it is solved in the develop branch with the latest of ITK. Would you be able to confirm?

HainBuche commented 3 years ago

In my case the performance does not seem to have significantly improved, as elastix-5.0-develop (ITK 5.1.1) is still about 2 times slower than elastix 4.9, BUT the results are not completely off anymore, they now only show small deviations between both versions.

N-Dekker commented 1 year ago

@HainBuche is this issue still relevant to the latest release, elastix 5.1.0? Please try! https://github.com/SuperElastix/elastix/releases/tag/5.1.0