
// Script function: Extract a singel spectrum at the position (x, y) from a 3D data cube
// Requirement: You need a 3D image opened at front-most.


// 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 Myx = 20
number Myy = 23
image GlobalSinoSI := GetFrontImage()
number EMx, EMy, EMz
Get3DSize( GlobalSinoSI, EMx, EMy, EMz )
image EMSpectrum := Slice1( GlobalSinoSI, Myx, Myy, 0,  2, EMz, 1 )
image EMExtractedSpectrum := ImageClone( EMSpectrum )
ShowImage( EMExtractedSpectrum )