brainstat.mesh.interpolate.multi_surface_to_volume

brainstat.mesh.interpolate.multi_surface_to_volume(pial, white, volume_template, output_file, labels, interpolation='nearest')[source]

Interpolates multiple surfaces to the volume.

Parameters
  • pial (str, BSPolyData, list, tuple) – Path of a pial surface file, BSPolyData of a pial surface or a list containing multiple of the aforementioned.

  • white (str, BSPolyData, list, tuple) – Path of a white matter surface file, BSPolyData of a pial surface or a list containing multiple of the aforementioned.

  • volume_template (str, nibabel.nifti1.Nifti1Image) – Path to a nifti file to use as a template for the surface to volume procedure, or a loaded NIfTI image.

  • output_file (str) – Path to the output file, must end in .nii or .nii.gz.

  • labels (str, numpy.ndarray, list, tuple) – Path to a label file for the surfaces, numpy array containing the labels, or a list containing multiple of the aforementioned.

  • interpolation (str) – Either ‘nearest’ for nearest neighbor interpolation, or ‘linear’ for trilinear interpolation, defaults to ‘nearest’.

Notes

An equal number of pial/white surfaces and labels must be provided. If parcellations overlap across surfaces, then the labels are kept for the first provided surface.