Description Usage Arguments Examples
Flip all trajectories 'en bloc' along the vertical or horizontal axis.
1 | mirror_trajectory(object, axis)
|
object |
An object of class 'Traj' |
axis |
If 'x', trajectories are flipped along the horizontal axis. If 'y' they are flipped along the vertical axis. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | data(cellmask)
data(trajectory)
mirroredtraj <- mirror_trajectory(trajectory, "x")
## Display image (first frame only)
EBImage::display(cellmask, method = "raster")
## Overlay trajectories in black
ntraj = nlevels(trajectory["trajectory"])
for (i in 1:ntraj) {
traj_i <- subset(trajectory["data"], trajectory == i)
lines(traj_i$x, traj_i$y, type="l", col = "black")
}
## Overlay mirrored trajectories in blue
nmirroredtraj = nlevels(mirroredtraj["trajectory"])
for (i in 1:nmirroredtraj) {
traj_i <- subset(mirroredtraj["data"], trajectory == i)
lines(traj_i$x, traj_i$y, type="l", col = "blue")
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.