Support files with different poses lengths
When there are entities with different poses lengths in a file, the trackviewer exits with an error currently. Fish with shorter trajectories should not be shown after their trajectory ended instead.
This part from python/src/robofish/trackviewer/common.py
could be modified to use self.entity_poses, which already automatically fills non existent poses with nans.
self.__entity_poses = {}
for entity in self.entities:
self.__entity_poses[entity.name] = entity.poses
assert len(np.unique([p.shape for p in self.__entity_poses.values()], axis=0)) == 1, "All poses must have the same shape"
assert len(self.__entity_poses) >= 1, "At least one pose required"
self.num_frames = list(self.__entity_poses.values())[0].shape[0]
def frame(self, entity_name, frame_index):
return self.__entity_poses[entity_name][frame_index]