SHOW_IMG This program allows you to display images, and was written for use with medical images such as MRI, PET, and SPECT. These images currently must have symmetric dimensions of 64, 128, 256 or 512. They may be either 8- or 16-bit images, and may be preceeded by a header of any size, provided that the header is smaller than the image. When you display a series of images, you may use the LEFT mouse button to zoom a portion of the window in a larger window; the zoom will follow the mouse as you move it (use the RIGHT button to remove the zoomed image). You can use the MIDDLE mouse button to plot a histogram of the selected image. Use the RIGHT mouse button to a window to make it the current window; this is useful when you are saving window contents to disk (see below). These operations will work for ALL currently displayed windows created using the "Series" button (not for single images). You can save the contents of the current window to a file in GIF, BMP, PICT, JPEG or TIFF format. See "Options" below. Several options are available using the "Options" button to call up a popup widget. These options effect the display of subsequent images. Several keyword options have been added to facilitate the calling of Show_Img from other modules. Quick Start: Set the environment variable IM to be a directory which is often used for images: setenv IM /dir/images (optional) In IDL, start the Show_Img program: IDL> show_img Enter the file specification for the series of images you wish to view, in the text widget below "Enter File Spec...": eg. /dir/images/run5*.pet Use "Mode" to change the window and image size, and then select "Series" to display the series. If the series contains more images than can fit in the window, select either "Continue" or "End". Basic Operations: Quit Viewer Exit the program. Select "Delete Windows" to remove windows, or "Leave_Windows" to leave them onscreen. Help Display this help file. Requires the program LHELP to display this .doc file. Mode... Choose the size and number of images to be displayed simultaneously. The choices are: Images in Window ---------------4 x 4 8 x 6 4 x 3 8 x 6 Size of Images -------------128 x 128 128 x 128 256 x 256 256 x 256 Mode ---1 2 3 4 1 x 1 2 x 1 3 x 2 256 x 256 256 x 256 256 x 256 5 6 7 1 x N 256 x 256 8 This option has no effect when you are viewing a single image file with "Display Image". The 8x6, 256x256 mode puts images in a scrollable window that fills most of the screen. The 1xN, 256x256 mode puts ALL of the images in the series specified into a scrollable window, with all images being viewable using the horizontal scrollbar. This is useful when comparing different series of images. Note that the last three modes are to create windows compatible with display modes on the IBM PC platform, for display and print purposes. Display... Display Linear Combination: -------------------------Various viewing options. The first is to display a series of linear combinations of two sets of images (the first image minus the second). Select "Display series as linear combination" to do this. This is useful for checking the registration in multiple-echo protocols. Enter the file-specifications for the series in the popup widget that appears. You will be forced to use the mode (8x6 256x256). The remaining options are for viewing a single image file. Select "512x512" or "256x256" to specify the size of the image. Then specify which file to display using the popup widget. Displaying Single Image Files: ----------------------------Use the choices "Display image (512x512)" and "Display image (256x256)" to display individual images in the sizes specified. Note that the mouse operations listed above do not work for these windows. Colors... Use this to select different color tables by selecting "Color Tables" (calls the IDL routine XLOADCT), or to adjust the gray-scale by selecting "Grayscale". Select "Palette colors" to adjust the RGB color values for individual color indices. Options [Popup widget] Press this to bring up a popup widget which will allow you to adjust display options. The default settings are capitalized. The currently enabled options are: * Display Filenames? (YES/No) * Set Colors on Display? (YES/No) If set to YES, then when images are displayed which require certain colors to be adjusted the color palette will be updated. Set to NO if you have adjusted colors yourself and do not wish the colors to be adjusted automatically when the next series is displayed. * Restore Colors for Windows (Yes/NO) All windows created while this option is set to YES will have the current color-table assigned to them when they are created. Thereafter whenever the cursor enters a window its color-table will be loaded, and when the cursor leaves the window the previous color-table will be restored. This option is useful when you want to display several series having incompatible color-tables simultaneously. Normally you could not view both at the same time; now you can view each with its appropriate color table, provided the cursor is within the window. When you update the gray-scale or adjust individual colors using "Colors...", the new color-table will be assigned to the current window (remember that you can press the right mouse button within a window to make it current). Note that this feature is NOT enabled for loading new color tables using XLOADCT (this is a limitation of XLOADCT, not SHOW_IMG). You can turn this feature on when you start SHOW_IMG by using the keyword /PRESERVE_COLORS (useful when calling from another module). * Multiple Windows For Series? (Yes/NO) Normally when a window is filled the program will pause until the user selects the "Continue" or "End" button to either continue display or stop display of the series. If you set this option to YES then the entire series will be displayed using as many windows as necessary. The window titles will indicate the sequence of the windows. This option is useful when you want to save multiple windows to graphics files using the "Write Windows to Files" option. * Source of Filenames For Series (FILESPEC/Series) This controls the source for the list of filenames to display whenever you select the "Series" button. When set to FILESPEC the file specification you enter in the text widget is used. When set to SERIES the program will use a list of filenames entered individually using the menu choice "Operations... : Create List of Filenames". * Reverse Images Vertically (Yes/NO) If set to YES then the images are reversed vertically (their columns are reversed). This is for images that appear "upside-down" relative to our usual orientation. * Write Windows to Files (Yes/NO) Selecting "Yes" for this option, you can save the contents of one or more windows to graphics files of the following formats: TIFF, GIF, BMP, PICT, JPEG This option will save the <next> window(s) created to graphics files, while the "Operations" item to save the current window to graphics file saves the <current> window to a graphics file. The JPEG format currently supports only grayscale images, and defaults to "very good" image quality (meaning QUALITY=75 in IDL's WRITE_JPEG() function call). You will be prompted to choose from the above formats, and then you will be asked to provide a base filename to use for the output graphics files. If you have an image series already displayed, then the first five letters of their filenames will be displayed as a suggestion. You can change the output directory for these image files as well. Each successive graphics file created will have an image number added to the filename, and the appropriate extension will be added. The image numbers will begin with '001' and increment monotonically. This option has been used, for example, to create single graphics files for each image in a series of images, to be printed later. NOTE: If you are creating graphics files to be used with Pizzaz Plus (IBM PC), use GIF files, as TIFF files seem to lose resolution information when they get converted. * Enable Uniform Scaling (YES/No/Manual) When uniform scaling is enabled ("Yes", the default) the maximum of the central image of a series is used as a common scaling factor for all images of the series, so that the images appear somewhat consistent in intensity. When disabled ("No") each image is scaled according to its own minimum and maximum values, which can lead to variations in image intensity. When "Manual" is selected then the user can specify the common maximum value to use for uniform scaling, using the slider below these buttons. Selecing this option will activate this slider. * Adjust scaling maximum [Slider] The slider sets the maximum value to use when scaling images. Show_img first determines a reasonable scaling factor and then applies it to subsequent images, resulting in the images having consistent on-screen values. If the images look too light or too dark then adjust the slider appropriately. This slider is only active when you have selected "Manual" in the above option "Enable Uniform Scaling". Operations... Save Window Contents To File... Formats: BMP : GIF : PICT : TIFF : JPEG : Microsoft Windows bitmap format Graphics Interchange format Macintosh graphics format Tagged Image File Format Joint Photographic Experts Group You can save the "current" window contents to a graphics file in PICT, TIFF, BMP, JPEG or GIF format by selecting "Save Window Contents To File". If more than one window is displayed, you can make one of them "current" by pressing the RIGHT mouse button over one of the images in the window. The title of the window will change momentarily, verifying that this is the current window. When you select a file format, the title of the current window will have '(CURRENT)' added to it, so that you can verify that you are saving the contents of the correct window. Currently the JPEG option only supports grayscale images, and defaults to "very good" quality (meaning QUALITY=75 in IDL's WRITE_JPEG() function). Create List of Filenames This will bring up a popup widget in which you can enter individual filenames for display. For Show_img to use this list you must set the source of filenames to be "List" within the "Options" popup widget. Press "Done" to accept the list, or "Cancel" to abort. If accepted, the program will verify whether all files entered actually exist. You will be given the chance to edit the list in the case of missing files. Series Use this to display a series of images. The source of filenames used depends upon the setting of "Source of Filenames For Series" within the "Options" widget (see "Options" section above). If the source of filenames is "Filespec", then the series is designated by entering a file specification, using wildcards, in the box below the instructions "Enter series filespec below:". If the source of filenames is "List", then the list of filenames you entered (see "Operations..." above) will be displayed. If "Multiple Windows For Series" option is set to NO (the default), then after all images are displayed or the screen is filled, whichever comes first, you may select "End" to discontinue displaying images, or select "Continue" to continue the display of images. Unfortunately, other options (most notably "Colors...") are not available "between screens"; you have to select "End" or "Continue" first. If "Multiple Windows For Series" is set to YES, then as many windows as necessary will be created to display the entire series of images. Enter Series Filespec Below: Use this when you want to display a series of images; type in a file specification using wildcards (* or ?) which designates the series you want to display. You must enter this BEFORE selecting "Series". Note that you can enter a file specification and then press <return> to display the series using the current entry. The initial entry in this text widget can be set using the environment variable IM. Setting this to a commonly used directory is often useful. Delete: Pressing this button deletes the most recently created imagedisplay window. Continue / End: When displaying more images than can fit into a single window, the program will pause after each complete window is filled. Pressing "Continue" will continue the display of images, whereas "End" will discontinue the display. Note that these options are useful only when "Multiple Windows for Series" is set to NO in the Options widget. ------------------------------------------------------------------------Keywords FILE=filespec Set this to a file specification for a series of image files. This Filespec will appear in the file-specification text widget. This is useful when calling from other modules. MODE=n ( n=1,2,3 or 4 ) This chooses the display mode (size and number of simultaneous images). See option "Mode" above for available modes and their numbers. NOCOLOR_TABLE Set this to inhibit the loading of the linear gray-scale (LOADCT, 0). This is useful when calling from other modules which adjust the color table themselves. NOSCALE Set this to force Show_img to display images in original form, without any scaling operations performed. If the display visual is 8-bit, then the image must be 8-bit also. This is useful when calling from other modules, when image signal values must not be changed. PRESERVE_COLORS Set this to enable event tracking for windows. Each window created will have the current color-table assigned to it, and whenever the cursor enters this window its color-table will be restored. See "Options" : "Restore Colors for Windows" for more details. This keyword also forces the following: whenever the cursor is moved outside one of the Show_img windows, the original color-table (before Show_img was run) is restored. This is useful when calling Show_img from other modules. SCALE_MIN Set this to the minimum value to use for scaled images. This is useful if you have reserved colors, say, from 0 to N, and want gray-scale images displayed beginning with color index N+1 (you would set SCALE_MIN=N+1). This keyword activates the BOTTOM keyword in the BYTE_SCALE routine. Local routines required by Show_Img: FILE_FIND.PRO ASK.PRO EDIT_TEXT.PRO FILE_STRARR.PRO ADJUST_COLORS.PRO ZOOM2.PRO STRETCH2.PRO Example show_img, mode=2 FILENAME.PRO BYTE_SCALE.PRO FILE_UTILS.PRO WINDOW_TO_FILE.PRO GRAYSCALE.PRO FIND_PROCEDURE.PRO GET_TEXT.PRO DELETE_FILES.PRO READ_IMG.PRO BEEP.PRO LHELP.PRO ADJUST_PALETTE.PRO