Hello!
I have an 512x512 array z where ~11000 points are non zero and the rest must be nans! Why is the following code giving me an array zgd filled with only nans? How does this program deal with nans?

xi = linspace(0,1,512);
[xg,yg]=meshgrid(xi,xi);
x = 1:512;
y = 1:512;
zgd = griddata(x,y,z,xg,yg);

So the pixel value from the moving image is transformed into the deformed moving one and the new position is e.g. x + Tx(x) , y + Ty(y), right? Does this mean that the old image is just updated with these values? what happens to the old pixel values where the pixel was transformed from and is the 'transformed to' pixel value the new value + the old one which was there already? And where does the interpolation take place?