// Script function: Bring the two earliest opened images to front and assign mirror/Identical Rectangle Annotation on them
// Requirement: At least open two images

// 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


number GlobalSinoImage = CountImageDocuments()
imageDocument ForEMImageA = GetImageDocument( GlobalSinoImage-1 )
image EMImageA := ImageDocumentGetImage( ForEMImageA, 0 )
Showimage (EMImageA)
 
imageDocument ForEMImageB = GetImageDocument( GlobalSinoImage-2 )
image EMImageB := ImageDocumentGetImage( ForEMImageB, 0 )
Showimage (EMImageB)
 
ROI MyROI = CreateROI();

ROISetRectangle(MyROI,0,200,250,300)

MyROI.ROISetVolatile( 0 ) // 0 is for Annotation, 1 is for ROI

if ( TwoButtonDialog( "Add Mirror ROI?", "Mirror ROI", "Cancel" ) )
{
 myROI.ROISetLabel( "Mirror" )
 EMImageA.ImageGetImageDisplay(0).ImageDisplayAddROI( MyROI )
 EMImageB.ImageGetImageDisplay(0).ImageDisplayAddROI( MyROI )
// The Mirror ROIs can be moved simultaneously
}

else
{
Exit(0)
}

 


 