Automated Gait Analysis Through Hues and Areas (AGATHA)

HK Heidi E. Kloefkorn
TP Travis R. Pettengill
ST Sara M. F. Turner
KS Kristi A. Streeter
EG Elisa J. Gonzalez-Rothi
DF David D. Fuller
KA Kyle D. Allen
request Request a Protocol
ask Ask a question
Favorite

A custom MATLAB code, named Automated Gait Analysis Through Hues and Areas (AGATHA), was created to identify the time and positional coordinates of foot-strike and toe-off events in videos of walking rodents. This code is available for free download at https://github.com/OrthoBME/AGATHA. With these time and position coordinates identified, AGATHA then calculates several spatiotemporal gait parameters explained in detail below.

AGATHA first isolates the sagittal view of the animal and locates the silhouette of the animal in each frame of the video (Figure 1a). This is achieved by subtracting a background image where the animal is not present in the arena, transforming the frame into a HSV (Hues, Saturation, Value) image, and using the hue value to convert the HSV image into a binomial silhouette (Figure 1b). Next, AGATHA locates the row of pixels representing the interface between the rat and the floor. In the binomial silhouette, the single row of pixels representing the floor interface is composed of background pixels (indicated by a value of 0, black) and rat contact points with the floor (indicated by a value of 1, white)(Figure 1c). Because a walking rat always has at least two limbs in ground contact during locomotion, this interface can be identified in every frame as the lowest row of repeated pixels in the binomial silhouette; however, please note that AGATHA may not accurately locate the rat-floor interface if the animal moves with a gait pattern containing a completely aerial phase (running trot or bounding). Second, AGATHA excludes the majority of nose and tail contacts with the floor from the analysis by comparing the contact point (white pixels) to the animal’s center of area in the sagittal view, eliminating contacts that are proportionally too far from the center of area to be considered a paw strike.

a) Original video frame. b) The transformed image frame in which the animal is isolated and shows as white, while the background is negated and shows as black. c) Graphical representation of the row of pixels identified as the floor in the transformed image. Within this row of pixels, portions of the animal in contact with the floor show up as white. d) Consecutive pixel rows representing the floor are stacked and the paw print objects can be represented 2-dimensionally for calculation of foot-strike and toe-off. Red shapes identify foot-strike and blue shapes represent toe-off. Triangles are used for fore-limbs and circles are used for hind-limbs.

By stacking the rat/floor interface across multiple frames, foot contact with the ground can be visualized over time (Figure 1d). AGATHA uses these stacked pixel rows of the rat-floor interface to determine the earliest frame associated with the paw entering the rat-floor interface (foot-strike) and last frame associated with the paw leaving the rat-floor interface pixel row (toe-off). Within the paw contact object seen in Figure 1d, foot-strike is defined as the earliest frame of the paw contact object (blue triangles and circles), while the toe-off is defined as the latest frame of the paw contact object (red triangles and circles). These temporal events can then be used to calculate temporal symmetry of the hind limbs (the percentage of the gait cycle representing when the right foot-strike occurs between two sequential left foot-strikes), duty factor (the percentage of the gait cycle that the limb is in contact with the ground) of the hind limbs, duty factor of the fore limbs, duty factor imbalance of the hind limb (left hind limb duty factor minus right hind limb duty factor), step frequency, and limb phase between the fore and hind limbs (variables explained in detail later in the manuscript). In this manuscript, data analysis is focused solely on the hind limb parameters.

In addition to the frame associated with foot-strike and toe-off, the sagittal image provides an estimation of the spatial foot-strike location along the axis of travel (Figure 2a). Using this approximate location, the precise spatial location of foot-strike can be determined in the ventral view of the animal (Figure 2b). To achieve this for white rodents, each paw print is evaluated on a frame just after foot-strike and on a second frame just prior to toe-off. In these two images, the pixels representing paw contact with the ground remain nearly constant while other pixels change, allowing the paw print to be isolated using iterative color thresholds that examine pixel change between the two video frames (Figure 2c). The centroid of the paw print is then identified and used to represent the paw’s spatial location during stance (Figure 2d). These spatial events are used to calculate stride length, step widths, and step length symmetry. In addition, the centroid of the rat in the ventral view is determined for every frame and used to calculate velocity.

a) Original video frame. b) AGATHA’s isolated paw image from the ventral view. c) AGATHA’s filtered representation of the paw print. d) A sequence of hind paw prints from a full trial.

As with any automated digitization package, AGATHA has limitations. To ensure accurate animal visualization at high video collection speeds, the arena should be well lit to provide contrast between the animal and background. Insufficient lighting may result in poor animal silhouette identification and affect accuracy of spatiotemporal gait measures. Furthermore, the camera should be level and at the height of the floor. Incorrect camera position can block the visualization of the animal’s feet or pick up reflection artifacts from the floor; this can result in incorrect identification of the rat-floor interface. To a certain degree, AGATHA can compensate for a range of lighting and camera conditions, but the quality of data calculated will ultimately suffer if recording conditions are poor.

In total, AGATHA calculates and exports the following gait variables: trial velocity, temporal symmetry of the hind limbs (when in time a right foot-strike occurs relative to two left foot-strikes), duty factor of the hind limbs, duty factor of the fore limbs, duty factor imbalance of the hind limb, stride length, hind limb step width, step frequency, limb phase between the fore and hind limbs, and number of steps in the video20,21. These parameters are based on the classic Hildebrand gait diagram to describe quadrupedal gait sequences1921. While AGATHA is able to acquire fore limb data, we have elected to compare AGATHA to manual digitization using only hind limbs; this was selected to reduce the cost and time of manual digitization.

Do you have any questions about this protocol?

Post your question to gather feedback from the community. We will also invite the authors of this article to respond.

0/150

tip Tips for asking effective questions

+ Description

Write a detailed description. Include all information that will help others answer your question including experimental processes, conditions, and relevant images.

post Post a Question
0 Q&A