Dear MNE community,
I have data from 40 subjs collected in three different sessions. I want to check for differences in those sessions regarding the time-frequency analysis (morlet waves) and the ERPs using the non-parametric cluster-level test: ‘mne.stats.permutation_cluster_1samp_test()’.
This function takes an array ‘X’ as input and I would like to prepare my data to fit in this function and I don’t know how to save it properly.
I’m considering preparing a for loop that, in every iteration, preprocesses data from one subject, and then saves it as a fif file. I’ll repeat it for every session.
Here is one example of how I save data from session 1, subj 1:
# Obtain evoked data from Epochs evoked = epochs.average() # Save it evoked.save(".../session_1/p01_1_Evoked-ave.fif")
# Obtain TFRs data from Epochs freqs = list(range(3, 38)) tfr_evoked = tfr_morlet(epochs_Tfr['OGT'], freqs, 6, return_itc=False, n_jobs=8) tfr_evoked.save(".../session_1_Tfr/p01_1_Tfr-ave.fif")
So after saving all files in its corresponding folders, e.g. session_1; session_2 (for ERPs); session_1_Tfr, session_2_Tfr (for TFRs)… can I use the function ‘read_evoked’ to get the saved data from the fif files and then save them as an array and then use it as input for the function ‘spatio_temporal_cluster_1samp_test’? How can I save this array? Would it work for both ERP and TFR data? At last but not least. Is there a standard way of performing group level analysis in MNE? Special functions that analyse data from all subjects and sessions, without having to use a for loop?
I’ll be thankful for any feedback
- MNE-Python version: 0.22.0
- operating system: Ubuntu 20.04.2 LTS