medusa.render.overlay#

Module Contents#

class medusa.render.overlay.Overlay(v, cmap='bwr', vmin=None, vmax=None, vcenter=None, dim='normals', v0=None, tris=None, norm=TwoSlopeNorm)[source]#

Class for creating color “overlays” to be rendered as vertex colors of a mesh.

Parameters:
  • v (torch.Tensor) – The values to be mapped to colors

  • vmin (float, optional) – The minimum value of the colormap (default: minimum of v)

  • vmax (float, optional) – The maximum value of the colormap (default: maximum of v)

  • vcenter (float, optional) – The center value of the colormap (default: mean of v)

  • dim (int or str) – If int (0, 1, 2), dimension to be visualized; if ‘normals’, the values are projected on the vertex normals

  • v0 (torch.Tensor, optional) – If dim=’normals’, v0 represents the mesh from which the normals are computed

  • tris (torch.Tensor, optional) – If dim=’normals’, tris represents the triangles from which the normals are computed

  • norm (matplotlib.colors.Normalize, optional) – Normalization class (default: TwoSlopeNorm)

to_rgb()[source]#

Returns the RGB colors for the overlay.

Returns:

colors – RGB colors (N x V x 3)

Return type:

torch.Tensor