The function calculates per-frame overlap between two trajectories. Besides the region overlap the function also returns cointainment of the second trajectory in the first and containment of the first trajectory in the second.
If the trajectories are not of equal length, then the overlaps are calculated up to the end of the shorter one.
Input:
T1 (cell): The first trajectory.
T2 (cell): The second trajectory.
bounds (vector): An optional bounds of valid region where the overlap is calculated.
Output:
overlap: A vector of per-frame overlaps.
only1: A vector of per-frame containment of the second trajectory in the first.
only2: A vector of per-frame containment of the first trajectory in the second.