visualization.spatial_annotator

Methods for adding spatial annotations to visualizations.

Functions

add_fiber_annotation_agents(traj_data, ...)

Add agent data for fiber annotations.

add_sphere_annotation_agents(traj_data, ...)

Add agent data for sphere annotations.

add_fiber_annotation_agents(traj_data: TrajectoryData, fiber_points: list[list[ndarray]], type_name: str = 'fiber', fiber_width: float = 0.5, color: str = '#eaeaea') TrajectoryData[source]

Add agent data for fiber annotations.

Parameters:
  • traj_data – Trajectory data to add the fibers to.

  • fiber_points – List of lists of arrays (shape = n x 3) containing the x,y,z positions of control points for each fiber at each time.

  • type_name – Agent type name to use for the new fibers.

  • fiber_width – Width to draw the fibers.

  • color – Color for the new fibers.

Returns:

Updated trajectory data.

add_sphere_annotation_agents(traj_data: TrajectoryData, sphere_positions: list[ndarray], type_name: str = 'sphere', radius: float = 1.0, rainbow_colors: bool = False, color: str = '#eaeaea') TrajectoryData[source]

Add agent data for sphere annotations.

Parameters:
  • traj_data – Trajectory data to add the spheres to.

  • sphere_positions – List of x,y,z positions of spheres to visualize at each time.

  • type_name – Agent type name to use for the new spheres.

  • radius – Radius to draw the spheres

  • rainbow_colors – True to color new spheres in rainbow order, False otherwise.

  • color – Color for the new fibers (if rainbow_colors is False).

Returns:

Updated trajectory data.