Login  Register

Re: Roi Manager headless mode

Posted by Herbie on Jan 22, 2016; 3:52pm
URL: http://imagej.273.s1.nabble.com/Roi-Manager-headless-mode-tp5011750p5015436.html

Dear Robert,

I'm not very familiar with "Analyze Particles..." but a quick test with
a single elliptic test particle revealed that

Roi.getCoordinates(xp,yp);

actually returns all co-ordinates of the enclosing contour.

So I guess, in order to get the content of the ROI you have either to
extract i.e. copy it, or access the content values pixel by pixel wise
according to the contour co-ordinates.

HTH

Herbie

:::::::::::::::::::::::::::::::::::::::::::
Am 22.01.16 um 14:36 schrieb robert atwood:

> 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&lt;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.
>   &lt;nabble_img src=&quot;imagej_blobnumber.jpg&quot; border=&quot;0&quot;/>
>
>
>   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
>
>
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Roi-Manager-headless-mode-tp5011750p5015434.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