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

8 views (last 30 days)
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

Accepted Answer

Michael Werthmann
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

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!