Measuring droplet diameter - for non ideal images

Sample image and/or code

123.tif (3.5 MB)
456.tif (3.5 MB)
789.tif (3.5 MB)

Background

Dear community,

I was happy to discover this forum and after a short browsing I’m sure you will have a solution for my issue. While my task is relatively simple, the images/results I have to work with are a bit more challenging. I’ll explain.

Analysis goals

I have multiple images of droplets (100+ droplets in each image, like those attached), those droplets are in different diameters and I simply need a way to automatically detect and measure diameter for all/most of the droplets in every image (which will later be used to produce a histogram).
This method will next be used on all my images, hence automatic/macros would be my ideal solution.
I’m using Fiji.

Challenges

The problem I had when trying to solve it myself, is as you can see, many of the droplets are merged and/or in clusters and/or out of focus.
Since I can live with not measuring 100% of the droplets in each image - I have no problem if your suggestion will not be ideal and some of the droplets would not be measured…

Theoretically I can go and measure all diameters manually by hand, but I’m confident there is an automatic solution that can do it for me. Yet I was unable to find it on my own.
So this is why I need you guys.
Please let me know if you have some ideas that can help me and save me precious time.

Thank you for your time!
Tomer

Hi
@t0mEsh

Using the MorpholibJ PlugIn gives me this:

run("Duplicate...", " ");
run("32-bit");
morpholib();

setOption("BlackBackground", true);
run("Convert to Mask");
selectWindow("droplet_1-1-watershed-lines.tif");
run("Convert to Mask");
run("Dilate");
run("Fill Holes");
run("Watershed");
run("Analyze Particles...", "  circularity=0.70-1.00 summarize add");
selectWindow("droplet_1.tif");
roiManager("Show All without labels");

//---------------------------------------------------------------------

function morpholib()
{
run("Morphological Segmentation");
selectWindow("Morphological Segmentation");
//setTool("point");
wait(2000);
call("inra.ijpb.plugins.MorphologicalSegmentation.setInputImageType", "object");
call("inra.ijpb.plugins.MorphologicalSegmentation.setGradientRadius", "1");
call("inra.ijpb.plugins.MorphologicalSegmentation.setGradientType", "Morphological");
wait(1000);
call("inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat", "Watershed lines");
call("inra.ijpb.plugins.MorphologicalSegmentation.segment", "tolerance=13.0", "calculateDams=true", "connectivity=8");
wait(12000);
call("inra.ijpb.plugins.MorphologicalSegmentation.createResultImage");
wait(1000);
selectWindow("Morphological Segmentation");
close();
print("\\Clear");
}
2 Likes

And if @Mathew’s solution doesn’t work for you, you might also try CellPose. I had quite a bit of luck with that analyzing phase/brightfield images.

Alternatively, that looks a lot like what was analyzed in StarDist, but you might need to try to contact someone to get the model:
https://youtu.be/Amn_eHRGX5M?t=4144

2 Likes