# how to apply a 2D displacement field to set of 2d pixel coordinates

26 views (last 30 days)
Laura nicolas on 27 May 2021
Commented: Laura nicolas on 2 Jun 2021
I am working with image registration. I have registered all my images and gotten various tforms and displacement fields from the image registration pipeline.
I now want to evaluate my method, I have a set of point coordinates representing landmarks for each image. I have managed to apply all the tforms to these landmarks without issues. However, I have not been able to find how to apply a (image) Displacement field to a point coordinate. Is it even possible?
Example of data:
Registered images of 10000 x 13000 pixels (double)
tforms: T =[a,b,c;e,f,g;h,i,j] Dimensionality=2
Displacement fields: 10000 x 13000 x 2 (double)
Landmarks: 61 x 2 (double)
Thank you

Michael Werthmann on 1 Jun 2021
Hi Laura,
I suppose you want to calculate the TargetRegistrationError. Here is a formula for the 3d case. u is your deformation field whereas x_i and x_j are the respective coordinates of landmark pairs.
e.g. if one Landmark is at position (x = 5, y = 5).
You now need to get the values from the displacement field at this position and apply it.
new_pos_x = x_LM + u_x(5,5)
new_pos_y = y_LM + u_y(5,5)
If your Landmarks are between pixels, you have to interpolate the displacement field at this respective position.
Keep in mind the difference between pixelspace and real world coordinates if this applies to your case.
Regards
Michael
Laura nicolas on 2 Jun 2021
Makes perfect sense and works like a charm. Thank you so much!