netneurotools.freesurfer.vertices_to_parcels
- netneurotools.freesurfer.vertices_to_parcels(data, *, lhannot, rhannot, drop=None)[source]
Reduce vertex-level data to parcels defined in annotation files.
Takes average of vertices within each parcel, excluding np.nan values (i.e., np.nanmean). Assigns np.nan to parcels for which all vertices are np.nan.
- Parameters:
data ((N,) numpy.ndarray) – Vertex-level data to be reduced to parcels
{lh (str) – Path to .annot file containing labels to parcels on the {left,right} hemisphere
rh}annot (str) – Path to .annot file containing labels to parcels on the {left,right} hemisphere
drop (list, optional) – Specifies regions in {lh,rh}annot that should be removed from the parcellated version of data. If not specified, vertices corresponding to parcels defined in netneurotools.freesurfer.FSIGNORE will be removed. Default: None
- Returns:
reduced – Parcellated data, without regions specified in drop
- Return type: