# How to create fsaverage bem folder and contents

**URL:** <https://mne.discourse.group/t/how-to-create-fsaverage-bem-folder-and-contents/5422>\
**Category:** Support & Discussions\
**Created:** [August 17, 2022, 4:13pm UTC](https://mne.discourse.group/t/how-to-create-fsaverage-bem-folder-and-contents/5422 "2022-08-17T16:13:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mschendel](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@mschendel](https://mne.discourse.group/u/mschendel)\
**Post date:** [August 17, 2022, 4:13pm UTC](https://mne.discourse.group/t/how-to-create-fsaverage-bem-folder-and-contents/5422/1 "2022-08-17T16:13:03Z")

</div>

Hi all,  
I am using freesurfer 7.2, I have mne1.0 working.

I’ve used an old script that I inherited for the freesurfer processing, but if I try to follow some examples (like [this](https://mne.tools/stable/auto_examples/inverse/morph_surface_stc.html#setting-up-sourcemorph-for-sourceestimate) one), but I am missing the fsaverage/bem/ folder. I now have all the files and folders I need for the freesurfer MRI processing of my subject data, but not the fsaverage in my project directory. I did a quick search of the mne documentation, but I don’t see how this is created. Can anyone point me in the right direction?

fsaverage does have the following directories  
label mri mri.2mm scripts surf xhemi  
and I’ve used it for other things, for example the labels and surf files.

Thanks,  
Megan

---

<div class="post-metadata">

**Author:** ![brainfreeze1212](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/brainfreeze1212/32/1815_2.png) [@brainfreeze1212](https://mne.discourse.group/u/brainfreeze1212)\
**Post date:** [August 19, 2022, 1:05pm UTC](https://mne.discourse.group/t/how-to-create-fsaverage-bem-folder-and-contents/5422/2 "2022-08-19T13:05:46Z")

</div>

Hey Megan,

I usually use the mri\_watershed algorithm from FreeSurfer to compute the bem surfaces (see here:[https://surfer.nmr.mgh.harvard.edu/fswiki/mri\_watershed](https://surfer.nmr.mgh.harvard.edu/fswiki/mri_watershed)).

Simply generate them using

```python
mri_watershed -surf [lh] yourMRIfilename.nii.gz BEMoutput

```

The BEMoutput directory should then appear in your subjects directory.  
To be able to use them with MNE I simply rename the files to ‘outer\_skull.surf’, ‘outer\_skin.surf’, and ‘inner\_skull.surf’.  
Subsequent to that, these files must be placed in a directory called ‘bem’ into the Freesurfers recon-all -all output directory.

I hope this is helpful,  
Bianca

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [August 19, 2022, 1:51pm UTC](https://mne.discourse.group/t/how-to-create-fsaverage-bem-folder-and-contents/5422/3 "2022-08-19T13:51:26Z")

</div>

There is also `mne.datasets.fetch_fsaverage()`  
[https://mne.tools/stable/overview/datasets\_index.html#fsaverage](https://mne.tools/stable/overview/datasets_index.html#fsaverage)

---

<div class="post-metadata">

**Author:** ![mschendel](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@mschendel](https://mne.discourse.group/u/mschendel)\
**Post date:** [August 24, 2022, 5:43pm UTC](https://mne.discourse.group/t/how-to-create-fsaverage-bem-folder-and-contents/5422/4 "2022-08-24T17:43:41Z")

</div>

Hi all,  
Thank you for your suggestions. I haven’t yet had time to try them out!  
Bianca, what would you use in yourMRIfilename.nii.gz for the fsaverage brain?

Megan

---

<div class="post-metadata">

**Author:** ![liana](https://avatars.discourse-cdn.com/v4/letter/l/e47774/32.png) [@liana](https://mne.discourse.group/u/liana)\
**Post date:** [July 14, 2024, 6:32am UTC](https://mne.discourse.group/t/how-to-create-fsaverage-bem-folder-and-contents/5422/5 "2024-07-14T06:32:43Z")

</div>

Is there a way to download what mne.datasets.fetch\_fsaverage() generates? My environment is closed network so I need everything offline.

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [July 14, 2024, 9:09am UTC](https://mne.discourse.group/t/how-to-create-fsaverage-bem-folder-and-contents/5422/6 "2024-07-14T09:09:37Z")

</div>

The data is stored on OSF; you can find the URLs in the MNE source code:

> <https://github.com/mne-tools/mne-python/blob/ac863e63e6233dd3ddb60e1058731f1839e55b02/mne/datasets/_fsaverage/base.py#L71-L82>

Best wishes  
Richard
