


// Script function: Remove a specific type (Oval ROI here) of annotations on the most-front image.
// Requirement: At least one opened image
 
 
// 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 GlobalSinoImg := GetFrontImage()
imageDisplay EMDisplay = GlobalSinoImg.ImageGetImageDisplay(0)
 
number EMAnnotationType = 28 // For Oval ROI. Search all types at http://www.globalsino.com/EM/page2597.html#Annotations.
number GlobalSinoSpecificAnno = EMDisplay.ComponentCountChildrenOfType( EMAnnotationType )
OKDialog( "There are " + GlobalSinoSpecificAnno + " annotations of type " + EMAnnotationType + ".\nRemove them now." )
for( number i = 0; i<GlobalSinoSpecificAnno; i++ )
{
    component GlobalSinoComponent = EMDisplay.ComponentGetNthChildOfType( EMAnnotationType, 0 ) 
    GlobalSinoComponent.ComponentRemoveFromParent()
}


// Script to remove all annotations at:
// http://www.globalsino.com/EM/page2597_annotation.s
