SOFTWARE FOR IMAGE SEGMENTATION AND ANALYSIS
IN PATHOLOGY (ISAP).
FORMULAS.


Copyright © 1994 G. William Moore, Geoffrey W. Moore,
Jules J. Berman, Lawrence A. Brown.
http://www.medparse.com/isapform.htm

U. S. Government Work, presented at the 1994 meeting of the American Society of Clinical Pathology, Washington, DC.
Moore GW, Berman JJ, Moore GW, Brown LA.
Software for Image Segmentation and Analysis in Pathology (ISAP)
Am J Clin Pathol 102:538-539, 1994.



1. ISAP FORMULAS.

      ISAP(c) WORD SEARCH OPTION: ISAP(c) 1994 by G. W. Moore, G. W. Moore, J. J. Berman, and L. A. Brown, is a public-domain system for Image Segmentation and Analysis in Pathology, developed at the Baltimore VA Medical Center. ISAP(c) is written in Visual Basic for Windows, an object-oriented programming environment, with linkage to MS-Windows. ISAP(c) has edge-detection algorithms for determining the edge of a particle which is contained within a larger field of different density, such as a nucleus contained within cytoplasm or a nucleolus contained within the nucleus. Features of the particle are then calculated, including: particle area (AREA), sum of gray values in the particle (GRAYSUM), sum of optical densities in the particle (DENSESUM), average optical density (DENSEAVG), standard deviation of optical density (DENSESTDV), least standard error threshold (THRESHOLD), average diameter of the particle (AVGDIAM), greatest diameter (MAXDIAM), least diameter (MINDIAM), elliptical eccentricity (ECCENT), center-of-gravity x-axis (XCENTER) and y-axis (YCENTER), particle contour (CONTOUR), fractal dimension (FRACTAL), and perimeter (PERIMETER). Several of these features have been shown to have diagnostic significance in assessing cancer cells, in particular, area, average optical density, and contour.

      IMAGE FILES. An IMAGE FILE is a sequence of bytes that represents an image or picture. The image may be a photograph or a line-drawing, color or black-and-white, and may be different sizes. Black-and-white images are shown on-screen with different intensities of black (`gray-values'). Color images are shown on-screen with different intensities of three colors: red, green, and blue. The two general methods for storing an image are `point-map' and `vector-map'. A point-map image divides the image into a grid of points, or `pixels', typically 500 by 500 or greater. Each point has either a gray-level (black-and-white image) or a separate intensity level for red, green, and blue (color image). A standard television set shows point-map images, and ISAP(c) works exclusively with point-map images. There are several formats for point-map image files, including:
  BIF ..... Binary information file.
  BMP ..... Microsoft Windows bitmap, used by ISAP(c).
  GIF ..... Compuserve's image format.
  JPG ..... Compressed format developed by Joint Photographic Experts Group.
  PCX ..... Used by PC-paintbrush.
  PCT ..... Macintosh.
  TGA ..... TrueVision's Targa graphic card format,
     used by Veterans Affairs Computer System.
  TIF ..... Tagged interchange file format.
Typically, a point-map image file consists of a `header' followed by image points. The header carries such information as the height and width of the image grid, the number of bits assigned to each pixel, and a COLOR PALETTE, which assigns colors to different pixel intensities. The simplest layout for image points is that each byte (=8 bits) corresponds to a single point on the image grid. Thus for example in a 512 by 512 black-and-white image, there are 512x512=262,144 image points; in the corresponding color image (1 byte for red, 1 byte for green, 1 byte for blue), there are 3x512x512=786,432 image points. In this design, each image-point ranges in value from 0 to 255, resulting in a range of gray values acceptable to the human eye.

      MENU OPTIONS. The initial screen of ISAP(c) offers the following main menu options:
FILE EDIT IMAGE EDGE ANALYSIS DATABASE HELP QUIT
The submenus for the main menu options may be selected, by clicking the mouse (left button) on the desired main menu option.

      FILE menu: There are three submenus: OPEN IMAGE; CONVERT; PALETTE.

      OPEN IMAGE submenu. The system prompts the user for a FILENAME ending in .BMP, in the same directory. This FILENAME.BMP must be an uncompressed 8-bit black-and-white image file, in the MicroSoft(R) Bitmap format. If you have an uncompressed black-and-white image file in the .TGA format, then these may be CONVERTed into .BMP format, in the CONVERT submenu.

      CONVERT submenu. There is one submenu: BLACK-WHITE .TGA to .BMP. The system prompts the user for a FILENAME ending in .TGA in the same directory. The FILENAME.TGA must be an uncompressed 8-bit black-and-white image file, in the TARGA format.

      PALETTE submenu. You may change the COLOR PALETTE of an image which is already OPENed on the screen, under the FILE menu. Color palettes (also called `color maps') are look-up tables that tell the computer monitor what colors to display for any gray value. Palettes can be designed to turn gray images into green-tinted or red-tinted images, or even into pseudocolor images, in which different gray values are assigned artificial combinations of red, green, and blue. Experiment with viewing your image, using different color palettes. These transformations will not alter your actual gray value data. The choice of palettes includes: AQUA, BLUE, EMERALD, GREEN, GRAY, RED, INVERTED, SPRINKLE, RAINBOW, and EXTREME.

      IMAGE menu: There are two submenus: BLOCK SELECT; MEASURE DISTANCE.

      BLOCK SELECT submenu. After mouse-clicking the BLOCK SELECT submenu, the system is activated for selecting a rectangular block on the screen. The user should place the mouse-pointer on the upper-left corner of the desired select-block, and push the left mouse-button. The user should then drag the mouse-point to the lower-right corner of the desired select-block, and release the left mouse-button. The SELECT-BLOCK outline appears in red, and the system determines the edge of the particle, beginning from the center of the SELECT-BLOCK. The EDGE menu is used to modify the edge-detection parameters.

      MEASURE DISTANCE submenu. After mouse-clicking the MEASURE DISTANCE submenu, the system is activated for measuring any segment-distance on the screen. The user should place the mouse-pointer on the left point of the desired segment, and push the left mouse-button. The user should then drag the mouse-point to the right point of the desired segment, and release the left mouse-button. The system provides the x-distance (horizontal), y-distance (vertical), and the Euclidean distance for the segment.

      EDGE menu: There are three submenus: METHOD; THRESHOLD; WINDOW SIZE.

      METHOD submenu. The METHOD submenu sets the edge-detection method. Two methods are offered: SOLID-FILL and RADIAL. In each method, the system classifies all points (pixels) in the SELECT-BLOCK as INSIDE, EDGE, or OUTSIDE. All parameters for the particle (area, average density, perimeter, etc.) are calculated from this classification.

      In the SOLID-FILL method, the system begins by designating the center point as INSIDE. At each INSIDE point, the system examines at four edge-contiguous points: left, right, up, and down. Each of these candidate points is scored and tested against a THRESHOLD level (from 0 to 255, default=90). If the average score is below the current THRESHOLD, then the candidate point is INSIDE. The average score is the average of all points in a WINDOW, centered at the candidate point. The WINDOW may be 3x3 points, 5x5 points, 7x7 points, or 9x9 points. The process continues to exhaustion.

      In the RADIAL method, the system begins by designating the center point as INSIDE. A vector is projected at three degree intervals, from 0 to 360 degrees. At each angle, the system steps from the center to the first point which scores above the current THRESHOLD. This step-up is an EDGE point; points between the center and EDGE are INSIDE points.

      THRESHOLD submenu. The THRESHOLD submenu sets the threshold at which the EDGE of a particle is detected. Values range from 0 to 255, default=90. For a darker image, select a lower THRESHOLD; for a lighter image, select a higher THRESHOLD. THRESHOLD may be set manually or automatically, by a self-thresholding

      SELF-THRESHOLD subsubmenu. The user makes a tracing to delineate a WORKSPACE, which includes the nucleus and a surrounding rim of cytoplasm and background. The nucleus should occupy between 10% and 90% of the workspace. ISAP makes a histogram of all pixels in the workspace. At each division point between two consecutive bars of the histogram, ISAP calculates the pooled standard deviation for the Student t test. This pooled standard deviation tends to be smaller when there is good separation between the dark (left) segment of the histogram and the light (right) segment of the histogram. The self-threshold is taken as the division point with minimum pooled standard deviaition.

      WINDOW submenu. The WINDOW submenu sets the window-size for calculating the average gray score in the edge detection methods. The average score for a given point is the average gray value of all points in a WINDOW, centered at that point. The WINDOW may be 3x3 points, 5x5 points, 7x7 points, or 9x9 points.

      ANALYSIS menu: There are two submenus: HISTOGRAM, VALUES.

      HISTOGRAM submenu. If there is an OPEN IMAGE (FILE menu) on the screen, and a particle has been BLOCK SELECTed (IMAGE menu), then the HISTOGRAM submenu of the ANALYSIS menu displays a bar graph of the gray values in the particle. The RED BARs represent the distribution of gray values. The BLUE BAR is the arithmetic mean for the distribution of gray values.

      VALUES submenu. If there is an OPEN IMAGE (FILE menu) on the screen, and a particle has been BLOCK SELECTed (IMAGE menu), then the VALUES submenu of the ANALYSIS menu displays particle area (AREA), sum of gray values in the particle (GRAYSUM), sum of optical densities in the particle (DENSESUM), average optical density (DENSEAVG), standard deviation of optical density (DENSESTDV), least standard error threshold (THRESHOLD), average diameter of the particle (AVGDIAM), greatest diameter (MAXDIAM), least diameter (MINDIAM), elliptical eccentricity (ECCENT), center-of-gravity x-axis (XCENTER) and y-axis (YCENTER), particle contour (CONTOUR), fractal dimension (FRACTAL), and perimeter (PERIMETER).

      The AREA is the number of pixels INSIDE the particle. GRAYSUM is the sum of GRAY_VALUEs inside the particle. From each GRAY_VALUE, the OPTICAL_DENSITY for that point is calculated by the formula: OPTICAL_DENSITY=LOG10(255/(255-GRAY_VALUE)), with OPTICAL_DENSITY equal zero if GRAY_VALUE equals 255. The DENSESUM is the sum of OPTICAL_DENSITY values inside the particle. DENSEAVG equals DENSESUM/AREA, and is designated with a BLUE BAR on the HISTOGRAM. DENSESTDV is the standard deviation of OPTICAL_DENSITY values inside the particle.

      The x-axis of the HISTOGRAM is divided at all points, and a Student t pooled standard error is calculated for the left and right histograms at every point, or DIVIDER, as follows. Actually, it suffices to calculate the Student t pooled variance at each divider. For each possible divider for left and right histograms, let NL represent the number of points (i.e., the sum of the histogram-bars) on the left histogram, NR represent the number of points on the right histogram, and NC represent the number of points on the combined histogram. Then NC = NL + NR. Let x be the abscissa-value (horizontal axis) and y be the ordinate-value (vertical axis) of each bar on each histogram. Let SxL=§(xL*yL) represent the sum of the left histogram bars (where § represents summation and * represents multiplication); let QxL=§(xL*xL*yL) represent the sum of squares of the left histogram bars; let SxR and let QxR be analogously defined for the right histogram bars, and SxC and QxC be analogously defined for the combined histogram bars. Then the variance, VL, of the left histogram is:
VL = (QxL-((SxL*SxL)/NL))/(NL-1).
Let VR and VC be analogously defined. The Student t pooled variance, VP, for the left and right histograms is:
VP =(VL*(NL-1) + VR*(NR-1))/(NC-1).
Likewise, the Student t pooled standard error, EP, for the left and right histograms is:
EP = SQRT(VP/NC).
The MINIMUM POOLED VARIANCE, and therefore the MINIMUM POOLED STANDARD ERROR, is obtained at the DIVIDER, and designated with a YELLOW BAR on the HISTOGRAM. If the minimum pooled variance, VP, is divided by the combined variance, VC, then we obtain the VARIANCE RATIO, VR, where
VR = VP/VC.
The variance ratio tends toward a value of 0.38 for large samples from the normal distribution. ISAP demonstration program and Perl source code are available at URL:
http://www.medparse.com/isapver2.htm

      The MAXDIAM for the particle is the (Euclidean) distance between the two most distant edge-points. If the particle is assumed to be an ellipse, then: AREA = (pi/4) * MAXDIAM * MINDIAM, and ECCENT = MAXDIAM/MINDIAM. If the particle is assumed to be a circle, then: AREA = (pi/4) * AVGDIAM * AVGDIAM. PERIMETER is the sum of edge-points of the particle. The particle CONTOUR equals PERIMETER/sqrt(AREA). For a perfect circle, the CONTOUR assumes a minimum value of 3.54. The FRACTAL DIMENSION, s, of a particle is a quantitative measure of complexity along the particle edge. s = 1 + lim(d->0) log2((PERIMETER at 2*d)/(PERIMETER at d)), for GRIDSIZE=d, as GRIDSIZE approaches 0. ISAP(c) calculates s for GRIDSIZE=d=1 pixel.

      DATABASE menu: There are two submenus: VIEW ACTIVE DATABASE and VIEW DATABASE.

      VIEW ACTIVE DATABASE submenu. If there is an OPEN IMAGE (FILE menu) on the screen, and a particle has been BLOCK SELECTed (IMAGE menu), then the VIEW ACTIVE DATABASE submenu displays the VALUEs for all particles accepted up to this point, as follows: particle area (AREA), sum of gray values in the particle (GRAYSUM), sum of optical densities in the particle (DENSESUM), average optical density (DENSEAVG), standard deviation of optical density (DENSESTDV), least standard error divider (DIVIDER), average diameter of the particle (AVGDIAM), greatest diameter (MAXDIAM), least diameter (MINDIAM), elliptical eccentricity (ECCENT), center-of-gravity x-axis (XCENTER) and y-axis (YCENTER), particle contour (CONTOUR), fractal dimension (FRACTAL), and perimeter (PERIMETER).

      VIEW DATABASE submenu. If there is an existing DATABASE file name ending in .DBS, then the VIEW DATABASE submenu displays the VALUEs for all particles in that existing database (see ANALYSIS/VALUES).

      MISCELLANEOUS NOTES:

      1. In image analysis of individual cells, the analysis usually begins by separating the NUCLEUS from the cytoplasm and background areas, or RIM.

      2. In the image for a single cell, the nucleus has a different color or darkness compared to the rim. Typically, the nucleus is DARK and the background is LIGHT.

      3. In available public-domain software, and apparently in many commercial system, a THRESHOLD is selected, which separates light and dark areas.

      4. This threshold may be selected manually or automatically.

      5. Manual selection of threshold may result in unrepeatable, non-objective determination of results.

      FRACTAL. (See References).

      1. Studied in 19th century by F. Richardson to describe irregularity of the British and Portuguese coastlines.

      2. Popularized by B. Mandelbrot in the late 20th century.

      3. Used in movie-making to simulate complex scenery (e.g., Forest Moon of Endor in Return of the Jedi).

      4. In pathology, used to describe the edge of an irregular, 2-dimensional object, such as the surface of the colonic mucosa.

      5. In the present study, used to describe a nuclear edge.

      FRACTAL DIMENSION.

      1. Consider the perimeter of an irregular, 2-dimensional object, and an overlying measurement grid.

      2. Mark each point (o) where the perimeter intersects the measurement-grid, and trace a polygon through these points.

      3. The length of the polygon edge is no larger than the length of the actual perimeter of the irregular object.

      4. If the measurement-grid is finer, then the length-polygon-edge becomes longer.

      5. If the object is a classical (Euclidean) geometric figure, then with finer-and-finer grids, the length-polygon-edge approaches a constant.

      6. If the object is a circle, then this method of finer-and-finer grids was used by ancient mathematicians to estimate the value of pi (=3.141592...).

      7. For an indefinitely irregular (non-classical, non-Euclidean) object, the length-polygon-edge becomes indefinitely longer as the grid becomes finer.

      8. If the length-polygon-edge becomes longer AT A CONSTANT RATE, then this rate+1 (i.e., slope+1) is called the FRACTAL DIMENSION of the object.

      9. For a classical plane-geometric object, fractal dimension, s=1. For a `space-filling- edge', fractal dimension, s=2. For all other objects, 1 < s < 2.

      LIMITS OF FRACTALS IN PATHOLOGY.

      1. Grid-interval cannot exceed the size of the object-to-be-measured (i.e., nuclear diameter). 2. Grid-interval cannot be less than pixel-width. 3. Two grid-intervals determine a slope. The two grid-intervals must be far enough apart to exceed measurement errors. 4. More-than-two grid-intervals determines a slope by regression analysis. More grid-intervals are better, but they may also encroach on the limits of measurement (above).

      ISAP: IMAGE SEGMENTATION & ANALYSIS IN PATHOLOGY. 1. Written in MicroSoft Visual Basic ver. 3. Requires an IBM-PC-compatible computer ver 3.1, DOS ver. 5, VGA or super-VGA monitor, 2 Mb hard disk, plus additional hard disk for your images.

      2. Public domain source code, executable program, and one-page user manual are distributed GRATIS at this conference.

      3. You may copy and distribute ISAP freely (i.e., its use lies within the public domain). The only restriction on its use is that no one may charge any fee of any kind for ISAP. In other words, ISAP can be copied and given away for free, but it cannot be sold.

      ISAP SOFTWARE LICENSE.

      1. ISAP is copyright © 1994, by G. William Moore, Geoffrey W. Moore, Jules J. Berman, Lawrence A. Brown (hereinafter called the authors), is software for image segmentation and analysis in pathology.

      2. This Software License is the only agreement between users of ISAP and the authors.

      3. There are no implied warranties that are not written in this Software License.

      4. There are no liabilities on the authors resulting from the use or misuse of ISAP.

      5. ISAP is not a diagnostic device, and there are no claims implied or stated concerning its value.

      6. The authors are not responsible for any software errors in ISAP and are in no way obligated to correct defects in ISAP.



2. ISAP REFERENCES.

      1. Mandelbrot BB.
The Fractal Geometry of Nature.
New York: W H Freeman. 1983.

      2. Mandelbrot BB.
The Fractal Geometry of Nature. Section 38. Scaling and power laws without geometry.
San Francisco: W. H. Freeman and Company. 1977;:.

      3. Schroeder M.
Fractals, Chaos, Power Laws.
San Francisco: W. H. Freeman and Company. 1991;:35-38.

      4. Lauwerier H.
Fractals. Endlessly Repeated Geometric Figures.
Princeton, NJ: Princeton University Press. Princeton Science Library. 1991;:.

      5. Moore GW, Berman JJ, Moore GW, Brown LA.
Software for Image Segmentation and Analysis in Pathology (ISAP)
Am J Clin Pathol 102:538-539, 1994. http://www.netautopsy.org/ascpisap.htm

      6. Moore GW, Berman JJ, Moore GW, Brown LA.
Welcome to ISAP.
http://www.medparse.com/isapwlcm.htm

      7. Moore GW, Berman JJ, Moore GW, Brown LA.
ISAP Edge Detection Menu.
http://www.medparse.com/isapedge.htm

      8. Moore GW, Berman JJ, Moore GW, Brown LA.
ISAP Histogram Menu.
http://www.medparse.com/isaphist.htm

      9. Moore GW, Berman JJ, Moore GW, Brown LA.
ISAP Values Menu.
http://www.medparse.com/isapvalu.htm

      10. Moore GW, Berman JJ, Moore GW, Brown LA.
ISAP Troubleshooting Menu.
http://www.medparse.com/isaptrub.htm

      11. Moore GW, Berman JJ, Moore GW, Brown LA.
ISAP Microsoft(R) Visual Basic Source Code.
http://www.medparse.com/isapsour.htm

      12. Moore GW, Berman JJ, Moore GW, Brown LA.
ISAP Formulas.
http://www.medparse.com/isapform.htm

      13. Moore GW, Berman JJ, Moore GW, Brown LA.
ISAP copyright and licensure agreement.
http://www.medparse.com/isapcopr.htm

      14. Moore GW, Berman JJ, Moore GW, Brown LA.
ISAP demonstration program and Perl source code.
http://www.medparse.com/isapver2.htm

Last Updated: January 26, 2003, by G. William Moore, MD, PhD.