CSV file with z values only

Feel free to ask any question here
Post Reply
Sam
Posts: 2
Joined: Thu Jun 10, 2021 12:53 pm

CSV file with z values only

Post by Sam »

Hello community!

I have a csv file that only consists of z values of points. The values are put in an array of 5843 columns and 2461 lines, as I could see in Excel. The data is coming from an electronic microscope. If delivers a tif image of the surface which also contains the height data. With a special program I can extract a csv file. I have no setting options, so this is the only kind of file I have. The x and y distances of the points would need to be entered manually. I have still to figure those out by checking the magnification and the camera resolution (but I'm at home now). But let's say those are 1µm. I would need to rescale the 3D file later anyway to serve my purpose (3D printing). I am used to having csv files with x, y and z coordinates written in them. Can I import such an csv file to CloudCompare and get a point cloud or even a mesh? I'm new with this program. It popped up when I tried to ask Google about the problem and remembered I got it installed for a while now. I could really use some help or a strategy to get forward.

Best regards,
Sam

Edit: I forgot to mention, that the values use a comma as decimal point and a semicolon to separate the values. As a test I tried to import the file. I could set up the semicolon to be recognized as separator but I could not tech the program to understand comma as decimal point. In the preview all points were marked red and ignored. As the file I mentioned is a test file with just a size of 55MB I could edit it in notepad++. After replacing all commas with points, I could import the file to CloudCompare. Unfortunately I could not set all points as z value or define the x and y distances. Importing gave me a crazy curvy line made of points but not a tame x-y array with variable height.

The actual files I need to make a point cloud (or a mesh) of are 1.8GB in size. I made that test file to try almost a dozen different 3D programs and text editors to get closer to a solution but I'm out of options. Almost none of my programs ask for how to interpret the csv file. I might also add I cannot code at all. I'm a button presser, importer, exporter, copy-and-paster. OK, now I hope for the best :)
daniel
Site Admin
Posts: 7721
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: CSV file with z values only

Post by daniel »

This is a 'raster' file actually, and you can't read it as an 'ASCII point cloud' (CC expects one point per line in this case)

You could try to load it explicitly as a 'raster' (change the file filter in the Load dialog). Maybe GDAL will understand what this file is ;). You could even try to load the tiff file this way (as GDAL can load geotiff files).
Daniel, CloudCompare admin
Sam
Posts: 2
Joined: Thu Jun 10, 2021 12:53 pm

Re: CSV file with z values only

Post by Sam »

Hi there, thanks for the reply!

CloudCompare accepts the tiff but gives me a flat point cloud - a point plane if you will.

GDAL is unknown to me. Googling helped a bit but I don't know what to download and then how to use it on my Windows. There are no .exe files for me ;) Is it a separate program or a plug-in or a script for CloudCompare?

Maybe there is a way to work with the csv file, not with the tiff. The microscope program just put image and spatial data in one file (the tiff) and I had to extract the csv file - not pretty optimal but 3D data is not the main task of the miscroscope.
daniel
Site Admin
Posts: 7721
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: CSV file with z values only

Post by daniel »

Ah sorry, we are actually using GDAL as a 3rd party library to load raster files. So if you select the 'Raster' type in the Load File dialog, then GDAL should do the work (or not) with the text file or the tiff image.
Daniel, CloudCompare admin
seb
Posts: 4
Joined: Mon Mar 30, 2020 1:24 pm

Re: CSV file with z values only

Post by seb »

Hello everyone,

Pretty happy to see that I'm not the only one trying to the same thing as Sam.
I had the same problem. I have data coming from a digital microscope, model Keyence VHX-7000 and just like Sam I can only have either :
- image files (tiff or jpg) that also seem to contain additional information, Z coordinates I think. (what a weird thing to do, I didn't know it was acceptable to do that).
- a CSV file, being the result of an export from the microscope data which indeed only contains Z coordinates, the X and Y being the column and line values. Thanks to Daniel I now know that these are called raster files.

Conclusion :
- CSV import obviously doesn't work
- raster grid doesn't either
- CSV matrix cloud DO WORK THOUGH ! I only had to change the comma separator as a dot beforehand with notepad++. During import we can even specify the X and Y spacing.
Post Reply