Login  Register

Re: Delete ROIs depending on their Results

Posted by Krs5 on Jun 12, 2014; 2:19pm
URL: http://imagej.273.s1.nabble.com/Delete-ROIs-depending-on-their-Results-tp5008152p5008160.html

Most likely the reason is that as soon as an ROI is deleted from your ROI list the results in the results table and the selected ROI don't match up anymore as you have deleted an ROI but still increase i with 1. So if you delete ROI nr 10, nr 11 becomes nr 10 but you select nr 11 in the next round what was actually ROI nr 12 before you started the operation.

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Advanced Imaging Facility
Centre for Core Biotechnology Services
University of Leicester
http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aif


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of giuseppe3
Sent: 12 June 2014 07:10
To: [hidden email]
Subject: Delete ROIs depending on their Results

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(&quot;IntDen&quot;, i);
        two = getResult(&quot;Mean&quot;, 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



--
View this message in context: http://imagej.1557.x6.nabble.com/Delete-ROIs-depending-on-their-Results-tp5008152.html
Sent from the ImageJ mailing list archive at Nabble.com.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html