neuromaps.points.get_surface_distance
- neuromaps.points.get_surface_distance(surface, parcellation=None, medial=None, medial_labels=None, drop=None, n_proc=1)[source]
Calculate surface distance for vertices in surface.
- Parameters:
surface (str or os.PathLike) – Path to surface file on which to calculate distance
parcellation (str or os.PathLike, optional) – Path to file with parcel labels for provided surface. If provided will calculate parcel-parcel distances instead of vertex distances, where parcel-parcel distance is the average distance between all constituent vertices in two parcels. Default: None
medial (str or os.PathLike, optional) – Path to file indicating which vertices correspond to the medial wall (0 indicates medial wall). If provided will prohibit calculation of surface distance along the medial wall. Superseded by medial_labels if both are provided. Default: None
medial_labels (list of str, optional) – List of parcel names that comprise the medial wall and through which travel should be disallowed. Only valid if parcellation is provided; supersedes medial if both are provided. Default: None
drop (list of str, optional) – List of parcel names that should be dropped from the final distance matrix (if parcellation is provided). If not specified, will ignore parcels commonly used to reference the medial wall (e.g., ‘unknown’, ‘corpuscallosum’, ‘???’, ‘Background+FreeSurfer_Defined_Medial_Wall’). Default: None
n_proc (int, optional) – Number of processors to use for parallelizing distance calculation. If negative, will use max available processors plus 1 minus the specified number. Default: 1 (no parallelization)
- Returns:
distance – Surface distance between vertices/parcels on surface
- Return type:
(N, N) numpy.ndarray