# Resting state epoch from auto events

**URL:** <https://mne.discourse.group/t/resting-state-epoch-from-auto-events/4343>\
**Category:** Support & Discussions\
**Tags:** eeg, epochs\
**Created:** [February 1, 2022, 10:58am UTC](https://mne.discourse.group/t/resting-state-epoch-from-auto-events/4343 "2022-02-01T10:58:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukas](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/lukas/32/873_2.png) [@lukas](https://mne.discourse.group/u/lukas)\
**Post date:** [February 1, 2022, 10:58am UTC](https://mne.discourse.group/t/resting-state-epoch-from-auto-events/4343/1 "2022-02-01T10:58:43Z")

</div>

- 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:

```python
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:

```python
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?

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [February 1, 2022, 1:15pm UTC](https://mne.discourse.group/t/resting-state-epoch-from-auto-events/4343/2 "2022-02-01T13:15:40Z")

</div>

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

[https://mne.tools/stable/generated/mne.make\_fixed\_length\_epochs.html](https://mne.tools/stable/generated/mne.make_fixed_length_epochs.html)

Alex

---

<div class="post-metadata">

**Author:** ![lukas](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/lukas/32/873_2.png) [@lukas](https://mne.discourse.group/u/lukas)\
**Post date:** [February 1, 2022, 3:19pm UTC](https://mne.discourse.group/t/resting-state-epoch-from-auto-events/4343/3 "2022-02-01T15:19:23Z")

</div>

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:

```python

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

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [February 1, 2022, 3:54pm UTC](https://mne.discourse.group/t/resting-state-epoch-from-auto-events/4343/4 "2022-02-01T15:54:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lukas](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/lukas/32/873_2.png) [@lukas](https://mne.discourse.group/u/lukas)\
**Post date:** [February 1, 2022, 4:02pm UTC](https://mne.discourse.group/t/resting-state-epoch-from-auto-events/4343/5 "2022-02-01T16:02:21Z")

</div>

Thank you, that’s worked.
