Resting state epoch from auto events

  • MNE version: 0.24.0
  • operating system: Windows 10

I’m struggling with setting mne.make_fixed_length_events.

I can set events like this:

events = mne.make_fixed_length_events(data, start=0, stop=60, duration=60/10)
epochs = mne.Epochs(data, events,preload=True)
evoked = epochs['1']  
       

but after doing this:

for epoch in evoked:
            print(epoch.shape)

I get:

Not setting metadata
Not setting metadata
10 matching events found
Setting baseline interval to [-0.2, 0.0] sec
Applying baseline correction (mode: mean)
Created an SSP operator (subspace dimension = 1)
1 projection items activated
Loading data for 10 events and 113 original time points …
1 bad epochs dropped
(64, 113)
(64, 113)
(64, 113)
(64, 113)
(64, 113)
(64, 113)
(64, 113)
(64, 113)
(64, 113)

I thought that changing the duration in mne.make_fixed_length_events will change the second shape of epoch (113) but no matter what I do this shape stays always the same. Why is this happening and how to set up it right?

hum… not sure but for what you want to do you can use:

https://mne.tools/stable/generated/mne.make_fixed_length_epochs.html

Alex

Thank you for answering, Alex.

I try to split my resting state signal from 64 electrodes to equal epochs and from that epochs, I want to access individual channels/electrodes to perform analysis on them.

I found solution to setting it like this:


Event_duration = 60 / 26 #  26 epochs from 60 seconds
events = mne.make_fixed_length_events(data, start=0, stop=60, duration=Event_duration)
epochs = mne.Epochs(data, events,tmin=-0.2, tmax=Event_duration)
evoked = epochs['1']

In the above solution, I had still some cuts because of baseline calculations for epochs. Is there a method to avoid using baseline while creating epochs? I tried like epochs = mne.Epochs(data, events,tmin=0.0,tmax=Event_duration,baseline=(None, None)) but it gives information that Applying baseline correction (mode: mean). Any hint on how to avoid applying baseline?

Basically, I need to spit rest into chunks and I don’t want to go outside the mne pipeline like doing eg. raw.get_data() - > numpy split.

Lukas

use baseline=None

and I guess one mistake is to do epochs[‘1’] to select the first epochs.
You should be doing epochs[0] passing an integer index and not a string.

ALex

Thank you, that’s worked.