FILMPS - POSTCRIPT IMAGE PLOT ============================= INTRODUCTION The program FILMPS is used to read a film or image-plate (i2) image and output a postscript file for printing a copy of the image with user added annotation. The film/image-plate image may have its data in any of the 8 possible orders and may be byte swapped if required. The program was written by J.W. Campbell, Daresbury Laboratory. List of sections: Data Control Cards Input and Output Files Running the Program Notes Printer Output Error Messages Program Function References DATA CONTROL CARDS The program is run interactively and uses the following question and answer sequence. Film (f) or image-plate (i) file [f]: The reply indicates the type of data file being accessed. This is either 'f' to indicate film or 'i' to indicate image-plate (i2) data. The default is film data. Name of input film image file: or Name of input image-plate data file: The reply is the name of the input film or image-plate data file. No. of x rasters, no. of y rasters [nx ny]: The reply gives the numbers of x-rasters and y-rasters in the input file (x and y are in the standard film 'xf' and 'yf' coordinate frame). The default values are 2400, 2400 for film and 1200, 1200 for image-plate. Enter origin pixel x, y [1 1]: The reply specifies the origin pixel of the section of the image to be printed. Enter no. of x, y pixels for the image section [nx, ny]: The reply specifies the size, in pixels, of the section of the image to be printed. The default values are for the complete image. Order of axes in input data file [+x+y]: The reply is a string indicating the order of the data in the input file. This indicates the slower moving axis in the file followed by the faster moving axes in terms of the directions of the film 'xf' and 'yf' coordinates. The order strings for the eight possible orders are: +xf +yf +xf -yf -xf +yf -xf -yf +yf +xf +yf -xf -yf +xf -yf -xf An additional item 's' in the string indicates that, for image-plate (i2) data, byte swapping of the data is to be carried out. The exact string may be input in a number of forms; the '+' signs need not be given, the letters 'f' need not be given, items need not be separated but may be separated by spaces or commas. Some valid examples are: xy -yx yxs -yf,xf,s xf -yf Byte swap data [n]: This question is only asked for image plate data and provided that byte swapping has not already been requested in reply to the previous question. The reply is either 'y' to byte swap or 'n' (the default) for no byte swapping. Name of output postscript file: The reply is the name of the output postscript file. Black = high (h) or low (l) [h]: The reply indicates whether a positive or negative image is required. The default has increasing blackness with increasing pixel value. Automatic (a) or user defined (u) scaling [a]: The reply indicates the type of scaling required for the printed image section (assumed to be on an A4 page). If automatic scaling 'a' is requested the maximum dimension of the printed image will be 6 inches (15.24 cms). If user defined scaling is requested, then the following additional question will be asked (with a note that the maximum dimension in xf, yf should not exceed 18.0 cms): Required width (xf) in cms [15.0]: The image will be scaled by setting its width in cms to the value given. As indicated, this should be chosen bearing in mind that the maximum dimension in xf or yf should not exceed 18.0 cms. ===> At this point the image data will be read and the maximum pixel value will be found and shown. Minimum and maximum thresholds for scaling [0 max_thr]: The reply gives the minimum and maximum threshold pixel values to be used in determining the output density of the pixels. Pixels less than the minimum threshold will be treated as having the minimum threshold value and similary for pixels above the maximum threshold requested. The default values are 0 and the maximum pixel value found when reading the file for film or 10% of the maximum pixel value found for image-plate data. Short title: The reply is a short title (say < 40 characters) for the plot. A blank reply may be made if no such title is required. Add further annotation [y]: The reply is 'y' if further annotation is to be added or 'n' if it is not. If further annotation is to be added the the following additional questions will be asked:- Add heading with date [y]: The reply is 'y' if a heading at the top of the plot containing the date and time is to be output; otherwise give a reply of 'n'. Add key [y]: The reply is 'y' if a standard key is to be output. The key contains details of the image section, orientation, data order in the file, maximum pixel value and scaling thresholds. If such a key is not required, a reply of 'n' is made. Add comments [y]: If a reply of 'y' is made the program will allow the user to input up to 4 lines of comments; if the reply is 'n' then no comments will be added to the output. The comments will be centred on the longest of the comment strings given. INPUT AND OUTPUT FILES The input file is one of the following: a) A film image file; this is assumed to have unsigned byte data and no header information. b) An image-plate (i2) data file; this is assumed to have unsigned two byte integer data and to have no header information. The output file is: a) A postscript file containing the requested section of the image annotated as required. RUNNING THE PROGRAM The program may be run via the command 'laue filmps' NOTES None. PRINTER OUTPUT The Postscript output file may be output on any suitable Postscript supporting printer device. The output is for a single A4 page. ERROR MESSAGES a) Invalid question replies **Error** Invalid file type **Error** Invalid reply **Error** Invalid axis order string **Error** Invalid image type **Error** Invalid scaling option **Error** Invalid value **Error** Width %.2f <= 0.0 **Error** Invalid value(s) b) File handling errors **Error** Unable to open input file **Error** Unable to open output file **Error** Read error at record 'n' c) Memory allocation errors **Error** Unable to allocate space for image PROGRAM FUNCTION The program FILMPS is used to read a film or image-plate (i2) image and output a Postscript file containing a copy of the image or a selected section of the image. The data file may have its data in any of the 8 possible orders and (for i2 data) may be byte swapped. The scale for the output size of the image may be calculated automatically by the program or may be given by the user. The density scaling and may be chosen and positive or negative images output. Various options for annotating the plot are available. The convention for defining the x and y axes are those of the film xf and yf axes defined for the oscillation film processing package MOSFLM. The plots are output with xf to the right and yf up. REFERENCES Example of a question and answer sequence: Film (f) or image-plate (i) file [f]: i Name of input image-plate data file: /scr1/pf.i2 No. of x rasters, no. of y rasters [1200 1200]: 1500 1500 Enter origin pixel x, y [1 1]: Enter no. of x, y pixels for image section [1500 1500]: Order of axes is input data file [+x+y]: yf xf s Name of output postscript file: /scr1/pf.ps Black = high (h) or low (l) [h]: Automatic (a) or user defined (u) scaling [a]: *Reading data file* *Data read* Maximum pixel value found = 65535 For image-plate default scaling threshold = 10% of maximum value Minimum, maximum pixel value thresholds for scaling [0 6553]: 0 1500 Short title: Proflavin Image Add further annotation [y]: Add heading with date [y]: Add key [y]: Add comments [y]: : Image recorded on MAR image plate system at the Daresbury Laboratory : : : *Preparing postscript file* *Post script file written*