Re: Area fraction within multiple ROIs
Posted by
ved sharma on
URL: http://imagej.273.s1.nabble.com/Area-fraction-within-multiple-ROIs-tp5006915p5006982.html
Hi Linda,
You are most welcome!
I put "if(i!=j)" to exclude the intersection of an ROI with itself. The idea is to see the intersection of an ROI (let's say ROI1) with another ROI (say ROI2) in the list. If the intersection is the same as the area of ROI1, then ROI1 is inside ROI2 and then you go ahead and measure its area and area fraction. If you don't put the "if(i!=j)" statement and then when ROI1 intersects with ROI1, you get the same area as the area of ROI1, that will mean that ROI1 is inside ROI1, which I think is meaningless. That is why I excluded the self intersection of ROIs by using if(i!=j).
Regarding your other comments:
// What happens with the data (area, mean...) received from this call?
// They don't seem to be stored anywhere.
Check the description of getStatistics() function. You do not need to assign it to a variable. When you call getStatistics(bla, blabla), the area will get stored in the variable "bla" and the mean will get stored in the variable "blabla".
BTW, I am curious if the macro worked for your images/ROIs and gave you the right numbers?
Ved
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html