Need to quantify area with white spots within a black/colored background

Hi everyone,

I’m involved in rubber development where we mix white mineral fillers into a colored polymer matrix (to make it simple). Fillers can be silica, kaolin, CaCO3, Al(OH)3, Mg(OH)2, … An important feature of interest is to maximize the dispersion of those fillers to improve physical properties like abrasion, traction resistance…
I’d like to use ImageJ to measure the total area of undispersed white fillers (seen as granules) vs the total area, expressed in percentage. Undispersed filler granules are of various sizes / shapes, but are all white. This would be visualized via a numerical microscope we plan to purchase. Could someone help me identifying a plugin/a way to make that?
Would be highly appreciated. See an example of what I mean in attached file:Capture

Hi @OlivierLouis,

In this perfect sample image, the percentage is easy to obtain, so probably I misunderstand your question or the reality is more challenging.
Measuring the total area and measuring with a threshold just above the grey and the option ‘limit to threshold’ will give you two nummbers that divided give you the percentage.

Have the image on the system clipboard and run the following code:

requires("1.52p");
run("System Clipboard");
run("8-bit");
makeRectangle(2, 3, 633, 401);
run("Crop");
run("Set Measurements...", "area redirect=None decimal=5");
all = getValue("Area");
run("Set Measurements...", "area limit redirect=None decimal=5");
setThreshold(134, 255);
fillers=getValue("Area limit");
percentage=100*fillers/all;
print ("Fillers occupy "+percentage+" % of the area");

Now I just keep wondering what a ‘numerical’ microscope is…

1 Like

Hi Olivier,

I guess your real life images will never be so perfect as your example, but this works on the example image. I guess some preprocessing will be required for your final images:

Area measurements:

run("Convert to Mask");
run("Fill Holes");
run("Analyze Particles...", "  show=[Bare Outlines] display clear summarize")

Just in case you want to count the particles:

run("Find Maxima...", "prominence=10 strict exclude output=Count");

Cheers,
Mario

Hi, thanks for your input. I gave this to my IT guys. Your recommendation generates a number, but like 98% white on the artificial image I defined and sent first. This can’t be right.

Meanwhile I received the microscope and could generate some more realistic pictures. see attached

The soft should give me the white are % over the background, which by the way could be any color, except white. Any possible trick ? thanks again.
Cheers from rainy Luxembourg.

Can we talk about the image recording first?

There are an awful lot of artifacts in the image that make it difficult to analyse. Don’t use compression. Use uncompressed tiff. If you can, use an illumination source that lets the particles stand out. An example could be that the particles are fluorescent. Then don’t use white light, use UV.
If your sample is monochrome anyway (shades of grey from black to white) 16 or 8-bit monochrome tiffs suffice. No need to store colour.

Do try to avoid shading; the image is much brighter in the center than it is in the edges:

run("Select All");
run("Plot Profile");

It looks as if there are shadow pits. Is the sample nice and flat or are these indeed material properties?

There are streaks in the image, from left to right they slightly go up. Are these real, a compression artifact or are these cutting abrasions that have skidded the white matter along the horizontal?
This little macro indicates how they are positioned:

makeLine(465,169,926,118,1400,98);
run("Fit Spline");

Next, how small a particle do you consider a particle? I found these classes, although some size details are probably lost in the artifacts:

   Area  XM  YM
1	444	461 155
2	205	 85	115
3	 11	229  41
4	  6 558   3

Finally, using this poor image for a measurement, I performed this macro, which yielded an area of 2600 px out of the 452865 pix, so about half a percent.

setAutoThreshold("MaxEntropy dark");
run("Select All");
run("Measure");
resetThreshold;
run("Measure");

I acknowledge the image is far from being perfect.
Is the sample nice and flat or are these indeed material properties? it’s a rubber piece cut with a simple cutter blade, this explains the streaks I guess.
how small is a particle? Let’s take them all. Not easy to define a dimension as this will vary with the sample / image size. But when I take this particular image and estimate the cumulative size of the 8 biggest particles, I fall on 0.5% as well, funny, isn’t it? So your counting must be good enough.

… and we keep getting this error messageerror%20message

In that case, you can use the macro below to achieve your goal.
The error you get is if you run the code without converting it to 8-bit first, that is now in the macro too.

The macro below will calculate the percentage area white and create an image that contains the outline of all particles detected:

run("8-bit");
setAutoThreshold("MaxEntropy dark");
run("Select All");
particleArea = getValue("Area limit");
run("Select All");
resetThreshold;
entireArea = getValue("Area");
percentage = 100*particleArea/entireArea;
print ("percentage of image covered by particles is "+percentage);
selectWindow("test.png");
setAutoThreshold("MaxEntropy dark");
run("Analyze Particles...", "  show=Ellipses add");