I have the following problem:
I can easily export the .vtk files of the topography meausered with AFM and displayed through gwyddion.
After I do that, I create an stl file with another software. So far so good.
The problem appears when I take two surfaces with completely different roughness (even 2 order of magnitude difference) and export their .vtk files.
Turns out that gwyddion does not consider the units and, when I export the .vtk files of different topographies, it is impossible to distinguish between surface roughness in the range of microns and surface roughness in the range of nanometers. In both cases, the .vtk files would give numbers with the same magnitude for the Z direction.
I have tried to use "stretch color range to part of data" to arbitrarly modify the colorbar and it works.
However, as soon as I export those data in .vtk or txt files, the actual surface does not scale accordingly.
To clarify what I mean, you can display a 3 D plot with "Display a 3D view of data" button for both a smooth and a really rough surface.
You will see in both cases that the Z scalebar changes optimally display peaks and valleys, however it becomes impossible to compare those two surfaces when data are exporte because they will rely on different scalebar.
Does any of you know how to help me with that?
Thanks a lot.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please do not shout here (I fixed the post title).
The VTK export is currently rather simple; there are no options and the z scale is chosen automatically for some reasonable height/width ratio.
Of course, we would like to simply write the z values into VTK files in physical units and let people choose the scale in the VTK viewer. But apparently adjusting the z scales there is not that easy.
So, generally, it is necessary to scale the data values to z coordinates in the VTK export. The image data can be a different physical quantity than x and y , differring by many orders of magnitude numerically. And even if z is actually the height, typical surfaces measured by AFM are quite flat, so with 1:1 scale one could not see much.
I can add an option to enter the z scale numerically to the VTK export module. For 3D view in Gwyddion it already exists as Physical scale in the Basic tab.
I do not understand the part about TXT files. If you export the data to a plain text file, it will contain the values in base physical units, nothing more and nothing less. They are not scaled in any way.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your answer.
I am not completely sure I understood correctly. You are saying it is not easy to export a .vtk file in which the z column reports the actual z value measured by AFM.
It is instead easier to rescale them to have them visible regardless the dimensions of x and y?
Is it not just possible to export the actual z values recorded by the AFM in a fixed unit (for instance nm) for all my files?
That would easily solve my problem and any other problem relating to comparison of different AFM files.
In addition, you said you added an option to enter the z scale numerically to the VTK export module. Where is it exactly? Is it accessible through file -> save as -> .vtk?
Thanks a lot.
Best,
Marco
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is it not just possible to export the actual z values recorded by the AFM in a fixed unit (for instance nm) for all my files?
In plain text file export (TXT), the units are always base SI units. Metres for height, Volts for voltage, Ampères for current, etc. So the units are indeed fixed. Completely. This minimises confusion when everyone inevitably forgets how the data were exported.
In VTK some automatic ‘visual’ scaling was applied, as described.
In addition, you said you added an option to enter the z scale numerically to the VTK export module. Where is it exactly? Is it accessible through file -> save as -> .vtk?
I see, unfortuntely the other software I am using to convert gwyddion files to stl does not read txt files.
Thanks a lot for your prompt answers though.
Best,
Marco
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can also export the image as an XYZ file, with each line containing one X, Y and Z value (again, in base SI units).
Generally a matrix of values and XYZ data are the only common representations of such data. Every file format is then just a small variation -- with some extra headers or syntactic sugar.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everybody,
I have the following problem:
I can easily export the .vtk files of the topography meausered with AFM and displayed through gwyddion.
After I do that, I create an stl file with another software. So far so good.
The problem appears when I take two surfaces with completely different roughness (even 2 order of magnitude difference) and export their .vtk files.
Turns out that gwyddion does not consider the units and, when I export the .vtk files of different topographies, it is impossible to distinguish between surface roughness in the range of microns and surface roughness in the range of nanometers. In both cases, the .vtk files would give numbers with the same magnitude for the Z direction.
I have tried to use "stretch color range to part of data" to arbitrarly modify the colorbar and it works.
However, as soon as I export those data in .vtk or txt files, the actual surface does not scale accordingly.
To clarify what I mean, you can display a 3 D plot with "Display a 3D view of data" button for both a smooth and a really rough surface.
You will see in both cases that the Z scalebar changes optimally display peaks and valleys, however it becomes impossible to compare those two surfaces when data are exporte because they will rely on different scalebar.
Does any of you know how to help me with that?
Thanks a lot.
Please do not shout here (I fixed the post title).
The VTK export is currently rather simple; there are no options and the z scale is chosen automatically for some reasonable height/width ratio.
Of course, we would like to simply write the z values into VTK files in physical units and let people choose the scale in the VTK viewer. But apparently adjusting the z scales there is not that easy.
So, generally, it is necessary to scale the data values to z coordinates in the VTK export. The image data can be a different physical quantity than x and y , differring by many orders of magnitude numerically. And even if z is actually the height, typical surfaces measured by AFM are quite flat, so with 1:1 scale one could not see much.
I can add an option to enter the z scale numerically to the VTK export module. For 3D view in Gwyddion it already exists as Physical scale in the Basic tab.
I do not understand the part about TXT files. If you export the data to a plain text file, it will contain the values in base physical units, nothing more and nothing less. They are not scaled in any way.
And I added it.
Dear David,
Thanks for your answer.
I am not completely sure I understood correctly. You are saying it is not easy to export a .vtk file in which the z column reports the actual z value measured by AFM.
It is instead easier to rescale them to have them visible regardless the dimensions of x and y?
Is it not just possible to export the actual z values recorded by the AFM in a fixed unit (for instance nm) for all my files?
That would easily solve my problem and any other problem relating to comparison of different AFM files.
In addition, you said you added an option to enter the z scale numerically to the VTK export module. Where is it exactly? Is it accessible through file -> save as -> .vtk?
Thanks a lot.
Best,
Marco
In plain text file export (TXT), the units are always base SI units. Metres for height, Volts for voltage, Ampères for current, etc. So the units are indeed fixed. Completely. This minimises confusion when everyone inevitably forgets how the data were exported.
In VTK some automatic ‘visual’ scaling was applied, as described.
Yes; the new option is currently present only in recent development snapshots.
I see, unfortuntely the other software I am using to convert gwyddion files to stl does not read txt files.
Thanks a lot for your prompt answers though.
Best,
Marco
What does it read?
You can also export the image as an XYZ file, with each line containing one X, Y and Z value (again, in base SI units).
Generally a matrix of values and XYZ data are the only common representations of such data. Every file format is then just a small variation -- with some extra headers or syntactic sugar.