
// Script function: Show the sum of rectangular ROI (will be the sum of the entire image if no ROI is selected).

// 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 GlobalSinoImage
GetFrontImage (GlobalSinoImage)
number GlobalSinoSum = Sum (GlobalSinoImage[])
number EMscale = ImageGetIntensityScale(GlobalSinoImage)
string EMunit = ImageGetIntensityUnitString(GlobalSinoImage)
string GlobalSinoEM = "Intensity sum in ROI: \n"
GlobalSinoEM += "\n Image value: " + GlobalSinoSum
GlobalSinoEM += "\n Calibrated: " + GlobalSinoSum*EMscale + "[" + EMunit + "]"
OKDialog(GlobalSinoEM)
