Hi, I am trying to regrid polar data to a rectangular grid, now this works but only if I use the griddata function. I want to be able to do this through interpolation or even better through convolutions, why? Because this is actually data in the frequency domain and because it is sampled in a polar way the lower frequencies have a higher density than the higher frequencies, so I need to compensate this through a convolution with another kernel.
So let me first situate the dataformat I have, because I think the biggest problem lies in here.
I have a vector representing data from radial lines, whereas the first 512 points are one radial line, the following 512 points is the next radial line, etc... (So all the radial lines have 512 points in my image). Considering the size of this vector is 411648, divided by 512, gets me 804 different radial lines.
Now I have another vector describing the trajectory of all the lines, this is one complex vector where the real parts are actually the x coordinates and the imaginary parts are the y coordinates, so by a simple real() imag() you can get the x and y coordinates, corresponding with the datavector.
so what I simply did was create a meshgrid from 512 to 512 and use the griddata() function with 'cubic' interpolation to get the data on a rectangular grid. Or in code:
rawdata %loaded data
ktraj %loaded trajectory vector
res = 512;
x = real(ktraj);
y = imag(ktraj);
[X, Y] = meshgrid(-(res-2)/2:res/2, -(res-2)/2:res/2);
gridraw = griddata(x, y, rawdata, X, Y, 'cubic');
Now as I said before this is actually frequency spaced data, so if I do an inverse fourier I get aliasing because the densities haven't been compensated. So what I actually want to do is compensate by weighing the data with the ramp filter used in the interpolation step (before interpolating ofc). So I have no idea how I should do this since I use the griddata function instead of doing interpolation manually, I also tried using interp2 instead of griddata, but it then complains that my x and y are not in meshgrid form (which is true since they just list the different coordinates). The weighing isn't as obvious for me either.
Anyone know how I should go about this problem?
If you want more info feel free to ask