The Use of Image Analysis to Quantify Damage to a Snail Shell

Albert Lilly, Ph.D.
Alabama School of Mathematics and Science
1255 Dauphin St., Mobile, AL 36604
e-mail: lilly@olympus.asms.state.k12.al.us
phone: (334) 441-2168
fax: (334) 433-0113

Thomas Fink, Ph.D.
Alabama School of Mathematics and Science
1255 Dauphin St., Mobile, AL 36604
phone: (334) 441-2165
fax: (334) 433-0113
Abstract:
With the proliferation of WWW sites, computational scientists have the opportunity to download images and analyze them. For example, it is possible to acquire the image of a snail (Neritina usnea) whose shell has been damaged. Certain techniques are used to compute the percent of damage. These same techniques are also necessary for more complex projects such as the analysis of stellar images.

Different software packages are used to accommodate the platform purchased at a particular school. In particular, the JAVA language is used to insure compatibility between UNIX , Windows and MacIntosh O/S. In order to increase the efficiency of the application, FORTRAN can be used to speed up processing of the data. Since FORTRAN is widely used in supercomputing, a side benefit is that students learn some FORTRAN while doing image analysis.

Keywords:
bitmap, damage, image analysis, JAVA, Neritina usnea, shell, snail

Introduction

The analysis of scientific images is a technique that offers many avenues for research in several fields of study. The proliferation of images on the Internet and the decline in prices of technology make this analysis affordable in many classrooms.

A simple example involves the analysis of the damage to a Neritina usnea shell. The question posed is: What percentage of the shell is damaged at a given point in time? By performing the analysis at various times, a rate of damage could be calculated. When proposals are made to retard the damage, the same techniques can be used to evaluate the effectiveness of the retardation procedures.

It is worth noting that many types of image analysis are extremely tedious if attempted by hand. Computers allow for a much faster, motivating and engaging method. A side benefit is that students learn to use a computer in a practical way and even learn some FORTRAN which is a language widely used in supercomputing [2]. Also, the techniques presented are needed for more complex projects such as the analysis of stellar images [3]. The JAVA language is used to insure compatibility between platforms [1].

Methods

In trying to analyze the amount of damage done to the Neritina usnea shell, certain steps were taken. These steps are not particular just to the problem of quantifying snail damage but are applicable to a wide variety of scientific studies. The steps are as follows:
  1. Choose the number of different colors in the palette used to display an image.
  2. Decide what the colors mean in terms of the scientific objective.
  3. Adjust the colors to fit the objective.
  4. Identify each color by a number.
  5. Perform the analysis.

MacPaint or NIH imaging software can be used to adjust the image on a MacIntosh. Similar procedures for a PC are explained below. The number of different colors for an image on a PC can be 16 (24), 256 (162), 65,536 (2562), or 16,777,216 (65,536 X 256). The maximum number of 16,777,216 colors is sometimes called 24 bit color because 224 = 16,777,216. The PC video card must support the number of colors chosen. In doing a wide variety of studies, 256 colors seems adequate for most projects. This is particularly true since many different color palettes are available. The color palette is nothing more than the one-to-one assignment of colors to numbers. Each color can be identified by exactly one number and each number represents a unique color. In the case of 256 colors, the number range is from 0 to 255.

The number of colors in an image can be adjusted by first converting the file to BMP format. A viewer commonly used with Netscape called LVIEW can be used to convert a file from either GIF or JPEG format to BMP. Once the file is in BMP format, it can be read by the Paintbrush program which is a part of the Windows operating system. Once in Paintbrush, the file can be saved according to different options that control the number of colors as shown below in Figure 1:

Figure 1. Windows bitmap options for saving a graphics file.

In any scientific investigation involving images, the colors must have a meaning according to a chosen scientific objective. In the case of a damaged Neritina usnea shell, the objective might be to measure the percentage of the shell that is damaged. In this simple case, the background of the Neritina usnea shell and the damaged areas of the shell are clearly identifiable to the human eye as shown below in Figure 2.

Figure 2. Picture showing damage to a Neritina usnea shell.

Even though the areas are identifiable to the human eye, a computer cannot necessarily distinguish the areas. The simplest method for distinguishing the colors on a computer is to use a program that converts the color for each pixel to a number. As long the colors/numbers differ for areas that need to be distinguished, an algorithm that counts colors/numbers will work. Unfortunately, in the example of the Neritina usnea shell and in many other examples, the meaning of the colors cannot be distinguished by just the number. For example, in the image above, white and near white colors appear in both the background and on the damaged areas of the shell. An algorithm that counted the number of white and near white pixels would not work because there would be no way to distinguish the white pixels in the background from the white pixels in the damaged areas.

A simple solution to the problem is to use Paintbrush to color the important areas with identifiable colors. For example, the background might be colored yellow, the Neritina usnea shell a very dark color and the damaged areas painted blue. The colorized version of the image is shown below in Figure 3:

Figure 3. Colorized version of the damaged Neritina usnea shell.

The colors in the image above were assigned the following numbers according to a FORTRAN program: blue = 3, dark = 36, and yellow = 252. The pixel resolution used was 640 columns by 480 rows. Therefore, the image contained 307,200 pixels (640 * 480 = 307,200). Of those 104,857 were yellow leaving 202,343 pixels (307,200 - 104,857 = 202,343) for the shell and the damage. Of the 202,343 pixels, 25,982 were in the damaged areas. Therefore, 12.8% of the shell shown by the image was determined to be damaged (25,982 / 202,343 = 12.8%).

A pictorial analysis is shown below in Figure 4 using a JAVA applet. The size of the image was adjusted to one tenth the normal size in order to speed up processing. The image contains 3,072 pixels (64 * 48 = 3,072). The bar chart in the middle shows the relative amounts of the background (yellow--34%), the undamaged area of the shell (dark--57%), and the damaged area of the shell (blue--8%). The sum of the percentages add to 99% due to rounding. The calculated percentage of damage to the shell is again approximately 12% (8%/(8%+57%))=(damaged area/(damaged area + undamaged area)). Click here to run the applet with a JAVA compatible browser.

Figure 4. Analysis of resized image using a JAVA applet.

Another strategy for speeding up the processing using JAVA is to split the JAVA applet into two applets. The first applet could store the pixel values into a data file. FORTRAN could then be used to perform the analysis. The second applet could be used to read the results of the FORTRAN program and create a visual display.

Conclusion

The colors and the positions of the colors of any given image define its unique makeup. The colors that have a bearing on the scientific investigation being pursued must be identified. If one color is representative of more that one aspect of the image, the colors in the image can be manipulated so that each aspect has a unique color. Once the important aspects are easily identifiable, the image can be analyzed.

The example of the snail (Neritina usnea) was used to show a simple application of the analysis of an image by measuring the percent of damage to the shell at a given point in time. The techniques used are not particular to the example given but are important in a wide variety of applications.


References

 [1] Cornell, Gary and Cay S. Horstmann, Core JAVA, Upper Saddle River, N.J.: SunSoft Press, 1996.

 [2] Levesque, John M. and Joel W. Williamson, A Guide to Fortran on Supercomputers, New York: Academic Press, 1989.

 [3] Parker, J. R., Practical Computer Vision Using C, New York: John Wiley & Sons, 1994.