Posted by
LyleBabcock on
Oct 15, 2019; 3:00pm
URL: http://imagej.273.s1.nabble.com/How-to-count-the-number-of-intersecting-ROIs-for-a-given-ROI-tp5022539.html
I've written a plugin that analyzes skeletal muscle fiber size, type, and
central nuclei. I want to give it the ability to count regular nuclei, and
the code right now prints a list of all the muscle fibers with intersecting
ROIs (or nuclei). Below is an example of my code for how I analyze central
nuclei. It works perfectly for central nuclei, as there is ever only going
to be one central nuclei in a fiber and the end results is a results page
that lists fiber number, fiber type, area, and either "1" if there is a
central nuclei, and "0" if there isn't one. The problem with regular nuclei
is that most of the fibers have more than one nuclei, so that fiber number
is simply listed multiple times, and I end up having a list that I can't
simply put into an array and make it a column in my results. For example, if
fiber #35 has 3 nuclei, the program prints out "35" three times. How to I
get the program to denote that there are 3 intersections with fiber #35, and
not a list with "35" written 3 times?
for (i=0;i<counts; i++){
for (j=0;j<roiManager("count");j++){
roiManager('select',newArray(i,j));
roiManager("AND");
if ((i!=j)&&(selectionType>-1)) {
print(i);
logString = getInfo("log");
}
}
}
if (isOpen("Log")) {
run("Clear Results");
roiManager("reset");
roiManager("open", Results+"ROISet.zip");
selectWindow("Fiber Borders");
run("From ROI Manager");
roiManager("multi-measure append");
updateResults();
setResult("Central Nuclei", logString, 1);
--
Sent from:
http://imagej.1557.x6.nabble.com/--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html