Draft: Experimental queued autofocus
This MR is for code written by Henry during his summer project that implements an optimised autofocus algorithm. I've not yet reviewed exactly what the changes are: there are two MRs implementing different versions of the algorithm. Both are draft for now, but we may want to merge one or the other depending on whether it works when tested more widely.
The basic principle is that we use a saved sharpness vs z profile instead of acquiring a new one each time, and we attempt to move down and then back up to the peak, rather than down-up-down-up. This should be significantly faster, and should also reduce overshooting due to latency issues.
This MR contains the following
- Adds sharpness monitors for X and Y (these may be removed)
- Implements a new autofocus method
spline_autofocus
Before merge:
-
Either make the X and Y sharpness monitors subclasses, or remove them. -
Test on more microscopes -
Make it available from UI
Merge checklist:
-
All new/changed functions have up to date typehints and docstrings -
Any UI updates have a before and after screenshot in the MR description -
Unit testing of new functionality has similar or better coverage than similar existing code -
This code has been tested on a microscope -
Webapp has been recompiled, with aesthetic changes checked in light and dark mode (if changed) -
With updated settings JSON (if changed) -
SmartScan and live stitching work
-
Edited by Richard Bowman