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

Add combine_tfr to API #13054

Merged
merged 9 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/api/time_frequency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Functions that operate on mne-python objects:
.. autosummary::
:toctree: ../generated/

combine_tfr
csd_tfr
csd_fourier
csd_multitaper
Expand Down
1 change: 1 addition & 0 deletions doc/changes/devel/13054.newfeature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added :func:`mne.time_frequency.combine_tfr` to allow combining TFRs across tapers, by `Thomas Binns`_.
2 changes: 2 additions & 0 deletions mne/time_frequency/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ __all__ = [
"RawTFRArray",
"Spectrum",
"SpectrumArray",
"combine_tfr",
"csd_array_fourier",
"csd_array_morlet",
"csd_array_multitaper",
Expand Down Expand Up @@ -71,6 +72,7 @@ from .tfr import (
EpochsTFRArray,
RawTFR,
RawTFRArray,
combine_tfr,
fwhm,
morlet,
read_tfrs,
Expand Down
8 changes: 4 additions & 4 deletions mne/time_frequency/tfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3914,10 +3914,10 @@ def __init__(
def combine_tfr(all_tfr, weights="nave"):
"""Merge AverageTFR data by weighted addition.

Create a new AverageTFR instance, using a combination of the supplied
instances as its data. By default, the mean (weighted by trials) is used.
Subtraction can be performed by passing negative weights (e.g., [1, -1]).
Data must have the same channels and the same time instants.
Create a new :class:`mne.time_frequency.AverageTFR` instance, using a combination of
the supplied instances as its data. By default, the mean (weighted by trials) is
used. Subtraction can be performed by passing negative weights (e.g., [1, -1]). Data
must have the same channels and the same time instants.

Parameters
----------
Expand Down
Loading