# Tutorial for source localization of resting EEG?

**URL:** <https://mne.discourse.group/t/tutorial-for-source-localization-of-resting-eeg/5295>\
**Category:** Support & Discussions\
**Tags:** eeg\
**Created:** [July 19, 2022, 7:51am UTC](https://mne.discourse.group/t/tutorial-for-source-localization-of-resting-eeg/5295 "2022-07-19T07:51:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lsun](https://avatars.discourse-cdn.com/v4/letter/l/6bbea6/32.png) [@lsun](https://mne.discourse.group/u/lsun)\
**Post date:** [July 19, 2022, 7:51am UTC](https://mne.discourse.group/t/tutorial-for-source-localization-of-resting-eeg/5295/1 "2022-07-19T07:51:00Z")

</div>

Dear MNE experts,

I am wondering if we have any tutorial for source localization of resting EEG with MNE? I have 64-channel resting EEG data of 5 min and want to do some theta-gamma coupling analysis after source localization (so I need signal within 1-100 Hz range). I guess I have to split the 5 min into epochs since it is too large to invert. Do we have any recommendations on splitting resting EEG data? What could be an ideal length for each epoch?

Thank you!  
Liwei

---

<div class="post-metadata">

**Author:** ![neuroLena](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/neurolena/32/3876_2.png) [@neuroLena](https://mne.discourse.group/u/neuroLena)\
**Post date:** [October 8, 2024, 1:55pm UTC](https://mne.discourse.group/t/tutorial-for-source-localization-of-resting-eeg/5295/2 "2024-10-08T13:55:42Z")

</div>

> [@lsun](#):
>
> he 5 min into epochs since it is too large to invert.

i have the same question

---

<div class="post-metadata">

**Author:** ![SBeumer](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@SBeumer](https://mne.discourse.group/u/SBeumer)\
**Post date:** [October 8, 2024, 2:24pm UTC](https://mne.discourse.group/t/tutorial-for-source-localization-of-resting-eeg/5295/3 "2024-10-08T14:24:06Z")

</div>

Most source localization algorithms have inherently no dependency on time, for example, sLORETA or dSPM. There are some which do, like the mixed norm in time and space (MxNE) or a weighted entropy on the mean (wMEM). So in principle, you could epoch them in any way, given that you use the algorithms that return an operator, without loss of information.

Subsequently, you can use the generator argument of the minimum\_norm\_apply\_inverse\_epochs to limit the amount of data in memory. ([mne.minimum\_norm.apply\_inverse\_epochs — MNE 0.14.1 documentation](https://www.nmr.mgh.harvard.edu/mne/0.14/generated/mne.minimum_norm.apply_inverse_epochs.html#mne.minimum_norm.apply_inverse_epochs))

---

<div class="post-metadata">

**Author:** ![pmolfese](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/pmolfese/32/1984_2.png) [@pmolfese](https://mne.discourse.group/u/pmolfese)\
**Post date:** [October 8, 2024, 7:54pm UTC](https://mne.discourse.group/t/tutorial-for-source-localization-of-resting-eeg/5295/4 "2024-10-08T19:54:45Z")

</div>

In addition to the solid answer by @SBeumer, you can also [look at applying the inverse to the “raw” unsegmented time series](https://mne.tools/stable/generated/mne.minimum_norm.apply_inverse_raw.html): `mne.minimum_norm.apply_inverse_raw`

Raw here could still be considerably well cleaned data.
