mirror_trajectory: Reflect trajectories

Description Usage Arguments Examples

Description

Flip all trajectories 'en bloc' along the vertical or horizontal axis.

Usage

1

Arguments

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.

Examples

 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")
}

MaxLev/CloseEnough documentation built on May 9, 2019, 2:19 a.m.