Comparing Vector Images in my Tests (using itkTestMain.h)

I am using itkTestMain.h as parent for module tests. However, I also need to compare Vector Images against their baseline and this is apparently not supported because the images are cast to double.

Did I overlook something or can you suggest an easy way to include Vector Image comparison in my tests?

This should be available in ITK. I don’t know how they compare color images if they don’t have this. It could worth asking this from ITK people.

A workaround could be to split the vector image to its components and compare each component separately.

Thanks Andras, I asked there (they confirmed it is a limitation currently), and implemented the workaround you suggested. Currently I am doing this in a copy of itkTestMain.h in my project/slicer module. When I put the pull request up for that project, I could share it here, if you’d like to see if it is worth considering integrating it into Slicer!?

In case you are interested in the workaround follow this link.

It’s a simple straight forward fix, not very sophisticated but better than before at least, since differences in Vector Images are now detected.

Thank you. If you can get it integrated ITK then it is enough. Slicer regularly updates its ITK version, so your changes will eventually get into Slicer.

Thing is, I only changed the itkTestMain.h, which is not part of ITK anymore (since 4 I think), but it was kept in Slicer for backwards compatibility (see here).

If the file is not part of Slicer then please send us a pull request and we’ll merge your improvements. It would be great if you could also add a test somewhere that uses the new vector image compare feature (e.g., you could add a new test to one of the CLI modules).