// Script function: Output the information of front-most image
// 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 GlobalSinoImg

if ( !GetFrontImage( GlobalSinoImg ) )
Throw( "No image displayed." )

number EMx, EMy
GetSize( GlobalSinoImg, EMx, EMy )
imageDisplay MyDisp = GlobalSinoImg.ImageGetImageDisplay( 0 )       

if ( 1 == MyDisp.ImageDisplayGetDisplayType() )
{
result ("\n The most-front image is a raster image" )
result ("\n The maximum of X is " + EMx + " and the maximum of Y is " + EMy)
result ("\n" )
}

else if ( 3 == MyDisp.ImageDisplayGetDisplayType() )
{
result ("\n The most-front image is a line plot image" )
result ("\n The maximum of X is " + EMx + " and Y is a constant: " + EMy)
result ("\n" )
}

else
{
 Exit( 0 )
}
