Login  Register

Working with very large ROI sets

Posted by MarSo on Apr 15, 2009; 8:06pm
URL: http://imagej.273.s1.nabble.com/Working-with-very-large-ROI-sets-tp3692872.html

Hello,

I am trying to quantify the density of punctate fluorescent labeling in tissue slices. The end result of my routine is an set of ROIs that can contain a couple thousand individual regions (one for each possible label). I wrote the macro below to scan each ROI and remove it from the set if its mean intensity is below a threshold (vMeanCutOff). The macro works well but is VERY slow. It seems like everytime an ROI is checked, the entire set gets redrawn. If anyone has a suggestion for speeding this up (or a better way to do this to begin with) I'd greatly appreciate it!

vMeanCutOff = 112.71
 j = 0
run("Clear Results")
  while (j<roiManager("count")) {
        run("Clear Results");
        roiManager("Select", j);
  roiManager("Measure");
        vMean = getResult("Mean",0);
        if (vMean < vMeanCutOff) roiManager("Delete");
        if (vMean>= vMeanCutOff) j++;
}

Thanks!