[Neuroimaging] [dipy] connectivity_matrix
schreiber at cbs.mpg.de
Fri Aug 21 17:44:53 CEST 2015
Hi Dipy Experts,
the function "connectivity_matrix()" provides the option to produce a
symmetric connectivity matrix.
The computation is done in line 202 in
201 if symmetric:
202 matrix = np.maximum(matrix, matrix.T)
The test of this function defines the expected matrix as
100 expected = expected + expected.T
I think the test might not be correct and it should be
100 expected = expected + expected.T - np.diag(np.diag(expected))
This does pop up as an error because the test does not include a
connection with start and end point in the same ROI. A within-ROI
connection produces an entry on the diagonal and would be counted twice
with "expected + expected.T".
A patch for an extended test is attached. I also added some more
combinations of possible connections.
What keeps puzzling me is that the function that computes the symmetry as
matrix = np.maximum(matrix, matrix.T)
gives the same result as
expected = expected + expected.T - np.diag(np.diag(expected))
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4092 bytes
Desc: not available
More information about the Neuroimaging