05-29-2018 11:21 PM
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!
05-30-2018 12:29 AM - edited 05-30-2018 12:53 AM
if you are plotting intensity as your z-axis, you can try the following:
From FP, Control > Graph> 3D Graph > Surface
05-30-2018 07:04 AM
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...
05-30-2018 08:03 AM
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.
05-30-2018 08:38 AM
@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.
05-30-2018 08:43 AM
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.
05-30-2018 09:01 AM
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.
05-30-2018 09:17 AM
@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.
05-30-2018 09:37 AM
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?
05-30-2018 10:24 PM
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...