LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to plot 3D array composed of stacked 2D arrays

Hello , 

 

 I want to plot a 3D array composed of stacked 2D arrays (xy arrays ) 

 

Thanks for your help  

0 Kudos
Message 1 of 11
(5,179 Views)

You'll have to gives us a little more description of what you are trying to do and what is the meaning of the data in your arrays.

0 Kudos
Message 2 of 11
(5,174 Views)

Hi  , 

The application is used  to extract external contour points from a frame of images and plotting the extracted  data in 3d surface or annulus graph 

with  more details I want draw a 3D shape of externals contours 

I will be thankful if you have another suggestion by using 3d picture controls tools

 

Thanks 

0 Kudos
Message 3 of 11
(5,159 Views)

Take a look at this thread for previous threads on this topic.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 11
(5,136 Views)

I looked at the collection of vi's you posted on the thread you mentioned, particularly "3-d surface.vi" However, that file has the 3-D array already. I am still trying to make the 3-D array.

 

My current code produces a 3-D graph of one picture. However, what I want is all the pictures together in one array, for example the first slice is at z=0, the second slice is at z=1, etc. I realize that there is a toolkit available to reconstruct the 3-D image from 2-D images, however I would like to work from the bin file to conserve space/memory.

 

 

display 1 picture.png

x and y are the dimensions of each 2-D picture. z is the number of pictures. Below is the modification that I attempted. A 3-D array is initialized outside of any loop (because I only need to do that once), then I wanted to use "insert into array" inside the inner loop to save each image as the loop runs.

 

save all pictures.png

 

 

I could just initialize a 5-D array in order to get three dimensions by the time I get into the small loop, but the problem with that is the extra dimensions will be added back again. I can put the 5-D array into the 3-D graphing stuff, and it allows me to run the vi, but as expected I will get an error (after about 10 minutes):

"Error -2146828283 occurred at Exception occured in cw3dgrph: Array dimension mismatch.Help Path is cw3dgrph.chm and context 429 in Post-Processing loop - Copy.vi

This error code is undefined. Undefined errors might occur for a number of reasons. For example, no one has provided a description for the code, or you might have wired a number that is not an error code to the error code input.

Additionally, undefined error codes might occur because the error relates to a third-party object, such as the operating system or ActiveX. For these third-party errors, you might be able to obtain a description of the error by searching the Web for the error code (-2146828283) or for its hexadecimal representation (0x800A0005)."

 

I would highly appreciate any suggestions as to how to do this.

0 Kudos
Message 5 of 11
(5,063 Views)

That error code is telling you the cw3D graph found a problem with the various inputs you suppled. Probably becuase you have too many dimensions.

 

THe 3d graph wants the same dimenstion for all of the datat value inputs and they all have to be the same size.

 

The varous inputs are used to compose the "quad" required to plot a point so they al have to be the same size and dimension so it has a complete set.

 

Judging by the image you posted, I suggest you start a new thread asking how to create a 3d array starting with your ... file.

 

There are many on this forum that can help you learn to generate the 3D array but few that have experience with the 3D graph. Once you get your array right, then return to using the 3D graph.

 

As a general rule I seriously question any array over 3 dimensions. I once read a post by Jim Kring who claimed there is no real-world use for an array over ... 3D (memory may be wrong). I could understand a 4D array as being used to store multiple 3D images but 5D ... there is something wrong.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 11
(5,059 Views)

Thanks for your response. I understand that cw wants a 3d input. I was just reporting what happened. Also, I totally agree that I don't want 5-D. If I can remove the 4th and 5th dimensions that were added as a result of loop indexing, I'll be happy. I'm looking at "delete from array," hopefully I can figure out how to use it. I think the length is the same as the loop N. According to the helpfile, the length is the number of rows, columns, etc. to delete. I need to figure out what to wire to "index (dim 5)" to remove the entire 5th dimension, then wire the 4-D output to another "delete from array" and do the same thing to the 4th dimension (which is "page", right?)

0 Kudos
Message 7 of 11
(5,053 Views)

Something seems very wrong about working a higher dimenstion than you plan to use in the end.

 

Re "page?"

 

Quoting myself from this post

 

"

Building

Floor

Isle

Shelf

Book

Page

line (row)

character (collumn)

 

if you were working with an 8D array (which is rediculous, I admit).

 

"

 

like I said above start a new thread. You will get better advise than just waiting on me.

 

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 11
(5,049 Views)

 

I will start a new thread, thanks.

 

So the 4th dim is a "book"?  Well, the helpfile calls it a "vol", same thing I guess. (volume) Too bad the rest of those names are not used.

 

"In bigger multidimensional arrays, column remains the last index and the more major indexes are added to the front. Thus, row is the first index, followed by page, vol, and column. These names are index identifiers and have no other meaning. "

0 Kudos
Message 9 of 11
(5,046 Views)

@count3r5tr1ke wrote:

 

I will start a new thread, thanks.

 

So the 4th dim is a "book"?  Well, the helpfile calls it a "vol", same thing I guess. (volume) Too bad the rest of those names are not used.

 

"In bigger multidimensional arrays, column remains the last index and the more major indexes are added to the front. Thus, row is the first index, followed by page, vol, and column. These names are index identifiers and have no other meaning. "


New thread:

Good thanks!

 

Too bad:

They apperently did not rad my post before writing up the help. Bad bad bad.

 

Here take a Kudos for starting the new thrad.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 10 of 11
(5,044 Views)