neurom.view.common.project_cylinder_onto_2d

neurom.view.common.project_cylinder_onto_2d(ax, plane, start, end, start_radius, end_radius, color='black', alpha=1.0)[source]

take cylinder defined by start/end, and project it onto the plane

Parameters:
  • ax – matplotlib axes
  • plane (tuple of int) – where x, y, z = 0, 1, 2, so (0, 1) is the xy axis
  • start (np.array) – start coordinates
  • end (np.array) – end coordinates
  • start_radius (float) – start radius
  • end_radius (float) – end radius
  • color – matplotlib color
  • alpha (float) – alpha value

Note: There are probably more efficient ways of doing this: here the 3d outline is calculated, the non-used plane coordinates are dropped, a tight convex hull is found, and that is used for a filled polygon