brainspace.mesh.array_operations.map_pointdata_to_celldata

brainspace.mesh.array_operations.map_pointdata_to_celldata(surf, point_data, red_func='mean', dtype=None, append=False, key=None)[source]

Map point data to cell data.

Parameters:
  • surf (vtkPolyData or BSPolyData) – Input surface.
  • point_data (str, 1D ndarray) – Array with point data. If str, it is in the point data attributes of surf. If ndarray, use this array as point data.
  • red_func ({'sum', 'mean', 'mode', 'min', 'max'} or callable, optional) – Function used to compute data of each cell from data of its points. Default is ‘mean’.
  • dtype (dtype, optional) – Data type of new array. If None, use the same data type of point data array. Default is None.
  • append (bool, optional) – If True, append array to cell 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 cell data attributes. Only used if append == True. Default is None.
Returns:

output (vtkPolyData, BSPolyData or ndarray) – Return ndarray if append == False. Otherwise, return input surface with the new array.