LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D picture stacking

Highlighted

Hi, I currently have a 2D image I can can capture with the SNAP.vi and effectively turn it into a 2d array of grey scale intensities. How would I stack a large number of these arrays to create a 3D intensity array that can be graphed with a contour plot or 3d surface graph. I'm really new to Labview and cant seem to get a good grasp of making this. Thanks in advance!

0 Kudos
Message 1 of 11
(808 Views)

if you are plotting intensity as your z-axis, you can try the following:

From FP, Control > Graph> 3D Graph > Surface

3DS.png

CY
0 Kudos
Message 2 of 11
(792 Views)

You're mixing to completely different things.

 

You have a 3D volume of values (a point cloud on a grid), often referred to as "voxels" (as in 3D "pixels"). A surface is something completely different. You'll need some pretty advanced\specialized algorithms to go from voxels to surface.

 

In it's 'simplest' form you can apply a threshold, and create triangles between adjacent voxels where the threshold is passed. Usually some surface optimization is applied, like Delaunay triangulation.

 

You can apply a alpha to textures created from that 3D data, in three directions, and render them as individual textures stacked in 3 directions. That would give a 3D volume rendering effect...

0 Kudos
Message 3 of 11
(768 Views)

pardon me, I must have misunderstood the question. but since you brought up the point cloud idea, rokar007's question may have been the reconstruction of a CAD model based on section layers images, like the 3D additive printing in reverse. thanks for pointing it out.

CY
0 Kudos
Message 4 of 11
(757 Views)

@cy... wrote:

pardon me, I must have misunderstood the question. but since you brought up the point cloud idea, rokar007's question may have been the reconstruction of a CAD model based on section layers images, like the 3D additive printing in reverse. thanks for pointing it out.


No problem for me, any help is appreciated.

 

What you created is known as height field rendering. 2D, with intensity as 3rd dimension, like a landscape.

 

With 3D data, and an intensity it gets more complicated... If fact, if OP can live with a height field, I'd really recommend it. Saves a lot of headaches.

 

Just remembered: going from 3D grid to surface can be done with marching cubes. Not easy. Let me know if you get it working, I never did although I might give it another try someday. And then optionally Delaunay or other level of detail algorithms.

0 Kudos
Message 5 of 11
(750 Views)

Thank you both for the input. I was wondering if there is any way to depict specific intensity levels using this "landscape" approach and if so how would I go about doing it.

0 Kudos
Message 6 of 11
(748 Views)

you can use 3 for loops to run the 3D array through. with the innermost nested loop having conditional terminal for Z (height), nested within a for loop for Y (width) and marching through X (depth). termination condition being a comparison function wired to a threshold control (numeric). the Z loop returns the iteration index for height, and the rest are the same using the 3D surface plot control. this will produce a landscape plot for the topmost layer of the intensity tested.

 

put it within an event structure to allow adjustments of intensity threshold. hope you get the picture.

CY
0 Kudos
Message 7 of 11
(736 Views)

@cy... wrote:

you can use 3 for loops to run the 3D array through. with the innermost nested loop having conditional terminal for Z (height), nested within a for loop for Y (width) and marching through X (depth). termination condition being a comparison function wired to a threshold control (numeric). the Z loop returns the iteration index for height, and the rest are the same using the 3D surface plot control. this will produce a landscape plot for the topmost layer of the intensity tested.

 

put it within an event structure to allow adjustments of intensity threshold. hope you get the picture.


That won't work for concavities... Best scenario it will result in 3 landscapes. Probably need to do it 6 times, each dimension, two directions. But it still won't work if the surface has concavities, as one threshold makes the scan stop. This will not (always) be handled by the other dimension either.

 

Great minds have given this a lot more thoughts than I ever could. Pretty sure marching cubes is the generally accepted way to do it.

0 Kudos
Message 8 of 11
(729 Views)

wiebe@CARYA wrote:

@cy... wrote:

you can use 3 for loops to run the 3D array through. with the innermost nested loop having conditional terminal for Z (height), nested within a for loop for Y (width) and marching through X (depth). termination condition being a comparison function wired to a threshold control (numeric). the Z loop returns the iteration index for height, and the rest are the same using the 3D surface plot control. this will produce a landscape plot for the topmost layer of the intensity tested.

 

put it within an event structure to allow adjustments of intensity threshold. hope you get the picture.


That won't work for concavities... Best scenario it will result in 3 landscapes. Probably need to do it 6 times, each dimension, two directions. But it still won't work if the surface has concavities, as one threshold makes the scan stop. This will not (always) be handled by the other dimension either.

 

Great minds have given this a lot more thoughts than I ever could. Pretty sure marching cubes is the generally accepted way to do it.



marching Z from the top should have handled concavities, unless the concave itself is obscured from the top view.

 

the marching cube method you mentioned, is it like the flood fill method in 3D?

CY
0 Kudos
Message 9 of 11
(725 Views)

perhaps this method can work?

https://forums.ni.com/t5/Example-Programs/Display-Point-Cloud-in-3D-Picture-Control/ta-p/3497874

you just have to modify the XYZ-bundle array to the coordinate of your threshold points

 

@wiebe: pardon me for not reading up on the method first... 

CY
0 Kudos
Message 10 of 11
(701 Views)