Re: Roi Manager headless mode
Posted by robert atwood on Jan 22, 2016; 1:36pm
URL: http://imagej.273.s1.nabble.com/Roi-Manager-headless-mode-tp5011750p5015434.html
Hi All
I came across this thread when trying to extract the detected particles into a master program using headless mode to call Imagej , and encountering the similar problem with the ROI manager.
I have now tried to use Overlay instead as suggested by Wayne, and to some extent it works, but I cannot quite obtain the information I want, which is a list of the pixels in the detected particle.
I have used the following:
run("Analyze Particles...", "size=25-Infinity show=[Overlay Masks] include record ");
nblobs=Overlay.size;
print ("nblobs="+nblobs);
for (blob=0;blob<nblobs;blob++){
Overlay.activateSelection(blob);
bname=Roi.getName;
Roi.getCoordinates(xp,yp);
for (i=0;i<xp.length;i++){
print(blob,bname,xp[i],yp[i]);
}
}
This seems to behave, but the actual list returned does not make sense to me and doesn't seem to correspond to the overlay as observed in the image viewer. Is it actually a list of some other description of the particle rather than the coordinates, and the number somehow not correspond to the number printed in the overlay label output?
For example, blob #39 is listed as follows, but the attached image (I hope) shows a blob that certainly has more than 4 pixels in it, and is not anywhere near co-ordinate 3214. Furthermore the co-ordinates listed do not form a connected object, it seems like the corners of a 5 pixel square.
<nabble_img src="imagej_blobnumber.jpg" border="0"/>
38 1095 55
38 1100 55
39 3214 60
39 3207 60
39 3207 55
39 3214 55
40 1729 57
What I really want is a list of horizontal start- and end-points for each row passing through the blob. From a list of all pixels in each blob I can generate this fairly simply -- or is there another way to do that inside imagej already? -- but I want to do it headless on a cluster and use some quite nice and not so simple processing that is already available in ImageJ even before the particle analysis.
Thanks
Robert