LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data interpolation inside a volume

Solved!
Go to solution
Hello,

I'm a "new" user of LabView and I've a "basic"need 🙂

I would like to perform an interpolation inside a volume.
I've a 3 dimensional array of data named V. This data are on a regular grid described with 3 vectors x, y and z.

I didn't find any LabView function in order to perform this interpolation (it seems that by default, it can only perform 2d interpolation).

Can you confirm that ?
Is there a way to perform such linear or nearest interpolation ? 🙂

Thank you very much for your help
Regards,
0 Kudos
Message 1 of 12
(7,300 Views)

You can interpolate the three vectors as a function of index, then reconstruct the higher resolution 3D trace.

 

For linear interpolation, you can use "interpolate array". For more complex interpolations, look in the interpolation palette.

0 Kudos
Message 2 of 12
(7,297 Views)

Here's what I had in mind. Modify as needed. (LabVIEW 2011)

0 Kudos
Message 3 of 12
(7,292 Views)

Actually, I probably misunderstood. It seems you want someting like bilinear interpolation, just in 3D.

 

Basically, you want trilinear interpolation. Seems easy to implement. 😄

0 Kudos
Message 4 of 12
(7,282 Views)
Solution
Accepted by topic author Rufnek

OK, I quickly wrote a trilinear interpolation from scratch. See if this works for you. (attached VI is LabVIEW 8.2)

 

(Make sure you are not indexing outside the volume. There are probably a few more tweaks and checks needed, this is just a rough draft.)

 

The definition of the fractional indices is similar to index array, except that fractional value are allowed Similar to my old bilinear demo, see also here)

 

 

Message 5 of 12
(7,273 Views)

Hello alterbach !

 

Thank you very much for your answers and this first draft of an trilinear interpolation.

I'm studying your example, I keep you in touch

 

Thanks,

0 Kudos
Message 6 of 12
(7,253 Views)

Please let me know if it works for you and if you find any bugs.

 

In the meantime I have added an idea for "interpolate array" to accept higher dimension arrays (link below).

 

Please vote for it if you think it would be useful. Thanks!

 

Idea: Interpolate array for higher dimensions (bilinear, trilinear)

0 Kudos
Message 7 of 12
(7,239 Views)

Thank you altenbach, your code is good working ! I've made some modifications in order to accept 3D arrays as input. It's nothing.

 

It can be improved by checking if interpolated point are outside the initial volume but It's not an important point for me...

 

Many thanks !

 

Best regards,

0 Kudos
Message 8 of 12
(7,210 Views)

@Rufnek wrote:

I've made some modifications in order to accept 3D arrays as input. It's nothing.


3D arrays where? The volume is already a 3D array in my code.


@Rufnek wrote:

It can be improved by checking if interpolated point are outside the initial volume but It's not an important point for me...


Yes, I was only interested in the math. A robust implementation definitely needs more work.

0 Kudos
Message 9 of 12
(7,204 Views)

xi, yi, and zi (coordinates points) are vectors. I prefer manipulate 3d arrays so, the function accept coordinates in 3d arrays. This arrays are converted into vectors and then your code is used. That's nothing.

0 Kudos
Message 10 of 12
(7,199 Views)