Instructions for using Drop-Ins for Manual Stereology These drop-ins are intended to facilitate manual stereology of images acquired by or loaded into Photoshop, NIH-Image and PrismView. Manual stereology in its simplest form relies on the human to recognize important details of the image, rather than trying to find some combination of image processing operations that will isolate the structures of interest. Manual stereology is basically a counting operation. A suitable grid of lines and/or points is placed on the sample, and the user counts the number of points that fall on a phase of interest, or the number of times that the grid lines cross a particular type of boundary between phase regions. From these numbers, basic structural parameters such as volume fraction and surface area per unit volume are obtained. In order to facilitate the counting and keep track of what has already been counted, it is often convenient for users to place marks directly onto the image. These add-on functions will generate the grids and count the user's marks. The procedure is described in detail for each of the three master programs and the corresponding add-ons. 1. Stereological Counting Drop-Ins for Photoshop Two Drop-Ins are provided, called DrawGrids and CountMarks. In order to use them, place them inside the same folder with your other drop-ins. They will appear by name in the "Counting" sub-menu under the "Filter" menu. The drop-ins should also work correctly with any other program that can use level 4 Photoshop filter plug-ins. 1. Acquire the image or load it from disk. Perform whatever processing may be needed to assist in the visual recognition of features. The plug-in works properly with RGB color images, and with grey-scale (8 bit) images. 2. Select a pen color from the palette by clicking on the foreground color icon and then using the color wheel and intensity slider. You can alternatively select a color by "picking it up" from the image using the eyedropper. The goal is to select a color that will provide adequate contrast with the image. 3. Use the Drop-In "DrawGridsÉ" to place a grid of points or lines on the image. Seven kinds of grids are available, which you may select from the dialog that is displayed. -- a square array of points, appropriate for point counting on random structures -- a staggered array of points, similar to the square array but with a higher density -- a random array of points, which are appropriate for counting points on structures that are not random but have a repetitive structure -- a square grid of lines, useful for counting intercepts on isotropic uniform samples -- a series of non-intersecting circles, which are appropriate for counting intercepts on structures that are not isotropic -- a series of random lines, which are appropriate for counting intercepts on structures that are not random but have a repetitive structure -- a series of cycloids, which are appropriate for counting intercepts on vertical sections, in which the vertical direction in the sample is the vertical direction on the screen (see below for details). 4. The total line length of the grid in inches (assuming 72 pixels per inch) or the number of grid points, as appropriate, is shown in a dialog box and can be recorded to facilitate subsequent calculations. 5. Select a pen color as in step 3 to use for marking points. For an RGB image, this can be any unique color. For a greyscale image, the marking color is true black, which should not otherwise be present in the image. Select a size for the paintbrush that is convenient for visibility and selectively marking individual points. The size used should be large enough for easy visibility but small enough to not hide important details of the image, or to overlap other marks along the grid lines (see the note below). 6. Mark all of the points of one selected class. Mark the points either directly on the grid or just next to it. The actual location of the points is not important, but you need to be able to keep track of what you have done in terms of the microstructure and the lines or points of the grid. You can use "Undo" under the "Edit" menu to erase an erroneous point. Only the final set of colored marks is counted. 7. Choose the Drop-In "CountMarks" to count the number of separate marks on the image. For an RGB color image the marks counted are those that are the same as the pen or foreground color, and for a greyscale image they are black. The number of counts is reported in a dialog box and can be recorded to facilitate subsequent calculations. Stereological Counting Macros for NIH-Image One text file containing macros is provided. In order to use them, load them into NIH-Image using the "Load Macros" command under the "Special" menu. Five grid selections and one counting selection will then appear under the "Special" menu. 1. Select "Lut OptionsÉ" from the "Options" menu, and enter a value up to 6 for "Fixed Colors" to use in marking features on the grids. Doing this first will prevent the image from intruding into the range of colors reserved. Otherwise, it will be necessary to adjust the contrast range using the control sliders to avoid the fixed colors. 2. Acquire the image or load it from disk. Perform whatever processing may be needed to assist in the visual recognition of features. 3. Select a pen color from the palette by clicking on the desired color or by "picking it up" from the image using the eyedropper. The goal is to select a color that will provide adequate contrast with the image. 4. Select the desired grid from the menu. Seven kinds of grids are available, which you may select from the dialog that is displayed. These are the same as those listed above for the Photoshop drop-in. 5. The total line length of the grid in the measurement units of the image or the number of grid points, and the image area, are written in the lower left corner to facilitate subsequent calculations. 6. Use the paintbrush tool to mark points. Click on each of the fixed colors shown in the palette to identify a different kind of point or intersection. You can change the diameter of the mark left by the tool by double clicking on the paintbrush tool icon and entering a diameter in pixels. The size used should be large enough for easy visibility but small enough to not hide important details of the image, or to overlap other marks along the grid lines (see the note below). 7. Mark the points either directly on the grid or just next to it. The actual location of the points is not important, but you need to be able to keep track of what you have done in terms of the microstructure and the lines or points of the grid. It is usually most convenient to do this for each color (type of intersection or phase) in turn, but you can use any order you wish, and can use "Undo" under the "Edit" menu to erase an erroneous point. Only the final set of colored marks is counted. 8. You can select the macro "Count Marks" to count up the number of marks for each color, and display the resulting counts in the "Info" window. However, the operation of the macro is extremely slow because of the difficulty of accessing individual pixels in the image this way. You may instead prefer to keep the macro for generating the grids, but use the Photoshop Drop-In for counting. If this drop-in is placed in your "Plug-Ins" folder with your other plug-in modules, it will appear in the "PlugInFilters" sub-menu under the "Process" menu. When this drop-in recognizes that it has been called from NIH-Image, it counts all of the marks that are present using any of the fixed colors and reports the number of each in a dialog box. 9. Use the number of counts along with the number of grid points, length of grid line, and image area, to calculate the desired stereological relationships. Note that for the grid points, it is usually easiest to mark only the minor phase points and obtain the number of counts for the major phase by subtracting the number of marked points from the total number of points in the grid. Stereological Counting Drop-Ins for Prism Two PCMDs are provided, called CountingGridsÉ and CountMyMarks. In order to use them, place them inside your System folder (but not inside any other folder), just as for any other PCMD drop-in used with PrismView. They will appear by name in the "PCMD" sub-menu under the "Process" menu. 1. Acquire the image or load it from disk. Perform whatever processing may be needed to assist in the visual recognition of features. 2. Select the "Fixed Colors" command from the "Grey" menu and enable at least as many colors as you will want to use to identify different types of counts on your image. The colors (which can optionally be named) will appear in a palette beneath the histogram window. 3. If these colors intrude upon the range of brightnesses used in the image, you can re-scale the image to avoid them by holding down the Option key while selecting "Grey Scale" (under the "Grey" menu). Then select "Apply Lut" (under the "Process" menu). 4. Select a paintbrush color that will allow the grid to show contrast with the image. This can either be a black, white or grey set of lines, or you may use one of the fixed colors. Use the eyedropper tool to select the desired color from the palette beneath the histogram window. Then use the paintbrush, line tool or pencil to make some mark on the image (you can immediately undo it) so that the color will be active for the image and correctly used by the PCMD routine. If you omit this step, the color used to draw the grids may be the default foreground color saved in Prism's preferences file, or the last paintbrush color actually used to draw on the image. 5. Use the PCMD "CountingGridsÉ" to place a grid of points or lines on the image. Seven kinds of grids are available, which you may select from the dialog that is displayed. These are identical to those listed above for the Photoshop drop-in. 6. The total line length of the grid in the measurement units of the image or the number of grid points, and the image area, are written in the lower left corner to facilitate subsequent calculations. 7. Use the paintbrush tool to mark points. Click on each of the fixed colors shown in the palette to identify a different kind of point or intersection. You can change the diameter of the mark left by the tool by double clicking on the paintbrush tool icon and entering a diameter in pixels. The size used should be large enough for easy visibility but small enough to not hide important details of the image, or to overlap other marks along the grid lines (see the note below). 8. Mark the points either directly on the grid or just next to it. The actual location of the points is not important, but you need to be able to keep track of what you have done in terms of the microstructure and the lines or points of the grid. It is usually most convenient to do this for each color (type of intersection or phase) in turn, but you can use any order you wish, and can use "Undo" under the "Edit" menu to erase an erroneous point. Only the final set of colored marks is counted. 9. Select a color for the paintbrush that will show up on the image, as the counting results will be shown there. This does not need to be one of the fixed colors; it can also be white, grey or black. If you select some color other than the last one used in step 8 to mark on the image, then just as in step 4, you should use this color to make some mark on the image (which you can immediately undo) so that the color will actually be used in the counting PCMD in the next step. 10. Select the PCMD "CountMyMarks" to count up the number of marks for each color, and display the resulting count at the upper left corner of the image. Colors not used are skipped. Note that if one of the fixed colors was used to mark the grid onto the image, the counts for that color will be incorrect because each separate piece of the grid as subdivided by the marks will be counted separately. The grid color should not be one of the colors used for marks of interest, and its count should be ignored. 11. Use the number of counts along with the number of grid points, length of grid line, and image area, to calculate the desired stereological relationships. Note that for the grid points, it is usually easiest to mark only the minor phase points and obtain the number of counts for the major phase by subtracting the number of marked points from the total number of points in the grid. Stereological calculations from the data The two most common stereological measures, which illustrate the use of this method, are the determination of volume fraction of each phase present, and the measurement of the surface area per unit volume. There may be several different type of boundaries evident as lines in the image, each of which corresponds to a one kind of surface separating the structure in three dimensions. You may select different colors to measure the various kinds of boundaries that are of interest. The volume fraction of a phase is estimated by the number of grid points counted as lying within the phase, divided by the total number of points in the grid. The word "phase" as used in the context of stereology, refers to any recognizable structure that may be present, even voids. If the volume fraction of one structure within another is desired, that is the ratio of the number of points in the inner structure divided by the sum of those points and those which lie within the outer structure. For example, the volume fraction of a cell occupied by the nucleus would be measured by marking points within the nucleus in one color, and points within the cell but outside the nucleus in a second color. Then the volume fraction of the cell occupied by the nucleus is N1/(N1+N2). The same method would be used if there were many cells and nuclei within the image. The surface area per unit volume is estimated from the number of places where the grid lines cross the boundary line corresponding to that surface. If the number of points is N, and the total length of the grid lines is L (in whatever units the image is calibrated in), then the surface area per unit volume is 2¥N/L. This measurement has a dimension, and so the image calibration is important. The dimension of area per unit volume is (1/units). All stereological techniques require that the grid be randomly placed with respect to the features in the microstructure. When the structure itself and the acquisition of the image are random, this criterion is fulfilled by a regular grid of points or lines. If the structure is isotropic, then any array of lines provides an unbiased sample. Since the square grid is the easiest for the human user to traverse, it will be the grid of choice. If the structure is anisotropic (in the two-dimensional image), then the grid must sample uniformly in all directions, and the circle grid can be used. If the structure is itself regular or quasi-periodic, such as a cross-section of a man-made composite, then a random grid of points or lines should be used to provide isotropic, uniform and random sampling. There is one important and common case where orientation of the section plane is not randomized. In the so-called vertical sectioning case, the surface of the sample that is examined is perpendicular to an exterior surface, but multiple sections can be taken in different orientations that include that surface normal (actually, the method works whenever some defined direction within the structure can be consistently defined as the vertical direction, which lies in all section planes imaged). In that case, in order to count intersections with lines that are uniformly oriented in three-dimensional space, the cycloid grid should be used. One of the common microstructural measurements used to characterize materials is the so-called "grain size." This is actually a misnomer, since it does not actually have anything directly to do with the size of the grains. There are two different definitions of grain size included in the ASTM standard. One is derived from the surface area per unit volume of the grain boundaries in the material. If this are measured by counting N intersections of a grid of total length L (in millimeters) with the grain boundaries, then the ASTM standard grain size can be calculated as G = Ð 6.65 ¥ Log (L/N)Ð 3.3 where the logarithm is base ten. Note that depending on the units of your image calibration, you may need to convert L to millimeters. The second grain size method counts the number of grains visible in the image. You can also use the procedure described above to mark each grain, without regard to the grid chosen. For grains that intersect an edge of the field of view, you should count those that intersect two edges, say the top and left, and ignore those that intersect the other two, say the bottom and right. By this method, if the number of grains is N and the image area is A (converted to square millimeters), then the grain size is G = 3.32 ¥ Log (N/A) Ð 2.95 Note that these two methods do not really measure the same characteristic of the microstructure, and will in general only approximately agree. More information about the interpretation of the counts, their conversion to microstructural information, and the statistical confidence limits that are a function of the number of counts can be found in standard texts such as: John C. Russ (1986) Practical Stereology, Plenum Press, New York, ISBN 0-306-42460-6 John C. Russ (1990) Computer Assisted Microscopy, Plenum Press, New York, ISBN 0-306-43410-5 Note on the counting algorithm: A short cut has been used to speed up the counting of user marks: it is assumed that the marks are convex. This will always be true for the paintbrush circles, unless you move the mouse with the button depressed and draw a funny shape on the image. However, if the paintbrush circle is large and the points being marked are close together, they may overlap. If two circles of the same color overlap, they may be counted as one feature or as two, as explained below. If they are of different colors, the underneath circle will in that case have a "bite" taken out of it. If the bite is taken out from the top (making a letter U) the resulting feature will be counted twice because of the way the counting operation proceeds. The algorithm counts topmost points on features, so an inverted U will still be counted as a single feature. You should either use a mark small enough to avoid overlapping (marks of different colors that touch are perfectly fine and are counted correctly), or work downwards from top to bottom so that overlapping marks fall with the topmost mark at the bottom of the underlying one. Except for this limitation, the counting is exact, and very fast. Copyright notice, etc. These drop-ins are copyrighted (© 1995 John C. Russ. All Rights Reserved.) but may be freely distributed or posted for electronic access provided they are distributed as a complete set, and may be used without royalty, provided that this information (complete and unmodified) accompanies them. The author accepts no responsibility for their use, or the interpretation of resulting measurement data. Please contact the author with suggestions for additional grids or features. John C. Russ Materials Science and Engineering Department North Carolina State University, Box 7907 Raleigh, NC 27695-7907 phone 919-515-3328; fax 919-515-7724 e-mail John_Russ@NCSU.edu