Power array from averageTFR object

:question: Dear collegues,
Maybe you can tell whether after creating an averageTFR object by tfr_morlet I can somehow extract power values as an array? After applying tfr_morlet for epoch object I received a object with 3 dimentions (ch, time, freq). But how to get the value of power from it?

MNE version - 4.10.1

Hi @Nikita13021995! The default is to return the TFR as power (see output here mne.time_frequency.tfr_morlet β€” MNE 1.0.0 documentation) but it’s also to return inter-trial coherence (return_itc=True) so what you get out can be a tuple with power and inter-trial coherence. You reference an object with channels x times x frequencies which is exactly what you want (it sounds like the AverageTFR object mne.time_frequency.AverageTFR β€” MNE 1.0.0 documentation) so you can just call tfr.data to get the data as a numpy array.

Also MNE just released version 1.0, yay! So I’m guessing 4.10.1 is another software package. You can use mne sys_info in a terminal or import mne; mne.__version__ in a python console to check your version.

1 Like

Dear alexrockhill,
Thank you very much for your answer. I got that the values are actually all inside the averageTFR β€œcontainer”: they are not the values of ch/times/freqs, but actually the power for each particular data point.
Thank you. I also checked the version, it is β€˜0.24.0’.

Glad it’s solved! You can call AverageTFR.times or AverageTFR.freqs or AverageTFR.ch_names to get the labels for each of those.

1 Like