How to automatically measure transparent particle diameter with ImageJ?

Hi!

I have got some images of transparent gel bead. Because it is transparent, I cannot turn it into masked Black&white image using “8-bit->threshold->set measurements (Feret’s Diameter)”.

  1. is there another way to obtain the outline and turn it into a solid black&white image for diameter analysis?

  2. Alternatively, is there a macro script/plugin that are designed for such transparent praticle?

  3. in some previous images, the gel beads are overlap with each other. How to process the overlap images for the diameter analysis in batch?

Thank you!

the image scale is 543.75 pixel=100um
x20 15-31 dripping 5.tif (8.4 MB) 15-30 x20 aamaac 2.tif (14.4 MB)

Hi
@Zonghan-Barry-Gan
For image # 1
A hundred measurements (in px) should be enough.

New step: Sorry! There are two measurement errors.
I changed the macro.

macro "Dripping"
{
requires("1.53g");
setBackgroundColor(0,0,0);
setOption("BlackBackground",true);
run("Set Scale...", "distance=0 known=0 unit=pixel");
makeRectangle(4, 0, 1980, 1944);
run("Duplicate...", "title=1");
run("Lab Stack");
run("Stack to Images");
selectWindow("a*");
close("\\Others");
setAutoThreshold("MaxEntropy");
//run("Threshold...");
run("Convert to Mask");
run("Analyze Particles...", "size=8000-50000 display exclude add");
close("Results");

roiManager("Select", 10);
roiManager("Delete");
roiManager("Deselect");
roiManager("Measure");
}
1 Like

To measure the diameter of the ROI, I add this to the end. Is it correct?

run("Set Scale...", "distance=543.75 known=100 unit=um");
run("Clear Results");
run("Set Measurements...", "area feret's limit display add redirect=None decimal=3");
roiManager("Measure");

Thank you very much! This work pretty well for the typical images.
However there are some images with lower brightness/phase contrast/ overlap beads which do not quite fit in the macro, how should I make the conditioning?

lower brightness.tif (14.4 MB) lower contrast bf.tif (8.3 MB) 15-30 x20 aamaac 2.tif (14.4 MB) phase contrast.tif (6.1 MB)

Thanks again!

1 Like

Hi
@Zonghan-Barry-Gan
I get this


with this macro:

macro "phase contrast"
{
requires("1.53g");
setBackgroundColor(0,0,0);
setOption("BlackBackground",true);
//---------------------------

run("Set Scale...", "distance=0 known=0 unit=pixel");
run("Polynomial Shading Corrector", "degree_x=2 degree_y=2 regularization=2");
run("Duplicate...", "title=1");
run("Duplicate...", "title=2");
run("Find Edges");
run("RGB Stack");
run("Stack to Images");
close("Green");
close("Red");
selectWindow("Blue");
run("Gaussian Blur...", "sigma=3");
run("Duplicate...", " ");
run("Invert");
setAutoThreshold("Otsu");
//run("Threshold...");
//setThreshold(197, 255);
setOption("BlackBackground", false);
run("Convert to Mask");
run("Invert");
run("Set Measurements...", "area feret's display scientific redirect=None decimal=9");
run("Analyze Particles...", "display exclude add");
decimal=9");
selectWindow("1");
close("\\Others");
roiManager("Show All without labels");
exit("Part of the objects are measured!");
}

Please, can you give me feedback on using the macro?

No problem. Firstly thanks for the magnificent work to help me!
A small problem is that the ROI is all drawn inner of the actual outline and making the diameter smaller.phase contrast after macro2 processing 2

also, For the bright field images, the outline and ROI capture are highly restricted to the contrast, brightness etc. Is there any way to condition the “dripping” macro for it? It is quite necessary, as in experiment there is a step to demulsify the bead. This will inevitably lower the contrast and the bead will swell larger afterwards. Could you help me fit them into the macro as well? Thank you very much!

Regards,

current original and feedback image of bright field:
lower brightness after processing.tif (3.7 MB) lower brightness.tif (14.4 MB) lower colour temperature after processing.tif (3.7 MB) lower colour temperature.tif (6.5 MB) lower contrast bf after processing.tif (3.7 MB) lower contrast bf.tif (7.8 MB) overlap after processing.tif (3.7 MB) 15-30 x20 aamaac 2.tif (14.4 MB)

1 Like

Take an extra step to widen.

selectWindow(“1”);
n=roiManager(“count”);
a=Array.getSequence(n)
roiManager(“Select”, a);
roiManager(“Combine”);
roiManager(“Add”);
roiManager(“Delete”);
roiManager(“Select”, 0);
run(“Enlarge…”, “enlarge=5”);
roiManager(“Add”);
roiManager(“Delete”);
roiManager(“Select”, 0);
roiManager(“Split”);
roiManager(“Measure”);

Thank you!
This post fix work perfect for the phase contrast image!

Also, Could you please tell me how can I cope with lower contrast image rising from the demulsification?
lower contrast bf.tif (7.8 MB)

lower contrast bf 2.tif (8.3 MB) lower contrast bf.tif (7.8 MB) lower contrast bf 4.tif (8.5 MB)

1 Like

Also There is another problem: when 2 bead contact with each other, the ROI joint. Is it possible to limit the ROI to match and fit shape of circle?
fluorescent after macro1.tif (2.7 MB)
overlap after processing.tif (3.7 MB)

Read this

29.8.12 Watershed

in
https://imagej.nih.gov/ij/docs/guide/146-29.html#toc-Subsection-29.8

Ah, I see. Thanks!
I also make a very interesting attempt today. By adding a self-made “dark-field grating” and adjust the color temperature of camera, the contrast get enhanced, though it is not strictly DF image. I then edit->invert it and feed it into the 2 macro. The first 1 can recognise some bead as ROI!. Yet how should I condition the macro to improve the result?

I tried different “threshold” method other than “max entropy” yet little was improved. I also tried adjust the parameter of “analyze particle”, including rising the circularity or min area. Yet adjusting the “analyse particle” just leading to 0 ROI found. How should the macro be conditioned to recognise the image after contrast improved?

Thanks!

sample image of DF, invert and ROI
DF 1 x20 15-31 washed 8.tif (14.4 MB) DF 1 invert x20 15-31 washed 8.tif (14.4 MB) DF 1 ROI x20 15-31 washed 8.tif (4.9 MB)

Other image taken at different camera color temperature
BF
x20 15-31 washed 5.tif (8.1 MB) x20 15-31 washed 6.tif (7.5 MB) x20 15-31 washed 7.tif (7.6 MB) x20 15-31 washed 8.tif (8.1 MB) x20 15-31 washed 9.tif (8.0 MB) x20 15-31 washed 10.tif (7.2 MB) x20 15-31 washed 11.tif (7.8 MB) x20 15-31 washed 12.tif (8.2 MB) x20 15-31 washed 13.tif (8.2 MB) x20 15-31 washed 14 ct3408 tint2500 et8-984ms 1-80.tif (11.0 MB) x20 15-31 washed 15 ct3408 tint2500 et8-984ms 0.tif (9.9 MB) x20 15-31 washed 15 ct3408 tint2500 et8-984ms 1-80.tif (10.0 MB)