-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with time-resolved spectral connectivity #90
Comments
@pedro3714 reposting here as a GH issue Also, if you want to format the code to make it easier to read. single enclosed brackets ` makes a code line E.g.
|
@adam2392 thank you! How can i edit it? |
Hi,
And this would raise an error at
|
Ah I see, so yea the function will require some bit of refactoring and additional testing. There is still an issue to be sorted out in #73 where there is a discussion going on as to how to best implement time-resolved spectral connectivity. Unfortunately, I am out of depth there, and cannot be of much help unless someone explains things to me :p. |
FYI I also encountered this bug, came here, and see #73 is blocking |
Hi @szerfas1 yes, unfortunately I do not have enough time/expertise to handle this specific related line of work with time-resolved spectral connectivity. Hoping a community member is interested in doing some OSS work and being a contributor to the MNE ecosystem :) |
@adam2392 ...Perhaps the implementation in HyPyP may help? |
"Hello everyone,
I’m currently using MNE connectivity to perform a functional connectivity analysis in a single epoch. With this said, I’ve read some threads where concerns were raised about using spectral_connectivity/spectral_connectivity_epochs on a single epoch.In such case we are advised to perform a time spectral connectivity analysis on the epoch. As my goal is to obtain connectivity in the following structure-(n_nodes,n_nodes,n_freqs), I tried to use the follwing functions: spectral_connectivity_time with mode=“multitaper”, SpectralConnectivity and EpochSpectralConnectivity. The code snippets are provided below and contain also the errors. At the snippets we only try to analyze theta and alpha freqs and the df_V[“data_ref”][0] represent a session of neurofeedback training in visual modality. Notice that this df_V[“data_ref”][0] is composed by 30 epochs so we are using the index 0 to access to the first epoch.
Thank you all,
Best Regards
MNE version: 0.24.1
-MNE connectivity version: 0.4.dev0
operating system: Windows 10
Option 1: spectral_connectivity_time
This raises an error on spectral connectivity time- UnboundLocalError: local variable ‘f_vec’ referenced before assignment. Notice that i tried using freqs instead of foi but i gaves me also errors.
Option 2: SpectralConnectivity function. In this case the error seems to be the parameters of the input array as it asks for a list/ [ np.ndarray ] with the following structure [epochs], n_estimated_nodes, [freqs], [times]). As my array has only 3 dimension (with the third being times), it gives me an error like the one below. It seems that he is considering the data as beeing on the frequency domain.
This last error seems to apply also to the function- EpochSpectralConnectivity
Originally posted by @pedro3714 in #73 (comment)
The text was updated successfully, but these errors were encountered: