// Script function: Embed in a larger 2D image with constant edge value with slice2 // 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 = 0 // Define the value of the edges (here the edge value is '0') slice2( imgCreated, Boundary, Boundary, 0, 0, EMx, 1, 1, EMy, 1 ) = imgOriginal ShowImage( imgCreated ) SetName(imgCreated, "The '" + GetName(imgOriginal) + "'is embedded.")