// Script function: Resize an image by changing the number of pixels in an original image
// Requirement: Open an 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 GlobalSinoImage, ReSizedImage
GlobalSinoImage.GetFrontImage()
number EMx, EMy

GetSize( GlobalSinoImage, EMx, EMy )

number EMfactor = 0.3  // You need to change this scaling factor to your own

ReSizedImage := ImageClone( GlobalSinoImage )

ImageResize( ReSizedImage, 2, EMx * EMfactor, EMy * EMfactor )

ReSizedImage = Warp( GlobalSinoImage, icol/EMfactor, irow/EMfactor )

SetName( ReSizedImage, GetName( GlobalSinoImage ) + "Resized Image" )

ShowImage( ReSizedImage )
 
