surfa.mesh.sphere.SphericalMapNearest#

class surfa.mesh.sphere.SphericalMapNearest(sphere, shape=(256, 512))#

A nearest-neighbor to map spherical surface overlays into a 2D image grid with (phi, theta) units.

Parameters
  • sphere (Mesh) – Spherical mesh to build parameterization map on.

  • shape (tuple of int) – 2D shape of the output parameterization map.

Methods

parameterize(overlay)#

Parameterize a spherical surface overlay into a 2D (phi, theta) map.

Parameters

overlay (Overlay) – Overlay to parameterize.

Returns

map – Sampled image parameterization.

Return type

Slice

sample(image)#

Sample a parameterized 2D (phi, theta) map back into a surface overlay.

Parameters

map (Slice) – 2D image parameterization.

Returns

sampled – Overlay sampled from the parameterization.

Return type

Overlay