# setup\_soruce\_space error

**URL:** <https://mne.discourse.group/t/setup-soruce-space-error/1768>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [March 5, 2019, 9:06pm UTC](https://mne.discourse.group/t/setup-soruce-space-error/1768 "2019-03-05T21:06:17Z")\
**Posts on this page:** 3\
**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:** [March 5, 2019, 9:06pm UTC](https://mne.discourse.group/t/setup-soruce-space-error/1768/1 "2019-03-05T21:06:17Z")

</div>

Hi all,

I received an error message when using setup\_source\_space with spacing=?ico5?. It states that it could not find a neighbor for vertex 8015 / 10242. The Freesurfer segmentation looks pretty good, and when I use setup\_source\_space with spacing=?oct6? it works fine. I?ve also used this same script (and, ergo, the same source space call) with several other subjects without error. Any thoughts on the best way to resolve this? Error code below.

Thank you,  
Josh

> > > src = mne.setup\_source\_space(subject, spacing='ico5', subjects\_dir=mri\_root\_directory)

Setting up the source space with the following parameters:

SUBJECTS\_DIR = /Users/joshbear/clinical/meg/anat/  
Subject = E-0192  
Surface = white  
Icosahedron subdivision grade 5

> > > 1. Creating the source space...

Doing the icosahedral vertex picking...  
Loading /Users/joshbear/clinical/meg/anat/E-0192/surf/lh.white...  
Mapping lh E-0192 -\> ico (5) ...  
&nbsp;&nbsp;&nbsp;&nbsp;Triangle neighbors and vertex normals...  
Loading geometry from /Users/joshbear/clinical/meg/anat/E-0192/surf/lh.sphere...  
&nbsp;&nbsp;&nbsp;&nbsp;Source space vertex moved from 154860 to 154932 because of double occupation  
&nbsp;&nbsp;&nbsp;&nbsp;Source space vertex moved from 154862 to 154866 because of double occupation  
&nbsp;&nbsp;&nbsp;&nbsp;Source space vertex moved from 154908 to 154891 because of double occupation  
&nbsp;&nbsp;&nbsp;&nbsp;Source space vertex moved from 154866 to 154868 because of double occupation  
&nbsp;&nbsp;&nbsp;&nbsp;Source space vertex moved from 154932 to 154938 because of double occupation  
Traceback (most recent call last):  
&nbsp;&nbsp;File "\<stdin\>", line 1, in \<module\>  
&nbsp;&nbsp;File "\<string\>", line 2, in setup\_source\_space  
&nbsp;&nbsp;File "/Users/joshbear/bin/anaconda3/envs/mne/lib/python3.6/site-packages/mne/utils.py", line 952, in verbose  
&nbsp;&nbsp;&nbsp;&nbsp;return function(\*args, \*\*kwargs)  
&nbsp;&nbsp;File "/Users/joshbear/bin/anaconda3/envs/mne/lib/python3.6/site-packages/mne/source\_space.py", line 1470, in setup\_source\_space  
&nbsp;&nbsp;&nbsp;&nbsp;subjects\_dir)  
&nbsp;&nbsp;File "/Users/joshbear/bin/anaconda3/envs/mne/lib/python3.6/site-packages/mne/surface.py", line 732, in \_create\_surf\_spacing  
&nbsp;&nbsp;&nbsp;&nbsp;'%d / %d' % (k, nmap))  
RuntimeError: Could not find neighbor for vertex 8015 / 10242  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: smime.p7s  
Type: application/pkcs7-signature  
Size: 1521 bytes  
Desc: not available  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20190305/6c161050/attachment.bin](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190305/6c161050/attachment.bin)  
-------------- next part --------------  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20190305/6c161050/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190305/6c161050/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:** [March 5, 2019, 9:47pm UTC](https://mne.discourse.group/t/setup-soruce-space-error/1768/2 "2019-03-05T21:47:55Z")

</div>

External Email - Use Caution

Is the brain in question small? If so it might be too small to work with  
ico-5 spacing (which has 10242 verts as opposed to oct-6's 4098). You could  
switch to using oct-6 for all your subjects.

Eric

---

<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:** [March 5, 2019, 10:11pm UTC](https://mne.discourse.group/t/setup-soruce-space-error/1768/3 "2019-03-05T22:11:04Z")

</div>

I think I switched to ico5 because I ran into some problem morphing to fsaverage so that I could use the HCPMMP labels with oct6. I?ll give it a try, though, as I don?t recall what the specific problem was ? to be continued!

Thank you,  
Josh

> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution
> 
> Is the brain in question small? If so it might be too small to work with ico-5 spacing (which has 10242 verts as opposed to oct-6's 4098). You could switch to using oct-6 for all your subjects.
> 
> Eric
> 
> Hi all,
> 
> I received an error message when using setup\_source\_space with spacing=?ico5?. It states that it could not find a neighbor for vertex 8015 / 10242. The Freesurfer segmentation looks pretty good, and when I use setup\_source\_space with spacing=?oct6? it works fine. I?ve also used this same script (and, ergo, the same source space call) with several other subjects without error. Any thoughts on the best way to resolve this? Error code below.
> 
> Thank you,  
> Josh
> 
> \>\>\> src = mne.setup\_source\_space(subject, spacing='ico5', subjects\_dir=mri\_root\_directory)  
> Setting up the source space with the following parameters:
> 
> SUBJECTS\_DIR = /Users/joshbear/clinical/meg/anat/  
> Subject = E-0192  
> Surface = white  
> Icosahedron subdivision grade 5
> 
> \>\>\> 1. Creating the source space...
> 
> Doing the icosahedral vertex picking...  
> Loading /Users/joshbear/clinical/meg/anat/E-0192/surf/lh.white...  
> Mapping lh E-0192 -\> ico (5) ...  
> &nbsp;&nbsp;&nbsp;&nbsp;Triangle neighbors and vertex normals...  
> Loading geometry from /Users/joshbear/clinical/meg/anat/E-0192/surf/lh.sphere...  
> &nbsp;&nbsp;&nbsp;&nbsp;Source space vertex moved from 154860 to 154932 because of double occupation  
> &nbsp;&nbsp;&nbsp;&nbsp;Source space vertex moved from 154862 to 154866 because of double occupation  
> &nbsp;&nbsp;&nbsp;&nbsp;Source space vertex moved from 154908 to 154891 because of double occupation  
> &nbsp;&nbsp;&nbsp;&nbsp;Source space vertex moved from 154866 to 154868 because of double occupation  
> &nbsp;&nbsp;&nbsp;&nbsp;Source space vertex moved from 154932 to 154938 because of double occupation  
> Traceback (most recent call last):  
> &nbsp;&nbsp;File "\<stdin\>", line 1, in \<module\>  
> &nbsp;&nbsp;File "\<string\>", line 2, in setup\_source\_space  
> &nbsp;&nbsp;File "/Users/joshbear/bin/anaconda3/envs/mne/lib/python3.6/site-packages/mne/utils.py", line 952, in verbose  
> &nbsp;&nbsp;&nbsp;&nbsp;return function(\*args, \*\*kwargs)  
> &nbsp;&nbsp;File "/Users/joshbear/bin/anaconda3/envs/mne/lib/python3.6/site-packages/mne/source\_space.py", line 1470, in setup\_source\_space  
> &nbsp;&nbsp;&nbsp;&nbsp;subjects\_dir)  
> &nbsp;&nbsp;File "/Users/joshbear/bin/anaconda3/envs/mne/lib/python3.6/site-packages/mne/surface.py", line 732, in \_create\_surf\_spacing  
> &nbsp;&nbsp;&nbsp;&nbsp;'%d / %d' % (k, nmap))  
> RuntimeError: Could not find neighbor for vertex 8015 / 10242  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu \<mailto:Mne\_analysis at nmr.mgh.harvard.edu\>  
> [https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne\_analysis\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis _______________________________________________ )  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20190305/d054ea96/attachment-0002.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190305/d054ea96/attachment-0002.html)  
-------------- next part --------------  
A non-text attachment was scrubbed...  
Name: smime.p7s  
Type: application/pkcs7-signature  
Size: 1521 bytes  
Desc: not available  
Url : [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20190305/d054ea96/attachment-0001.bin](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190305/d054ea96/attachment-0001.bin)  
-------------- next part --------------  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20190305/d054ea96/attachment-0003.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20190305/d054ea96/attachment-0003.html)
