Difficulties with defining source space src, when I change spacing to ico5

I have a difficulties with defining source space src, when I change spacing to ico5. It is no group analysis, I defining source space for one subject only

  • MNE-Python version: 0.22.0
  • operating system: Linux Ubuntu
os.environ['SUBJECTS_DIR'] = '/net/server/data/Archive/prob_learn/freesurfer'
subject='P045'
src = mne.setup_source_space(subject = subject, spacing='ico5', add_dist=False )

Gives an error message:

setting up the source space with the following parameters:

SUBJECTS_DIR = /net/server/data/Archive/prob_learn/freesurfer
Subject      = P045
Surface      = white
Icosahedron subdivision grade 5

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

Doing the icosahedral vertex picking...
Loading /net/server/data/Archive/prob_learn/freesurfer/P045/surf/lh.white...
Mapping lh P045 -> ico (5) ...
    Triangle neighbors and vertex normals...
Loading geometry from /net/server/data/Archive/prob_learn/freesurfer/P045/surf/lh.sphere...
    Source space vertex moved from 54910 to 56106 because of double occupation
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-9-df604f17014f> in <module>
----> 1 src = mne.setup_source_space(subject =subject, spacing='ico5', add_dist=False )

<decorator-gen-116> in setup_source_space(subject, spacing, surface, subjects_dir, add_dist, n_jobs, verbose)

/opt/anaconda3/envs/py37/lib/python3.7/site-packages/mne/source_space.py in setup_source_space(***failed resolving arguments***)
   1531                         % (hemi, subject, stype, sval))
   1532         s = _create_surf_spacing(surf, hemi, subject, stype, ico_surf,
-> 1533                                  subjects_dir)
   1534         logger.info('loaded %s %d/%d selected to source space (%s)'
   1535                     % (op.split(surf)[1], s['nuse'], s['np'], src_type_str))

/opt/anaconda3/envs/py37/lib/python3.7/site-packages/mne/surface.py in _create_surf_spacing(surf, hemi, subject, stype, ico_surf, subjects_dir)
    970                 if len(inds) == 0:
    971                     raise RuntimeError('Could not find neighbor for vertex '
--> 972                                        '%d / %d' % (k, nmap))
    973                 else:
    974                     mmap[k] = neigh[inds[-1]]

RuntimeError: Could not find neighbor for vertex 4395 / 10242.

Could you help me with the problem?

Another quistion, how I can change amount of sources in fsaverage (by default it is 20484). But if I use spacing = oct6 (in mne.setup_source_space by default), the amount of sources for subject is 8196, and Icannot morph it with fsaverage, I suppose.

Thank you in advance

Hello @Mirrabella and welcome to the forum!

Please fill in the requested information (MNE-Python version, operating system) in the post template (you can edit your existing posting). Also, we will need much more information on what you have been trying to do and what exactly isn’t working. Otherwise it’s close to impossible to help you. Please provide code snippets and ideally a minimal working example.

Thanks,
Richard

@Mirrabella I’ve edited your post for clarity, you can take a look at the edits to be able to format the code and exceptions nicely next time :slight_smile:

1 Like

thank you very much :slight_smile: