How to plot a Height height correlation function from AFM image?

Hello,
I have some AFM images and I use Gwyddion and Matlab. I would like to have the PLOTS of the height-height correlation function. I would like to have these plots either for one directional displacement or for a radius displacement among some reference points , The plot i am looking for should look like exacttly the attached picture !
Can you provide me maybe with Matlab a code make these plots ?? Thank you in advance!

4 comentarios

What have you tried so far?
I tried to write down a code myself but the result i get is not good . something should be wrong with my code .Hereby i attach a plot result of mycode
The problem is that the correlation function goes down to zero !! :( . Actually, it should reach a value and then saturate around , like the plot i posted on my question :( Any clues ? Have you ever done this before ?
Thank you for making this a question instead of an answer. As a question, it will be seen, and hopefully answered. As an answer itself, it would probably have gone unseen and unanswered.
Can you send me the code to basantakumarparida@gmai.com, I will try to solve and send you.

Iniciar sesión para comentar.

Respuestas (2)

Star Strider
Star Strider el 9 de Jun. de 2014
Check to see how they calculated the data for the plot in the paper. It looks like a cumulative distribution function of some sort. The cumtrapz function might be what you want.
It looks like they also fitted a line to it. Using polyfit with a 3rd order polynomial might be what you want for that.

5 comentarios

Polynomials tend to be terrible at fits like this. They simply don't like flat sections.
In my experience, they don’t mind flat sections so long as:
  1. The flat section isn’t the predominant feature;
  2. There are no abrupt transitions (this one seems gradual enough);
  3. It isn’t called upon to extrapolate beyond the region-of-fit.
Unless the function is known (a particular CDF), fitting a generic logistic function (using fminsearch) would likely be a more appropriate approximation here than the polynomial, though.
Hi Star -
In the old days at Kodak, we used to try things like you suggested. Film and paper, not to mention copiers (yeah, we made them for a while) and printers of all ilk, all generate dose-response curves that look much like the one shown. With no input (exposure, whatever) the system has no response. As the exposure increases, the system responds smoothly and monotonically, until the point where it is essentially saturated.
My point is, Kodak used models for curves like this all over the place. Years ago, they were trying to use parametric forms heavily. Many variations of sigmoidal shapes were employed. The problem is, such curve shapes never seem to have just the right shape. The toe or shoulder might miss by a bit. Those parameters were important too, because these curves were used to estimate parameters like contrast and speed for the film/paper.
So what ends up happening is the user tries vainly to find a shape that fits their curve, playing with starting values, etc.. Then they try a different sigmoidal shape. Really, they are trying to force the model to fit their own data, when there is no reason why any given model will do the trick.
As far as polynomials go, cubics really don't have the ability to fit BOTH a long flat section and something with a sharp transition as we see here. Even higher order polynomials fail at this, as they all exhibit ringing behavior in the flat section.
The solution is generally to use splines, which have no characteristic/fundamental shape to deal with. Interpolating splines are often useful, and we used pchip (or some of its cousins) heavily at Kodak. Here, I would suggest a least squares spline, since there appears to be noise in the sample plot.
This kind of problem is in fact the basis for my SLM toolbox, which was built from my experiences in model building for many years at Kodak. It allows the user to specify information about the curve that they have, then enforce it in the curve fit. Monotonicity, for example, which is arguably the most common thing people are looking for in curve fits like this.
Efthymios
Efthymios el 9 de Jun. de 2014
Editada: Efthymios el 9 de Jun. de 2014
Dear all,
The formula i want to use for the "height-height correlation" function is: G= < |h_i-h_j|^2 >
*The equation is fairly simple - summation along one direction of the image (say along x), the average of the height differences. Any clues ? Has anyone used that before ?
Efthymios — In line with John’s relevant discussion in his most recent comment, I very strongly suggest you use the procedure and techniques accepted by the literature in your area of research. Those techinques should be described in the ‘Materials and Methods’ section of original research papers on the topic, both to generate your data and to fit it.
If you simply want the model-free cumulative sum, it would be appropriate for you to use cumtrapz or its relative, cumsum (linked to at the end of the ‘cumtrapz’ documentation page). Choose whatever best suits your needs. If you need to sum across the other dimension (the dimension you are not summing with cumsum or cumtrapz) first, see the documentation for sum, and sum across the appropriate dimension, then do cumsum or cumtrapz across the results of the sum operation. (I’m not quite certain what you are exactly doing, so I’m guessing a bit here.)
John — Kodak had excellent products. I had several Kodak digital cameras (unmatched colour quality, in my opinion) and at least one printer, strictly for photographic use for the same reason. I certainly recommend your File Exchange contributions and that Efthymios explore them to see if they solve the problem. Just now, we don’t quite know.

Iniciar sesión para comentar.

I also want this HHCRF but I am not getting these from elsewhere.

Categorías

Preguntada:

el 9 de Jun. de 2014

Comentada:

el 2 de Jun. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by