Measure area fraction

Hi, I am a new user of ImageJ/FIJI. I am trying to measure the area fractions of the gold, grey and white region in the attached figure using ImageJ/FIJI. The gold regions have distinct edges and are relatively easy to separate out. The grey and white regions are much harder for me to separate. Please let me know how I can separate the grey and white regions and measure their area fraction. Thanks.

Hi Mei
@zgmei
Something similar was dealt with there: Distinguishing between two types of soil

  1. For your image I suggest:
    RGB-> Edit->Invert->RGB to CMYK-> Stack to Images-> Thresholding-> Measure
    Can you tell me about your results, if you don’t mind.
  2. Below is a macro to find the white area.
    Greetings
requires("1.52t");
// -------------------------Clean and preparate environment
print("\\Clear");
run("Clear Results");
roiManager("reset") ;
if ( isOpen("Summary") )
{
run("Close");
}
// ---------------------------Macro start
setBackgroundColor(0,0,0);
setOption("BlackBackground",true);
img=getImageID();
selectImage(img);
setBatchMode(true);
run("Duplicate...", "title=original");
run("Duplicate...", " ");
run("Invert");
run("RGB to CMYK");
//selectWindow("CMYK_2");
run("Stack to Images");
selectImage("Y");
run("Duplicate...", "title=Y-1");
rename("Whitezone");
setAutoThreshold("Default dark");
//run("Threshold...");
//setOption("BlackBackground", true);
run("Convert to Mask");
run("Set Measurements...", "area redirect=None decimal=2");
run("Analyze Particles...", "display summarize add");
roiManager("Show All without labels");
roiManager("Set Fill Color", "blue");
selectWindow("Whitezone");
roiManager("Set Fill Color", "blue");
run("Flatten");
setBatchMode(false);
if (nImages>0)
{ showMessage("Warning", "All images will be closed now!");
close("*"); }
// ---------------------------------------------- Macro end
selectWindow("Summary");
setLocation(0,0);
exit("For whitezone, all is done!");

Hi Mathew,

Thank you so much for your reply and macro. The figure you posted is exactly what I wanted.

Some improvements could be to exclude the small blue dots in grey regions. In the original picture, those small white dots in the grey regions are artifacts. Overlaps between different regions should be minimized. Something like the following will be more realistic. Let me know if you can help me further.

Thanks,
Zhi-Gang

1 Like