When rendering my demons displacement field as polygonal arrows they point backwards. Additionally, if I manually investigate the values of the image, they point backwards. So I’ve been considering if demons even produces a forward displacement like documentation lead me to believe. It seems as though something is fundamentally wrong with my understanding but maybe it’s just a bug.
The documentation is a bit vague just saying that it would produce a field that would map the moving image to the fixed. Which is confusing because it entirely depends on how you map the image. IE: Some function exists that would produce the fixed image given the moving image and output field.
Most examples and myself, use WarpImageFilter. This computes the inverse of the input field which is much more useful because we can warp the image by simply sampling where it came from. This would imply you should provide WarpImageFilter with your forward displacement. And since I have supplied WarpImageFilter with my demons displacement field (and it produced the fixed image successfully), it would imply this is a forward displacement field.
So I’m a bit confused why the values are backwards. The only other possible step that could have messed them up is my conversion of the ITK vector image to a VTK image. But this just uses ITKs itk to vtk filters. When I manually investigate the values though I use the VTK converted image.
Any help would be appreciated.