Get cell's radius in javascript

47 views
Skip to first unread message

Yasmine Khalil

unread,
May 30, 2017, 4:14:32 AM5/30/17
to Icy imaging
Hello,

I recently implemented a script that extract all the ROIs of a sequence, determine cells, green spots and red spots.
That gives me 3 lists of ROIs.
My script calculates after that (in each cell) the distance between green and red spots that are close (2D distance < 20).
It also calculates these spots' area.
At the end, I get an xls file containing each couple of remaining spots, their area, and the distance between them (cf. attached doc).

I'd like to compute for each couple of spots the radius of the corresponding cell. Do you think it's possible?
(I tried to do that based on the ROIInclusionAnalysis source code, but of course it was a total failure.)

P.S: this script is integrated in a protocol and it works very well. I attached it too.

Thank you in advance.
Message has been deleted
Message has been deleted
Message has been deleted

Yasmine Khalil

unread,
May 30, 2017, 4:18:53 AM5/30/17
to Icy imaging
Sorry, I can't attach my files, I don't know why...
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Stephane

unread,
May 31, 2017, 7:51:23 AM5/31/17
to Icy imaging
Hi Yasmine,

I'm attaching your files to the message, but given your script (very cell written by the way, very easy to read), yeah i think you can get the corresponding cell radius.
I guess you mean by "corresponding cell", the cell which contains the spot right ?
For that you can use ROI.contains(roi) method to check if a ROI contains another ROI, you can also use the bounding box for fast contains checking but that is not really accurate... After that you can just use ROI descriptor to get cell radius :)

Is it that you want ?

Best,

- Stephane
Message has been deleted

Stephane

unread,
May 31, 2017, 7:52:47 AM5/31/17
to Icy imaging
You're right, i can't attach any file neither... otherwise an error happen.

Yasmine Khalil

unread,
Jun 1, 2017, 4:27:34 AM6/1/17
to Icy imaging
That's exactly what I mean, and that's what I do to check if a cell contains a spot or not.

I'm precisely trying to do that using computeDescriptors as you told me las time. ( ROIDescriptor.computeDescriptor("radius", currentCell, seq) )
But when I print the resulting value, I always get a null value.  I tried 'radius', 'Radius', 'Diameter', 'diameter', 'ROI radius', 'Cell radius', and others but I can't put the finger on the right expression.


Le mercredi 31 mai 2017 13:51:23 UTC+2, Stephane a écrit :

Stephane

unread,
Jun 1, 2017, 6:11:25 AM6/1/17
to Icy imaging
Hi,

Here's a code to show you all available descriptors and an example about the one you probably want :

importClass(Packages.icy.roi.ROIDescriptor)

s
= getSequence()
r
= s.getSelectedROI()

descriptorsMap
= ROIDescriptor.getDescriptors()
descriptors
= descriptorsMap.keySet()

// see all descriptor id
it
= descriptors.iterator()
while(it.hasNext())
  println
(it.next().getId())
 
value
= ROIDescriptor.computeDescriptor("1st Diameter", r, s);
println
(value)

If you really want the radius you can divide the diameter by 2 ;)

Best,

- Stephane

Yasmine Khalil

unread,
Jun 2, 2017, 4:26:21 AM6/2/17
to Icy imaging
Waouh, that's perfect! :o I didn't imagine that we could get all these properties.
Thank you Stephane, that's great. ^^
Reply all
Reply to author
Forward
0 new messages