Skip to main content

distances

distances(
    lr,
    source,
    target=None,
    mask=None,
    source_mask=None,
    target_mask=None,
    **kwargs,
)

Distances between vertices.

Parameters

Name Type Description Default
lr str Hemisphere, either ‘l’ or ‘r’. required
source str Source space. required
target str Target space. If None, assuming it’s the same as source. None
mask str Mask to apply to the distance matrix. If None or False, no mask is applied. If True, the group-based cortical mask is used. If a boolean array, it is used as the mask. source_mask and target_mask can be set separately, and they take precedence over mask. None
source_mask str Mask to apply to source space (rows) of the distance matrix. None
target_mask str Mask to apply to target space (columns) of the distance matrix. None

Returns

Name Type Description
M ndarray Distance matrix. The shape is (n_source_vertices, n_target_vertices).