I finally managed to release my optimised 2-D / 3-D libatrous library, as well as a simple CellProfiler plugin (2-D), which I often use in CellProfiler 2.4 pipelines for cleaning images before “IdentifyPrimaryObjects”.
I do have a 2-D / 3-D plugin for CellProfiler 3.0 but I need to clean it up a bit before I release it.
The “A trous” filter works pretty well for detecting roundish objects of similar sizes in an image, even in the presence of speckled noise / high background. The filter uses combined “scales” to define a range of object / feature sizes to detect in the image.
Roughly (in my mind), scales correspond to a feature size of 2^(scale_index-1) to 2^(scale_index). So scale 1 would isolate features of 1-2 pixels in diameter, scale 2 2-4, scale 3 4-8, etc… So if you wanted to detect nuclei which are roughly 20 pixels in diameter and eliminate speckle noise (scale 1) as well as the image background, you could try to select scale 4 or scale 5 or scales 3-5.
Thresholding is important to use with this filter, because each scale may have positive and negative values. So thresholding at 0 or maybe just above 0 is important. The high value depends on what you’re trying to detect. Sometimes it’s advantageous to clip the high intensity values. So choose a high value and go down from there (test mode is your friend).
The filter can be used as a nuclei / spots detector in fluorescence images or (to some extent) can detect cells in brightfield images. You may need to invert the images first with ImageMath (as below) if the objects you are trying to detect are darker than the background.
The negative image below was filtered using the “B3 Spline 5x5” filter, scale 3-3, no residual low-pass, threshold 20-500 (was a 16 bit image). Output is not normalised.
In the primary objects detection, Global Otsu / 2 classes usually works quite well, and no additional smoothing is required (important).
This is the result of the primary object identification:
I will put some demo images / pipelines together on my github, to try and explain how to best use the filter. For now, I thought I’d just put it out there and see what people think