brainstat.mesh.interpolate.ribbon_interpolation

brainstat.mesh.interpolate.ribbon_interpolation(pial_mesh, wm_mesh, labels, nii, points, interpolation='nearest')[source]

Performs label interpolation in the cortical ribbon.

Parameters
  • pial_mesh (BSPolyData) – Pial mesh.

  • wm_mesh (BSPolydata) – White matter mesh.

  • labels (str, numpy.ndarray) – Filename of a .label.gii or .shape.gii file, or a numpy array containing the labels.

  • nii (Nibabel nifti) – Reference nifti image.

  • points (numpy.array) – Numpy array containing the coordinates of the ribbon.

  • interpolation (str, optional) – Interpolation method. Can be either ‘nearest’ or ‘linear’.

Returns

numpy.ndarray – Interpolated value for each input point.

Notes

Strictly, this function will work outside the cortical ribbon too and assign any point to its label on the nearest mesh. An adventurous user could use this for nearest neighbour surface to volume anywhere in the brain, although such usage is not offically supported.