How to import AFM data to Matlab?

Dear Matlab community!
I have the following problem: I'm measuring a surface with an AFM and analyzing it with Gwyddion. But since the graphic shows a slight bend, I would like to analyze the XYZ-data in Matlab first.
So my question is:
How can I import the XYZ data from Gwyddion to Matlab?
I hope someone can help me out!
Kind regards

댓글 수: 4

KSSV
KSSV 2020년 8월 5일
You need to specify about your data? How the data is? Is it in a file? Is so how the file is.
Hivanu I
Hivanu I 2020년 8월 5일
Yes, it's a gwyddion file. So when I'm on gwyddion, I can see the image of the surface and I'd like to export the "Z-Axis foward" values.
Cris LaPierre
Cris LaPierre 2020년 8월 5일
For those of us who have never seen this file format before, could you perhaps upload a sample along with a description?
Hivanu I
Hivanu I 2020년 8월 7일
I will try! In Gwyddion the image in the backround is the surface of my sample. When I click on Info-->Data Browser, the window in the front shows up and I can choose between the image channels. The other headings just as Graphen (Graphs), Sprektren (Spectra) etc are empty. There are options of exporting the mean values but I need all the original values of the Z-Axis forward channel.
Please excuse my English, I'm trying my best.

댓글을 달려면 로그인하십시오.

답변 (1개)

Kiran Felix Robert
Kiran Felix Robert 2020년 8월 24일

0 개 추천

Hi Hivanu,
There is no direct way to import AFM data from Gwyddion to MATLAB, but MATLAB has option to import csv files using the csvread function or the readmatrix function.
The data imported from a CSV file can be parsed into a matrix and can also be converted in to an image using the image function.
The data in Gwyddion file can be exported to either a CSV file or a .txt file with rows and column containing the required data, which can be parsed in MATLAB and can be saved as an image or used for analysis.
For example, assuming you export a grayscale image data from Gwiddon file which is saved as ‘GwiddonData.csv’, a csv file, then the following example shows one way to import it into MATLAB (Refer mat2gray for more information),
A = readmatrix('GwiddonData.csv');
% To Convert to Grayscale image
I = mat2gray(A);
imshow(I)

댓글 수: 1

Hi Hivanu,
We have collected togther several MATLAB scripts from various authors to open various AFM image file formats. We have packaged these in a GUI but the MATLAB functions for file opening can be downloaded here:
(go to the functions tab and see the scripts for functions for different file formats, open_nanoscope, open_gwychannel, open_ibw, open_JPK...)
or here:
The open_gwychannel function will open files saved in gwyddion. If you download the script and then run:
[im, meta] = open_gwychannel(filename)
Replacing 'filename' with the filename eg:
[im, meta] = open_gwychannel('Testdata.gwy')

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

질문:

2020년 8월 5일

댓글:

2024년 10월 8일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by