Check that two images are at the same physical location

Hello,

In itkImageToImageFilter the method VerifyInputInformation check that all the inputs are in the same physical location. When filters do not expect all input images to be at the same physical location, this method is overridden and the check is removed.

In RTK, sometimes we want to perform this check not on all the inputs but only on specific ones. For now, every time we need to do this test we basically copy/paste the code from itkImageToImageFilter and apply it to the specific inputs (see here for example).

In order to avoid this copy/paste, @simon.rit suggests in this thread to create a method in ImageBase HasSameInformation(Self *img2) (or another convenient name) in which we would move most of the ImageToImageFilter::VerifyInputInformation() code to reuse it when needed on the specific inputs.

What do you think of this solution ? If it suits you, I could implement it and do a pull request on ITK repository. Or maybe do you have a better solution in mind ?

Thanks,

Antoine

2 Likes

That sounds good to me.