netneurotools.interface.vertices_to_parcels

netneurotools.interface.vertices_to_parcels(vert_data, parc_file, hemi='both', background=None, parc_ignore=['unknown', 'corpuscallosum', 'Background+FreeSurfer_Defined_Medial_Wall', '???', 'Unknown', 'Medial_wall', 'Medial wall', 'medial_wall'])[source]

Convert vertex-level data to parcel-level data.

Parameters:
  • vert_data (np.ndarray or tuple or list) – Vertex-level data.

  • parc_file (str or Path or tuple or list) – Path to parcellation file.

  • hemi (str, optional) – Hemisphere to process. Can be ‘both’, ‘L’, or ‘R’.

  • background (int, optional) – Background value in vert_data to ignore.

  • parc_ignore (list, optional) – List of labels to ignore.

Returns:

  • reduced (np.ndarray or tuple) – Reduced data.

  • keys (tuple) – Keys.

  • labels (tuple) – Labels.

Notes

If hemi is ‘both’:

  • vert_data can be a tuple or list of two arrays. It can also be a single array with left then right hemisphere data.

  • parc_file should be a tuple or list of two paths, unless it is a dlabel.nii file, in which case it can be a single path.

  • Returns tuples of reduced data, keys, and labels.

If hemi is ‘L’ or ‘R’:

  • vert_data should be a single array.

  • parc_file should be a single path.

  • Returns reduced data, keys, and labels.