netneurotools.interface.parcels_to_vertices

netneurotools.interface.parcels_to_vertices(parc_data, parc_file, hemi='both', fill=nan, parc_ignore=['unknown', 'corpuscallosum', 'Background+FreeSurfer_Defined_Medial_Wall', '???', 'Unknown', 'Medial_wall', 'Medial wall', 'medial_wall'])[source]

Convert parcel-level data to vertex-level data.

Parameters:
  • parc_data (np.ndarray or tuple or list) – Parcel-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’.

  • fill (int or float, optional) – Fill value for vertices not in parcels. Default is np.nan.

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

Returns:

  • projected (np.ndarray or tuple) – Projected data.

  • keys (tuple) – Keys.

  • labels (tuple) – Labels.

Notes

If hemi is ‘both’:

  • parc_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 projected data, keys, and labels.

If hemi is ‘L’ or ‘R’:

  • parc_data should be a single array.

  • parc_file should be a single path.

  • Returns projected data, keys, and labels.