LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace Subset of 3D Array page

Solved!
Go to solution

Is is correct that LabVIEW has no built in function to replace a subset of an 3D Array page?

Quiztus2_0-1708095669575.png

Replace Subset of 3D Array page.png

 

Actor Framework
0 Kudos
Message 1 of 8
(826 Views)

To replace a 2D subset of a 3D array, you need to wire only one of the indexes; in this implementation, when you wire all three indices, it points to an element and not a 2D subset.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 8
(808 Views)

In more general terms:

 

altenbach_0-1708099382801.png

 

0 Kudos
Message 3 of 8
(794 Views)

Another option (Replace a 3D array in a 3D array):

wiebeCARYA_0-1708102300949.png

Also note that the 2D arrays can be transposed, making life "easier":

3D Array Study.png

 

I'd think about it a while. Only if your data is really 3D (like a 3D voxel cloud or something), I'd consider 2D arrays in an array of classes (or clusters).

 

3D is too difficult for me. I'll use it if I have to (if the data is really 3D), but I try to avoid it.

 

I'd never put 2D tables in a 3D array, just because the size matches. If 1 measurement result is 2D, 2 measurements would fit a 3D array. Headaches for sure...

Message 4 of 8
(780 Views)

Would you find it counterintuitively, if one could wire a 2d array in the way I ask for in my initial post?

Actor Framework
0 Kudos
Message 5 of 8
(745 Views)

@Quiztus2 wrote:

Would you find it counterintuitively, if one could wire a 2d array in the way I ask for in my initial post?


If you have a 3d array and index into on all 3 axis (like 1, 1, 1) what size array/object do you expect to be located at the index(1, 1, 1)? A 2d array? 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 6 of 8
(738 Views)
Solution
Accepted by topic author Quiztus2

@Quiztus2 wrote:

Would you find it counterintuitively, if one could wire a 2d array in the way I ask for in my initial post?


Given a position and a 2D array, it can be inserted in three different planes. Obviously LabVIEW cannot make that decision because the information is insufficient.

0 Kudos
Message 7 of 8
(728 Views)

If you really want to use 3D arrays (although this works for 2D arrays too), you might spent some time exploring the In Place Element Structure, esp. Index / Replace Element and Split / Replace Subset functions:

 

wiebeCARYA_0-1708335235782.png

It never quite does what I expect from them (the replace can only replace scalars, the split doesn't actually return a 2D array when splitting a 3D array). These functions used to crash LabVIEW if the data sizes didn't match, but that's probably fixed.

 

A really annoying thing is that the dimension you set silently fall back to 0 if you wire the input with something bad. Fixing the problem doesn't restore the dimension you set. E.g. if you set the dim to 2, and insert a reverse array (obviously wrong for a 3D array), and remove it and rewire, all dims are back to 0. So, be warned and use CTRL+Z (and unit testing?)...

0 Kudos
Message 8 of 8
(635 Views)