LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can you transpose a 3D array?

I have 84 columns, 24 rows and 100 pages and I want to rotate the data so that I have 84 columns, 100 rows and 24 pages. Any ideas pleeease?! The attached file is a bodge-up attempt of mine but it is unbelieveably slow - there must be a simpler way of doing it.
0 Kudos
Message 1 of 12
(6,646 Views)
I couldn't follow your program. It looks to me like you're getting the same thing out that you put in. I have attached an example that should do what you described. It is specific to the application you described, but you could generalize it.

Hope that helps.

John
Message 2 of 12
(6,646 Views)
Thanks for your response. Unfortunately the transposition I need is 100x24x84 to 24x100x84 (I could have organised my question better, I now realise!) - the problem lying in how to swap the pages with the columns. Any idea how to do that?

Thanks again!
0 Kudos
Message 3 of 12
(6,646 Views)
Hi Stressed Fred,

Check out the "re-shape array" function in the array manipulation palette. It is about as fast as you can get with this type of operation in LV.

Question:
Why do you want to move all of this data around?
It much faster to work on data "in-place" and avoid copying thing around. If you are trying to use for loops to auto-index then you may be better off switching over to while loops and doing you indexing explicitly.

I am just guessing here.

Trying to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 12
(6,646 Views)
You can still use the same method that I used in the previous example program. The only difference is that you will need to manually do the indexing on the row instead of autoindexing.

John
0 Kudos
Message 5 of 12
(6,646 Views)
Hi Ben,

Thanks a lot. However, it seems re-shape array leaves the data in the same order so it won't do what I need it to do.

Um, in an attempt at a reply to your question, I'm taking a series of images with a CCD camera and need to perfom operations (such as frequency filtering) on 1d arrays of data where the 1D array is, for example, the first pixel in the first image, followed by the first pixel in the second image etc.

Thanks for your help!

Regards,

Fred
0 Kudos
Message 6 of 12
(6,646 Views)
Hi,
try this example.

Good luck.

Oleg Chutko.
Message 7 of 12
(6,646 Views)
Then I recommend working with the array in place and explicitly indexing out the data you need.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 12
(6,646 Views)
Good point - I guess that'd be the most efficient way of doing it.

Thanks,

Fred
0 Kudos
Message 9 of 12
(6,646 Views)
That's brillant! Thank you!
0 Kudos
Message 10 of 12
(6,646 Views)