Compare two images of any kind

Is there an easy way to compare two images for equality that also supports Vector Images?

Right now I am using the old itkTestMain.h :confused: which uses the itkTestingComparisonImageFilter and does not support Vector Images.

This is an unfortunate limitation of the current method.

For SimpleITK testing we implemented a function which works with scalars, vector images, and images of complex numbers. It computes the root means squares:

This is build upon SimpleITK’s typeless layer, but could be ported to native ITK Filter and many people would find it useful. Dealing with the different pixel types may require some C++ meta-programming, new C++11 features may make this easier to do now.

Thanks for your answer. I’ll see if I can switch to SimpleITK or try to port it to native ITK.

For the reference, and in case someone else needs this, @mschwier implemented this comparison separately in our library by comparing all vector components (this is what makes sense for our use case), see