Is WarpImageFilter supposed to reverse a displacement field?

Continuing the discussion from How to create a displacement field image from a numpy array without files?:

Is WarpImageFilter supposed to reverse a displacement field?

Hi! I just figured how to warp an image with a displacement field, but I think that I am doing it backwards… or is WarpImageFilter supposed to reverse the displacement field?

In the figures below, the red block is moved -1 in x, y and z, but the displacement field was 1 in each direction.


Hello @edgar,

This discussion answers your question.

2 Likes

Also the general ResampleImageFilter should be preferred over the specialized WarpImageFilter.

1 Like

Yes, it does. Thank you very much. Sorry for the duplicate posting.

Thanks, I will look into that (when I have to cross that bridge again q: ).