Skip to content
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

Fix connectivity phase metrics and averaging #632

Merged
merged 48 commits into from Aug 23, 2023

Conversation

Moo-Marc
Copy link
Collaborator

@Moo-Marc Moo-Marc commented Jun 28, 2023

  • Fix WPLI and ciPLV which both had errors in the formulae.
  • Refactor code for coherence and phase metrics (plv, ciplv, wpli), in large part to allow proper averaging of terms across files, before the final connectivity formula is "assembled". Previously, only spectral coherence did it properly, now also hilbert/morlet coherence and all phase metrics.
  • Extended time-frequency options for phase metrics
  • Added full time resolution for coherence (when estimating across trials)
  • GUI: Moved time-resolved coherence from "envelope correlation" process back to coherence
  • Harmonized GUI between all PLV, coherence, envelope correlation processes
  • Removed pre-2019 coherence processes from deprecated folder, moved 2021 versions there, 3 new process files
  • Major performance improvements.
  • Confirmed plv and coherence on single file gives exact same results as previously
  • Fixed bugs in envelope correlation (AxB error, values > 1)

Remaining:

  • Additional testing, esp. other connectivity processes
  • envelope correlation: similar averaging issue due to abs at file level, other issues
  • ~10 "TODO" left in code

@rcassani rcassani marked this pull request as ready for review August 9, 2023 22:15
Copy link
Collaborator Author

@Moo-Marc Moo-Marc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I committed one fix and minor comment tweaks not mentioned here.

toolbox/connectivity/bst_connectivity.m Show resolved Hide resolved
toolbox/process/panel_process1.m Outdated Show resolved Hide resolved
toolbox/process/functions/process_corr1n.m Outdated Show resolved Hide resolved
toolbox/connectivity/bst_xspectrum.m Outdated Show resolved Hide resolved
@rcassani rcassani merged commit 24e3d22 into brainstorm-tools:master Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants