The algorithm is very confusingly coded. But it appears to ignore whatever is set in “y” steps, and use the “x steps” to set the number of square rings. So for 10 I think you should get
a central image.
2 images in each of the 4 directions on “ring 2”
4 images in each of the 4 directions on “ring 3”
6 images in each of the 4 directions on “ring 4”
…
18 images in each of the 4 directions on “ring 10”
Which would make me think you should have 361 images not 900. But I agree this is far more than I would have expected.
I would have taken a central image, 2 steps in +x, 2steps in +y, 3 steps in -x, 3 steps in -y, 4 steps in +x, 4steps in +y, 5 steps in -x, 5 steps in -y … 10 steps in +x, 10steps in +y. Which gives 109 images.
I assume there is a reason why the ring system is used. But a UI improvement would make it much clearer to the user.
Thank you for your assistance! I now understand that setting 10 steps in the spiral scan captures 361 pictures, taking about 8 seconds to autofocus and capture each field.
I’ve learned two things about my microscopy process:
Fast autofocus requires four movements (down-up-down-up), making the stage move for up to 8 seconds. Can I accelerate this process by moving the z-stage only once to record the stream, then detecting the focus frame and outputting it without moving back to the calculated position?
Sometimes, the four movements do not converge with each other, even when moving in the same direction. What part of the assembly might contribute to these problems?
The first down just takes the stage to a start point, it is a ‘half down’. Then the first up searches for the focus. Changing direction has backlash, so the stage returns down to the start point and then all being well the last up matches the first up (as it is in the same direction) and so can return to focus.
As you show, this is better in theory than in practice and the two up movements are different. Yours are more different than I expected, but we have seen that this is a problem in high resolution scans, which have a small focal depth.
There is a smart stack and scan that overcomes the problem, which I thought was implemented in current software release. It may not be. @JohemianKnapsody will know.
Unfortunately you do need most of the down,up,down,up motion, because there are usually plateau regions (as in your data) and sometimes false peaks. So a full up scan is needed to find a more global focus. The smart stack and scan does not go all the way down to the start point when returning to the best focus, it just goes ‘enough’ past focus. That saves a little time. It then checks the final up movement (your orange) against the first up (your red) to measure and account for any offset.
I think that very soon the new development version with all bells and whistles should be more available for testing. It is all already developed openly (the v3 branch of the openflexure-microscope-server), we haven’t been putting out regular builds due to some issues in the build pipeline and because some server migration is needed.
I think that soon we should have this under control and Joe’s improved and much faster scanning will be much easier for the community to use.
There is a paper on the autofocus. Figure 6 of the paper has a flow chart explaining the movements.
I am still assembling my first microscope, but this is a very interesting question for me What is the average scanning time at the moment, with default parameters? The reason I am asking is because I want to do soil microscopy based on a simple protocol (take water, add soil, shake, put a drop of the mixture on the slide, cover). I need to have the full slide scanned, but the sample starts to dry up quite quickly, I probably have 30 minutes on average. However, if the movement of the microscope will move the water column under the slide significantly, I will need to look into mounting mediums anyway which will prevent evaporation too.
I suppose average time depends on the number of images you are taking. It should be significantly faster with version 3 of the software. We are hoping to do a big tidy up and do an alpha release of this soon.
There are also some modifications changes, which adjust the x/y gear ratios to speed up scan. We should make these easier to access.