Create ROi, mismatch points

21 views
Skip to first unread message

MLB

unread,
Jul 27, 2015, 5:25:43 AM7/27/15
to Icy imaging
Hi,
I have a trouble with ROI building.

From 2 polyLine Roi : polyline.xml
I create subRoi by polygone : polygoneok.xml
but sometimes( with the same polyline)... it seems to appear randomnly,
I have some strange shape : polygonenotok.xml
like roi #3
 
My belief is that's associated to script window selection, script save ... or perhaps it's the same kind of things like ROI.idComparator.

Perhaps you've got an idea of what's wrong, or what it can help me.

Thank you for your help,

Marie Laure




polyline.xml
polygonenotok.xml
polygoneok.xml

MLB

unread,
Aug 3, 2015, 9:50:39 AM8/3/15
to Icy imaging
Hi Stephane,

As you advise me, I change

Myroi.addPointAt(p1, true) -> Myroi.addPointAt(p1, false)

to add the new point at the end of list of point.

It runs well :-)

Thank you very much Stephane!


Here is a proposal for a new Generate Polygonal ROI.

Generate Polygonal ROI V2
importClass(Packages.icy.roi.ROI2DPolygon)
importClass
(Packages.java.awt.geom.Point2D)
 
seq
= getSequence()
if (seq == null) throw "No sequence opened"
 
// creates anchor points for the Rectangle.
p1
= new Point2D.Double(100, 100)
p2
= new Point2D.Double(150, 200)
p3
= new Point2D.Double(200, 500)
p4
= new Point2D.Double(500, 200)
p5
= new Point2D.Double(400, 150)


// create an ROI with order p1-> p5
roi
= new ROI2DPolygon(p1)
roi
.addPointAt(p2, true)
roi
.addPointAt(p3, true)
roi
.addPointAt(p4, true)
roi
.addPointAt(p5, true)
seq
.addROI(roi)
roi
.setName("roi true - ordered");
 
// create an ROI with order p1-> p5
// true -> "insert" the point between closest one
roi1
= new ROI2DPolygon(p1)
roi1
.addPointAt(p5, true)
roi1
.addPointAt(p2, true)
roi1
.addPointAt(p3, true)
roi1
.addPointAt(p4, true)
roi1
.addPointAt(p2, false)
 seq
.addROI(roi1)
roi1
.setName("roi true - not ordered");

// create an ROI from (100,100) to (200,200)
// false -> add the new point at the end of list of point.
roi2
= new ROI2DPolygon(p1)
roi2
.addPointAt(p5, false)
roi2
.addPointAt(p2, false)
roi2
.addPointAt(p3, false)
roi2
.addPointAt(p4, false)
roi2
.addPointAt(p2, false)
roi2
.setName("roi false");

// add the ROI to the sequence
seq
.addROI(roi2)




Best,
Marie Laure
Reply all
Reply to author
Forward
0 new messages