///////////////////////////////////////////////////////////////////// // (c) Gatan Inc. ///////////////////////////////////////////////////////////////////// // This script will scale all of the annotations on an image by a requested factor. // It will keep the center of all of the annotations put together constant. ////////////////////////////////////////////////////////////////////// // last modified 08-July-2014 BS (comments only) /* This method cycles through the annotations in the input image and returns the annotation bounds extrema values in the passed parameters (hence the use of '&', allowing the passed parameters to be modified).*/ void CalculateAnnotationExtent( Image image, number &xTop, number &xLeft, number &xBottom, number &xRight ) { // Get the size of the input image number width, height Get2dSize( image, width, height ) // Count the number of annotations present number annotCount = CountAnnotations( image ) // Begin with the most extreme values for each bounding side variable xTop = height xLeft = width xBottom = 0 xRight = 0 // Loop through each annotation in the image number index for ( index=0; index xBottom ) xBottom = bottom if ( right > xRight ) xRight = right } } /* This method recales all the annotations in the given image around the given origin by the given percentage. It is called with the image of interest, the specified origin and the scaling factor. It returns nothing. */ void RescaleAnnotations( Image image, number originX, number originY, number scale ) { // Get the height and width of the input image number width, height Get2dSize( image, width, height ) // Count the number of annotations number annotCount = image.CountAnnotations( ) // Loop through the annotations number index for ( index=0; index