Focus correction for microscopy movies

Hi Everyone,

I am working with a microscopy movie. The focus on most of the images looks perfect. However, I have noticed small drifts on a few frames. Certainly, this will introduce noise in the pixel intensity for the later analysis of the movie. Therefore, I would like to ask:

  1. Is “image refocus” something doable at all?
  2. If so, which plugins could I find within the Fiji environment for image denoising?
  3. How could I call them from Python/Jython?

Thank you very much in advance!

If you have a Z-stack then there are some plugins implementing algorithms to find the most focused slice. But taking an unfocused image and de-blurring is not really available. The closest solutions would be deconvolution or machine-learning based methods like CARE. But for the later you need to train the machine which is not straightforward.

There is also a method called “Sharpening” but this just reinforces the edges in the image. Give it a try in case.

Wait denoising and deblurring are not the same :sweat_smile:
You can find some denoising method in Fiji via the search bar (try denoise). I haven’t used any so I cant really recommand one.
Yet for a light salt/pepper noise we usually just apply a slight blur (Gaussian for instance) to smooth out the noise. The blurred image is then only use to derive a mask, not to do quantification.

You can use the macro recorded first, selecting the Java language (to have a syntax compatible with Jython).
If you dont find some method you can have a look in the ImageJ API, which also offer more flexibility than the recorded commands.