plotting LiDAR data in 3D

Hi, I'm trying to make a specific LiDAR curtain plot. LiDAR data was collected on board an airplane, so I'm looking to plot LiDAR "curtains" on a map in 3D (similar to the attached image - though I'm not looking to use a complex terrain map, just a simple political boundary map).

The LiDAR data comes in a matrix - altitude is vertical, time is horizontal, and each point is measured value at that particular time(in this case, some property of aerosols, either backscatter or extinction). I have no problem plotting this in 2D (altitude on y, time on x), but I have no idea how to plot this in 3D. At each point in time, there are associated latitude and longitude coordinates. I was thinking of taking my 2D matrix and converting it to a 3D matrix, where each "layer" would be identical (i.e. have the same data points), but I'm not sure how to copy the rows and columns of one layer into other layers. Furthermore, even if I did that, I'm not sure of the best way to plot this so it would look similar to the attached picture. If anyone has suggestions or has worked with plotting LiDAR data in 3 dimensions, help would greatly be appreciated.

I am a bit confused by your description.
Quote:
The LiDAR data comes in a matrix - altitude is vertical, time is horizontal, and each point is measured value at that particular time(in this case, some property of aerosols, either backscatter or extinction).

This does not describe how you are connecting between time and geographic position.

If I needed to create a graph similar to the one that you posted I'd probably do it in two steps:

The first step would be to display the background map image. This can be done from geo data that you can display as a surface or an image that you map to the bottom of the Gizmo drawing cube.

The second step is for you to create parametric surface(s) for the various LIDAR segments that you are displaying. The parametric surface(s) define the shape of the "curtains". The actual data is coded into a color wave. You can find a more complicated example of parametric surface (in the shape of a sphere) in the demo under File Menu->Example Experiments->Visualization->GizmoSphere.

To generate the color wave you first select a built-in colortable, e.g., Rainbow. You then execute:
ColorTab2Wave Rainbow                                             // get the colors into the wave M_colors
MatrixOP/O gizmoRGBColors=M_colors/65535        // convert to SP and scale


The color wave has to have the same number of rows and columns as your parametric surface and 4 layers for (RGBA). Fill the last layer with 1 for opaque colors. Fill the remaining layers by indexing the scaled LIDAR data into the gizmoRGBColors wave. Specifically, if z0 is a scalar value that you want to draw, you find the min and max to establish the global z range which gives you the following index for the selected RGB:
Variable min=WaveMin(scalarWave)
Variable max=WaveMax(scalarWave)
Variable nor=255/(max-min)
Variable index=nor*(z0-min)

If z0 corresponds to element (i,j) of your parametric wave, you assign the colors using:
paramColorWave[i][j][0]=gizmoRGBColors[index][0]
paramColorWave[i][j][1]=gizmoRGBColors[index][1]
paramColorWave[i][j][2]=gizmoRGBColors[index][2]


I hope this helps,

A.G.
WaveMetrics, Inc.
OK, that makes sense and seems like it should work - so my surface "curtain" will be a parametric surface that is fit to my lat, long, and altitude data and then I colorize it with my actual data.

I'll read a bit more about scaling color waves

Just one question: where does the 255 in your line nor=255/(max-min) come from?
jschroed wrote:
Just one question: where does the 255 in your line nor=255/(max-min) come from?


I think this is the number of entries in the color wave.
jtigor wrote:
I think this is the number of entries in the color wave.


That is correct. I used 255 for simplicity. In practice, you should use numpnts(M_colors) since some of built-in colortables have less than 255 entries.

AG
Thanks guys. I've been able to successfully make the LiDAR curtains and put them on top of an image file. I'm still having some trouble with the color scale, however. How can I set max/min color values, and have every point above/below those max/min values assigned a certain color (or transparent?)
jschroed wrote:
Thanks guys. I've been able to successfully make the LiDAR curtains and put them on top of an image file. I'm still having some trouble with the color scale, however. How can I set max/min color values, and have every point above/below those max/min values assigned a certain color (or transparent?)


If you are using the method I suggested then the color assignments are all in the parametric surface color wave. Therefore, as you fill the color wave you can execute something like:
if(z0>zmax)
  paramColorWave[i][j][3]=0  // make it transparent
endif

If instead you want to assign some fixed color:
if(z0>zmax)
  paramColorWave[i][j][0]=0  
  paramColorWave[i][j][1]=0  
  paramColorWave[i][j][2]=1     // make it blue, for example.  
endif


I hope this helps,

AG
Awesome, this has worked and I'm able to set max and min values for the colorization. I'm still having one problem, though - the alpha values don't seem to have any effect on the surface. For example, I check the color wave that I am mapping to my parametric surface (a plane), and in layer 4 (where the alpha values go), there are lots of 0's. However, these 0's dont show up as transparent on my image, and I'm not sure why.
Nevermind, clicking "enable transparency blending" seems to have resolved the issue.


Thanks again for the help.