Possibility of obtaining `adjacency` from a distance matrix

  • MNE version: 1.9.0
  • operating system: Ubuntu 22.04

Hello,

Is it possible to obtain the adjacency variable going into permutation cluster tests from a simple distance matrix? A minimal example would be,

import numpy as np
distance_matrix = np.array([
    [0.0, 1.0, 2.0],
    [1.0, 0.0, 1.0],
    [2.0, 1.0, 0.0]
])

adjacency = some_function(distance_matrix)

distance_matrix here would refer to 3 channels where channel 1 and 2 have a distance of 1.0, channel 1 and 3 have a distance of 2.0 and channel 2 and 3 have a distance of 1.0.

Cheers,
Yasir