How can I calculate bubble area?

Dear @sunihlMa,

try the following macro (which requires MorphoLibJ):

open("http://forum.image.sc/uploads/imagej/original/2X/d/dd949831e45e12143ea4da30c2e2aca97f5c34e2.jpg");
makeRectangle(0, 0, 1280, 958);
run("Crop");

run("Morphological Segmentation");
selectWindow("Morphological Segmentation");
//setTool("multipoint");
call("inra.ijpb.plugins.MorphologicalSegmentation.setInputImageType", "object");
call("inra.ijpb.plugins.MorphologicalSegmentation.setGradientRadius", "1");
call("inra.ijpb.plugins.MorphologicalSegmentation.segment", "tolerance=20", "calculateDams=true", "connectivity=6");
call("inra.ijpb.plugins.MorphologicalSegmentation.setDisplayFormat", "Catchment basins");

wait(3000)
call("inra.ijpb.plugins.MorphologicalSegmentation.createResultImage");
close("Morphological Segmentation");


wait(3000);
run("Region Morphometry");
waitForUser("Select circularity in the next dialog");
run("Assign Measure to Label");

setThreshold(0.7000, 3.4e38);
setOption("BlackBackground", true);
run("Convert to Mask");

run("Analyze Particles...", "clear add");

Best,
Stefan

4 Likes