[Insight-users] Warping an Image?

Chad Washington chad.w.washington@vanderbilt.edu
Tue, 25 Feb 2003 00:38:04 -0600


I am attempting to use the itkWarpImageFilter on a 2-D image.  My deformation 
field is an image of 2-D vectors defining x and y displacements.  They both 
have the same size, origin and spacing.  My deformation field is calculated 
from a finite element mesh.  I have viewed the deformation field plotted 
against my mesh, and believe that it is correct.  However, my deformed image 
looks nothing like what I predict.  It actually looks as if the field is 
being applied in the opposite direction, i.e. my deformed image appears 
stretched rather than compressed.  I have tried the 
BSplineInterpolateImageFunction.  With this the image is smoother, but it is 
still not being deformed correctly.  I also tried reversing my field.  
Currently, the field is defined for each pixel position of the original input 
image.  Is this wrong? Should it define the inverse mapping for the pixels of 
the output image?  I have been working with the assumption that the 
WarpImageFilter does the inverse mapping for you.  I would be extremely 
thankful to anyone that has used this filter and can provide some tips on its 
use.

Chad Washington
Biomedical Modeling Lab
Dept. of Biomedical Engineering
Vanderbilt University