Delete ROIs depending on their Results
Posted by Giuseppe Lucarelli on Jun 12, 2014; 6:09am
URL: http://imagej.273.s1.nabble.com/Delete-ROIs-depending-on-their-Results-tp5008152.html
Hi there,
I get a large number of ROIs for my yeast cells (>400) but some of them represent either cells that have too low fluorescence or too high and skew my analysis.
So I came up with a macro that can go through the list of ROIs and delete those that have too high or too low "IntDen" value. Here is the code:
num=roiManager("count");
for (i=0;i<num;i++){
one = getResult("IntDen", i);
two = getResult("Mean", i);
print(one);
if (one > 40000){
roiManager("select",i);
roiManager("Delete");
roiManager("Update");
}
print(one+ " "+two);
}
The print() function is to check that the macro is doing the right thing and IT'S NOT!!!
It deletes ROIs even if their IntDen is <40000 (i should mention that I analyse 16 bit images).
What am I doing wrong? Can you help please.
Thanks