[Mne_analysis] Correct data for spatio_temporal_cluster_1samp_test

Bruno Mansur brunommansur at gmail.com
Mon Feb 22 13:10:39 EST 2021
Search archives:

        External Email - Use Caution        

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:

For ERPs:

# Obtain evoked data from Epochs
evoked = epochs.average()
# Save it
evoked.save(".../session_1/p01_1_Evoked-ave.fif")

For TFRs:

# 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'? 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

Best regards,
-- 
*Bruno*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20210222/6e5697a7/attachment.html 


More information about the Mne_analysis mailing list