brainconn.utils.matrix.binarize

binarize(W, copy=True)[source]

Binarizes an input weighted connection matrix. If copy is not set, this function will modify W in place.

Parameters:
  • W (NxN numpy.ndarray) – weighted connectivity matrix
  • copy (bool) – if True, returns a copy of the matrix. Otherwise, modifies the matrix in place. Default value=True.
Returns:

W – binary connectivity matrix

Return type:

NxN numpy.ndarray