Title: MATLAB Mandible Tracing
1MATLAB Mandible Tracing Calculations Program
- Documentation by Antonis Vakis
- Supplemental Material for
- PHYLOGENY, SCALING, AND THE GENERATION OF EXTREME
FORCES IN TRAP-JAW ANTS - JOSEPH C. SPAGNA, ANTONIS I. VAKIS, CHRIS A.
SCHMIDT, SHEILA N. PATEK, - XUDONG ZHANG, and ANDREW V. SUAREZ
2The images, within their original folders (e.g.
093004as4), need to be placed in a directory
called 'Images,' located in the current working
directory
So far, all captures have been saved as
sequential TIFF files
First, run the tracing program
3The folder name is saved as a parameter called
filename
4Specify the number of frames per second (fps)
5Specify the width of video in pixels (width)
6Specify the height of video in pixels (height)
7Specify the image resolution in dots per inch
(dpi)
8Viewing the image thumbnails, select the range of
images over which the full motion of the
mandibles is captured
9Viewing the image thumbnails, select the range of
images over which the full motion of the
mandibles is captured
10Viewing the image thumbnails, select the range of
images over which the full motion of the
mandibles is captured
11Specify whether the strike involves both or just
one of the mandibles
12First, select the approximate location of the
mandible base
13Then, sequentially select the left and right
mandible tips over the selected frames of interest
14Then, sequentially select the left and right
mandible tips over the selected frames of interest
15Then, sequentially select the left and right
mandible tips over the selected frames of interest
16Then, sequentially select the left and right
mandible tips over the selected frames of interest
17Then, sequentially select the left and right
mandible tips over the selected frames of interest
18Then, sequentially select the left and right
mandible tips over the selected frames of interest
19Then, sequentially select the left and right
mandible tips over the selected frames of interest
20Then, sequentially select the left and right
mandible tips over the selected frames of interest
21Then, sequentially select the left and right
mandible tips over the selected frames of interest
22Then, sequentially select the left and right
mandible tips over the selected frames of interest
23Then, sequentially select the left and right
mandible tips over the selected frames of interest
24Then, sequentially select the left and right
mandible tips over the selected frames of interest
25Then, sequentially select the left and right
mandible tips over the selected frames of interest
26Then, sequentially select the left and right
mandible tips over the selected frames of interest
27Then, sequentially select the left and right
mandible tips over the selected frames of interest
28Then, sequentially select the left and right
mandible tips over the selected frames of interest
29Then, sequentially select the left and right
mandible tips over the selected frames of interest
30Then, sequentially select the left and right
mandible tips over the selected frames of interest
31Then, sequentially select the left and right
mandible tips over the selected frames of interest
32Then, sequentially select the left and right
mandible tips over the selected frames of interest
33Finally, reselect the approximate location of the
mandible base an average mandible position will
be used for the calculations
34In the case where it is unknown, the
magnification can be calculated from the average
recorded mandible length for each species
Magnification parameter zoom Default value 10x
35Finally, run the calculations program
The name of the folder must be specified this is
the same name as the .mat file to be used
36Calculations Rcrude
Mandible base, A (x1, y1)
Rcrude
Closed position B (x2, y2)
37Calculations Grid
- Select number of grid points/ possible positions
of centers of rotation - e.g. 40 intervals, 41 x 41 1,681 grid points
- Create grid centered around the calculated
mandible base location - cor_values_min_x base_coords(1,1) Rcrude
- cor_values_max_x base_coords(1,1) Rcrude
- cor_values_min_y base_coords(1,2) Rcrude
- cor_values_max_y base_coords(1,2) Rcrude
38Calculations Grid
- Create a matrix with grid coordinates using
values calculated for the minima and maxima in
the x and y directions, as well as the interval - Reshape the resulting 41 x 41 x 2 matrix to a
matrix of size 1681 x 2 (cor_values matrix)
39Calculations Rvalues
- Having established the number of iterations for
the left and right centers of rotation locations,
specify the number of iterations for each
mandible radius (values, e.g. 200) - Specify
- Rmin Rcrude Rcrude/2 (50 smaller)
- Rmax Rcrude Rcrude/2 (50 larger)
- Rvalues linspace(Rmin,Rmax,values)
40Calculations Iterations
- Using nested for loops, iterate the values of x,
y and R for the left and right mandibles - for of possible radius values (values) (p)
- for of elements (41 x 41 1,681) (k)
- for of frames (e.g. 8) (i)
- to get the RMS_error for each mandible
41Calculations RMSerror
- The RMS (Root Mean Square) error is calculated
from the formula - where radius is defined as
- and 3 is the number of free parameters (x, y, R)
for each mandible - Methodology of circle fitting using RMS error
adapted from Amara Graps of Stanford Universitys
Solar Oscillation Investigations
(http//www.mathcom.com/corpdir/techinfo.mdir/scif
aq/q230.html)
42Calculations Minimum RMSerror
- The resulting matrices of the left and right
mandible RMS_error values are reshaped into two
new matrices of size 336,200 x 1, where 336,200
41 x 41 x 200 - Using a simple algorithm (min command), the
minimum values of the RMS_error are found
(RMSleft_min RMSright_min) - These are used to extract the values of x, y and
R where the error is minimum for each mandible
43Calculations RMSerror plots
44Calculations Radii c.o.r.
45Calculations ? and a
- To calculate the angular velocities and
accelerations use the following formulae, based
on the difference of the slopes in each frame - ?(i) atan coords(i,2) x0y0(1,2)
- coords(i,1) x0y0(1,1)
- ?(i) ?(i1) ?(i)fps (rad/s)
- a(j) ?(j1) ?(j)fps (rad/s/s)
- where ?(i) is the slope of each frame, ?(i) is
the ang. velocity, a(j) is the ang. acceleration,
and fps are the frames per sec. For n frames,
there are n-1 velocity and n-2 acceleration values
46Calculations u and a
- In order to convert the angular velocities and
accelerations into their linear counterparts, the
radius of each mandible is needed in meters - Rnew (R/ dpi/ zoom)0.0254 (m)
- Then, the linear velocities and accelerations
are - u(i) ?(i)Rnew (m/s)
- a(j) a(j)Rnew (m/s/s)
47Calculations Velocity Plots
48Calculations Acceleration Plots
49Output of Calculations Program