Save PointCloud as Tiff

Hi,

I try to save my PointCloud as Tiff, which is working, if I save the Pointcloud as file and read it in again. If I use the object directly, I get a Tiff file, which cannot be opened.

Here is my code:

PointCloud cloud = Calibrator3D.FromFile($@"D:\VermessungErgebnisse\CalibrationFile.dat").CreatePointCloud(image, PointCloudFlags.Double);
var boundingBox = cloud.CalculateBoundingBox();
ValueRange<double> xRange = new ValueRange<double>(double.MinValue, double.MaxValue);
ValueRange<double> yRange = new ValueRange<double>(double.MinValue, double.MaxValue);
xRange.Min = boundingBox.X.Min;
xRange.Max = boundingBox.X.Max;
yRange.Min = boundingBox.Y.Min;
yRange.Max = boundingBox.Y.Max;
int targetWidth = image.Width;
int targetHeight = image.Height;
double bgValue = boundingBox.Z.Min;
cloud.ToRangeMap(xRange, yRange, targetWidth, targetHeight, gValue).Save($@"D:\VermessungErgebnisse\Test\notWorking.tiff");
cloud.Save($@"D:\VermessungErgebnisse\Test\test.xyz");
cloud = PointCloud.FromFile($@"D:\VermessungErgebnisse\Test\test.xyz");
cloud.ToRangeMap(xRange, yRange, targetWidth, targetHeight, bgValue).Save($@"D:\VermessungErgebnisse\Test\Working.tiff");

Hi Michael,

both ways must work. What exactly means that you cannot open the tiff file? Are you sure that the saving of the rectified range map has already worked?
In your code I can see that you use different background values. Is that on purpose?

Best regards,
Maurice