pyimreg / python-register

Linear and non-linear image registration methods, using scipy and numpy.
Other
62 stars 35 forks source link

Doubt regarding the Kernel Function in Thin Plate Splines #48

Closed anorak94 closed 2 years ago

anorak94 commented 3 years ago

Hey in the kernel function U in thin plate splines, there is a minus sign so the equation is computed -r*2 log(r*2). Should there be a minus sign in the equation. I dont think so because in the paper by Bookstein he shows an example where the matrix K is positive, and in the beginning he also says that the minus sign is for reading convenience using your implementation the kernel matrix is negative. I think this is a bug in the implementation. Also I think the functions you are using to get the grid after computing the affine and non linear part is wrong too because I compared it against the naive implementation of x_new = x_oldaff + non_linearity for each coordinate of a grid and it gives different results. They are maybe a little close but clearly off by a large amount