Login  Register

Calculating the percent overlap of one ROI over another

Posted by LyleBabcock on Mar 30, 2020; 4:32pm
URL: http://imagej.273.s1.nabble.com/Calculating-the-percent-overlap-of-one-ROI-over-another-tp5023112.html

I've written a macro program that analyzes the number of nuclei per muscle
fiber by counting the number of nuclei that intersect the muscle fiber
border. The problem is that the program over estimates these counts, and I
want to ensure that only nuclei with a 50% or greater overlap with a fiber
border is counted. Below is the portion of the macro that determines whether
or not the nuclei and fiber borders overlap. How do I calculate the
percentage of over lap, and then only count those nuclei that have a 50% or
greater overlap?

        selectWindow("DAPI");
for (i=0;i<counts; i++){
        nuclei_counts[i] = 0;
  for (j=0;j&lt;roiManager(&quot;count&quot;);j++){
    roiManager('select',newArray(i,j));
    roiManager(&quot;AND&quot;);
   if ((i!=j)&amp;&amp;(selectionType>-1)) {
    nuclei_counts[i]++;
    }
  }
}

Thank you.



--
Sent from: http://imagej.1557.x6.nabble.com/

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