Interp3. Error using griddedInterpolant. The grid vectors do not define a grid of points that match the given values.

32 visualizaciones (últimos 30 días)
Hi,
I'm trying to use interp3(x, y, z, image, xq, yq, zq).
My new query xq, yq and zq are [256, 256, 90], and my old x, y and z are equal to [196,256,512].
I get the following error
Error using griddedInterpolant
The grid vectors do not define a grid of points that match the
given values.
Error in interp3 (line 146)
F = griddedInterpolant(X, Y, Z, V, method,extrap);
Error in clinicalTest_aligment (line 99)
newMrImg = interp3(X, Y, Z, oldImage, Xq, Yq, Zq);
It does not work because the x is smaller than xq?
In that case it is 'extrapolation' and not interpolation?
Thanks in advance
  3 comentarios
drummer
drummer el 20 de Feb. de 2020
Hi Adam, I am trying to interpolate a MRI volume image to a smaller size.
Previously I 'meshgridded' x, y and z and xq, yq and zq, so:
[x, y, z] = meshgrid(xDim, yDim, zDim)
[xq, yq, zq] = meshgrid(newxDim, newyDim, newzDim) % newxDim, newyDim and newzDim are 2-dimensional vectors
% to compose the new dimensions of Vq. Ex: newxDim = xVector(256,1) = newyDim, and newzDim = zVector(90,1)
% same for xDim, yDim and zDim.
So the dimension being smaller in the original image it is not related to the issue I'm facing?
You're actually the first fellow drummer neuroscientist I ever met. Cheers.
Adam Danz
Adam Danz el 20 de Feb. de 2020
I do extracellular recordings so I've spent a lot of time (4-6 hrs a day for years) listening to spike trains of visually responsive neurons (MSTd) firing in real time to various visual stimuli. I've always thought it would be cool to combine segments of those audible responses to dubstep music :D

Iniciar sesión para comentar.

Respuestas (1)

Adam Danz
Adam Danz el 20 de Feb. de 2020
Editada: Adam Danz el 20 de Feb. de 2020
Follow this tutorial and if you get stuck or come across a problem that isn't already addressed in the forum I'd be glad to dig in. If you're working with an image of uint8 data, you'll need to convert it to double, first.

Categorías

Más información sobre 3-D Volumetric Image Processing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by