Is Scan Speed Normal or Low?

Hi!
When performing a 10x10 grid scan with a z-step of 1,


the process took 53 minutes and generated 900 images, each with size about 600k.

Upon switching to debug log mode, I observed that each stage movement step takes approximately 1.5 to 2 seconds.

I have a few questions:

  1. Why is the output image count 900?
  2. Why does the scan take so long?
  3. Is a step movement time of 2 seconds considered normal or low latency?

Thank you for your assistance!

@JohemianKnapsody will know better, but this sounds about right for the time per image.

The motors are clocked at 1kHz, so your image spacing of about 1000 steps will take at least one second. 2sec seems a bit long, but not a lot.

The algorithm for deciding where to take images is here:

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.

2 Likes

@WilliamW @j.stirling

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:

  1. 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?
  2. 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.

@JohemianKnapsody has more tricks in development.

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.

2 Likes