// Script function: Crop a 2D image // Requirement to run the script: 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 imgOriginal, imgCreated if ( !GetFrontImage(imgOriginal) ) Throw( "Please open an image." ) number EMx, EMy GetSize( imgOriginal, EMx, EMy ) number EMBoundary = EMx/4 // Removed boundary width imgCreated := ImageClone( imgOriginal[ EMBoundary, EMBoundary, EMy - EMBoundary, EMx - EMBoundary] ) SetName( imgCreated, " cropped from '" + GetName(imgOriginal) + "'") ShowImage( imgCreated )