Skip to content

Commit

Permalink
Add combine_tfr to API (mne-tools#13054)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsbinns authored and qian-chu committed Jan 20, 2025
1 parent 09ed0bd commit 4fb92a3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions doc/api/time_frequency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Functions that operate on mne-python objects:
:toctree: ../generated/

combine_spectrum
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 @@ -12,6 +12,7 @@ __all__ = [
"Spectrum",
"SpectrumArray",
"combine_spectrum",
"combine_tfr",
"csd_array_fourier",
"csd_array_morlet",
"csd_array_multitaper",
Expand Down Expand Up @@ -73,6 +74,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

0 comments on commit 4fb92a3

Please sign in to comment.