This is an archive of the old MediaWiki-based ImageJ wiki. The current website can be found at

Microscope Focus Quality


Microscope Image Focus Quality Classifier
Source on GitHub
License Apache
Release 0.1.0
Development status Unstable
Support status Active
Founders Curtis Rueden, Samuel Yang, Asim Shankar
Leads Curtis Rueden
Developers Curtis Rueden
Debuggers Curtis Rueden
Reviewers Curtis Rueden
Support Curtis Rueden
Maintainers Curtis Rueden
Contributors Samuel Yang, Asim Shankar

This plugin assesses the focus quality of microscope images, classifying the image in tiles.


The plugin predicts an absolute measure of image focus on a single image in isolation, without any user-specified parameters. It uses a pre-trained deep neural network, operating at the image-patch level, and also outputs a measure of prediction certainty, enabling interpretable predictions.


  • Enable the TensorFlow update site.
  • The command is in Plugins  › Classification  › Microscope Image Focus Quality.


  • Open an image to analyze (see sample images).
  • Run Plugins  › Classification  › Microscope Image Focus Quality.
  • A dialog will appear allowing you to configure the output visualization. The following options are available:
    • Generate probability image - When checked, a multi-channel image will be created with one channel per focus level, and each value corresponding to the probability of that sample being at that focus level.
    • Overlay probability patches - When checked, each classified region of the image will be overlaid with a color whose hue denotes the most likely focus level and whose brightness denotes the confidence (i.e., probability) of the region being at that level.
    • Show patches as solid rectangles - When checked, overlaid probability patches will be filled semi-transparent and solid; when unchecked, they will be drawn as hollow boundary boxes.
    • Displayed patch border width - When drawing probability patches as boundary boxes, this option controls the box thickness.

The screenshot above uses the "Overlay probability patches" option with a thickness of 5.

If you wish to access the results of the classification quantitatively (e.g., as part of an automated workflow via scripting), use the "Generate probability image" option.

You can can remove the probability patches overlay via the Image  › Overlay  › Remove Overlay command.


The plugin is currently limited to single (i.e., 2D) images of 16-bit integer data only. The model was trained with images in the intensity range of [0, ~10000]; your mileage may vary if the input image intensities diverge from that too greatly.


See also