Short Description

Generates various ROIs and add them to the current sequence. Shows the use of points in scripting: Point2D.

Versions

  • Version 1 • Released on: 2013-03-13 15:30:54
    Download
    Description:

    initial version

    importClass(Packages.icy.roi.ROI2DPoint)
    importClass(Packages.icy.roi.ROI2DLine)
    importClass(Packages.icy.roi.ROI2DEllipse)
    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 ROIs.
    topLeft = new Point2D.Double(100, 100)
    bottomRight = new Point2D.Double(200, 200)
    
    // create a point ROI at (100,100)
    roiPoint = new ROI2DPoint(topLeft)
    
    // create a line ROI from (100,100) to (200,200)
    roiLine = new ROI2DLine(topLeft, bottomRight)
    
    // create an rectangular ROI from (100,100) to (200,200)
    roiRect = new ROI2DRectangle(topLeft, bottomRight)
    
    // create an circle ROI from (100,100) to (200,200)
    roiEllipse = new ROI2DEllipse(topLeft, bottomRight)
    
    // add the ROI to the sequence
    seq.addROI(roiPoint)
    seq.addROI(roiLine)
    seq.addROI(roiRect)
    seq.addROI(roiEllipse)
    

Leave a Review