Original Post: i got a huge list of points. Every point consists of four values. The first three values are X, Y and Z. The last one i need to use as the color of the point.
In Matlab the "scatter" function does it for me. There it is very easy, i only need to pass the 4th dimension of my array as a parameter for the color. But plotting pointclouds with more than 100.000 points is not efficient in matlab. Because of that i want to use ILNumerics.
If I'm right it is not possible to do it like matlab does, because ILNumerics need a Array[3] or Array[4] for the Color-Attribute of ILPoints.
Is there an easy way to convert my 4th-value into a Color-Attribute/Array which is needed by ILPoints.Color?
Thanks for your help!
Wayn0r
New Post:
Datasetup: A huge list of points with four parameters (X, Y, Z and let us call it color). With a normal StreamReader i read all lines and convert them to a List. After that i pass them to a float[] Array
float[] xArray = xFloat.ToArray<float>();
float[] yArray = yFloat.ToArray<float>();
float[] zArray = zFloat.ToArray<float>();
float[] colorArray = colorFloat.ToArray<float>();
After that i creat a ILArray an pass the float[] to this ILArray
ILArray<float> points = ILMath.zeros<float>(4, xFloat.Count);
points["0;:"] = xArray;
points["1;:"] = yArray;
points["2;:"] = zArray;
points["3;:"] = colorArray;
If I create an Array of 4 dimensions the ILPanel is blank everytime i run/debug the tool. So actually I use this code to convert the X,Y,Z- and the Color-Information to ILArrays
ILArray<float> points = ILMath.zeros<float>(3, xFloat.Count);
points["0;:"] = xArray;
points["1;:"] = yArray;
points["2;:"] = zArray;
ILArray<float> color = ILMath.zeros<float>(1, xFloat.Count);
color["0;:"] = fzArray;
All my values are at position color["1;0"] and not as i coded it as position color["0;:"] because at position 0 there is the value "(:,:) 1e+003 * " and all data are in position 1 and are devided by 1000.
Nex i get the Limits of the color-ILArray to pass them to the ILStaticColormapProvider
color.GetLimits(out min, out max);
var cmProv = new ILNumerics.Drawing.Plotting.ILStaticColormapProvider(Colormaps.ILNumerics, min, max, AxisScale.Linear);
Everything else is identical to your linked code. For the "Colors" parameter of ILPoints i use Colors = cmProv.Colormap.Map(color["0;:"]).T
Everything is plotted and colored with different colors, but the colorbar range should be from -2081 up to 222, but it is from 30 up to 60. So the granularity of the used colors is not enough to see the differences between the plotted points.