Script

Generate Rectangular ROI

Publication ID: ICY-M5A6X5

Short Description

Generates a rectangular ROI and add it to the current sequence. Shows the use of points in scripting: Point2D.

Versions

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

    initial version

    importClass(Packages.icy.sequence.Sequence)
    importClass(Packages.icy.roi.ROI2DRectangle)
    importClass(Packages.java.awt.geom.Point2D)
    
    seq = getSequence()
    if (seq == null) throw "No sequence opened"
    
    // creates anchor points for the Rectangle.
    topLeft = new Point2D.Double(100, 100)
    bottomRight = new Point2D.Double(200, 200)
    
    // create an ROI from (100,100) to (200,200)
    roi = new ROI2DRectangle(topLeft, bottomRight)
    
    // add the ROI to the sequence
    seq.addROI(roi)

Leave a Review