Cavalieri Macro Documentation Version 2.0 corrects syntax errors in the macro code that are no longer allowed by recent versions of NIH Image. It also adds two new features: 1. The user may change the color of the point counting grid. One the "Change Grid Color" macro is activated, entering any pixel value between 0 and 155 will set the grid to that color. Values for colors available under 8-bit grayscale LUT are given in the Info box at the lower left of your monitor. 2. A list of random numbers may be generated and is saved to the measurements array. It contains repeated numbers, since the purposes for which this was written needed them. There is a set of macros available to allow recording z-values from a Heidenhain VRZ 405 digital micrometer connected to the Mac serial port. This will eventually be incorporated into the Cavalieri macros. This set of macros is for quantitative morpometry. One can obtain: -area and volume estimates by the the method of Cavalieri; -volume, area, and point densities or ratios; -numerical densities by optical disector or physical disector methods. Areas may be obtained 2 ways: -a grid of point counting tiles; -a counting frame; additionally, planimetric lengths may be drawn with a line tool. Creating a sampling reference area. The sizes of the tiles and counting frames are set by the user. The grid may be randomly placed for systematic random sampling or forced to align with the image. The counting frame defaults to centered over the image. For some types of measurements one can draw a line with a line tool and then count points as a function of the drawn length. The user is prompted for 3 sample identity parameters and then may count points for up to 4 categories. Creating a Point Counting Grid [P]. You will be prompted for a tile size, in pixels. The next prompt defaults to locate the grid randomly, placing the origin randomly within an area of one tile relative the screen corner. Enter zero to force the grid to coordinates 0,0. Creating a Counting frame [F]. Pressing F creates the frame, B actually draws its boundary and measures the area, so you can drag frame around before planting it. If you alter the frame size while dragging, the macro measures the final size. Sampling Line [L]. Select the appropriate line tool, draw the line and then press L to measure it. More than one sampling template may be used on an image, any samples counted after invoking an additional template will display the area or length of the most recent template. Physical Disector Counts. There are several ways to compare the two images from the adjacent reference and lookup sections. The most efficient will depend upon the sample. Two monitors can allow a straight forward approach. Live paste is elegant, but having only 1 LUT makes it difficult to tell to which layer a given sample object belongs. This can sometimes by overcome by using pseudocolor and LUT tranformations (inverting the LUT is often helpful) of the first image so that color differences will identify structures overlapping during the live paste. This has been used for identifying cells labelled with two different antibodies in two adjacent sections. Putting large splotches of a contrasting color (or black or white) over the items on the reference section may allow distinction. The simplest method we have found involves marking the reference image with a counting frame and placing counting spots on the objects to be counted, this is the reference section. Then boost the contrast as much as possible and print the image onto mylar transparency with a laser printer. Printing as a black and white image will greatly reduce print time. Grab the lookup image and simply hold the mylar over the monitor and rotate until your landmarks or objects align and then run the macros to create a counting frame, identify the sample and count the objects present in the lookup frame, but not in the reference frame. For doubled sampling effiency, run the identify and counting macros to count those objects unique to the mylar. There are two new macros available on Zippy.nimh.nih.gov for rotational alignment of sections. One allows rotational alignment of pairs of sections, the other aligns stacks of images. Both align based upon user-designated landmarks. Open the image and press "F", then "B". Identify sample and begin counts. Press "D" when done. Optical Disector. Make a counting frame on a blank image and ignore the rest of the macros (except possibly Set Scale). Then perform a live paste from the microscope and count while focussing but DO NOT CLICK THE MOUSE (TABLET) FOR YOUR COUNTS OR YOU WILL COMPLETE THE PASTE. This means doing analog (pencil and paper) counts. Cavalieri estimates and Counts. "P" for the grid, enter tile size as the pixel length of a tile side. Area will be reported in pixels if the scale has not been set. Default of the next question is to allow random placement of the grid's origin within the area of one tile. Entering "0" for the starting location will force the grid's origin to the upper left corner of the image. To Count. Press "I" to be prompted for 3 sample identifiers. To count, 1. press a number between 1 and 4 to select a category, click on each point; 2. terminate counts by clicking in the menu bar or in the lefthand palettes; 3. fill the results window by pressing "D" after terminating the last category's counts. Skip any category not to be counted. The default count value is zero. You select categories in any order. Results format: Area = Slide Number, Mean = Section number, S.D. = Other; X = the area of the frame or tile, or length of a sampling distance; Y = the exponent of the sampling units (2 for area, 1 for length). Making sampling templates with a drawing program and printing them onto paper allows use of a drawing tube for numerical densities and point counts for area estimates. Printing templates onto mylar allows either hand counting or use of a digitizing tablet and Image for working with micrographs. References. West, M.J. and H.J.G. Gundersen, J Comp. Neurol, 296:1-22, 1990. Gundersen, H.J.G. et al, APMIS 96:379-94, 1988. Gundersen, H.J.G. and E.B. Jensen, J. Microscopy, 229-63, 1987 West, M.J. , Slomianka, Gundersen, Anat Record, 231:482-497, 1991. D.C. Sterio, J. Microsc. 1984, 134:127-136. QM-2000, a PC based tutorial on quantitative morphometry with examples, worksheets for computing results, power analysis and references is available from the Health Sciences Center for Educational Resources, University of Washington, Seattle, WA 98195 (helpful, but $185 and PC based). If you have any questions, please contact me. If you have any ideas for improvements, or code for more templates, please, please contact me. Glen MacDonald Hearing Development Laboratories RL-30 University of Washington Seattle, WA 98195 (206) 543-8360 glenmac@u.washington.edu