brainspace.mesh.mesh_operations.downsample_with_parcellation

brainspace.mesh.mesh_operations.downsample_with_parcellation(surf, labeling, name='parcel')[source]

Downsample surface according to labeling.

Such that, each parcel centroid is used as a point in the new downsampled surface. Connectivity is based on neighboring parcels.

Parameters:
  • surf (vtkPolyData or BSPolyData) – Input surface.
  • labeling (str or 1D ndarray) – Array of labels used to perform the downsampling. If str, it must be an array in the PointData attributes of surf.
  • name (str, optional) – Name of the downsampled parcellation appended to the PointData of the new surface. Default is ‘parcel’.
Returns:

res (BSPolyData) – Downsampled surface.