brainspace.mesh.array_operations.compute_point_area¶
-
brainspace.mesh.array_operations.
compute_point_area
(surf, cell_area=None, area_as='one_third', append=False, key='point_area')[source]¶ Compute point area from its adjacent cells.
Parameters: - surf (vtkPolyData or BSPolyData) – Input surface.
- cell_area (str, 1D ndarray or None, optional) – Array with cell areas. If str, it must be in the cell data attributes of surf. If None, cell areas are computed first. Default is None.
- area_as ({'one_third', 'sum', 'mean'}, optional) – Compute point area as ‘one_third’, ‘sum’ or ‘mean’ of adjacent cells. Default is ‘one_third’.
- append (bool, optional) – If True, append array to point data attributes of input surface and return surface. Otherwise, only return array. Default is False.
- key (str, optional) – Array name to append to surface’s point data attributes. Only used if
append == True
. Default is ‘point_area’.
Returns: output (vtkPolyData, BSPolyData or ndarray) – 1D array with point area. Return ndarray if
append == False
. Otherwise, return input surface with the new array.