private double[][] JsonToDoubleArray(string str)
        {
            IRItems items = JsonConvert.DeserializeObject <IRItems>(str, settings);

            double[][] points = new double[items.Items.Length][];
            double[]   point;
            IRpoint    iRPoint;

            for (int i = 0; i < items.Items.Length; i++)


            {
                iRPoint = items.Items[i];

                if (iRPoint.visible == 1)
                {
                    point = new double[3]
                    {
                        iRPoint.x, iRPoint.y, iRPoint.z
                    };
                    points[i] = point;
                }
                else
                {
                    points[i] = null;
                }
            }

            return(points);
        }
        private string DoubleArrayToJson(double[][] points)
        {
            IRItems items = new IRItems
            {
                Items = new IRpoint[points.Length]
            };

            double[] point;
            for (int i = 0; i < points.Length; i++)
            {
                IRpoint irpoint = new IRpoint();
                point           = points[i];
                irpoint.id      = i;
                irpoint.visible = 1;
                irpoint.x       = (float)point[0];
                irpoint.y       = (float)point[1];
                irpoint.z       = (float)point[2] * 1000;

                items.Items[i] = irpoint;
            }


            //    string oel = JsonConvert.DeSerializeObject<Items>(items, settings);

            return(JsonConvert.SerializeObject(items));
        }