Title                  :IMAGE Version 1.25
Keywords               :Image Processing
Computer               :MACII
Operating System       :Mac
Programming Language   :Pascal
Hardware Requirements  :8 bit Video
Author(s)              :Wayne Rasband                   
Correspondence Address :National Institues of Health
                       :Bldg 36, Room 2A-03, Bethesda, Md.20892
		       :BITNET:WSR@NIHCU

Documentation
-------------------------------------------------------------------------------



Change History

V1.24 (18-Jan-90)

1) Ability added to read and write MacPaint documents.

2) Image now waits for QuickCapture external trigger if Option
key down when using "Start Capturing" or "Make Movie".

3) Magnification is now shown in document title bars if
magnification is not one-to-one or the window is in scale-to-
fit mode.

4) Magnification is now computed correctly when using zoom box
with tiled windows in scale-to-fit mode.

5) Clicking in the active image window, on the magnifying
glass, or on the grabber tool now disables Select All.

6) Internal holes are now excluded when measuring area and
density of thresolded objects.

7) Histogram values are now saved in the reverse order if the
"Use zero for black, 255 for white" preference is checked.

8) Min and Max are now calculated correctly when measuring
images with inverting density calibration functions.

9) The look-up table is no longer automatically reset to gray
scale when 16-bit images are imported.

10) 3D plotting of density calibrated images is now done
correctly.

11) All 256 histogram values are now plotted when thresolding
is in effect, with non-thresholded values plotted in gray.



V1.25 (30-Jan-90)

1) The number of image windows listed in the Windows menu is no
longer limited to 20.

2) Most keyboard shortcuts for menu selections now work with
the option key down. For example, type Option-Command-W to
close all image windows.

3) The 50Hz version(768 x 512 resolution) of the Data
Translation QuickCapture is now supported.

3) The field holding offset in the Import dialog box was made
larger to prevent the last digit of 5 digit offsets from being
dropped.

4) When the window is in the "scale to fit" mode, and the
magnification is less than one, the selection outline is now
drawn using a larger QuickDraw pen size so that parts of the
outline no longer disappear.

5) "Select All" now correctly changes to "Deselect All" when
magnification is not equal to one.

6) The "marching ants" selection outline is no longer animated
if it takes more than 1/2 second per update, which is normally
the case in scale-to-fit window mode.

7) "Run Movie" no longer clobbers windows(e.g., the Paste
Control window) that are overlapping the image window that is
being animated.

8) The number of digits to the right of the decimal point in
measurement results can now be specified in the
Analysis/Options dialog box.

9) Once a file name has been entered in the Save As dialog box
it is no longer changed when you select a different file type.

10) Various enhancements have been made to Set Scale: Measured,
as well as actual, distance can now be entered into the Set
Scale dialog box; A magnification factor can now be entered;
You can now switch to other units of measurement once an image
has been spatially calibrated; If an image is calibrated, you
can bring up the Set Scale dialog box without having used the
ruler tool; Calibration can now be disabled.

11) Text(e.g., measurement results) can now be pasted into
image windows.

12) It is no longer necessary to use thresholding or to "Make
Binary" before using the Wand tool or Analyze Particles with
images that are already binary.

13) Hold down the Option key while Exporting or Copying
measurement results to include column and row headers.

14) Newly created Camera windows are now centered in the
640x480(NTSC) or 768x512(PAL) QuickCapture frame.

15) Bus Error bombs(ID=1) should no longer occur when moving
live QuickCapture Camera windows.

16) Scale to fit mode is no longer allowed with live
QuickCapture Camera windows.




NIH Image (Version 1.25)





2	Introduction



	Menus

3		File

10		Edit

12		Options

17		Enhance	

20		Analyze

25		Video	

27		Text

27		Windows



28	Using the Tools



	 Managing Windows

32		Image Windows

32		Gray Map

33		LUT

33		Histogram	

34		Results



	Techniques

35		Using Selections

36		Analyzing Gels

37		Redirected Sampling

38		Using the Option Key

39		Questions and Answers

40		Using Flatbed Scanners



	Appendices

41		A. Frame Grabber Cards 

42		B. TV Camera and Light Box 

43		C. Alternate Programs 

44		D. File Formats

45		E. Program Limitations	

46		F. Shortcuts

47		G. New Versions and Bug Reports





Introduction



Image is a public domain program for the Macintosh II for doing digital image processing and
analysis. It can acquire, display, edit, enhance, analyze, print, and animate images.  It reads and
writes TIFF, PICT, and MacPaint files, providing compatibility with many other Macintosh
applications, including programs for scanning, processing, editing, publishing, and analyzing
images. It supports many standard image processing functions, including histogram equalization,
contrast enhancement, density profiling, smoothing, sharpening, edge detection, and noise
reduction. Spatial convolutions, with user defined kernels up to 63x63, are also supported.



Image can be used to measure the area, mean density, center of gravity, and angle of orientation of
a user defined region of interest. It also performs automated particle analysis and can be used to
measure path lengths and angles. Measurement results can be printed, exported to text files, or
copied to the Clipboard.  Results can also be calibrated to provide real world values.



Density calibration can be done against radiation or optical density standards using any user
specified units. The user can select from any of eight different curve fitting methods for generating
calibration curves.



It provides MacPaint-like editing of color and grayscale images, including the ability to draw lines,
rectangles, ovals 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. It uses digital halftoning to print images on PostScript
printers and Floyd-Steinberg dithering for printing on non-PostScript printers.



It supports either the Data Translation QuickCapture or Image Systems Technology(Scion) Image
Capture 2 cards for digitizing images using a TV camera. Acquired images can be shading
corrected and frame averaged.



Image is written in Think Pascal from Symantec Corporation, and the source code is available. 
The program can be easily ported to other Pascal compilers for the Macintosh, such as MPW
Pascal or TML Pascal.





System Requirements 



For full operation, Image requires a Mac II(x, cx, ci) with at least 2 megabytes of memory, but 4
megabytes, or more, is recommended for doing animation, for simultaneously displaying more
than a handful of pictures, or for running under MultiFinder. Image also requires an 8-bit video
card capable of displaying 256 colors or shades of gray. Image directly supports, or is compatible
with,  large monitors, flatbed scanners, film recorders,  graphics tablets, PostScript laser printers,
phototypesetters, and color printers.







File Menu



New



Creates a new image window which is filled with the current background color. The default size is
600 pixels wide by 512 pixels high, but this can be changed in the Preferences dialog box. The
new window inherits its gray map(or color palette), as well as any spatial or density calibration,
from the currently active image window. 



Open 



Use the Open command to load and display images or to switch to alternate color palettes. Image
currently supports two image file formats(TIFF and PICT) and four palette formats.



1) 8-bit gray scale TIFF files, of type TIFF, created by many other Mac programs,
including Image Studio, Digital Darkroom, and many scanner programs. Image is unable to
open bitmap(1-bit), 24-bit color, or compressed TIFF files. Digital Darkroom is frequently
useful for converting TIFF files into a format that Image can read.  TIFF files that were
created on other systems, such as an IBM-PC, usually need to be opened using the Import
command. 



2) PICT files, of type PICT, created by many Mac programs, including MacDraw, Digital
Darkroom, and PixelPaint. Check Keep LUT in the Open dialog box(shown below) if you
want to display the image using  the current palette, instead of the one contained in the PICT
file.



3) MacPaint documents. Image will trim white space from the right edge and bottom of
MacPaint documents to reduce memory requirements. You will want to set Undo Buffer Size
in Preferences to 405K if you regularly open large MacPaint drawings, since this is the
memory required for  a full size( 576 x 720) MacPaint document.



4) Image pseudocolor palettes, of type ICOL, which are currently limited to a maximum of
32 colors, and are unique to the Image program. Colors in these palettes can be edited using
the eyedropper tool, and the number of colors can be changed using Set Number of Colors.



5) 256 color palettes created by PixelPaint(type PX05), by Canvas (type drwC), or by
the Klutz DA(type CLUT). PixelPaint and Canvas have palette editors which can be used
to create 256 color palettes for use by Image . The public domain PalEdit program from
NCSA may also be used to create 256 color palettes. The Klutz DA can be used to capture
palettes used by other programs.



If you check the Open All box, select one image within a folder, and then click on the Open button,
Image will open all the images in that folder, not just the one selected. This is a good way to load
into memory a series of images to be animated using the Run Movie command. 

Check Keep LUT  if you want the image being opened to be displayed using the current video
lookup table, rather than the one saved with the image. This feature can be used to combine PICT
files with different palettes into a montage. When a PICT file is drawn on the screen, and the image
and screen LUTs are different, the pixel values are remapped to make the colors consistent.



Import



The Import command can be used to read image files created by non-Macintosh based systems, or
for importing custom color palettes. It presents a dialog box allowing you to select one of four file
types. TIFF, MCID, and Custom are the three image file formats currently supported. Select
Palette to import 256 color palettes.









Select TIFF to open 8-bit  grayscale TIFF files imported from another system, such as an IBM PC.
Select MCID to opens files created by the IBM-PC based MCID image analysis system from 
Imaging Research. Select Custom to open any other types of 8-bit and 16-bit images. If you select
Custom then Width is the width of the image in pixels, Height is the number of lines in the image,
and Offset specifies the number of bytes Image will skip before it starts reading the pixel data.  For
example, use an offset of 512 to skip over a 512 byte file header.



Image computes the minimum and maximum pixel values of 16-bit images and uses this
information to scale to 8-bits. Check Swap Bytes if you are importing 16-bit images from
little-endian systems, such as the IBM-PC, PDP-11, or VAX. To import MRI scans from the
GE SIGNA scanner, select 16-bit Signed and set Offset to 14336.



Check Open All  if want to import all of the images in a folder. All of the images must have the
same width, height, etc.



Palettes to be imported should consist of 256 8-bit red values, 256 8-bit green values, and 256
8-bit blue values, a total of 768 bytes.





Close



Closes the currently active image, Plot, or Histogram window, i.e., the one with the highlighted
title bar. Hold down the Option key to close all currently open image windows. Typing
Option-Command-W or Option-Clicking in the close box of an image window will also close all
the image windows.



Save



Resaves the currently active image to the disk. In the case of a window that was newly created
using New, Duplicate, or Start Capturing, you will be prompted for a name. Files are resaved in
their original format. In other words, TIFF files are resaved in TIFF format, and PICT files are
resaved in PICT format.



Hold down the Option key(notice how Save changes to Save All) to save all currently open image
windows. This is a convenient way to save a set of images acquired using Make Movie.



Save As



Saves images, pseudocolor palettes, selection outlines, measurement results, density profile plot
values, or histogram values to the disk.







TIFF

Saves the currently active image to a file in 8-bit grayscale TIFF format. You will be asked to
enter a name for the new file.  Changes to Save Selection As TIFF if a rectangular selection
is active, allowing you to save a subsection of the image.  TIFF is the default file format in
Image,  and is usually the best format for saving digitized or scanned images. Because TIFF
files are not compressed they Open and Save faster than PICT files.



PICT

Saves the currently active image to a PICT file. PICT files can be exported to many other
Mac programs, including PixelPaint, Digital Darkroom, SuperPaint, and MacDraw.  Because
they are compressed, PICT files also have the advantage of being more compact if the image
contains large areas of uniform density, which is typical of computer generated images.
Unfortunately, the run length compression scheme used with PICT files is ineffective with
most scanned images.  Changes to Save Selection As PICT if a rectangular selection is
active. Warning: Don't save pseudocolored images in PICT format if you are using 32-bit
QuickDraw, and if you plan to make future density measurements, since pixel values may get
altered.



MacPaint

Saves the currently active image as a MacPaint document. Since MacPaint documents are
binary images, you will probably want use Dither or Make Binary to convert grayscale
images to binary before saving them in MacPaint format.



Palette

Saves the current pseudocolor palette, including its position and width, to a file.



Outline

Saves the current selection outline as a PICT file. The outline can be restored at a later time
by using the Open command. The outline will be displayed within a blank image window. It
can be transferred to another image window by selecting that window and using Restore
selection



Region Measurements

Exports the current area and density measurements to a tab-delimited text file which can be
read by spreadsheet and statistical analysis programs. Additional measurements can be
enabled using the Measurement Options command. You can also export measurements by
copying them to the Clipboard or by using the Export button in the Show Results window.



Length Measurements

Exports the current length measurements (made with the ruler tool) to a text file. 



Point Measurements

Exports the current X-Y coordinate measurements to a tab-delineated text file.  X-Y
coordinate measurements are made by using the pointing tool, which is in the lower right
hand corner of the tool palette.



Plot Values

Exports the data values representing the most recent density profile to a text file. If you have
just used the Calibrate command to do density calibration, and are viewing the density
calibration plot, then this option saves the 256 Y-values of the current calibration plot to a text
file.



Histogram Values

Exports the 256 data values from the most recent histogram to a text file.





Record Preferences



Saves(as a resource in the Image application file) the current state of the following Image program
parameters. Recording preferences will not work if the Image application is residing on a write
protected floppy disk or file server.



 Foreground color

 Background color

 Brush size

 Smudger diameter

 Airbrush diameter

 Color Look-Up Table mode

 Color palette position and width

 Text attributes, including font, size, style, and justification

 Extra colors

 Invert Video switch

 Measurement Options

 Profile Plot Options

 Frames averaged by Average Frames command

 Size of image created by New command

 Undo(and Clipboard) buffer size

 Apple Look Table options for images with density slicing enabled

 Frame grabber input channel

 Import command parameters

 Most options in Preferences dialog box





Revert to Saved



Reverts to the most recently saved version of the file, effectively undoing all changes made
since the last Save command.





Duplicate



Creates a new window the size of the current rectangular selection, copies the selection to the
new window, and then makes the new window the active window. The entire image is
duplicated if no selection is active. The newly created window will inherit the gray map(or
color palette), as well as any spatial or density calibration, of the window being duplicated.



Get Info



Presents up the following window which provides information about the status of the system
and of the currently active picture window.











Halftone Options



Allows you to specify how halftoning is done on the LaserWriter or other PostScript printers.
Halftoning is a technique which allows grayscale images to printed on a device whose pixels can
only be black or white. This is accomplished by dividing the printer pixels into small groups(or
cells) according to some pattern(called the halftone screen). Within each cell, a dot is drawn whose
size is proportional to the gray value of that part of the image. A screen frequency of about 50
halftone cells per inch,  providing a cell size of 6 x 6 pixels, is optimum for a 300 dots per inch
laser printer.







Page Setup



Lets you specify printing orientation (portrait or landscape) and scale (25% to 400%). The quality
of density profile plots and calibration plots will be better if  you leave the scale set at 100% and
enlarge the plot window  before printing the plot.





Print



This command lets you print images, plots, histograms, and the results of measurements. What
gets printed is determined by which window is active at the time. The print command changes (e.g,
Print Image, Print Plot, etc.) depending on which window is active.



Print Image - Prints the currently active image on PostScript printers using halftoning to
simulate gray values. Any colors are converted to shades of gray(using the equivalent of the
Apply Lookup Table command).  If you have made a rectangular selection, only the selection
will be printed. 



Hold down the Option key at the start of printing to get higher quality text and line drawings
on PostScript printers. In this case, printing is done using bitmap smoothing instead of
halftoning. When using version 6.0(or later)of the LaserWriter driver, holding the Option
key down causes the LaserWriter driver to do the halftoning and changes to Halftone
Option have no effect. Use the new Halftone and BitMap buttons in the Print dialog box to
specify what kind of printing to do. 



Color printing is supported on the Tektronix 4693D, the HP PaintJet, and similar printers.
On color printers and film recorders the output will be centered on the page(or slide).Use the
Dither command to simulate shades of gray when printing on non-PostScript printers, such
as the ImageWriter. 



Print Plot - Prints the current density profile or calibration plot. The size of the printed plot
is proportional to the size of the plot window.



Print Histogram - Prints the contents of the histogram window.



Print Readings - Prints the results of measurements made with the Measure Command.
The Print Readings is available when you have used the Measure command at least once and
the results window  is active.



Print Lengths - Prints the results of length measurements made with the ruler tool. This
command is available when the results window is active and you have made at least one
length measurement.



Print Points - Prints the X-Y coordinate pairs resulting from using the point measurement
tool. This command is available when the results window is active and you have recorded at
least one point.





Quit



Closes all image windows after asking, in each case, whether changes made during the session
should be saved, then quits to the Finder. If measurements have been made but not saved (or if a
measurement tool such as the ruler has been used), a dialog box will be displayed notifying you of
that fact. The Save Changes? dialog boxes will be not be displayed if you hold down the
Command and Period keys while quitting, and any changes will not be saved.





Edit Menu



Undo



Reverses the effect of the last editing or filtering operation. When using the Measure command,
Undo deletes the most recent measurements.



Cut



Copies the contents of the current selection to the Clipboard and fills it with the current background
color.



Copy



Places a copy of  the contents of the current selection on the Clipboard.



Copy  will also copy the entire contents of the LUT, Plot, or Histogram window to the Clipboard
if one of these is the active window. If the Plot or Histogram window is active then both the data
values and the graphics will be copied to the Clipboard, allowing you to transfer plot and
histogram data to other programs for plotting or statistical analysis.



You can use the eyedropper tool to copy colors from the LUT window to the Clipboard and then
paste them back into another palette location. Copy and Paste of colors is limited to pseudocolor
palettes, which have a maximum of 32 colors.



After using the Measure command, Copy changes to Copy Measurement, allowing you to use the
Command-C  keyboard shortcut to copy measurements to the clipboard.



Paste



Displays the contents of the Clipboard in the currently active image window. The pasted object is
automatically selected, allowing you to move it by clicking on it and dragging. With rectangular
objects, you can click and drag on the resize handle in the lower left corner to expand or contract
the selection.



You can also use the paste command to paste colors copied with the eyedropper tool  back into the
LUT window.



If you make a rectangular selection while digitizing using the Data Translation QuickCapture(which
will stop capturing), copy the selection to the Clipboard, and then paste into another
window(without deleting the Camera window), then pasting will be live from the camera. This
feature. along with the Paste Control window,  allows the image currently being digitized to be
aligned with a previously digitized image.



Text can be pasted into Image windows. For example, you can copy measurement results to the
Clipboard, then paste them into an image window. Text pasted inside the current rectangular
selection, or, if there is no selection, in the upper left hand corner of the window. Use the Text
menu to select font, size, style, etc. If the text doesn't fit within the selection, Undo, switch to a
different font or size, and try again. The text background is always erased to the current
background color, the No Background option in the Text menu is ignored.



Clear



Erases the current selection to the current background color.  The Delete key is a handy shortcut for
this command. The background color is set by clicking with the eraser tool in the LUT window.
The color of the eraser indicates the current background color.



Fill



Fills the current selection with the current foreground color. You can change the color after the
selection has been filled by clicking in the LUT window. The entire image window is filled if no
selection is active.



The foreground color is set by clicking with the eye dropper tool in the LUT window or in the
active image window. The color of the brush in the tool palette is an indicator of the current
foreground color.



Invert



Inverts the current selection, or the entire image if no selection is active.



Draw Boundary



Outlines the current selection using the current foreground color and line width. Both the color and
line width can be dynamically changed as long as the selection is still active.



Select All 



This command is equivalent to using the rectangular selection tool to select the entire picture,
including portions that may be offscreen.  Once the selection has been made, Select All  changes to
Deselect All, allowing you to deactivate the selection. You can also deactivate the selection by
clicking on any tool other than one of the selection tools, the grabber, or the magnifying glass.



Scale Selection 



Scales the current rectangular selection by a factor you enter in a dialog box.Scaling up is done
using pixel replication. Use the slower Rotate and Scale command if you want independent
horizontal and vertical scaling, or if you want to scale up smoothly.



Rotate Left 



Rotates the contents of the current rectangular selection counter-clockwise 90. Holding the Option
key down causes the original object to be erased before being replaced by the rotated version.



Rotate Right



Rotates the contents of  the current rectangular selection clockwise 90. Hold the Option key down
to erase before rotating.



Flip Horizontal



Flips the current rectangular selection horizontally around a vertical line through its center. The
entire image is flipped horizontally if no selection is in effect.



Flip Vertical



Flips the current rectangular selection upside down. Flips the entire image if no selection is in
effect.



Rotate and Scale



Rotates the contents of  the current rectangular selection an arbitrary number of degrees. Rotation
will be clockwise if you specify a positive number and counter-clockwise if you specify a negative
number. You can also simultaneously scale the selection. Rotation and scaling are done using
bilinear interpolation, which produces smooth looking results, unlike Scale Selection, which uses
pixel replication. On the other hand, Scale Selection is much faster.



Show Clipboard



Creates a new window the size of the picture currently on the clipboard, and then displays it. This
window, which will have the title Clipboard, will not be updated if the Clipboard later changes.







Options Menu



Invert LUT



Flips the current video lookup table. Unlike the Invert command, Invert LUT does not alter pixel
values, only the way the image is displayed on the screen. The first and last entries(white and
black) of 256 color palettes are left unchanged since these entries are used for drawing the menu
bar, title bars, dialog boxes, etc.



Set Number of Colors



Allows you to change the the number of colors used in the current pseudocolor palette. Any added
colors will be set to shades of gray. Newly added colors can be edited by selecting the eyedropper
tool and double-clicking in the LUT window on the color you want to change. Pseudocolor
palettes are currently limited to 32 colors.



Set Extra Colors



Allows you to reserve up to six entries in the Look-Up Table for colors that will not be altered by
routines that manipulate the look-up table. For example, you could use an extra color to add color
annotation to a grayscale picture.  Extra colors are displayed at the bottom of the LUT window,
allowing you to edit them by double-clicking with the eyedropper Tool.



Palettes



Image currently supports four different types of look-up tables:



1) Grayscale - Consists 256 shades of gray. Contrast and brightness can be altered by
manipulating the  transformation function displayed in the Gray Map window. This function
can be applied to the pixel data in memory, thereby making any contrast and brightness
changes permanent, by using the Apply Look-Up Table command. 



2) Pseudocolor - This is the default color mode in Image and was inherited from the
PDP11 version. In this mode your are limited to a maximum of 32 colors. You can use the
LUT tool(the double headed arrow) to both stretch (changing contrast) and shift the colors
within the LUT. Also, in this mode, you can edit colors by double clicking on them with the
eyedropper tool.



3) System - This is Apple's standard palette for the Mac II.  It is the same as the
PixelPaint's System palette. You can use the LUT tool to rotate this palette.



4) 256 Color Spectrum - This is a continuous color spectrum which you can rotate using
the LUT tool.

	

Profile Plot Options



Displays a dialog box, shown below, which allows you to set various options relating to density
profile plots generated by the profile plot tool and the Column Average Plot command. In Auto
Scale mode,  profile plots will be scaled depending on the minimum and maximum density values.
In Fixed Scale mode, the y-axis range is fixed and the minimum and maximum may be specified.
Fixed Plot Size  allows specify the size of the plot window. This is useful for pasting a series of
plots into an image window. Profile Plot Line Width specifies the width of the line which controls
the amount of pixel averaging done by the profile plotting tool. Profile plot options can be made
permanent using Record Preferences.



Preferences



Displays a dialog box, shown below, which allows you to change various Image parameters.







New Width and New Height specify the size of images created using the New command.



Frames to Average is the number of video frames that will be averaged by the Average Frames
command.



Scion Window Width allows you to change the width of the the window used for acquiring images
when using the Scion frame grabber. This value may need to be reduced to get the Scion card to
work properly with some video cards.



Undo Buffer Size allows you to change the size of the two internal image buffers(Undo and
Clipboard) used by Image. You must Record Preferences, Quit, and then restart Image before any
buffer size change will take effect.



When Auto-measure is checked the Measure command will be automatically called whenever an
outline is created using the wand tool. If Auto-number is checked, a number, which corresponds to
the current measurement number, will be drawn in the center of outlines created using the wand
tool. In addition, a white line will be drawn along the outline.



Images acquired using a grabber card will be inverted if Invert Video Input is checked.



Pixel values resulting from Add, Subtract, Multiply, or Divide operations(see Show Paste Control)
will be scaled to the range of 0 to 255 if Scale Image Arithmetic is checked, otherwise, results will
be clipped to 0 and 255.



Checking Use Zero for Black, 255 for White sets up a straight line density calibration function for
the current image that results in gray levels displayed in the Results window, in density profile
plots, and in histograms, to be inverted. Subsequent image windows created using New, Start
Capturing, and the Import of 8-bit images, will inherit this calibration function.



Check Invert Y Coordinates  if you want the X-Y origin to be the lower left corner of the image
window, otherwise it will be the upper left corner.



The status of all the parameters in the Preferences dialog box can be made permanent using Record
Preferences.





Scale to Fit Window



Switches the the currently active image window in and out of Scale to Fit mode. If checked, the
window is in the Scale To Fit mode, and you can use the size box, located in the lower right
corner, to rescale the image.  Clicking in the zoom box of an image window(upper right corner)
will also switch that window to Scale to Fit mode, and then scale the window(and image) to fit the
screen. In Scale to Fit mode you are not allowed to change the aspect ratio of an image and the
magnifying glass and grabber tools do not work.  When a window is in Scale to Fit mode the
current magnification level  is shown in the title bar. 



Threshold



Thresholding is used to segment an image into objects of interest and background on the bases of
gray level. When thresholding is enabled objects are highlighted in red and background pixels are
left unchanged.  Background pixels are ignored when making area and density measurements
using the Measure and Analyze Particles commands. The gray value range used to highlight
objects(called a density slice) appears in the LUT window. Use the LUT tool(the one with the
double headed arrow) and click and drag near the top of the density slice in the LUT to vary its
size, and click and drag near the bottom to slide it up and down. Double click on the slice with the
eyedropper tool to change its color.



The Apply LUT command can be used to set all pixels which are within the density slice to the
foreground color(or leave then unchanged) and all other pixels to the background color(or leave
them unchanged). The Make Binary command will set all pixels within the density slice to black,
and all other pixels to white. The wand tool can be used to outline thresholded objects, and
Analyze Particles will automatically measure objects segmented by thresholding.





Show Paste Control



Displays a new window which allows you to control how image selections are pasted, or to do
image arithmetic using pasted images. (Notice that the Paste Control window tries to float above
Image's other windows.)





When Copy is selected pasting will proceed normally. When And, Or, or Replace are selected the
selection is copied to the screen using And, Or, and Replace with Transparency modes,
respectively, allowing you to transparently see both the object being pasted and the underlying
image. This has potential for aligning two images, and works particularly well for binary (black
and white) images resulting from use of the Make Binary, Trace Edges, or Dither commands.



The foreground color is set to black and the background color to white whenever And, Or, or
Replace are selected, but you are can vary the foreground and background colors during the paste
operation by clicking(or Option-clicking) in the LUT window. This will produce some interesting,
and possibly useful, effects. 



Or mode can be used to color objects in binary  images created by Image or programs such as by
SuperPaint and MacDraw. Simply select the object you want to color, Copy, switch to Or mode,
then select a color by clicking in the LUT window.



Replace mode replaces the destination pixel with the source pixel if the source pixel isn't equal to
the background color(normally white). Replace mode is useful for overlaying colored objects with
white backgrounds(e.g. text or plots) onto another image.



Clicking on Add, Subtract, Multiply, or Divide causes the specified image arithmetic operation to
be performed and terminates the paste operation. For example, clicking Subtract will subtract the
selection being pasted from the current window.



Arithmetic operations are normally done in two passes. In the first pass, Image  determines the
minimum and maximum gray levels that would result from performing the operation. In the second
pass, the image arithmetic is actually performed, and the resulting pixel values are scaled to the
range of 0 to 255. Scaling can be disabled in the Preferences dialog box, in which case results are
clipped to 0 and 255.



Subtraction is probably the most useful arithmetic operation. It can be used to subtract the
background(the image with features of interest removed from view) from an image. It can also be
used to detect differences between two images or for motion analysis.



The arrow keys can be used to nudge the selection currently being pasted in any of four direction
by a single pixel. You can get interesting effects, including edge detection, by using the arrow keys
to offset an image by one pixel, and then subtracting it from itself. To see how this works, try
Select All(Command-A), Copy(Command-C), Paste(Command-V), Down Arrow, Right Arrow,
and Subtract.





Propagate LUT



Copies the current video lookup table to all open image windows. This provides a way to transfer
contrast, brightness, or pseudocolor changes made to one image image in a set(e.g., a series of
MRI scans), to all other images in the set.







Enhance Menu





Filtering Functions(Smooth, Sharpen, etc.) 



These functions, with the exception of  Reduce Noise and Dither, are implemented using 3 x 3
spatial convolutions, where the value of each pixel in the selection is replaced with the weighted
average of its 3 x 3 neighborhood.  For correct operation, they require a grayscale image, or a
pseudocolored image that started out as a grayscale image. Filtering is not limited to rectangular
selections. The entire image will be filtered if no selection is active. Filtering operations can be
aborted by typing Command-Period.



The 3 x 3 tables shown below are the coefficients for the filters which use spatial convolution. The
popularity of plus and minus one in these tables is due to the fact that multiplication by one is very
efficient, i.e, it is unnecessary.





Smooth - This filter blurs(softens) the selection area. It can be used to reduce noise in
an image. Hold the Option key down for increased blurring.



	1 1 1	1 1 1	(If Option key down)

	1 4 1	1 1 1

	1 1 1	1 1 1



Sharpen - Increases contrast and accentuates detail in the selection, but may also
accentuate noise. To minimize this problem, you can Smooth and/or Reduce Noise
before using Sharpen. Hold the Option key down for increased sharpening.



 	-1 -1 -1	-1  -1  -1	(If Option key down)
	-1  9 -1	-1 12  -1

 	-1 -1 -1	-1  -1  -1



Trace Edges - Produces a binary image with a black background and white outlines
representing objects in the original image. Two convolutions are done, generating
vertical and horizontal derivatives and the larger of the two result is used. If the resulting
pixel is above a threshold value it is set to white, otherwise it is set to black. You can
increase or decrease the number of edges by preprocessing the image. Increasing
contrast and Sharpening will increase the number of edges found, decreasing contrast
and smoothing do the opposite. If you hold down the Option key the thresholding step
will not be done, allowing you to do it yourself.



	1  1  1	-1  0  1

	0  0  0	-1  0  1

	-1 -1 -1	-1  0  1



Reduce Noise - This is a median filter, where each pixel is replaced with the median
value of its 3 x 3 neighborhood. This a time consuming operation because, for each
pixel in the selection, the nine pixels in the 3x3 neighborhood must be sorted and the
center pixel replaced with the median value(the fifth). For a demonstration of the
effectiveness of median filtering try removing random spot noise generated using an air
brush with a diameter of around 50.





Dither - Uses the Floyd-Steinberg error diffusion algorithm to convert the current
selection to a binary(black and white only) image. Dithering can be useful for exporting
pictures to applications such as MacPaint, MicroSoft Word or MacDraw that can only
accept binary images. Dithering can also be used for printing on the ImageWriter, or
other non-PostScript printers. The quality of dithered images can frequently be
improved by increasing contrast using the Gray Map window before doing the
dithering. Color images should be converted to grayscale using the Apply Lookup Table 
command before being dithered.



Convolve - Does spatial convolutions using kernels, which are read from a text file,
than can be up to 63 x 63 in size. Desk accessory text editors, such as MockWrite or
MiniWriter, are particularly convenient for creating or examining these kernels.



For an example, use a text editor to create the following file and then use the Convolve
command to try it out.



   	 	 0   0   0  -1  -1  -1   0   0   0

		 0  -1  -1  -3  -3  -3  -1  -1   0

		 0  -1  -3  -3  -1  -3  -3  -1   0

		-1  -3  -3   6  13   6  -3  -3  -1

		-1  -3  -1  13  24  13  -1  -3  -1

		-1  -3  -3   6  13   6  -3  -3  -1

		 0  -1  -3  -3  -1  -3  -3  -1   0

		 0  -1  -1  -3  -3  -3  -1  -1   0

		 0   0   0  -1  -1  -1   0   0   0



This is a 9 x 9 Mexican hat filter which will do both smoothing and edge detection in
one operation. Each line should be terminated with a carriage return, and the coefficients
should be separated by one or more spaces, or by a tab.







Equalize



Performs histogram equalization based on the density histogram of the current selection. A new
gray map look-up function is generated which more evenly distribute the gray values of the image.
This will usually improve contrast. The newly created look-up table function is displayed in the
Gray Map window. Use the Apply LUT to make the contrast change permanent. Equalization only
works with grayscale images.



Apply LUT



Applies the current look-up table to each pixel in the current selection (or of the entire image if there
is no current selection) and then restores the default look-up table(the identity function). This
modifies the gray values so that when the image is viewed using the default look-up table it will
look the same as it did before. This command provides a way of making brightness and contrast
changes permanent. It can  be used to posterize(reduce the number of gray values)  an image by
loading and Applying, for example, a palette consisting of four shades of gray.It can also be used
to convert color images to grayscale, and to convert a thresholded image to binary(black and white
only).





If thresholding is in effect, the above dialog box will be displayed, allowing you to process pixels
highlighted by the thresholding in one way, and all other pixels another way.





Binary



This submenu is used to convert grayscale images to binary(black and white only) and also to
process these binary images.



Make Binary - Converts the current image to binary format by setting pixels highlighted
by thresholding to black(255), and all other pixels to white(0). Thresholding must be in
effect in order to use this command. There are two ways to enable thresholding: by using the
Threshold command, or by clicking on the threshold button in the Gray Map window.



Erosion - Removes pixels from the edges of objects in a binary images, where contiguous
black areas in the image are considered objects, and the background is assumed to be white.
A pixel is removed(set to white) if four or more of its eight neighbors are white. Erosion
separates objects that are touching and removes isolated pixels.



Dilation - Adds pixels to the edges of objects in a binary images. A pixel is added(set to
black) if four or more of its eight neighbors are black. Dilation connects discontinuous
objects and fills in holes.



Opening - Performs an erosion operation, followed by dilation, which will smooth objects 
and remove isolated pixels.



Closing - Performs an dilation operation, followed by erosion, which will smooth objects 
and fill in small holes.



Outline - Generates a one pixel wide outline of objects in a binary image.



Skeletonize - Repeatably removes pixels from the edges of objects in a binary image until
they are reduced to single pixel wide skeletons. Command-period can be used to abort the
thinning process.





Change Values



Changes the gray level of all pixels in the selection(or the entire image if no selection is active) that
are in the current foreground color to the current background color. For example, to change a solid
white background to black you would set the foreground color to white, the background color to
black and then use Change Color.



To be more precise, Change Values changes all pixels using the current foreground index value(a
number in the range 0 to 255) to the current background color index value. It is possible that a
given color on the screen could be represented by several different index values. In this case,
Change Values may not behave as expected.







Analyze Menu



Measure



Computes the area and mean density of the current  selection and displays the results in the Results
window. In addition, you can use the Options dialog box to enable other measurements, such as
perimeter length. Undo will delete the last measurement. If the minimum density is less than 1, or
the maximum is greater than 254, then a message will be displayed indicating the possibility of
saturation. If thresholding is enabled only thresolded pixels will be included in the computation. A
counter will be incremented each for each measurement. The maximum number of measurements is
250. Use Show Results to  list, print, or export the current measurements, and Reset to reset the
counter to zero.



If Set Scale has been used to establish the spatial scale, then the area of the selection will be given
in calibrated units, such as square millimeters. If Calibrate has been used to perform density
calibration, then density readings will be converted, using the standard curve generated by
Calibrate, and the results reported in calibrated units, such as optical density or isotope
concentration.



The most efficient way to record measurements is to use MultiFinder, and to have a spreadsheet on
the screen at the same time you are using Image. Make a series of measurements(Command-1),
Copy them to the Clipboard(Command-C), click on the spreadsheet to activate it, select the cell
where you want the measurements stored, Paste the results(Command-V), click on the image
window to reactivate Image, and finally, Reset the measurement counter(Command-3). If you are
using Excel, make sure it's version 2.2(or later), since earlier versions do not work reliably under
MultiFinder.



Analyze Particles



Analyze Particles automatically counts and measures objects in a binary image, or thresholded
objects in a grayscale image. It does this by scanning across the image until it finds the boundary
of an object, outlines the object using the same outliner used by the Wand tool, measures the object
using the equivalent of  the Measure command, and then redraws the object in a different gray level
so that it becomes invisible to the scanning process. The Options dialog box allows you to specify
the measurement parameters to be recorded, to ignore particles touching the edge, and to specify
minimum and maximum particles sizes. Use Show Results to display the recorded measurements.
Up to 32767 particles can be counted, but measurement recording is limited to the first 250
particles found. Type Command-Period to abort particle analysis.

Show Results



Displays a list of the current measurements. At the bottom of the window are buttons that can be
used to Export, Print, or Copy(to the Clipboard) the readings, or to Reset the measurement
counter. Show Results displays length measurements if the current tool is the ruler and you have
made at least one length measurement. Likewise, it displays X-Y coordinates if the current tool is
the pointing tool, and you have recorded X-Y coordinates.





Export saves the measurements as a tab delimited text file that can be Opened by many Mac
programs, including Excel, StatView, and Cricket Graph. For correct display, it may be necessary
to adjust tab settings when opening an exported file with a word processing program, such as
MacWrite. Hold down the Option key when using Export or Copy to include column and row
headers with the output.



Show Histogram



Displays a plot showing the distribution of gray values within the selection. The plot shows, for
each of the possible 256 gray values, the number of pixels in the selection that have that gray
value. Histograms are not limited to rectangular areas. When the cursor is over the Histogram
window, X(the gray value) and Y(the number of pixel with that gray value) are  displayed
dynamically in the Results Window.



Using the Copy command when the histogram window is the active window will copy both the
histogram plot(as a PICT) and the histogram data values(as a single column of text) to the
clipboard. Histogram data values can also be saved to a text file using the Save As command.



Column Average Plot



Generates a density profile plot, where the width of the plot is equal to the width of the current
rectangular selection and each point in the plot represents the average intensity of the pixels in the
corresponding column in the selection. The Profile Plot Options dialog box can be used to control
various aspects of these plots.



Using the Copy command when the Plot window is the active window will copy both the column
average plot(as a PICT) and the data values(as a single column of text) to the clipboard. Plot values
can also be saved to a text file using the Save As command.



3D Plot



Generates a 3-dimensional plot of the current selection. If no selection is active the entire image is
plotted. The 3-D plot will replace the current image. Use  Command-Period to abort plotting and
Undo(Command-Z) to restore the image. You can exaggerate the vertical scale in 3D plots by
increasing the contrast of the image before plotting using the controls in the Gray Map window.

Options



Allows you to specify which measurement will be displayed(and Exported, Printed or Copied) by
Show Results. Double-clicking on the polygon tool will also bring up this dialog box.





Area -Area of the selection in pixels. Area will be given in calibrated units, such as square
millimeters, if you have used Set Scale to do spatial calibration.



Mean Density - Average gray level of the pixels within the selection. Given in calibrated
units if you have used the Calibrate command to generate a standard curve.



Standard Deviation - This is the standard deviation of the pixel densities used to generate
the mean density.



X-Y Center of Gravity - Center of mass of the selection, measured from either the upper
left or lower right corner of the image, depending on the status of the Invert Y Coordinates
check box in the Preferences dialog box.



Modal Density - Most frequently occurring gray level within the selection. Corresponds to
the highest peak in the density histogram.



Perimeter - Length around the outside of the selection. Only computed for freehand and
polygon selections, or  when using Analyze Particles.



Major/Minor Axis - Lengths of the major and minor axes of the best fitting ellipse.



Orientation - This is the angle between the major axis and a line parallel to the x axis of the
image.



Integrated Density - Used to measure the size(volume) of spots(such as protein spots on
a two-dimensional electrophoresis gel). Computed using the following formula:



             IntegratedDensity=N * MeanDensity - N * BackgroundDensity



where N is number of pixels in the selection, and BackgroundLevel is the modal density after
smoothing the density histogram. If there isn't a well defined peak in the histogram then the
background level may computed incorrectly, resulting in a negative integrated density.





When Redirect Sampling is checked, pixel data for calculating mean density is taken from a second
image. Requires that exactly two image windows be open, and that these two images be the same
size.



Check Label Particles if you want Analyze Particles to draw a number, which corresponds to the
measurement number, on each particle found. Checking Ignore Particles Touching Edge causes
Analyze Particles to ignore particles touching the edge of the image, or the edge of the selection if a
selection is active. Min/Max Particle Size can be used to get Analyze Particles to discriminate
particles by size.





Set Scale



Performs spatial calibration so that results from length and area measurements can be presented in
calibrated units, such as millimeters. Before setting the scale, you must first measure a known
distance using the ruler tool. Then, bring up the Set Scale dialog box, select a unit of measurement, 
and enter the known value in Actual Distance.





Once the scale has been set you can switch to other units of measurements, for example, you can
convert from inches to centimeters. If you know what the scale for an image is(e.g., 300 DPI),
then, for this example, enter 300 in Measured Distance, and 1 in Actual Distance. Click on Pixels
to disable spatial calibration.



Double-clicking on the ruler will also present the Set Scale dialog box.

Calibrate



Allows you to calibrate to a set of density standards, such as a calibrated optical density step tablet,
or radioactive isotope concentrations. Before using this command,  use the Reset command to set
the measurement counter to zero, and use the Measure command to record the mean density of each
of the standards. To save time, you can click on the Open button to read in the actual(as opposed to
measured) standard values from a text file.



If you hold down the option key when invoking Calibrate you will be allowed to change the
measured values. This feature allows you to enter measurements acquired previously or acquired
from another system.





                                             Calibration Dialog Box







                      Resulting Calibration Curve



Reset



Reset the counters used for area(density), length, and X-Y coordinate measurements to zero.



Restore Selection



Returns the selection outline to its original position immediately after an operation that has removed
it. If there is an outline currently active, this command restores the previous one. Can also be used
to transfer a selection outline from one window to another, or for redirected sampling(see below). 

 

Number Selection



Draws the current measurement count at the center of the current selection and outlines the selection
in white. Can be used to keep track of which objects have been measured when doing redirected
sampling(see Techniques).







Video Menu



Start Capturing



Continuously captures TV camera images using either the Data Translation DT2255 QuickCapture
or the Scion Image Capture 2 frame grabber cards.  The command changes to Stop Capturing
while digitizing is in progress. Clicking in the Camera window with any tool except the
magnifying glass or the grabber will also cause digitizing to stop. Newly created Camera windows
will inherit the gray map(or color palette), as well as any spatial or density calibration, of the
currently active window, if there is one.



When digitizing using the Data Translation card you are allowed to change contrast, alter color
schemes, zoom, or pan. Also, when using the QuickCapture, histograms are continuously
computed and displayed when you use the Histogram command. These features are not supported
on the Scion card because it writes directly to the screen at 30 frames per second.



Hold down the option key to digitize using the whole screen with the Scion card. With the
QuickCapture card, if you hold down the Option key(or type Option-G), Image will wait for an
external trigger, and then capture a single frame.



Average Frames



Averages two or more video frames to reduce time-varying random noise. Averaging will be done
only for the current rectangular selection, or for the entire image if there is no selection. The
number of frames to be averaged is specified using the Preferences command.



Hold down the option key to do frame summation, rather than frame averaging.  Frame summing
increases image quality and contrast in low light situations. Pixel values resulting from frame
summing are scaled to a range of 0 to 255.



Save Blank Field



Use this command to save a median brightness blank field which will be used  to correct for
nonuniform illumination and for the nonuniform response of the video camera. Before using this
command you must Start Capturing and adjust the lens diaphragm and/or lightbox intensity so that
the average pixel value, as shown by the dynamic pixel value displayed in the Results window, is
approximately 128.



The Stop Capturing  command will use the reference image previously acquired by Save Blank
Field to correct shading errors in the newly acquired image. It does this by dividing each pixel in
the newly acquired image by a correction factor computed for each of the 300,000 pixels in the
blank field.  This correction factor is generated by dividing each blank field pixel value by the mean
blank field density.



You can digitize a single frame without shading correction by holding down the Option key while
selecting Stop Capturing. Close the Blank Field window if you want to stop doing shading
correction.



Shading correction using division works best with CCD cameras. If you are using a tube camera,
you may want to try the Subtract option in the Paste Control window to do shading correction.





Select Channel



Allows you to specify which input channel is used by the QuickCapture or Scion frame grabber
board. 



Make Movie



Captures a series of video frames the size of the current selection. If no selection is in effect, the
frames are the same size as the camera window. Image will attempt to open the number of
windows required to hold the number of frames you specify. You will be asked to enter the time to
delay between frames. Entering zero will result in the fastest possible sampling rate. Full 640x480
frames can be acquired at a rate of about six per second. Rates of up to about 20 frames per second
are possible with small selections. You are allowed to enter delays of less than one second. For
example, enter 0.5 to sample at 2 frames per second.The number of the current frame is shown in
the Results window. Type command-period to stop acquiring frames.



A useful shortcut if the  movie doesn't work out is to Option-click in the close box of an image
window(or type Option-Command-W) to close all of the currently open windows. You will not be
presented with the Save Changes dialog boxes If you hold down Command and Period while the
windows are being closed.



Run Movie



Animates the currently opened images by repeatedly drawing them to the screen at the location of
the currently active window. If the images are not all the same size, or if you hold the Option key
down,  the screen will be erased to the current background before the animation starts. The images
will be drawn in the order in which they are listed in the Windows menu. The speed of drawing
can be controlled by pressing keys '1' through '9'. The right and left arrow keys can be used to
single step through the images. Press the mouse button to stop the animation.



Check the Open All box in Open commands dialog box to load a series of images which make up a
movie.You can also use the Finder's Open command to cause Image to load a series of images.
Image will close all open image windows if you hold the option key down in click in the close box
of any image window. If you hold down Command and Period while closing a series windows,
the Save Changes dialog box will not be displayed, and any changes will not be saved.





Photo Mode



Erases the entire screen to the current background color and then redraws the current image
window without the menu bar, title bar, tool palette, etc. You can change the background color by
selecting the eraser tool and clicking in the LUT window. Holding down the Option key while
selection this command will cause the image to be drawn starting at the top of the screen using the
space formally occupied by the Menu Bar.





Text Menu



Text handling in Image is similar to that in Macintosh painting programs such as MacPaint,
SuperPaint, and PixelPaint, with the exception that you currently can only change characteristics,
such as size and style, of the last line entered. You are allowed to change the color(by clicking in
the LUT window), size, typeface, style and justification of the current line of text after the text has
been entered.  The background color can be changed by option-clicking in the LUT window.







Windows Menu



Next Window



Deactivates the current image window and activates the next window in the list of window shown
in the Windows Menu.



Stack Windows



Expands all the image windows to their original size and redraws them slightly offset from each
other. If you hold down the Option key, all windows will be drawn in the same location, at the
upper left corner of the screen, next to the tool palette.



Tile Windows



Contracts all the images windows and repositions them so that they will fit on the screen without
overlapping. If you hold the Option key down the tiled windows will be drawn using Scale to Fit
mode. Click on the Zoom Box of a tiled window to expand it to fill the screen.





Using the Tools 



The window containing the tool palette, as well as all the other windows displayed by Image(with
the exception of the Scion Camera window), can be freely moved around the screen.  All the tools
work at any of the eight available levels of magnification.







Magnifying Glass - Click within the active image window to zoom. Double-click on the
magnifying glass to unzoom. Option-click(or use Undo) within the image window to unzoom in
steps. Notice how the plus sign changes to a minus sign when you hold the option key down.
Eight magnification levels are available: 1:1, 2:1, 3:1, 4:1, 8:1, 16:1, 32:1, and 64:1.



Scrolling Tool(Grabber) - Moves images within windows. When using other tools, with the
exception of the text tool, you can temporarily switch to the grabber by holding down the space
bar.



Selection Rectangle - Use this tool to specify a rectangular subregion for use by commands in
the Edit, Functions and Analysis menus. Rectangular selections can be Saved, Copied, Cleared,
Filled, Duplicated, Scaled, Flipped, Rotated, Inverted, filtered, or Measured.  Hold down the Shift
key to constrain the selection to be square. Double-click to select the entire image. As the rectangle
is being drawn, its width and height  are shown in the Results window.





Oval, Polygon, Freehand, Rounded Rectangle - These are outlining  tools for defining
non-rectangular subregions for use by various commands in the Edit, Functions and Analysis 
menus. Regions defined by these tools, along with the rectangle tool,  can Copied, Filled, Cleared,
Inverted, Framed, filtered, or Measured. The Fill command allows you to change colors after a
region has been filled by clicking in the LUT window. Similarly, Draw Boundary allows you to
change the line width by clicking on the lines in the Tools window. Double-click on the polygon
tool to bring up the Measurement Options dialog box. Use the arrow keys to nudge selections
one pixel at a time.



Pencil -  Draws thin lines using the current foreground color. Option-click to pick up the color
under the pencil. This works in either the current image window or the LUT window. It is not
necessary to hold down the Option key to pick up colors from the LUT window.  Holding down
the Shift key causes pencil movements to be constrained to be either horizontal or vertical.



Eraser - Erases to the current background color. Option-click to pick up background colors from
within the image window. The eraser can also pick up background colors from the LUT window. 
Holding down the Shift key causes eraser movements to be constrained to be either horizontal or
vertical. The color of the eraser indicates the current background color. The background color is
used by the Cut and Clear commands and as the background color for text. Double-click on the
eraser to erase the active image window.



Paint Brush - Draws in the current foreground color. Option-click to pick up the color under the
brush . It is not necessary to hold down the Option key to pick up colors from the LUT window.
The color of the brush indicates the current foreground color. Double-click on the brush to change
its size. Holding down the Shift key causes brush movements to be constrained to be either
horizontal or vertical.



LUT Tool - This tool is used to dynamically modify the Color Look-Up Table(LUT) by clicking
and dragging in the LUT window. It is also used to manipulate the density slice when thresholding
is enabled. Double-click on this tool to enable/disable thresholding.



Airbrush Tool - Double-click to change the brush diameter. 



Ruler 

Draws straight lines and measures linear distances. To measure a distance(or draw a line), click at
the starting point, drag to to the ending point, and then let the mouse button up. The horizontal
distance(X), vertical distance(Y), and total distance will be dynamically shown in the Results
window as the line is drawn. If you are measuring, and don't want to leave the line as a reference,
use the Undo(Command-Z) to erase it.



Hold down the Option key to measure distances along an irregular path. Tracing in this case is
done using a technique similar to how the polygon outlining tool works.Terminate tracing by
double clicking. It is only necessary to hold the Option key down at the start of tracing.



Lines can be constrained to be either vertical or horizontal by holding down the Shift key. Line
width is specified by clicking on the lines at the bottom of the Tools window. Distances are given
in pixels unless Set Scale has been used to perform spatial calibration. Use Show Results to
display length measurements.  Option-click with the text tool to auto-label length measurements.
Double-click on the ruler to bring up the Set Scale dialog box. 



Automatic Outlining Tool(Wand)

Traces the edge of a thresholded object and, optionally, measures and/or numbers it, producing a
standard Image outline in the process. To use this tool, you must be currently thresholding, or
working with a binary image created with the Make Binary command. There are two ways to do
thresholding. The first method is to use the Threshold command(or double click on the Wand tool)
to enable thresholding, and then use the Wand tool to manipulate the resulting density slice. The
second method is to click on the threshold button in the lower right corner of the Gray Map
window, and then click and drag the vertical line to control the threshold.



The object to outlined should first be thresholded. Next, click inside the object near the right edge.
Imagine a turtle that starts moving right from where you click looking for an edge. Once it finds an
edge, it will trace it in a counter clock-wise direction until it returns to the point where it first found
the edge.



You can specify that the object be automatically measured and/or numbered by using the
Preferences command. The numbers correspond to measurement numbers. If you are numbering
the objects, but not measuring them, the numbers will not automatically be incremented.  Undo can
be used to remove the most recent number, along with the corresponding measurement, if any.





Density Profile Tool 

Displays a plot of the gray values along an arbitrary line. You generate this line in the same way
you use the ruler tool to draw lines or to measure lengths.  Hold down the option key if you want
the line drawn for reference purposes.  Averaging will be performed if the line width is greater than
one. For example, assume the maximum line width is selected by clicking on the thickest line at the
bottom of the tool palette, then each data point plotted is the average of eight pixels. The Plot
window, unlike the Histogram window,  my be resized. Lines can be constrained to horizontal or
vertical be holding down the Shift key.



Plots can be copied to the Clipboard and then pasted into a picture window. In addition to the plot,
the Copy command also copies the plot data to the Clipboard as a single column of numbers,
where it can be pasted into analysis and plotting programs, such as KaleidaGraph. Profile plot data
values can be saved to a file using the Save As command.



Various aspects of the plots produced by this tool can be altered using the Profile Plot Options
command. Double-click  on this tool to bring up the Profile Plot Option dialog box.



Paint Bucket

This is a MacPaint-like Paint Bucket. It causes all pixels located where paint can leak from the
starting point(the end of the paint coming from the bucket) to be changed to the foreground color.
In conjunction with density slicing, it can be used for measuring areas under profile plots. Profile
plots must first be pasted into an image window before they can be filled using the Paint Bucket.



There is currently a bug which prevents paint from leaking near the right edge of images with
widths that are not evenly divisible by eight.





Text Tool

When only words will do. Allows typing in the Font and Style chosen in the appropriate menus.
Various attributes of the text, such as font, size and color, can be changed after the text has been
entered, but once another tool has been chosen, or you have typed Return, the text becomes part of
the image's bitmap.



Hold down the option key and the text tool will automatically type for you the most recent length or
area measurement.  Repeated option-clicking will enter previous readings, starting with the most
recent one. Using Show Results will allow you to automatically type a set of readings a second
time.



Eyedropper - Picks up colors from the active picture window and from the LUT window.
Option-click to pick up background colors.  If you are using pseudocolor, double-clicking on a
color in the LUT window  causes the Color Picker dialog box to be displayed, allowing you to
modify that color. Double-clicking in the LUT window also allows you to change the density slice
color when Image is in the density slicing mode.



Angle Tool - Measures the angle formed by two lines drawn through a point by this tool. The
value is shown interactively in the results window. Undo can be used to delete the lines if they are
not wanted.



Pointing Tool - Counts objects and records their X-Y coordinates, leaving markers so that
objects are not counted twice. Markers are drawn in the current foreground color and their size is
related to the current line width. Use the Show Results command to display the X-Y coordinates.



Line Width - Allows user to choose the line width used by the ruler and profile plot tools and by
the Draw Boundary command. The lines are 1, 2, 3, 4, 6, or 8 pixels in width. Line widths greater
than eight can be specified in the Profile Plot Options dialog box.





Image Windows







Images are displayed within image windows, such as the one above, which are created using New,
Open, Import, or Duplicate. The size of image windows created using the New command can be
specified in the Preferences dialog box. The Close Box closes the window and frees the memory
used to store the image. Hold down the option key when clicking in the close box to close all
image windows. The Zoom Box switches the window to Scale to Fit Window mode and resizes
the window to make it as large as possible, while still maintaining the same aspect ratio. You can
restore the window to its original size by clicking again in the Zoom Box, or by using Unzoom. 
Note that the magnifying Glass and the Grabber tools do not work in Scale to Fit mode. The Grow
Box is used for resizing the window. If you are in the Scale to Fit mode the image will be rescaled
to fit any resized window. You can use the Grow Box to make the window larger than its original
size if you have zoomed in using the magnifying glass.







Gray Map Window







This window is used to vary brightness and contrast by loading different functions into the video
look-up table. To vary brightness, click and drag inside the frame, which moves the plot(a
piece-wise linear density transformation function) horizontally. This changes the Y-intercept of the
function while maintaining the slope fixed. To change contrast, click and drag in the margin to
move the two points which define the function. A good strategy for improving the contrast of
grayscale image is to click(outside the frame) in the lower left hand corner, than drag horizontally
to the right until the image starts to saturate. Similarly, click in the upper right hand corner, and
drag horizontally to the left. If you are using a color palette, clicking in this window switches to
grayscale mode. Double-click to reset the look-up table to a 256 gray value ramp(an identity
function). 





LUT Window





This window displays the contents of the video look-up table(LUT), which is used to transform
each of the 256 possible pixels values into one of 16 million possible screen colors. Several types
of look-up tables(also called palettes) are possible, including grayscale, pseudocolor, and custom.



Click in the LUT window with any of the drawing tools to pick up a new drawing (foreground)
color. 256 color palettes, such as the one produced by the 256 Color Spectrum command can be
rotated,  but not stretched. Click in the LUT window with the eraser,  or Option-click with any
other tool, to pick up a new background color.  Use Save to save the modified palette with the
image, or Save Palette As to save the palette separately.



The default pseudocolor palette consists of 20 colors.  Click and drag near the bottom of the palette
to move it within the LUT. Click and drag near the top of the palette to stretch it. Double-click on a
color  with the eyedropper tool to edit it.









Histogram Window





This window displays the gray value histogram produced by the Show Histogram command. This
is a function that shows, for each of the 256 possible gray values, the number of pixels within the
selection that have that gray value. The actual histogram values will be dynamically displayed in the
Results window whenever the cursor is over the histogram window. Both the histogram plot and
the 256  data values can be copied to the clipboard(using Copy) whenever the histogram window is
active. The data values can also be saved to a text file using the Save As command.





Results Window



X, Y and Value at the top of the Results window are dynamically updated variables that have
different meanings depending on which window the cursor is in.



Image Window - X and Y are the current cursor coordinates, where the origin of the
coordinate system is at the lower left-hand corner and positive X is to the right and positive Y
is up. (Note, you can change the origin to the upper left in Preferences.) Value is the gray
level of the pixel at the current X-Y coordinates. The range of values is from 0(white) to
255(black). In the case of color or pseudocolor images, Value is the index used by the color
look-up table.



LUT Window - Value is the grayscale value(look-up table index) pointed to by the
eyedropper. You can use this information to set the foreground or background  grayscale, or
color, to a specific grayscale value or index.



Gray Map Window - X and Y display the X-Y coordinates of the gray map control point
you are currently changing by dragging the mouse. To change one of the two control points
you click and drag near the border of the gray map.



Histogram Window - X is the current X-axis(grayscale) value, Y is the number of pixels
in the selection which have that value.



Plot Window - X is the cursor x-coordinate. Y is the corresponding plot y value.

Using Selections



A selection is a user defined region of interest created using one or more of Image's five outlining
tools. Selections are used for defining areas to be measured or areas to be operated on using
various filtering or editing commands. Selections, such as those shown below, are indicated by the
selection marquee, sometimes referred to as marching ants.



Moving a selection. Selections can be moved by clicking within the selection and dragging.
The Results window displays the coordinates of the upper left corner of the selection(or the
bounding rectangle for non-rectangular selections) as it is being moved. Notice that the cursor
changes to an arrow when it is within the selection. If you want to move the contents of a
selection, rather than the selection itself, first do a Copy(Command-C) and a Paste(Command-V),
then click within the selection and drag. Use the shift key to constrain movement to horizontal or
vertical. The arrow keys can be used to nudge the selection one pixel in any direction.



Stretching a Selection. Rectangular selections can be stretched using the handle in lower right
corner. The contents of the selection will also be stretched if the selection is the result of a paste
operation. The width and height will be displayed in the Results window as the selection is
stretched.



Adding to a Selection. If you hold down the Control key(notice the little plus sign in the
cursor) while making a selection, then the new selection you create will be added to the current 
selection. This feature allow you to edit existing selections, or to create discontinuous selections,
such as the one above. This feature is implemented using QuickDraw's UnionRgn routine.



Subtracting from a Selection. If you hold down the Option key(notice the little minus sign)
while making a selection, then the new selection you create will be subtracted from the current 
selection. This feature allow you to edit existing selections, or to create selections with holes in
them, like the one above. This feature is implemented using QuickDraw's DiffRgn routine.



Deleting a Selection. To delete the current selection, choose any of the selection tools and click
anywhere outside the selection. Or, alternately, choose a tool other than one of the selection tools,
the magnifying glass, or the grabber hand. You can use Restore Selection to bring the selection
back after you have deleted it.



Transferring a Selection. A selection can be transferred from one image window to another by
using the Restore Selection command. Simple activate the window you want to transfer the
selection to by clicking on it, and use Restore Selection. You can also use the Next Window
command to activate another image window.



Saving a Selection. A selection can saved to disk using Save Outline As and restored later
using the Open command.



Analyzing Electrophoretic Gels



Here is one possible procedure for using Image to analyze a one dimensional electrophoretic gel(or
a chromatogram), such as the one shown below. This procedure also demonstrates some of the
less obvious features in Image, and also illustrates a few shortcuts.





1) Digitize the gel using a high quality monochrome TV camera and light box. Note that the gel
must be oriented horizontally, not in the usual vertical mode. (You may want to first digitize a
blank field so Image can do a shading correction).  Save the digitized image.



2) Make space for the profile plots by selecting an area below the lanes of interest with the
rectangle selection tool and pressing delete to erase it, or by opening a new Image window.



3) Use the Selection Rectangle tool to outline the first lane, noting the width of the selection shown
in the Results window.



4) Double-click on the profile plot tool to bring up the Profile Plot Options Dialog box. Check
Fixed Scale and Fixed Plot size, and uncheck Labels (Image will remember the settings if you use
Record Preferences).  Set the Plot Width to that of the selection width from step 3. You may also
want to set Min and Max to more appropriate values. You can use the Measure or the Column
Average Plot  command to help determine optimum Min and Max values.



5) Use the Column Average Plot command to create the profile plot of a lane. Use Restore
Selection if the selection outline you created in step 3 has disappeared.



6) Use Copy to copy the plot to the Clipboard. Click on the gel (or on the new) window and Paste.
You may use the mouse to reposition the pasted plot, but do not click outside of it prior to
restoration of the original selection, or the latter will be lost. Repeat steps 5 and 6 for each lane.



7) Double-click on the LUT tool to enable density slicing. Select the paint bucket tool, click in the
LUT window within the density slice, and click to fill peaks in the profile plots. You may first
need to draw base lines, which must be black, with the ruler to create closed peaks. (Rectangular
selections can usually serve as drop lines, or these may also be drawn with the ruler.)



8) Use Measure (Command-1) to find the area under peaks within a selection outline. In many
cases, a single selection outline can be moved over each peak, otherwise draw a new one.
(Measure will only count pixels within the outline that are highlighted by the density slice.)



9) Select the text tool and click on black in the LUT window.



10)  Select 9-Point and Align Center from the Style menu.



11) Option-click with the text tool to automatically label the peaks, in reverse order, with the area
measurements from step 8. The measurements will also have been recorded in tabular form, and
can be printed (use Show Results to bring up the table).



Redirected Sampling



Here is a technique you can use to get Image to outline objects on one image, but get the pixel data
used for density  measurements from the corresponding area of another image.



1) Open(or digitize) two images. It helps if the two widows are placed side-by-side and are
non-overlapping, but this is not necessary.



2) Outline a region of interest on one of the images.



3) Use Next Window(Command-`) to activate the other window.



4) Use Restore Selection(Command-4) to transfer the selection to the other window.



5) Use Measure(Command-1) to measure the corresponding region of interest in the second
window..



6) Switch back to the original window using Next Window(Command-`).





If you are making many measurements you can use a macro utility, such as MacroMaker or
QuickKeys, to automate steps 3-6. You might want to add a Number Selection command between
steps 2 and 3 in order to outline and number the regions of interest for reference purposes. One, or
both, of the windows can be magnified and this technique will still work. It will not work if more
than two image windows are open.







Using the Option Key



Holding the option key down when using many of the commands and tools in Image  causes
alternative functions to be performed. You only need to hold the option key down when you first
invoke a menu command.



Menu Command Options



Starting Image - Use QuickCapture card instead of Scion card, assuming both are installed



Close - Changes to Close All

Save - Changes to Save All

Save As(Measurements)- Exports measurement results with column and row headers

Print - Do bitmap printing(which is better for text and line art), rather than halftoning. (If using
LaserWriter 6.0(or later) causes the driver(rather than Image) to do halftoning.)



Copy(Measurements) - Measurement results copied with column and row headers

Rotate Left, Rotate Right  - Erase before rotating

Rotate and Scale - Use nearest neighbor sampling instead of bilinear interpolation



Smooth - More(unwighted) smoothing

Sharpen - Increased sharpening

Trace Edges - Result is not thresholded, allowing you to do it yourself

Convolve - Open kernel as an image



Calibrate - Allows you to edit the measured values



Start Capturing - Digitize with Scion frame grabber using whole screen

                               - With QuickCapture card, wait for external trigger

Stop Capturing - Omit shading correction

Average Frames - Sum frames instead of  averaging

Make Movie - With QuickCapture, for each frame, wait for external trigger

Run Movie - Erase screen before doing animation

Photo Mode -Move window to top of screen before erasing screen





Stack Windows - Move all windows to the home position in the upper left corner of the screen

Tile Windows - Use Scale to Fit mode to draw windows





Tool Options



Magnifying Glass - Zoom out instead of zooming in

Text Tool - Draw results of area or length measurements

Eraser - Pick up background color from image window

Brush - Pict up foreground color from image window

Ruler - Measure length of irregular path

Profile Plot Tool - Draw line

Eye dropper - Select background color rather than foreground color



Questions and Answers



Q. I am used to black having a value of zero, and white a value of 255, but in Image black is 255
and white is zero. How can I change this?



A. Choose one of the selection tools and use the Measure command twice (it doesn't matter what
you measure). Hold down the option key and bring up the Calibrate dialog box. Enter 0 and
255 in the first column(replacing what was there) and 255 and 0 in the second column. Click
the button labeled Straight Line and then click OK. Or, check Use Zero for Black, 255 for
White in Preferences, which will do all of the above for you.





Q. How can I create a new window of a particular size, for example 1024x1024?



A.	Bring up the Preferences dialog box(its in the Options menu). Set New Height to 1024 and
New Width to 1024 and click on OK. Any windows created with the New command during
this session should now be 1024x1024. Many functions(such as Copy, Paste, and Undo) will
fail with this large window unless you also make the Undo buffer larger. In the case of a
1024x1024  window, you would need to set the Undo buffer to 1024K.





Q.	When I rotate a large rectangular object it gets clipped. How can I get around this problem?



A.	Create a larger window(see question above), copy the object into the larger window, and then
rotate it.





Q. Sometimes, after I have copied an image to the clipboard, the Paste command becomes dim.
Why is this?



A.	Images copied to the clipboard are stored in a buffer(called the Clipboard buffer), which is the
same size as the Undo buffer. In some situations, such as filtering or 3D plotting, Image has to
use the Clipboard buffer for internal operations. When this is necessary, the Paste command
gets dimmed out.





Q. Why do the Finder's icons change color when I run Image?



A.	Image all but two of the 256 available screen colors. The two colors that Image will never
change are black and white. Objects on the screen that are not black and white are likely to
change color when in Image is being used. Colored objects are redrawn in their original color
when you quit Image.





Q. Why don't the Halftone and BitMap buttons in the print dialog box do anything?



A.	You are using version 6.0, or later, of the LaserWriter driver. This version supports halftone
printing for all Mac applications. This feature is normally not used by Image since Image does
its own halftoning by sending PostScript commands directly to the printer. You can disable
Image's built-in halftoning by holding the Option key down at the start of printing, in which
case, you can take advantage of the buttons in the Print dialog box.



Q.	I want to combine two color images to produce a montage, but when I Copy from one window
and Paste into the other the colors are wrong.



A. You can't normally combine images that have different LUTs, but if you check KeepLUT in
the Open dialog box when you open the second image(which must be stored as a PICT file) its
pixel values will be remapped to conform to the LUT of the first image. You will now be able
to successfully Copy and Paste, since both images have the same LUT.









Using Image with Flatbed Scanners



Several potential problems can occur when you use a flatbed scanner to digitize images for use
with Image. For example, scanners which only support 4-bit (16 gray level) scanning are a poor
choice for use with Image, since at least 32 gray levels are need to realistic looking images, and
256 gray levels are desirable for quantitative analysis. You should also avoid scanners with
software that is unable to save in uncompressed 8-bit TIFF format, since PICT files digitized at
greater than 75 dots per inch(DPI) will probably not be displayed correctly by Image. One scanner
that works reasonable well with Image is the DataCopy 730GS.



You also have to be careful not to generate files that are two large for Image to handle. Image was
optimized to handle the 640 x 480 (300K) images produced by frame grabber cards, whereas an
8x10 inch page scanned at 300 DPI is 2400 x 3000 pixels , or 7.2MB, which is much larger
than Image was designed to handle. The following table gives suggested maximum scan areas for
different scanning resolutions for use with the standard Apple 13 inch monitor(640 x 480) and for
19 inch monitors(typically 1024 x 768). Image can handle scans somewhat larger than these, but
you will probable run into problems if you greatly exceed these recommended sizes.





	75 DPI	150 DPI	300 DPI



13" Monitor 	7.5" x 6"	3.75" x 3"	1.8"  x 1.5"



19" Monitor	12" x 10"	6" x  5"	3"  x  2.5"





The Undo buffer should be set to 700K when working with  scans the size of the ones suggested
for 19 inch monitors.



You should probably stick to 75 DPI unless you are scanning small selections. 75 DPI also has the
advantage of producing images that are near actual size when displayed on the screen, since
nominal screen resolution is 72 DPI.

Appendix A: Frame Grabber Cards 



Image supports two frame grabber cards for acquiring images from video sources, such as TV
cameras and VCRs: the Data Translation QuickCapture and the Scion card.



Both cards have advantages and disadvantages. When using the QuickCapture, Image allows you
to adjust brightness, contrast, and pseudocoloring while digitizing. The continuous histogram and
live paste features are also currently only available with the QuickCapture. Image also supports the
full 768 x 512 resolution available with 50Hz(PAL) version of the QuickCapture card. On the other
hand, when capturing using the QuickCapture, the screen is redrawn only about four frames a
second. Also, the A/D converter in the QuickCapture seems to favor odd pixels values, which
results in strange looking histograms. This does not, however,  seem to be a problem in normal
use, and Data Translation claims to have a fix.



The Scion card, in addition to being less expensive, has the amazing ability to capture and
displaying on the screen at 30 frames per second. One disadvantage of this card is that, since it
copies video data directly to the video card over the NuBus at video rates(about 9 MB/sec.), it
doesn't work with  some third party video cards, or is unable to capture the entire 640x480 frame.
On the 640x480 Apple video card, it is able to capture 600x480 frames. Another disadvantage of
the Scion is that it will not work with the built-in video on the IIci. The Scion card also has a 4-8%
vertical shading problem and is also considerably noisier than the QuickCapture card, problems
which Image Systems claim they will fix.



Both Data Translation and Scion offer optional software for their respective cards for digitizing in
color using an RGB color camera, and then reducing the resulting 24-bit color image to an 8-bit
color PICT file that can be opened in Image.

  



1)	Data Translation QuickCapture



	Part Number: DT2255

	Price: $1295

	Requires EP205 Cable Assembly: $125

	

	Data Translation, Inc.

	100 Locke Drive

	Marlboro, MA 01752

	(508) 481-3700



2)	Image Systems Technology(was Scion) Video Image 1000



	Price: $1195

	

	Image Systems Technology

 	3 North Main Street

	Walkersville, MD 21793

	(301) 845-4045







Appendix B: Recommended Camera and Light Box 



Quantitative image analysis using Image requires the use of a high quality TV camera and light
source. You should select a high resolution solid-state(CCD) monochrome camera designed for
imaging applications. There should be a way to disable any automatic gain control(AGC) or
automatic black level features. The light source should provide uniform illumination, as well as
stable output with normal line voltage variation. 



The Sierra Scientific MS-4030 solid state camera is one camera that is well suited for quantitative
densitometry. A less expensive camera that is also well suited for scientific imaging applications is
the COHU Model 4815-5000.  Both Sierra Scientific and COHU also sells lenses and filters. 



Imaging Research, creator of the highly regarded MCID biomedical image analysis system for the
IBM-PC,  makes a stabilized fluorescent illuminator that provides the uniform illumination needed 
for autoradiographic densitometry. They also sell several needed accessories, including the Nikon
Micro-Nikkor f2.8/55 mm lens, the F-C adapter needed to connect the lens to a TV camera, and the
Kaiser RS-1 copy stand. In addition, they sell the Sierra Scientific and COHU cameras.





1)	Sierra Scientific



	1173 Borregas Avenue

	Sunnyvale, CA 94089

	408-745-1500





2)	COHU Inc.



	5755 Kearny Villa Road

	San Diego, CA 92138

	619-277-6700





3)	Imaging Research Inc.



	Brock University

	St. Catharines, Ontario

	Canada L2S 3A1

	416-688-2040



Appendix C: Alternate Mac II Analysis Systems



1) BigImage



	2Ai Inc.

	300 East Bells, #304

	Pasadena,CA 91101

	818-449-9512



2) The Explorer



	UCLA Software Service Center (1400 PVUB)

	UCLA

	405 Hilgard Ave.

	Los Angeles, CA 90024

	213-825-0757



3) Image Analyst



	Automatix

	1000 Tech Park Drive

	Billerica, MA 01821

	508-667-7900 



4) NCSA Image, NCSA PalEdit, NCSA Layout



 	NCSA Documentation Orders

 	152 Computing Applications Building

 	605 East Springfield Avenue

 	Champaign, IL 61820

 	217-244-0072

	(or via anonymous ftp from zaphod.ncsa.uiuc.edu)



5) NuVision



	Perceptics Corporation

	Pellisippi Center

	P.O. Box 22991

	Knoxville, TN 37933

	615-966-9200



6) Prism Image Analysis System



	Dapple Systems, Inc.

	355 West Olive Ave.

	Sunnyvale, CA 94086

	408-733-3283



7) Ultimage

	

	GTFS Inc.

	2455 Bennett Valley Rd, #100C

	Santa Rosa, CA 95404

	707-579-1733



Appendix D: File Formats





TIFF Files Created by Image



Bytes 0-7 contain the TIFF header. Bytes 8-97 contain the TIFF directory. Within the TIFF
directory, bytes 30-31 contain the image width, and bytes 42-43 contain the height.

Bytes 98-255 are currently unused and are set to zero. Bytes 256-767 contain a 512 byte header
which is unique to the Image program. Image data starts at byte 768, stored in row order, one byte
per pixel. Note that the 16-bit integers containing the width and height have the opposite byte order
as compared to IBM PC and VAX systems.



The information provided here should be adequate for writing a program to read a TIFF created by
Image. It is not sufficient for creating TIFF files that Image, or any other program, can read. More
detailed information on TIFF is available from either Aldus Corporation or Microsoft at the
following addresses:



Developer's Desk	Windows Marketing Group

Aldus Corporation	Microsoft Corp.

411 First Ave. South	16011 N.E. 36th Wy.

Suite 200	P.O. Box 97017

Seattle, WA 98104	Redmond, WA  98073

(206) 628-6593





MCID File Format



The easiest way to create variable sized image files that can be read by Image is to duplicate the
MCID format accepted by the Import command. These files contain the line width less one in bytes
0-1, the number of lines less one in bytes 2-3, followed by the 8-bit pixel data in row order. The 2
bytes (one 16-bit word)used to store the width and height  are stored in Intel/VAX byte order,
where the low order byte is first. The Import command expects these files to be of type TEXT,
although they are actually binary files. The following Pascal program is an example of how to
create a file that can be Imported into Image.





PROGRAM MakeRamp;

{

This example Pascal program that creates a picture

file that can be opened using Image's Import command.

}

VAR

  f:text;

  i,line,pixel,PixelsPerLine,nLines:integer;

BEGIN

  write('Pixels Per Line: '); readln(PixelsPerLine);

  write('Number of Lines: '); readln(nlines);

  writeln('Creating image. This may take a few minutes.');

  rewrite(f,'Ramp');

  write(f,chr((PixelsPerLine-1) MOD 256));

  write(f,chr((PixelsPerLine-1) DIV 256));

  write(f,chr((nlines-1) MOD 256));

  write(f,chr((nlines-1) DIV 256));

  FOR line:=1 TO nlines DO

    FOR pixel:=0 TO PixelsPerLine-1 DO write(f,chr(pixel));

  close(f);

END.



IPIC files, which Image can open but longer create, use a very simple file format consisting of a
512 byte header followed by uncompressed 8-bit pixel data. The format is similar to that used by
the PDP-11 version of Image, and, in fact, the Macintosh version of Image can read the files
produced by PDP-11 version of Image. The easiest way to generate a file that the Mac version of
Image can read is to duplicate the PDP-11 file format, where bytes 0-1 contain the number of lines
using Intel/VAX byte order and bytes 2-3 contain the number of pixels per line, also using
Intel/VAX byte order. Image data starts at byte 512, and is stored in row order. Pixels are always
one byte(8-bits) in length, where 0 is black(minimum intensity) and 255 is white(maximum
intensity. The file type and creator of the file must be IPIC and IMAG, respectively.





Palette File Format



Pseudocolor palette files, which are of type ICOL,  contain the number of colors in byte 0. Byte 1
contains the starting location of the palette within the LUT and byte 2 specifies how many times
each color is replicated. Bytes 3-31 are currently unused, and are set to zero. Bytes 32-63 are used
for storing red, bytes 64-95 for storing green, and bytes 96-127 for storing blue. In other words,
starting at byte 32, 32 unsigned bytes are used for storing the red intensity values, then 32 bytes
are used for storing green intensity values, and finally, 32 bytes are used for storing blue.









Appendix E: Program Limitations



The maximum number of pixels per line is 2048. There is no arbitrary limit(other than memory
requirements) on the maximum number of lines in an image. Image uses two 300K buffers as
Undo and Clipboard buffers. Many program function will not work with images larger than these
buffers. The size of these buffers can be changed in the Preferences dialog box. You must Save
Preferences,  Quit, and then restart Image before the buffer size change will take effect.



The maximum number of colors allowed in a pseudocolor palette is 32. This will probably be
increased in some future version.



The maximum number of characters that can be saved, printed, or copied to the clipboard is
30,000.



The maximum number of region and particle measurements is 250. The maximum number of
length measurements is 100 and the maximum number of X-Y coordinates pairs that can be
recorded is 200. The maximum number of allowed density standards is 20.







Appendix F: Shortcuts 













Appendix G: Updated Versions and Bug Reports



Image is available from the National Technical Information Service(NTIS), and from many Macintosh
bulletin boards and user group libraries. A reasonably current version, including Pascal source code and
example images,  should be available from one of the following:



1) From a friend. The Image program, including source code and documentation, is
	public domain and may be freely copied, distributed, and modified.



2)	Via anonymous FTP from alw.nih.gov [128.231.128.251] in the directory /pub/image.



3)	Via anonymous FTP from sumex-aim.stanford.edu [36.44.0.6]. The application is in
	the directory /info-mac/app, and the source is in /info-mac/source/.



4)	DL10 of MACPRO on CompuServe (expensive)



5)	Twilight Clone  BBS in Silver Spring, MD,  301-946-5032 ($25/year fee)



6)	EMMPDL(Electron Microscopy and Microanalysis Public Domain Library),

	312-972-7919, Username: EMMPDL, Password: EMMPDL, 1200 baud, 8 data, 1 stop,    
	No parity (user pays phone charges)



7)	NTIS, 703-487-4650, Order Number PB90-500687, $100(Check, Visa, MasterCard).
	NTIS sells a two disk package complete with documentation, HyperCard reference stack,
	Lightspeed Pascal source, and example images.





Bug reports and suggestions are welcome, as well as corrections or additions to this manual. The
author can be reached at the following electronic mail addresses:



BitNet:	wayne@helix.nih.gov  or  wsr@nihcu

Internet:	wayne@helix.nih.gov

CompuServe:	76067,3454