Techniques

Analyzing Electrophoretic Gels

The following is one possible procedure for using Image to analyze a one-dimensional electrophoretic gel. It also demonstrates some of the less obvious features in Image, and also a few shortcuts. Note that this technique cannot be used to compare bands on different gels unless the gels are calibrated to known standards. Any results obtained using this procedure should not be trusted without testing using standards with known concentrations or by comparing with results obtained using a densitometer.

manual60

  1. Use the Calibrate command to calibrate the image to a calibrated optical density step tablet. Failure to do this could result in incorrect and misleading measurements.

  2. If the commands Mark First Lane , Mark Next Lane and Plot Lanes are not shown in the Special menu then use Load Macros to open the file "Gel Plotting Macros" in the Macros folder.

  3. Use the rectangular selection tool to outline the first lane. This is the left most lane for vertically oriented lanes and the top lane for horizontal lanes.

  4. Select Mark First Lane in the Special menu. A copy of the image will be displayed with the first lane outlined.

  5. Move the rectangular selection (by clicking inside it and dragging) and outline (using Mark Next Lane ) each of the other lanes in succession.

  6. Use Plot Lanes to generate the lane profile plots.

  7. Use the line drawing tool to draw base lines and drop lines so that each peak defines a closed area as shown above. Note that you can hold the shift key down to constrain lines to be vertical.

  8. Measure the areas of the peaks by clicking inside each one in succession with the wand tool.

  9. Option-click with the text tool to automatically label the peaks, in reverse order, with the area measurements. The area measurements are also recorded in tabular form, and can be displayed (Show Results) printed (Print) or exported (Export) to a spreadsheet.

Plot Lanes may fail if it tries to create a plot window that is larger than the Undo buffer. If this happens, you will need to increase Undo & Clipboard Buffer Size in the Preferences dialog box, Record Preferences, and restart Image .

Note that this macro package changes several of the settings in the Analysis/Options dialog box. It enables Wand Auto-Measure so that the area is automatically measured when you click with the wand tool under a peak. It disables Label Particles so that peaks are not automatically numbered by the wand tool. It enables Include Interior Holes . If this were not done, the wand tool would measure zero area. It enables Adjust Areas to compensates for the tendency of the wand tool to underestimate the size of small peaks. The size of small peaks is underestimated because some of the actual peak area is represented on the screen by the pixels which define the boundary, and, on small peaks, the ratio of boundary pixels to interior pixels is higher.



Using Selections

Selections are user defined regions or lines within an image that can be measured, filtered or edited. Region selections are created using the rectangular, oval, polygonal or freehand selection tools. Line selections are created using the line selection tool, which has three forms selected from a pop-up menu. Line selections can be straight, freehand or segmented. Selections are outlined by a moving marquee, sometimes referred to as the "marching ants". Only one selection can be active at a time.

manual61

Moving a Selection. Selections can be moved by clicking inside them and dragging. The Info 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. Straight line selections can be moved using the handle (small black box) in the center of the line. If you want to move the contents of a selection, rather than the selection itself, do a Copy (command-c), a Paste (command-v), then click within the selection and drag. Use the shift key to constrain movement to be horizontal or vertical. Use the arrow keys to nudge the selection one pixel at a time in any direction.

Stretching a Selection. Rectangular selections can be stretched using the handle (small black box) in the 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 are displayed in the Info window as the selection is stretched. Use the arrow keys with the option key down to stretch a rectangular selection one pixel at a time. Straight line selections can be stretched and repositioned using the handles at the ends of the line.

Adding to a Selection. Hold down the control key (notice the little plus sign in the cursor) while making a selection and any new selection you create will be added to the current selection. This feature allows you to edit existing selections, or to create discontinuous selections. The shift key can also be used to extend selections when using either the polygon or freehand tool. Note that it is not possible to measure the perimeter of selections that have been edited in this way except by doing a Draw Boundary and using the wand tool to recreate the selection. Also note that line selections cannot be added to or subtracted from existing selections, but freehand and polygon selections can added to or subtracted from line selections.

Subtracting from a Selection. Hold down the option key (notice the little minus sign) while making a selection and any new selection you create will be subtracted from the current selection. This feature allows you to edit existing selections, or to create selections with holes in them.

Deleting a Selection. To delete a selection, choose any of the selection tools and click outside the selection. Alternately, choose any tool other than one of the selection tools, the magnifying glass, or the grabber hand. 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 using the Restore Selection command. Simply activate the destination window and use the Restore Selection command. The Next Window command (command-'`') can be used to activate a series of windows in sequence.

Saving and Restoring Selections.
Selections can be saved to disk using the Save As command (with the Outline option) and restored using Open. Multiple selections can be saved by transferring them to a blank (white) window, using the Draw Boundary command (make sure the boundary is black) for each selection, and saving the resulting binary image as a PICT file. To restore a selection, open the PICT file and click to the left of one of the drawn outlines with the wand tool.

Using Image with Flatbed Scanners

The Acquire command provides direct support for most scanners that have Photoshop plug-ins. Three scanning modes are supported: 8-bit grayscale, 8-bit indexed color and 24-bit color. 24-bit color images are stored as a three-slice (red, green and blue) stacks and the RGB to 8-bit Color command is automatically called to generate an 8-bit color version of the image.

A list of scanners known to work with Image is included with the description of the Acquire command. The plug-in that comes with the La Cie Silver scanner is one that works particularly well with Image.

You need to be careful not to generate images that are too large for Image to handle. Image was optimized for the 640 x 480 (300K) images produced by frame grabber cards, whereas an 8 x 10 inch page scanned at 300 DPI is 2400 x 3000 pixels (7.2MB), much larger than Image was designed to handle. The following table gives suggested maximum scan areas for different scanning resolutions and monitor sizes. Image can handle scans somewhat larger than these, but you will probably run into problems if you greatly exceed these recommended sizes.


Monitor 75 DPI 150 DPI 300 DPI

14" (640x480) 8" x 6" 4" x 3" 2" x 1.5"

17" (832x624) 11" x 8" 5.5" x 4" 3" x 2"

20" (1152x870) 14" x 11" 7" x 5.5" 3.5" x 2.75"


Use the Preferences command to increase the size of the Undo and Clipboard buffers to 600K when working with scans of the size suggested for 17" monitors, and to 1000K for 20" monitors. Note that making the Undo and Clipboard buffers larger then necessary can require a lot of extra memory. For example, increasing the buffer sizes from 1000K to 1500K increases Image's memory requirements by 1MB.

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

Recovering Data from Line Plots

Image can be used to recover numeric coordinate data from printed line plots using the following procedure.

manual62

1) Digitize the plot using a TV camera or flat bed scanner.

2) Edit the plot to remove the x-axis, y-axis and labels.

3) Rotate the plot 90 clock-wise.

4) Create a line mask similar to the one above using the line drawing tool and repeated use of Copy and Paste.

5) Convert the line plot to a scatter plot by ANDing the plot with the mask using the Image Math command.

6) Select X-Y Center in the Analyze/Options dialog box.

7) Deselect Invert Y-Coordinates in the Preferences dialog box.

8) Use the Analyze Particles command to record the X-Y coordinates.

Alternately, and much easier, use the macros in the file "Line Plots->Data", which automates most of these steps. Use the wand tool to outline the plot (click to the left of the curve), then use the Clear Outside macro to erase everything except the plot. Next, use Convert Line Plot to Points, which will perform steps 3-8 above. It assumes the active window contains a binary image and you have selected, using the rectangular selection tool, a single isolated line plot drawn on a white background. Use the Plot Points macro to display the resulting coordinate data.

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. When using menu commands, you only need to hold the option key down when you first select the command.


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

Menu Command Options

Close - Changes to Close All
Save - Changes to Save All
Export (Measurements) - Exports measurement results with column and row headers

Copy (Measurements) - Copy measurement results with column and row headers
Rotate Left, Rotate Right - Erase before rotating

Smooth - More (unweighted) smoothing
Sharpen - Increased sharpening

Analyze Particles - Omit dialog box
Calibrate - Allows you to edit the measured values

Stop Capturing - Omit shading correction
Average Frames - Omit dialog box
Animate - Erase screen to background color before doing animation
Photo Mode - Move window to top of screen before erasing screen

Cascade Images - Move all image windows to the "home" position (upper left corner)
Tile Images - Use "Scale to Fit" mode to draw image windows


Tool Options

Magnifying Glass - Zoom out instead of zooming in
Grabber - Scroll all other tiled windows to the same position
Text Tool - Draw results of area or length measurements
Eraser - Pick up background color from image window
LUT Tool - Rotate the LUT
Brush - Pick up foreground color from image window
Eyedropper - Select background color rather than foreground color