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

[ENH] Multiple improvements to spectral_connectivity_time #113

Closed
wants to merge 67 commits into from

Commits on Aug 31, 2022

  1. FIX: compute connectivity over multiple tapers when mode='multitaper'…

    …, 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
    ruuskas committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    41bd87b View commit details
    Browse the repository at this point in the history
  2. require MNE-Python 1.0 or newer due to breaking changes in mne.time_f…

    …requency.tfr_array_multitaper
    ruuskas committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    05ae8f6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9cc283c View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2022

  1. Configuration menu
    Copy the full SHA
    924b4ab View commit details
    Browse the repository at this point in the history
  2. fix docstring typo

    Co-authored-by: Adam Li <[email protected]>
    ruuskas and adam2392 authored Sep 1, 2022
    Configuration menu
    Copy the full SHA
    c5b75f8 View commit details
    Browse the repository at this point in the history
  3. update docstring: faverage is False by default

    Co-authored-by: Adam Li <[email protected]>
    ruuskas and adam2392 authored Sep 1, 2022
    Configuration menu
    Copy the full SHA
    7699983 View commit details
    Browse the repository at this point in the history
  4. update docstring: lower bound of frequency range for connectivity com…

    …putation may be None
    
    Co-authored-by: Britta Westner <[email protected]>
    ruuskas and britta-wstnr authored Sep 1, 2022
    Configuration menu
    Copy the full SHA
    89f683a View commit details
    Browse the repository at this point in the history
  5. update docstring: fmax may be None

    Co-authored-by: Britta Westner <[email protected]>
    ruuskas and britta-wstnr authored Sep 1, 2022
    Configuration menu
    Copy the full SHA
    cb2dab5 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2022

  1. update docstring

    ruuskas committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    0fd34c9 View commit details
    Browse the repository at this point in the history
  2. new default for fmin

    ruuskas committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    f4992a7 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'spectral_time' of github.com:ruuskas/mne-connectivity i…

    …nto spectral_time_hypyp
    ruuskas committed Sep 2, 2022
    Configuration menu
    Copy the full SHA
    cc1d69d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fa9bce7 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2022

  1. fix bug with indices: connectivity is now computed correctly between …

    …specified indices when set
    ruuskas committed Sep 5, 2022
    Configuration menu
    Copy the full SHA
    9e9f983 View commit details
    Browse the repository at this point in the history
  2. DOC: improve documentation

    ruuskas committed Sep 5, 2022
    Configuration menu
    Copy the full SHA
    2e4ccd1 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2022

  1. Configuration menu
    Copy the full SHA
    926c330 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b881c34 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    73fb937 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2022

  1. Configuration menu
    Copy the full SHA
    baaca26 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2022

  1. Change block_size default to 1

    This change will minimize memory usage by default.
    ruuskas committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    2a7e09e View commit details
    Browse the repository at this point in the history
  2. Add documentation for block_size

    Add a short description for the block_size parameter to allow users to
    better understand the memory usage of the spectral_connectivity_time
    function.
    ruuskas committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    2a0be06 View commit details
    Browse the repository at this point in the history
  3. Change for more useful variable names

    Improve the readability of code by shortening variable names in
    pairwise_pli.
    ruuskas committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    53ac7b5 View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2022

  1. Remove regression test

    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.
    ruuskas committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    bc61e54 View commit details
    Browse the repository at this point in the history
  2. Remove block_size parameter

    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.
    ruuskas committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    7ce13bd View commit details
    Browse the repository at this point in the history
  3. Improve documentation

    Added a note on memory mapping in the docstring of
    spectral_connectivity_time. Corrected some typos and inconsistent
    backticks.
    ruuskas committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    c7dd18c View commit details
    Browse the repository at this point in the history
  4. Improve comments

    Removed redundant comments, clarified and fixed typos.
    ruuskas committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    4d2c1f0 View commit details
    Browse the repository at this point in the history
  5. Remove unused code

    ruuskas committed Oct 5, 2022
    Configuration menu
    Copy the full SHA
    1b6224f View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2022

  1. Configuration menu
    Copy the full SHA
    054512b View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2022

  1. Fix style issues

    ruuskas committed Oct 17, 2022
    Configuration menu
    Copy the full SHA
    283a1a1 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'spectral_time' of github.com:ruuskas/mne-connectivity i…

    …nto spectral_connectivity_time_pairwise
    ruuskas committed Oct 17, 2022
    Configuration menu
    Copy the full SHA
    083aa1b View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2022

  1. Add comment

    Co-authored-by: Adam Li <[email protected]>
    ruuskas and adam2392 authored Oct 19, 2022
    Configuration menu
    Copy the full SHA
    e89ac77 View commit details
    Browse the repository at this point in the history
  2. Improve comment

    Co-authored-by: Adam Li <[email protected]>
    ruuskas and adam2392 authored Oct 19, 2022
    Configuration menu
    Copy the full SHA
    19603bd View commit details
    Browse the repository at this point in the history
  3. Rename test function

    Co-authored-by: Adam Li <[email protected]>
    ruuskas and adam2392 authored Oct 19, 2022
    Configuration menu
    Copy the full SHA
    e5da3ae View commit details
    Browse the repository at this point in the history
  4. Update docstring

    Add clear reference to MNE-Python functions.
    
    Co-authored-by: Adam Li <[email protected]>
    ruuskas and adam2392 authored Oct 19, 2022
    Configuration menu
    Copy the full SHA
    39f0ee6 View commit details
    Browse the repository at this point in the history
  5. Add comments

    Add some comments to clarify the new test case for time-resolved
    spectral connectivity.
    ruuskas committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    4b6311c View commit details
    Browse the repository at this point in the history
  6. Merge branch 'spectral_time' of github.com:ruuskas/mne-connectivity i…

    …nto spectral_connectivity_time_pairwise
    ruuskas committed Oct 19, 2022
    Configuration menu
    Copy the full SHA
    7c64633 View commit details
    Browse the repository at this point in the history

Commits on Oct 28, 2022

  1. Add ciPLV

    Add the corrected imaginary Phase-Locking-Value into the list of
    available connectivity metrics.
    ruuskas committed Oct 28, 2022
    Configuration menu
    Copy the full SHA
    14cc7d0 View commit details
    Browse the repository at this point in the history

Commits on Oct 31, 2022

  1. Speed up computation

    All connectivity measures are now computed with only a single
    computation of pairwise cross spectrum.
    ruuskas committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    aa05ba4 View commit details
    Browse the repository at this point in the history
  2. Add logging

    ruuskas committed Oct 31, 2022
    Configuration menu
    Copy the full SHA
    8465068 View commit details
    Browse the repository at this point in the history

Commits on Nov 1, 2022

  1. Add the option to specify freqs in all modes

    In some scenarios, users might want to specify the frequencies for
    time-frequency decomposition also when using multitapering. These
    changes allow users to specify the 'freqs' parameter to override the
    automatically determined frequencies.
    ruuskas committed Nov 1, 2022
    Configuration menu
    Copy the full SHA
    f13f4e6 View commit details
    Browse the repository at this point in the history

Commits on Nov 2, 2022

  1. Add connectivity with Hilbert transform

    Add a new function spectral_connectivity_time_hilbert, which computes
    connectivity on frequency bands using Hilbert transform on FIR-filtered
    data.
    ruuskas committed Nov 2, 2022
    Configuration menu
    Copy the full SHA
    42db712 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    249afc7 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2022

  1. DOC: Fix typos

    Co-authored-by: Adam Li <[email protected]>
    ruuskas and adam2392 authored Nov 9, 2022
    Configuration menu
    Copy the full SHA
    f6684c0 View commit details
    Browse the repository at this point in the history
  2. DOC: Improve doc formulation

    Co-authored-by: Adam Li <[email protected]>
    ruuskas and adam2392 authored Nov 9, 2022
    Configuration menu
    Copy the full SHA
    39fef93 View commit details
    Browse the repository at this point in the history
  3. DOC: Add note on memory mapping

    Co-authored-by: Adam Li <[email protected]>
    ruuskas and adam2392 authored Nov 9, 2022
    Configuration menu
    Copy the full SHA
    08b5c79 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ccb0a2d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fe727f7 View commit details
    Browse the repository at this point in the history
  6. DOC: Improve documentation

    Revised documentation of spectral_connectivity_time.
    ruuskas committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    3b966ec View commit details
    Browse the repository at this point in the history
  7. Add test for cwt_freqs

    ruuskas committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    f082d6f View commit details
    Browse the repository at this point in the history
  8. BUG: Fix 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.
    ruuskas committed Nov 9, 2022
    Configuration menu
    Copy the full SHA
    84d073b View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2022

  1. Configuration menu
    Copy the full SHA
    a5db88b View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2022

  1. Compute weighted average over CSD

    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.
    ruuskas committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    3e7f208 View commit details
    Browse the repository at this point in the history
  2. Add option to use part of signal as padding

    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.
    ruuskas committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    072b0bb View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2022

  1. Fix style

    ruuskas committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    71b61ad View commit details
    Browse the repository at this point in the history
  2. Update the docstring of spectral_connectivity_time

    Made the docstring more stylish, removed unnecessary things and
    added better compliance with MNE-Python style guidelines.
    ruuskas committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    9e073c6 View commit details
    Browse the repository at this point in the history
  3. Remove unnecessary defaults

    The _spectral_connectivity function doesn't need defaults as these are
    already spelled out in the main spectral_connectivity_time function
    signature.
    ruuskas committed Nov 15, 2022
    Configuration menu
    Copy the full SHA
    dcfbc8b View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2022

  1. Configuration menu
    Copy the full SHA
    fb9869f View commit details
    Browse the repository at this point in the history
  2. Merge spectral_time into main

    ruuskas committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    b2e8240 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fa003bf View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2022

  1. Revert "Add connectivity with Hilbert transform"

    This reverts commit 42db712.
    ruuskas committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    6f3e803 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2022

  1. Fix bug with dpss windows

    Sym is not a parameter of dpss_windows. (But is one of the underlying
    scipy.signal.dpss)
    ruuskas committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    218ad37 View commit details
    Browse the repository at this point in the history
  2. Only show progress bar if verbosity level is DEBUG

    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.
    ruuskas committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    26d54fe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    31c4191 View commit details
    Browse the repository at this point in the history
  4. Merge with upstream

    ruuskas committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    966d569 View commit details
    Browse the repository at this point in the history
  5. Improve doc

    Add a better description of the method + style nitpicks.
    ruuskas committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    e2f0033 View commit details
    Browse the repository at this point in the history
  6. Fix style to make flake happy

    ruuskas committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    aa5a92d View commit details
    Browse the repository at this point in the history
  7. Fix whitespace

    ruuskas committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    4c80f36 View commit details
    Browse the repository at this point in the history
  8. Fix doc

    ruuskas committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    871ce92 View commit details
    Browse the repository at this point in the history