# How to create a sphere file to compute source space?

**URL:** <https://mne.discourse.group/t/how-to-create-a-sphere-file-to-compute-source-space/1012>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [May 2, 2016, 9:17am UTC](https://mne.discourse.group/t/how-to-create-a-sphere-file-to-compute-source-space/1012 "2016-05-02T09:17:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 2, 2016, 9:17am UTC](https://mne.discourse.group/t/how-to-create-a-sphere-file-to-compute-source-space/1012/1 "2016-05-02T09:17:10Z")

</div>

Hello !

I would like to create a forward solution using source space  
(mne.setup\_source\_space).

I?ve created the surface mesh from Brainvisa but I don?t have the sphere  
file (.sphere) to compute a source space.

How can I create it in MNE ? I?m thinking to use mne.make\_sphere\_model but  
I?m not sure how it works.

Any help or suggestion would be appreciated!

Thanks.

Alexandre F  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20160502/6f68fe03/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160502/6f68fe03/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 2, 2016, 3:33pm UTC](https://mne.discourse.group/t/how-to-create-a-sphere-file-to-compute-source-space/1012/2 "2016-05-02T15:33:01Z")

</div>

hi,

> I would like to create a forward solution using source space  
> (mne.setup\_source\_space).
> 
> I?ve created the surface mesh from Brainvisa but I don?t have the sphere  
> file (.sphere) to compute a source space.

you cannot generate a source space with MNE for a surface not produced  
by freesurfer.  
at least not easily without hacking the MNE data structures.

> How can I create it in MNE ? I?m thinking to use mne.make\_sphere\_model but  
> I?m not sure how it works.

the make\_sphere\_model is for the forward model and is unrelated with  
the freesurfer .sphere files that are used for source space  
subsampling.

I really recommend you use freesurfer to generate your cortical  
surfaces. Unless it does not work it will make your life much easier  
with MNE.

HTH  
Alex

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 2, 2016, 6:22pm UTC](https://mne.discourse.group/t/how-to-create-a-sphere-file-to-compute-source-space/1012/3 "2016-05-02T18:22:19Z")

</div>

Dear Alexandre,  
thanks for your feedback. What we are trying to do with Alexandre  
(Fabre), who posted the first email, is to create a source space using  
the cortical meshes from Brainvisa.  
Today, we managed to create a .sphere file in Brainvisa that maps each  
node of the Lwhite mesh onto the sphere. This seems equivalent to the  
procedure done in Freesurfer. Both have approximately 50k nodes per  
hemisphere. What we are tying to deal now is to create the source space by :  
1) downsample the mesh to 10k or 5k nodes  
2) avoid some nodes which are not on the cortical sheet. For example, in  
Brainvisa some nodes are in the cingular pole, where we don't want  
source reconstruction from. We do have a "texture" for each node of the  
mesh that indicates the brain region according to MarsAtlas (the atlas  
we use in Brainvisa).

To do so, we were thinking to use mne.setup\_source\_space. Any suggestion  
as you said to "hack" this functiona are welcome.  
If it is not possible, I guess we will have to modify the function.  
Thanks a lot,  
Andrea

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [May 2, 2016, 7:31pm UTC](https://mne.discourse.group/t/how-to-create-a-sphere-file-to-compute-source-space/1012/4 "2016-05-02T19:31:36Z")

</div>

hi Andrea,

thinking about it what you can do is to setup a discrete source space  
using the locations and normals for your cortical mesh.

See setup\_volume\_source\_space and the pos parameter.  
You'll have a source space that you can then use for forward/inverse modeling.

Let me know it this works.

Alex
