Introduction


NIH Image is a public domain image processing and analysis program for the Macintosh. It can acquire, display, edit, enhance, analyze and animate images. It reads and writes TIFF, PICT, PICS and MacPaint files, providing compatibility with many other applications, including programs for scanning, processing, editing, publishing and analyzing images. It supports many standard image processing functions, including contrast enhancement, density profiling, smoothing, sharpening, edge detection, median filtering, and spatial convolution with user defined kernels.

Image can be used to measure area, mean, centroid, perimeter, etc. of user defined regions of interest. It also performs automated particle analysis and provides tools for measuring path lengths and angles. Spatial calibration is supported to provide real world area and length measurements. Density calibration can be done against radiation or optical density standards using user specified units. Results can be printed, exported to text files, or copied to the Clipboard.

A tool palette supports editing of color and gray scale images, including the ability to draw lines, rectangles and text. It can flip, rotate, invert and scale selections. It supports multiple windows and 8 levels of magnification. All editing, filtering, and measurement functions operate at any level of magnification and are undoable.

Image directly supports several frame grabber cards for capturing images or movie sequences using a TV camera. It also supports QuickTime compatible video digitizers such as those built into "AV" Macs and the Power Mac 7500/8500. Acquired images can be shading corrected and frame averaged.

Image can be customized in three ways: via a built-in Pascal-like macro language, via externally compiled plug-in modules and on the Pascal source code level. Example macros, plug-ins and complete source code are available from the NIH Image Web site (http://rsb.info.nih.gov/nih-image/).




System Requirements

Image requires a color capable Macintosh and at least 2MB of free RAM. A Macintosh with 16MB or more of RAM is recommended for working with 3D images, 24-bit color or animation sequences. System 7.0 or later is required. Image directly supports, or is compatible with, large monitors, flatbed scanners, film recorders, graphics tablets, PostScript laser printers, photo typesetters and color printers.

Acknowledgments

The author wishes to thank the following individuals for their help, encouragement, and contributions: Peter Ahrens, Joseph Ayers, Greg Brown, Mike Castle, Rick Chapman, Dennis Chesters, David Chow, Ted Colburn, Cyrus Daboo, Andras Eke, Chuck Fiori, Garth Fletcher, Tom Ford-Holevinski, Keith Gorlen, Joseph Hennessey, Greg Hook, Marshal Housekeeper, Edward J. Huff, Werner Klee, John Ladwig, Cary Mariash, Kelly Martin, Reuben Mezrich, Tom Marschner, Ranney Mize, Jim Nash, Ed Nater, Steve Pequigney, David Powell, Ira Rampil, Arlo Reeves, Robert Rimmer, Bob Rodieck, Stein Roervik, Christian Russ, John Russ, Matthew Russotto, Bruce Smith, Seth Snyder, Roy Standing, Cliff Stoll, Steve Ruzin, Norbert Vischer and Mark Vivino.

Overview


manual1

Windows

Image displays images, measurement results, profile plots, etc. in windows. Windows can be dragged around the screen by their title bars. In addition, some windows can be resized (e.g. the Plot window) using the "drag box" in their lower right corner. A window buried underneath other windows can be activated by selecting it in the Windows menu.

The LUT window displays the current video look-up table. The Tools window contains a palette of tools for making selections, editing images, drawing text, and making measurements. The Map window is used for adjusting the contrast and brightness of images and for enabling and disabling thresholding. The Info window displays status information, such as cursor position and value, and the most recent measurement results. The Results window displays the current table of measurement results. The Plot window displays density profile and calibration plots. The currently active window (e.g., the MRI window above) has a highlighted menu bar.


Images

Image manipulates, displays and analyses images. Images are two dimensional arrays of pixels (picture elements). Pixels are represented by 8-bit unsigned integers, ranging in value from 0 to 255. Image follows the Macintosh convention and displays zero pixels as white and those with a value of 255 as black. 16-bit images, however, can be imported and scaled to 8-bits. The 16-bit (up to 65,00 gray levels) to 8-bit (256 gray levels) scaling can be controlled by the user or performed automatically based on the minimum and maximum gray values in the 16-bit image. The Rescale command (in the File menu) allows the user to redo the 16-bit to 8-bit scaling at a later time.

Stacks

Image supports the organization and manipulation of a series of 2D images as a 3D array called a stack. A stack contains set of related 2D images, such as a movie loop or serial sections from a volume. The 2D images that make up a stack are called slices. You can step through the slices using the ">" and "<" keys. The number of the current slice and the total number of slices are displayed in the title bar. The Stacks menu contains commands that work with stacks. Windows to Stack converts a set of 2D images into a stack. Animate animates the images in a stack at a rates up to 100 frames per second. Reslice reconstructs a new 2D image perpendicular to the plane of the slices in a stack. Project does volume rendering, useful for visualizing the internal structures of 3D images. Commands not in the Stacks menu, except for Open, Save and Export, have no knowledge of stacks. For example, the Invert command only inverts the current slice, not the entire stack. Macros are available, however, for performing various operations on all the slices in a stack.

Memory Requirements

Opened images are stored entirely in the Mac's internal memory, or RAM (Random Access Memory). An image requires one byte of RAM for each pixel plus a few thousand additional bytes for data structures containing information about the image, such as color tables and calibration. For example, a 512 X 512 image requires 262,144 bytes, or 262K, where 1K equals 1024 bytes. A 256 X 256 X 256 stack would require 16,777,216 bytes or 16MB. To see how much RAM an image uses, use the Get Info command, or pull down the Windows menu, which shows the size of all open images.

The number and size of images that Image can work with depends on Image 's RAM allocation. To check or change the allocation, select Image 's icon (a microscope) and use the Finder's Get Info command. The default allocation is 2500K. To use all of Image 's features requires a RAM allocation at least three times the size of the largest image, plus the size of the program (about 300K). The extra RAM is used for a buffer that supports one level of Undo (the Undo Buffer) and a Clipboard buffer that supports copy and paste functions. The default size of these buffers is 300K. This can be changed using the Preferences command in the Options menu. You can find out how much memory is currently available for opening images by selecting "About NIH Image" from the Apple menu.

File Formats

manual2 Image supports TIFF, PICT, PICS and MacPaint file formats. Stacks can be saved as either multiple image TIFF files or as a PICS file. The Import and Export commands allow images with arbitrary binary and tab-delimited text (spreadsheet) formats to be read and written. The Open All option of the Open and Import commands allows a series of images to be read automatically. Measurement results can be exported to a text file compatible with spreadsheet and statistical analysis programs.

Macros

Image can be extended using a Pascal-like macro programming language that allows users to customize and automate repetitive and frequent tasks. The easiest way to develop a custom macro is to modify one of the macros in the Macros folder distributed with Image . Macros are stored in text files that can be edited using Image 's built-in text editor. Using the Load Macros command causes the macros in the file to appear as commands at the bottom of the Special menu. The macro language is described in
Appendix A. The description assumes some familiarity with the Pascal programming language. Additional help on macro writing, and other ways to extend Image , can be found in a separate document named "Inside Image".

Plug-ins

Image can also be extended using Photoshop compatible plug-ins. Acquisition plug-ins are used to support scanners or frame grabbers, or to read images in file formats that Image does not normally support. They are accessed using the Acquire sub-menu. Export plug-ins are used to output to printers that do not have a Chooser selectable driver or to save images in file formats not normally supported by Image . They are accessed using the Export sub-menu. Filter plug-ins perform filtering operations on images. They are accessed using the PlugIn Filters sub-menu. Image expects to find plug-ins in a folder named Plug-ins located in either the same folder as Image or in the System folder.

Video Capture

Using a frame grabber card, Image can digitize images from TV cameras, VCRs or video disks. Captured frames can be averaged or integrated. Integration can be done in RAM (using software), on-chip at video rates using Cohu or Dage CCD cameras, or on-board at video rates using the Scion AG-5. The Histogram command will display a continuously updated density histogram during "live" capture. The Make Movie captures a sequence of frames into a stack at rates up to 30 frames per second. The Capture Color command digitizes 24-bit color into a three slice stack. For alignment purposes, Show Paste Control (in the Windows menu) allows "Live" video to be superimposed over a previously captured image. Information about the four frame grabber cards directly supported by Image (the Scion LG-3, Scion AG-5, Scion VG-5, and the Data Translation Quick Capture) is provided in Appendix B. Image also supports QuickTime compatible video digitizers such as those built into "AV" Macs and the Power Mac 7500/8500.

Image Enhancement

The Process menu provides filters for smoothing, sharpening, finding edges and reducing noise in images. The Convolve command uses user-defined filters that operate on up to 63 X 63 neighborhoods. The Binary sub-menu's Make Binary command converts grayscale images to images consisting of only black and white pixels and includes commands to process such images. Use the Arithmetic sub-menu to add or multiply an image (or selection) by a constant. Arithmetic operations between two images are done using the Image Math command or by using the Paste Control dialog box during paste operations.

Making Measurements

manual3 To make a manual area measurement, first outline a region of interest using the rectangular, oval, polygonal, or freehand selection tool. Then select the Measure command, which will compute the area, mean gray value, and the minimum and maximum gray value. Other measurements, such as perimeter, can be enabled using the Options command in the Analysis menu. Measure distances by making a straight, freehand or segmented line selection, and then using the measure command. (Note that the line selection tool uses a pop-up menu for selecting different line types.) Use the angle tool to measure angles. The cross hair tool counts objects, marks them, and records their X-Y coordinates. The wand tools automatically outlines structures isolated using thresholding. Results from the most recent measurement are displayed in the Info window. Use Show Results to display a table of results since the last time the Reset command was used.

The Analyze Particles command automatically counts and measures features of interest. This requires thresholding to discriminate objects of interest from surrounding background based on their gray values. Image has two thresholding methods. In thresholding mode (Threshold is checked in the Options menu), all pixels equal to or greater than a single threshold level are displayed in black, and all other pixels (the background) are displayed in white. In Density Slicing mode (Density Slice is checked), all pixels between a lower and upper threshold are highlighted in red. For both modes, you adjust threshold levels by dragging the LUT tool (the one with the double-headed arrow) in the LUT window. For successful thresholding, it may be necessary to use the Subtract Background command to remove the effects of uneven illumination.

Images can be calibrated to either spatial or density standards using the Set Scale and Calibrate commands respectively. To calibrate spatially, use the line selection tool to measure a known distance, then use Set Scale to specify a unit of measurement (e.g. millimeters) and enter the known distance. To calibrate to a set of density standards (e.g. an optical density step tablet), measure the mean gray level of each of the standards, then use the Calibrate command to enter the known values and specify the type of curve fit.

Editing

manual4 Image 's tool palette contains several tools used for image editing and annotation. The pencil, brush, line, paint bucket and spray draw in the current foreground color (the color of the brush in the Toolbox window). The text tool draws text using the current font, size, style, and foreground color. Click on a color with the eyedropper tool to select a new foreground color. The eraser tool erases to the current background color (the color of the eraser in the Toolbox window). Click on a color in the LUT window with the eraser to select a new background color.

Commands in the Edit menu operate on the current selection. Cut, Copy and Paste perform the standard Macintosh Clipboard operations. Fill fills the selection in the foreground color. Clear erases it to the background color. Draw Boundary draws a line around the selection. Scale and Rotate enlarges, shrinks and/or rotates the current rectangular selection. Commands are also available for flipping and rotating by 90 .

Text Windows

Image has a built-in text editor that can open and edit text files up to 32K in size. The following command know how to deal with text windows: New, Open, Close, Save, Save As, Print, Cut, Copy, Paste, Clear, Select All, Font, Size, Convolve (uses the kernel in the current text window), and Load Macros (loads the macros contained in the current text window). Also note that the Fill command changes to Find when a text window is active.

Look-up Tables

Each open image has a look-up table (LUT) associated with it. The LUT window displays the contents of the look-up table for the currently active image. The LUT is used to map, at video rates, pixels (in the range 0-255) to screen colors. Click and drag with the LUT tool in the LUT window to adjust brightness and contrast. Measured density values will not change since you are manipulating the look-up table, not the image's pixel values.

Various commands at the top of the Options menu allow you to invert the current LUT, to specify the number of gray levels or colors it uses, or to switch to one of several built-in color tables. LUTs are automatically stored with an image when it is saved to disk, or they can also be saved separately.

manual5

On-line Help

Balloon help is available in the Tools, Map and LUT windows, in menu commands, and in most dialog boxes. Balloon help is enabled by selecting Show Balloons from the Help (?) menu. The Tools, Map and LUT windows must be activated (by clicking on them) to get the help messages to appear.

NIH Image Mailing List

No telephone support is available for Image. The NIH Image mailing list, however, provides a way to get questions answered. It can also be used to contact other users, to keep abreast of new developments, and to get updates via e-mail. Instructions on how to subscribe are in the Frequently Asked Questions section. The NIH Image mailing list is maintained by Drexel University.

Citing NIH Image

Published research assisted by NIH Image should use a statement similar to the following in the materials and methods section "... analysis performed on a Macintosh computer using the public domain NIH Image program (developed at the U.S. National Institutes of Health and available on the Internet at http://rsb.info.nih.gov/nih-image/)".


[Next] [Contents] [Home]