# Connectivity in source space

**URL:** <https://mne.discourse.group/t/connectivity-in-source-space/9138>\
**Category:** Support & Discussions\
**Tags:** ﻿source-localization, eeg, connectivity\
**Created:** [July 31, 2024, 10:34am UTC](https://mne.discourse.group/t/connectivity-in-source-space/9138 "2024-07-31T10:34:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![moniczek](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/moniczek/32/3795_2.png) [@moniczek](https://mne.discourse.group/u/moniczek)\
**Post date:** [July 31, 2024, 10:34am UTC](https://mne.discourse.group/t/connectivity-in-source-space/9138/1 "2024-07-31T10:34:02Z")

</div>

Hello everyone!  
I have a question about preparing structure for connectivity analysis on sources.  
My pipeline:

1. preprocess and epoch data
2. create headmodels, using template MRI file
3. perform source analysis using lcmv, but not on averaged epoch data, i want to to this on eachepoch separately
4. parcel the reconstucted source data onto atlas, im specifically interested in visual areas
5. create a matrix, which will contain structures from the atlas as rows and source data as columns.
6. perform connectivity analysis on parcellated data to atlas.

What i need help with is performing source analysis and then parcellation using MNE. Is it possible to do this on trial data, not on averaged data (since i do not have ERPs in my data)?  
I have searched through posts in this community, but i did not found similar problem to mine.

I will be thankful for any help.  
Best regards,  
Monika

---

<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:** [August 1, 2024, 8:47am UTC](https://mne.discourse.group/t/connectivity-in-source-space/9138/2 "2024-08-01T08:47:04Z")

</div>

Yes, you can do this. I use more or less the same pipeline to analyze epileptic slowing.

By invoking the mne.minimum\_norm.apply\_inverse\_epochs function on the epochs object you obtain the source localized epochs. (It might be helpful to set return\_generator to True so as not to flood your memory).

Afterwards, you can call mne.extract\_label\_time\_course on the sources to get the time courses in a parcellated brain and continue with your pipeline as you wish!

---

<div class="post-metadata">

**Author:** ![moniczek](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/moniczek/32/3795_2.png) [@moniczek](https://mne.discourse.group/u/moniczek)\
**Post date:** [August 5, 2024, 9:41am UTC](https://mne.discourse.group/t/connectivity-in-source-space/9138/3 "2024-08-05T09:41:58Z")

</div>

Okay, that is really helpful, thank you!  
Looking through functions you’ve mention i’ve seen i have to use make\_bem\_model function, but it requires FreeSurfer subjects reconstructions - is it possible to use MRI file instead of FreeSurfer? I have one MRI file template which i want to use. If not,

Once again thank you for your help!  
Monika

---

<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:** [August 5, 2024, 12:55pm UTC](https://mne.discourse.group/t/connectivity-in-source-space/9138/4 "2024-08-05T12:55:23Z")

</div>

Dear Monika,

For a source reconstruction, you’ll need a source space derived from MRI data. I use the FSaverage template myself that is incorporated in MNE, but you could check for other atlasses that match the one you have.

Kind regards,  
Steven
