eigenstrapping.geometry.geodesic_distmat
- eigenstrapping.geometry.geodesic_distmat(surface, mask_input=None, use_cholmod=False, n_jobs=1, m=1.0)[source]
- Compute geodesic distance using the heat diffusion method built into LaPy
Based on: doi/10.1145/2516971.2516977 Crane et al., “Geodesics in heat: A new approach to computing distance based on heat flow”
- Parameters:
surf (str) – Path to input surface
mask_input (array_like or str) – Mask to remove from surf (i.e. medial wall) during the geodesic distance calculations
use_cholmod (bool, optional) – Specify whether to use
scikit-sparsecholmod libraries (much faster), if False then usesscipy.sparselibraries instead (much slower). Default False.n_jobs (int, optional) – Number of workers to use for parallel calls to ._thread_method(), default is 1.
m (float, optional) – Scaling factor for time in the heat kernel calculation. As m decreases, distances increase in accuracy (if you care) but increases computation time. Best put between 1.0 and 0.1. Default 1.0.
- Returns:
D – Distance matrix of every vertex to every other vertex
- Return type:
(N,N) np.ndarray