Comments (6)
Hi @khashayar854,
Can you show me the code please? You might need to transform it to a pandas dataframe. Something like this :
df = pd.DataFrame(coh, index=ch_names, columns=ch_names)
circular(df)
from netchos.
Yes I had. Circular used to work with my own connectivity function. But it seems that it doesn't like MNE connectivity for some reason?
th = np.percentile(am, 95)
# set to nan every non-significant links
am[am < th] = np.nan
df = pd.DataFrame(am, index=chans, columns=chans) # am is the adjecency matrix, chans is the list of channels
fig = circular(df)
fig.show()
from netchos.
Maybe netchos has a different convention in the orientation of the upper / lower triangle. Could you try the two following tests:
# number of significant links
print(np.sum(~np.isnan(am)))
# try to transpose the array
df = pd.DataFrame(am.T, index=chans, columns=chans)
from netchos.
Yes, thank you.
The orientation of the upper/lower triangle was indeed the issue, and transposing the adjacency matrix solved it.
Of course, heatmap() didn't have any issue with the orientation of the triangle since it could accept either, not circular() though.
maybe checking the orientation of the triangle can be added to the circular function so that it transposes df automatically if needed, so it would directly work with MNE with no extra step too?
Thanks for the tip.
from netchos.
Yes, indeed, netchos should perform this test. I didn't thought about this before. If I remember correctly, I think scipy
has functions to check if symmetrical arrays are corrects. Could you check it?
from netchos.
Sorry, python beginner here. Not sure if there is a built-in function for it, but it seems like people have some suggestions here:
https://stackoverflow.com/questions/42908334/checking-if-a-matrix-is-symmetric-in-numpy
from netchos.
Related Issues (2)
- minimum arguments? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netchos.