brainspace.mesh.array_operations.map_celldata_to_pointdata

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

Map cell data to point data.

Parameters:
  • surf (vtkPolyData or BSPolyData) – Input surface.
  • cell_data (str, 1D ndarray) – Array with cell data. If str, it must be in cell data attributes of surf.
  • red_func (str or callable, optional.) – Function used to compute point data from data of neighboring cells. If str, options are {‘sum’, ‘mean’, ‘mode’, ‘one_third’, ‘min’, ‘max’}. Default is ‘mean’.
  • dtype (dtype, optional) – Data type of new array. If None, use the same data type of cell data array. Default is None.
  • 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 None.
Returns:

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