Short Description

Generates a polygonal ROI (5 points) and add it to the current sequence. Shows the use of points in scripting: Point2D.

Versions

  • Version 1 • Released on: 2013-03-11 11:03:47
    Download
    Description:

    initial version

    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 from (100,100) to (200,200)
    roi = new ROI2DPolygon(p1)
    roi.addPointAt(p2, true)
    roi.addPointAt(p3, true)
    roi.addPointAt(p4, true)
    roi.addPointAt(p5, true)
    
    // add the ROI to the sequence
    seq.addROI(roi)
    

Leave a Review