Giter VIP home page Giter VIP logo

Comments (6)

EtienneCmb avatar EtienneCmb commented on June 17, 2024

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.

ghoorzehi avatar ghoorzehi commented on June 17, 2024

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.

EtienneCmb avatar EtienneCmb commented on June 17, 2024

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.

ghoorzehi avatar ghoorzehi commented on June 17, 2024

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.

EtienneCmb avatar EtienneCmb commented on June 17, 2024

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.

ghoorzehi avatar ghoorzehi commented on June 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.