cortex.polyutils.Surface.surface_gradient¶
-
Surface.
surface_gradient
(scalars, at_verts=True)[source]¶ Gradient of a function with values scalars at each vertex on the surface. If at_verts, returns values at each vertex. Otherwise, returns values at each face.
- Parameters
- scalars1D ndarray, shape (total_verts,)
A scalar-valued function across the cortex.
- at_vertsbool, optional
If True (default), values will be returned for each vertex. Otherwise, values will be retruned for each face.
- Returns
- gradu2D ndarray, shape (total_verts,3) or (total_polys,3)
Contains the x-, y-, and z-axis gradients of the given scalars at either each vertex (if at_verts is True) or each face.