semeiotica
evolutionary design ecology

Archive for March 17, 2008

Measuring Behavior

This is actually a really old post from when I was doing my master’s work in host-parasite biology. Nonetheless, it turns out that I’m revisiting it in preparation for an upcoming project.

Behavioral differences between the sexes may explain sexually dimorphic patterns of infection. The risk of infection may be one such factor that an analysis of movement paths can predict. For example, if males spent more time than females foraging for food and, as a result, passively ingest more parasites while doing so, then their risk for infection would generally be greater than females. The tortuosity (or crookedness) of movement paths between the sexes were compared to see if any differences in movement (e.g. foraging) could suggest an explanation for male-biased infection. These differences may suggest that males and females experience their environment at different scales.

Image Analysis

The first thing that needs to be done is to plot the movement of the snails. This can be done by hand, but time-lapse digital photography can help to automate the process. The easiest way to do this was to set up a tripod with the camera pointed down. A white container was used to hold the snails and create the highest contrast background for the photography. Pay attention to the reflection of your light source on the surface between the subject and camera (in this case, water and plastic container). A picture was taken approximately every minute, and to make things simple for the analysis program, I used only two snails per trial- one female and one male. Once I had a stack of pictures (over the course of an hour or two), I loaded them into the image analysis program.

ImageJ is the java implementation of an image analysis program developed by the National Institutes of Health. ImageJ allows you to track the movements of individuals on the screen and outputs a list of XY coordinates for each subject. The first thing that had to be done though was to import the images as a greyscale stack. Once that was done, I cropped out the uninteresting parts of the frame to show only the subject of interest. Further processing was needed to create a binary (black/white) image source for the analysis. Using Process>Subtract Background, I created more contrast with the subject and background. Finally, using the Process>Binary>Threshold, I was able to make the stack be completely composed of black and white images with no greytones inbetween. This is crucial if the analysis algorithm is going to separate the subject from the background. Some parameters may need adjusting for optimal results, but it usually works without too much toying. The final step in ImageJ is to apply the Plugin “Tracker”. This plugin tracks the subject(s) on the screen and outputs a datafile with the coordinates of the movement path. These can then be saved into a text file for later use. I used only two individuals per trial because Tracker is limited to only two subjects. A plugin called MultiTracker is available, but I found it difficult to keep it focused on both individuals. When individuals overlap in space MultiTracker assigns both sets of coordinates to a single individual.

Movie 1. Male and female movement played back after image processing and before tracking analysis.

 


Measuring the Fractal Dimension of the Paths

I found a great program for measuring the fractal dimension (D) of the snail movement paths. This measurement is thought to measure the scale at which an organism percieves its landscape. Differences in D for different populations would suggest that the populations utilize their landscape differently- perhaps as a result of their perception. The program for measuring D is called Fractal (Nams 2003), and it allows you to import the XY coordinates (after you pare them down to the basic data in excel or something like it). It also allows you to do this as a batch process, making large datasets more manageable. Fractal will give you D for your sample along with confidence intervals. I used a paired-sample t-test in my final analysis. It turned out to be important that I paired similar individuals in the trials; the results did indicate a positive relationship between D and body length. Luckily, I put males and females of the same size in each trial. You’ll have to look into the guidelines for using Fractal yourself if you are going to take a stab at it, but the descriptions are pretty easy to follow. With a bit of doing, it shouldn’t pose a problem to measure these types of behaviors yourself.

A comparison of movement paths for a male and female in maps generated by Fractal.


 

Selected Bibliography

Bascompte, J., C. Vila. 1997. Fractals and search paths in mammals. Landscape Ecology 12:213-221.

Dicke, M., P. A. Burrough. 1988. Using fractal dimensions for characterizing tortuosity of animal trails. Physiological Entomology 13:393-398.

Escos, J. M., C. L. Alados, J. M. Emlen. 1995. Fractal structures and fractal functions as disease indicators. Oikos 74:310-314.

Nams, V. O. 1996. The VFractal: a new estimator for fractal dimension of animal movement paths. Landscape Ecology 11:289-297.

Nams, V. O. 2001. Using animal movement paths to measure response to spatial scale. submitted.

Turchin, P. 1996. Fractal analyses of animal movement: A critique. Ecology 77:2086-2090.

With, K. A. 1994. Using fractal analysis to assess how species percieve landscape structure. Landscape Ecology 9:25-36.