
// Script function: Add two paired ROI lines to the two front-most images
// Requirement: With or without multiple images opened

// Unless named starting with GlobalSino, EM, My, Self, the function commands are defined 
//by Gatan DM, please see at link: http://www.globalsino.com/EM/page2597.html


image GlobalSinoFrontImage := GetFrontImage() // Get the front-most image
image GlobalSinoSecondImage :=FindNextImage(GlobalSinoFrontImage) // Get the 2nd-front-most

number EMxsize, EMysize
getsize(GlobalSinoFrontImage, EMxsize, EMysize)

ROI GlobalSinoLine = NewROI() // Create a new ROI
GlobalSinoLine.ROISetLine(EMxsize*1/5, EMysize*1/5, EMxsize*4/5, EMysize*4/5) // X1, Y1, X2, Y2 (pixel)
GlobalSinoLine.ROISetLabel("GlobalSino Line") // add text
GlobalSinoLine.ROISetColor(1, 0, 0) // Set red color as the color of the line
GlobalSinoLine.ROISetVolatile(0) // 0: No dashing

// Add a ROI line to the front-most image
GlobalSinoFrontImage.ImageGetImageDisplay(0).ImageDisplayAddROI(GlobalSinoLine)
// Add a corresponding (paired) ROI line to the second image
GlobalSinoSecondImage.ImageGetImageDisplay(0).ImageDisplayAddROI(GlobalSinoLine)
