// Script function: Embed in a larger 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 Boundary = 10 // enlarging border width imgCreated := RealImage( "", 4, EMx + 2 * Boundary, EMy + 2 * Boundary ) imgCreated = -1 imgCreated[ Boundary, Boundary, Boundary + EMy, Boundary + EMx ] = imgOriginal // Directly define a portion of an image is equal to one image ShowImage( imgCreated ) SetName(imgCreated, "The '" + GetName(imgOriginal) + "'is embedded.")