brainconn.utils.matrix.threshold_absolute¶
-
threshold_absolute
(W, thr, copy=True)[source]¶ This function thresholds the connectivity matrix by absolute weight magnitude. All weights below the given threshold, and all weights on the main diagonal (self-self connections) are set to 0.
If copy is not set, this function will modify W in place.
Parameters: - W (
numpy.ndarray
) – weighted connectivity matrix - thr (float) – absolute weight threshold
- copy (bool) – if True, returns a copy of the matrix. Otherwise, modifies the matrix in place. Default value=True.
Returns: W – thresholded connectivity matrix
Return type: - W (