inconsistent autofucus results
Added by @Maria Janssen over 12 years ago
I was wondering why autofocusing is 300-600nm off in some images: I queued up a couple of targets in different squares to determine if automatic focus went well. I manually checked the focus after each image. The first image in each square is defocused correctly, but then after that images are off, in one square only 400nm, other squares even 600nm. Is this a matter of beam-tilt calibration (defocus calibration)?
Replies (8)
RE: inconsistent autofucus results - Added by Anchi Cheng over 12 years ago
I assume that you did auto-focus on every target, right? Otherwise, the answer is that you need to focus more frequently in the same square.
Beam tilt calibration can only solve part of the problem. Here are other possibilities:
1. Beam-Tilt <-> Defocus relationship is not linear over large range, which may contribute to your error. If some of the targets require larger correction, it will increase their error.
2. If you move to the focus target by image shift, image shift will introduce some beam tilt of its own and therefore some error in autofocusing.
3. Drift from either sample movement OR hysteresis of beam/image shift in shuttering (often noticed in drift monitoring as a larger measured drift on the
first pair of the images) will increase autofocus measurement error.
4. The accuracy of the method is limited indeed. We don't expect in the best condition to be better than 100 nm by doing the autofocusing once and yet handling offset bigger than 25 um with 0.01 radian beam tilt (See Optimizing Autofocus
If I recall right, you use smaller beam tilt because of the limit set by the objective aperture. Therefore, even in best situation you can only expect 200 nm accuracy if it is 0.05. 300-600 nm off is not very unreasonable.
However, if you do want to improve it, you can try to do beam-tilt based autofocus more than once in the focus sequence. I committed a patch for version 2.1 today r16647 that will allow this to be done properly using the same preset. We have used this in the last 3 months and saw a lot of improvement in accuracy even in less than ideal condition. However, accuracy comes with the price of time. extra autofocus sequence does take time. You just have to decide what is more important.
The reason the second autofocusing sequence with the exact parameter helps with final accuracy is that is reduces the error from item 1 above.
You should also check if your grid is bent. If it is bent badly, your item 1 problem is larger, too, even within one square. There is a graph in the webviewer (click on [summary] on the top left corner of the image viewer page that tracks the performance of autofocus in the session. Here is an example:
The blue dots give you how much z is adjusted, the red dots the defocus. Ideally you want all adjustment comes from stage z not defocus, then the accuracy will be the highest. With bent grid, add a focus sequence in Focus node before adjusting defocus to adjust z height as well.
autofocus1.png (25.9 KB) autofocus1.png |
RE: inconsistent autofucus results - Added by @Maria Janssen over 12 years ago
Yes, I did auto-focus on every target.. I don't mind if a session takes more time if that means defocus accuracy can be approved. I checked out the patch (r16647) you committed and would like to try it. How do I incorporate this in Version 2.1, do I down-load it? I saw there is an iteration # in simulated target loop under 'focus settings', is this the one I increase?
I checked the autofocus graph in web viewer and attached it below. I think it looks weird because I resumed a session from a week earlier, so if you read the graph from 9:40 till 23:33 (right side) that should correspond to my session. I think it looks reasonable?
I started redoing the defocus and stigmator calibrations. For some reason I cannot seem to get a good calibration done. I'm at eucentric height, in focus, rotation center and beam pivot points are aligned. The manual says to make sure there's a 10-20% image shift when doing the calibration, but in my case the image shift in very very small (few pixels). That might be the problem, but I don't understand how to get the image shift larger. I tried removing the obj.aperture and increasing the beam tilt angle to 0.01 (instead of 0.005), but that doesn't make a big difference.
Screenshot.png (152 KB) Screenshot.png |
RE: inconsistent autofucus results - Added by @Maria Janssen over 12 years ago
Sorry Anchi, nevermind the defocus calibration. The correction image was not good, so after redoing the dark and gain references it works fine. But I'm still interested to know what exactly to do with the patch you mentioned.
Thanks!!
RE: inconsistent autofucus results - Added by Anchi Cheng over 12 years ago
No, you need to add focus sequence in the tool for focus sequence Adding_a_new_focus_sequence_to_a_focus_node
If -2 um and -4 um defocus give very similar peak position (see Optimizing_Autofocus) and are very small in both cases, you either have to increase the magnification at which you do autofocus, or the beam tilt on your microscope is not output in radian. See TEM_Scripting_Beam_Tilt_Calibration
Stigmator calibration does not yield usable correction when activated in our hand, especially in ice. you can skip it.
To update, you need to copy focuser.py that you download to your installation in python's site-package on the linux computer to replace the one that is in the leginon directory there. This will require root access normally. Get help from whoever did it last time.
Your graph looks o.k. I think your autofocusing just could not distinguish small differences well enough.
Anchi
RE: inconsistent autofucus results - Added by @Maria Janssen over 12 years ago
Thanks for the help! One weird question maybe: instead of using this path to do beam-tilt based autofocus more than once in the focus sequence, why not just add a focus sequence in the focus node?
Z-to_eucentric
def_to_eucentric
def_to_eucentric (2)
Manual_after
I'll ask Jinghua about adding that patch to our version 2.1
Thanks!!
RE: inconsistent autofucus results - Added by Anchi Cheng over 12 years ago
Your idea is exactly what I suggested. However, without the patch, it would not work properly if def_eucentric and def_to_eucentric(2) use the same preset because of a bug in Leginon that the patch fixes.
RE: inconsistent autofucus results - Added by @Maria Janssen over 12 years ago
Okay, I need to learn how to read better :-) Thanks for all your help! After re-doing defocus calibration, defocus now only deviates 200-400nm (best in first imaging square, worst in squares farther from starting point).
RE: inconsistent autofucus results - Added by @Maria Janssen over 12 years ago
Just installed the patch, doing focussing twice helps as well! Thanks!