Beispiel #1
0
    def setUp(self):
        """
        There are 3 trajectories of 4 frames each, each going along a separate
        axis.
        """
        tmpl = "tests/testing_fodder/three_trajects_simple.h5"
        self.scene = Scene(tmpl)

        # ptv_is files are in [mm], [mm/s], etc.
        correct_pos = np.r_[0.1, 0.2, 0.3, 0.5] / 1000.
        correct_vel = np.r_[0.1, 0.1, 0.2, 0.] / 1000.
        correct_accel = np.r_[0., 0.1, 0., 0.] / 1000.
        t = np.r_[1:5] + 10000

        self.correct = []
        for axis in [0, 1, 2]:
            pos = np.zeros((4, 3))
            pos[:, axis] = correct_pos

            vel = np.zeros((4, 3))
            vel[:, axis] = correct_vel

            accel = np.zeros((4, 3))
            accel[:, axis] = correct_accel

            self.correct.append(
                Trajectory(pos, vel, t, len(self.correct), accel=accel))
Created on Wed Feb 22 12:08:02 2017

@author: yosef, based on attempt by lillyverso
"""

import itertools as it, numpy as np
import matplotlib.pyplot as plt

from flowtracks.scene import Scene
from flowtracks.trajectory import Trajectory

# Unpack the param
inName = 'data/ptv_scene16_testYosef/lillys_particles.h5'
frate = 100
scn = Scene(inName)
# Can limit the frame range but not a must:
# scn.set_frame_range((param.first, param.last))

## Hitao linking criteria -----------------------------------------------------
#distThresh=0.005;
#maxDt=1;
#minLength=3;

distThresh = 0.003
maxDt = 0.025
minLength = 3
# length of elemnts in the trajs

# Though this won't be necessary if you don't save the short ones at all in the
# HDF conversion.