Getpoints of an ROI.

12 views
Skip to first unread message

MLB

unread,
Aug 4, 2015, 4:38:55 AM8/4/15
to Icy imaging
Hi,
I've an issue with getpoints of an ROI.
I use it, and have a point missing. Instead of  coordinates, I have [
NaN, NaN]
See below.
Why, and How can I manage it ? Test if it's a number or not ?
Thank you for your help,

Marie Laure


imageName="0-17"
seq
= gui.getSequences(imageName).get(0)
theX
= [];
theY
= [];
roi00
= seq.getROI2Ds().get(0);

listptroi
= roi00.getPoints();
jj
=21
theX
[jj] = listptroi.get(jj).x;
theY
[jj] = listptroi.get(jj).y;

//println("theX[jj] :"+theX[jj]+"  theY[jj] "+theY[jj]);

println
(roi00.getPoints());

[Point2D.Double[245.0, 441.0], Point2D.Double[245.0, 534.0], Point2D.Double[253.0, 537.0], Point2D.Double[262.0, 540.0], Point2D.Double[270.0, 541.0], Point2D.Double[280.0, 542.0], Point2D.Double[290.0, 544.0], Point2D.Double[299.0, 545.0], Point2D.Double[309.0, 546.0], Point2D.Double[319.0, 547.0], Point2D.Double[329.0, 548.0], Point2D.Double[339.0, 550.0], Point2D.Double[349.0, 551.0], Point2D.Double[359.0, 552.0], Point2D.Double[369.0, 553.0], Point2D.Double[379.0, 555.0], Point2D.Double[389.0, 556.0], Point2D.Double[399.0, 557.0], Point2D.Double[409.0, 559.0], Point2D.Double[419.0, 560.0], Point2D.Double[429.0, 561.0], Point2D.Double[439.0, 562.0], Point2D.Double[449.0, 563.0], Point2D.Double[NaN, NaN], Point2D.Double[365.0, 488.0], Point2D.Double[356.0, 485.0], Point2D.Double[346.0, 481.0], Point2D.Double[337.0, 478.0], Point2D.Double[328.0, 474.0], Point2D.Double[318.0, 470.0], Point2D.Double[309.0, 467.0], Point2D.Double[299.0, 463.0], Point2D.Double[290.0, 460.0], Point2D.Double[280.0, 456.0], Point2D.Double[271.0, 453.0], Point2D.Double[262.0, 449.0], Point2D.Double[253.0, 445.0], Point2D.Double[245.0, 441.0]]



script-getPoints.js
roi.xml

Stephane

unread,
Aug 5, 2015, 7:31:42 AM8/5/15
to Icy imaging
Hi MLB,

I wonder how did you manage to get a ROI containing a Nan coordinates point !?!
But still you can use and test again NaN (Not a Number) by using this :

x = java.lang.Double.NaN

if (java.lang.Double.isNaN(x))
    println
('NaN detected')

Best,

- Stephane

MLB

unread,
Aug 5, 2015, 7:39:14 AM8/5/15
to Icy imaging
Thanks again Stephane !

That's the kind of things I was looking for.

To get an ROI containing a Nan coordinates point, Easy :-)
add a point on a ROI with an empty value.

Marie Laure

Stephane

unread,
Aug 5, 2015, 8:25:35 AM8/5/15
to Icy imaging
You're welcome !  And i understand now, you generated the ROI from a script, that explains then ;)
Reply all
Reply to author
Forward
0 new messages