-
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
[ENH] Multiple improvements to spectral_connectivity_time #113
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…, then average FIX: add working support for computation of multiple connectivity metrics at once, as indicated by existing docstring FIX: correct calculation of PLV and coherence connectivity metrics FIX: block_size parameter now actually corresponds to the size of blocks instead of number of blocks ENH: add PLI and wPLI connectivity metrics ENH: improve docstring and typechecks in code ENH: streamline the public API with mne_connectivity.spectral_connectivity_epochs ENH: enable averaging connectivity results over frequencies and epochs
…requency.tfr_array_multitaper
Co-authored-by: Adam Li <adam2392@gmail.com>
Co-authored-by: Adam Li <adam2392@gmail.com>
Co-authored-by: Adam Li <adam2392@gmail.com>
…putation may be None Co-authored-by: Britta Westner <britta.wstnr@gmail.com>
Co-authored-by: Britta Westner <britta.wstnr@gmail.com>
…nto spectral_time_hypyp
…specified indices when set
This change will minimize memory usage by default.
Add a short description for the block_size parameter to allow users to better understand the memory usage of the spectral_connectivity_time function.
Improve the readability of code by shortening variable names in pairwise_pli.
Remove the regression test which tests against the spectral connectivity implementation in frites. The implementation in frites is erroneous, and therefore we should not test against it.
The block_size parameter is not useful, as testing shows that running the computation in blocks of epochs does not have a meaningful effect on the speed of computation, but significantly increases memory usage.
Added a note on memory mapping in the docstring of spectral_connectivity_time. Corrected some typos and inconsistent backticks.
Removed redundant comments, clarified and fixed typos.
…nto spectral_connectivity_time_pairwise
Co-authored-by: Adam Li <adam2392@gmail.com>
Co-authored-by: Adam Li <adam2392@gmail.com>
Co-authored-by: Adam Li <adam2392@gmail.com>
Revised documentation of spectral_connectivity_time.
Spectral connectivity computation failed if cwt_freqs was only a single number or an array with a single entry due to invalid array slicing. Fixed by incrementing the upper bound of the slice by one when computing the average in a frequency band.
Compute a weighted average of the tapered cross spectra when using the multitaper mode. Weighting is derived from the concentration ratios between the DPSS windows.
This adds the option to use the edges of the signal at each epoch as padding. The purpose of this is to avoid edge effects generated by the time-frequency transformation methods.
Made the docstring more stylish, removed unnecessary things and added better compliance with MNE-Python style guidelines.
The _spectral_connectivity function doesn't need defaults as these are already spelled out in the main spectral_connectivity_time function signature.
This reverts commit 42db712.
Sym is not a parameter of dpss_windows. (But is one of the underlying scipy.signal.dpss)
This change will skip the rendering of the connectivity computation progress bar if the logging level is not DEBUG. This is in line with MNE-Python, where progress bars are not shown at INFO or higher logging levels. Rendering the progress bar regardless of logging levels has the potential to cause unnecessary clutter in users' log files.
Add a better description of the method + style nitpicks.
ruuskas
changed the title
[ENH] Improve spectral time
[ENH] Multiple improvements to spectral_connectivity_time
Nov 25, 2022
I decided to close this PR and repost with the relevant commits properly cherry-picked on top of |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Description
This PR addresses improvements mentioned in #104.
Unfortunately the Git log for this PR is a huge mess. The reason is that this was started before breaking changes were made in #104. Should probably have rebased instead of merging from main.
Merge checklist
Maintainer, please confirm the following before merging: