Description Usage Arguments Details Value References See Also Examples
Compute the angle between the first step of a track and a reference plane. Useful to detect directed movement and/or tracking artefacts.
1 2 3 4 5 6 7 8 9 
x 
a single input track; a matrix whose first column is time and whose remaining columns are a spatial coordinate. 
p1, p2, p3 
numeric vectors of coordinates of three points specifying a reference plane to compute distances to. 
from 
index, or vector of indices, of the first row of the track. If

xdiff 
row differences of x. 
degrees 
logical; should angles be returned in degrees rather than radians? (default = TRUE). 
The average angle of steps to a reference plane should be roughly 32.7 degrees. Lower angles to the border planes of an imaging volume can be indicative of tracking artefacts, and systematic deviations from 32.7 can indicate a directional bias (Beltman et al, 2009).
A single angle.
Joost B. Beltman, Athanasius F.M. Maree and Rob. J. de Boer (2009), Analysing immune cell migration. Nature Reviews Immunology 9, 789–798. doi:10.1038/nri2638
distanceToPlane
to compute the distance to the reference plane, and
AngleAnalysis
for other methods to compute angles and distances.
1 2 3 4 5 6 7 8 9 10 11  ## Plotting the angle versus the distance to a reference plane can be informative to
## detect tracking artefacts near the border of the imaging volume.
## We should be suspicious especially when small angles are more frequent at low distances
## to the border planes.
steps < subtracks( TCells, 1 )
minz < boundingBox( TCells )["min","z"]
## Compute angles and distances to the lower plane in zdimension
angles < sapply( steps, angleToPlane, p1 = c(0,0,minz), p2 = c(1,0,minz), p3 = c(0,1,minz) )
distances < sapply( steps, distanceToPlane, p1 = c(0,0,minz), p2 = c(1,0,minz), p3 = c(0,1,minz) )
scatter.smooth( distances, angles )
abline( h = 32.7, col = "red" )

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.