// // Adds a white (or maximum-color) vertical projection to the specified image. // The profile is a vertical projection of the image. The percent // parameter tells how much of the image will be used for displaying // the vertical projection. // // Copyright © 1995, Gatan Inc. // All rights reserved. // Written by Chris Meyer, 3/23/95. // // Future extensions: // // Draw line with sub-pixel setting so that it is visible even when the spacing // between projection pixels is greater than 1. // // Create image as rgb. // void AddVerticalProjection( Image image, number percent ) { number width, height GetSize( image, width, height ) RealImage profile := RealImage( "temp", 4, width, 1 ) profile = 0 index( profile, icol, 0 ) += exprsize( width, height, index( image, icol, irow ) ) number max = max( image ) number minp = min( profile ) number maxp = max( profile ) number rangep = maxp - minp profile = ( percent / 100 ) * height * ( profile - minp ) / rangep index( image, icol, height - 1 - profile ) = exprsize( width, 1, max ) } // Example of use: Image frontImage := GetFrontImage() AddVerticalProjection( frontImage, 5 )