Backwards 2D Interpolation

Hi

I have two scaled 2D wave representing z1 and z2 as a function of x and y. 

I would like to interpolate z1 "backwards" to create two new scaled 2D waves representing  (1) x as a function of y and z1 and (2) z2 as a function of y and z1.

I see how I could use a binarysearchinterp of z(x) at fixed y to build up the new waves but this is less accurate than a true bilinear or spline interp of the 2D "surfaces".

Is there a built-in function for this?

I am struggling to imagine a bit what you are trying to achieve, but for (1), isn't that just a matter of how the data is arranged in a 3D matrix? If you swap the data so that you have [z1][y][x] you are done, no? You can do such data shuffling via

MatrixOP out=transposeVol(in,4)

As for (2), you would first need to figure out how z1 and z2 are related to each other. If you have achieve (1) I guess you want to look up x in your first map and then recast the x in your second map. You may be able to do that by using interp2D on (1). Do you have some example data to better understand what you want?