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)