# Pipelines for Mouse Data Analysis in MNE-Python

**URL:** <https://mne.discourse.group/t/pipelines-for-mouse-data-analysis-in-mne-python/8414>\
**Category:** Support & Discussions\
**Tags:** ﻿source-localization, eeg, visualization\
**Created:** [March 3, 2024, 4:13am UTC](https://mne.discourse.group/t/pipelines-for-mouse-data-analysis-in-mne-python/8414 "2024-03-03T04:13:07Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![loresalm](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/loresalm/32/3014_2.png) [@loresalm](https://mne.discourse.group/u/loresalm)\
**Post date:** [March 19, 2024, 11:50am UTC](https://mne.discourse.group/t/pipelines-for-mouse-data-analysis-in-mne-python/8414/15 "2024-03-19T11:50:06Z")

</div>

Hey @Davi1990 Thank you for the update, and for starting this discussion.  
If you want to convert a .obj file into a .surf file you can use the following code:

```python
import mne

obj_file_path = "path/to/file.obj"
verts, faces = surf_dict = mne.read_surface(obj_file_path, file_format='obj')

surf_file_path = "path/to/surface.surf"
mne.write_surface(surf_file_path, verts, faces, overwrite=True, file_format="freesurfer")

```

I have recently looked into MNE source localization because I wanted to use a 4-layer BEM (in humans).  
After a lot of trial and error, I reached the following conclusions:

- It is possible to adapt the BEM model’s source code to make BEM models with any number of layers.

- As long as the BEM model is made correctly the inverse/forward solution will work. You need to remove all the if statements that check if the BEM model has exactly 3 layers.

- It’s unclear to me why MNE forces the users to have exactly 3 layers even if the mathematical model used to make the source localization works with any number of layers. For more information about the model I found this line of the [Source code](https://github.com/mne-tools/mne-python/blob/maint/1.6/mne/bem.py#L83) that points to [this article](https://ieeexplore.ieee.org/document/256433)

I also take the chance to point to these two questions that are related to the topic but haven’t been answered at the moment:

- [BEM with more than 3 layers](https://mne.discourse.group/t/eeg-source-localization-bem-model-with-more-than-3-surfaces/7497)
- [IP skipping layer](https://mne.discourse.group/t/head-model-and-forward-computation-skipping-layer-and-ip-approach/8006)

Good luck with your project and keep us updated with your progress.

---

_[View the full topic](https://mne.discourse.group/t/pipelines-for-mouse-data-analysis-in-mne-python/8414)._
