eigenstrapping.datasets.load_distmat

eigenstrapping.datasets.load_distmat(space='fsaverage', den='10k', data_dir=None, hemi='lh', sort=False)[source]

Downloads geodesic distance matrices. If the dense distance matrix is retrieved, there is an option to return the sorted distance matrix and index memmapped, ala variogram calculation in brainsmash in sort=True. If sort=False, the unsorted distance matrix (as per normal) is returned.

Parameters:
  • space (str, optional) – Which space of the files to get. Default is ‘fsaverage5’

  • data_dir (str, optional) – Path to use as data directory. If not specified, will check for environmental variable ‘E_DATA’; if that is not set, will use ~/e-data instead. Default: None

  • hemi (str, optional) – Which hemisphere to load data for. Default ‘lh’

  • parcellated (bool, optional) – If True, return parcellated format of distance matrix. If False, return sorted dense distance matrix.

  • sort (bool, optional) – If True, return sorted dense distance matrix and index memory-mapped using .utils.txt2memmap() for variogram calculation. Does nothing if parcellation is passed.

Returns:

  • if parcellated

    ndarray

    Parcellated distance matrix

  • else

    if sort:
    tuple of ndarrays

    Sorted distance matrix and index for hemisphere in ‘lh’

    else:

    ndarray Dense geodesic distance matrix