brainconn.utils.visualization.reorderMAT

reorderMAT(m, H=5000, cost='line')[source]

This function reorders the connectivity matrix in order to place more edges closer to the diagonal. This often helps in displaying community structure, clusters, etc.

Parameters:
  • MAT (NxN numpy.ndarray) – connection matrix
  • H (int) – number of reordering attempts
  • cost (str) – ‘line’ or ‘circ’ for shape of lattice (linear or ring lattice). Default is linear lattice.
Returns:

  • MATreordered (NxN numpy.ndarray) – reordered connection matrix
  • MATindices (Nx1 numpy.ndarray) – reordered indices
  • MATcost (float) – objective function cost of reordered matrix

Notes

I’m not 100% sure how the algorithms between this and reorder_matrix differ, but this code looks a ton sketchier and might have had some minor bugs in it. Considering reorder_matrix() does the same thing using a well vetted simulated annealing algorithm, just use that. ~rlaplant