help with macro for particle analysis

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

help with macro for particle analysis

Thorsen, Anders
Hi,

I have made a macro to measure the size of fish oocytes. This macro usually works works fine with many types of oocytes, but now that we started to measure oocytes of Anchovy it is not optimal anymore. In our macro there is a threshold limit on circularity to discriminate between  oocytes, that usually are rather round, and other less round objects in the picture. For most fish species this works fine, but the anchovy oocytes that we now work with are elliptical, - and then this do not work so well anymore. I have changed the circularity threshold settings in the macro so that it fits with the elliptic shape of the anchovy oocytes, but then the macro also measure some objects that are not supposed to be measured, and these measurements then has to be manually deleted in the ROI manager.

To improve the macro I would like to also set threshold limits on the aspect ratio of major an minor axis (AR) of the obejcts. I can see that correctly measured oocytes usually have an aspect ratio between 1.9 and 2.5. Would it be possible to implements such a AR threshold in the macro in addition to the circularity threshold?

A test image can be downloaded from: files.me.com/andersth/0bblg9<http://files.me.com/andersth/0bblg9>.

The existing macro looks like this:

macro "AnchovyOocytes 250-950 µm [8]" {
run("Set Scale...", "distance=0.103 known=1 pixel=1.0 unit=µm global");
run("Duplicate...", "title=tmp");
run("8-bit");
run("Subtract Background...", "rolling=100 light");
setThreshold(0, 170);
run("Threshold", "thresholded remaining black");
run("Erode");
run("Erode");
run("Erode");
run("Erode");
run("Dilate");
run("Dilate");
run("Dilate");
run("Dilate");
run("Watershed");
run("Set Measurements...", "area perimeter fit circularity redirect=None decimal=2");
run("Analyze Particles...", "size=49063-708463 circularity=0.65-0.8 show=Nothing display exclude include add");
run("Put Behind [tab]");
run("ROI Manager...");
setOption("Show All",true);
run("Clear Results");
}


anders

Anders Thorsen, Ph. D.
Institute of Marine Research,
Bergen, Norway