[Mne_analysis] reading bem solution

Tadeusz W. Kononowicz t.w.kononowicz at icloud.com
Thu Jan 21 08:33:52 EST 2016
Search archives:

Hello Mne Users,


This code works fine:
bem1 = path + '-20480-20480-20480-bem-sol.fif'
surfaces = mne.read_bem_surfaces(bem1)

But when I want to read another solution I got that. Any hints?


bem2 = path + '-5120-5120-5120-bem-sol.fif'
surfaces = mne.read_bem_surfaces(bem2)

---------------------------------------------------------------------------
IOError Traceback (most recent call last)
<ipython-input-10-5b41654e22f2> in <module>()
----> 1 surfaces = mne.read_bem_surfaces(sub_name_bem)

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/bem.pyc in read_bem_surfaces(fname, patch_stats, s_id, verbose)

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/utils.pyc in verbose(function, *args, **kwargs)
549 finally:
550 set_log_level(old_level)
--> 551 return function(*args, **kwargs)
552
553

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/bem.pyc in read_bem_surfaces(fname, patch_stats, s_id, verbose)
1063 coord_frame = FIFF.FIFFV_COORD_MRI
1064 # Open the file, create directory
-> 1065 f, tree, _ = fiff_open(fname)
1066 with f as fid:
1067 # Find BEM

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/io/open.pyc in fiff_open(fname, preload, verbose)

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/utils.pyc in verbose(function, *args, **kwargs)
549 finally:
550 set_log_level(old_level)
--> 551 return function(*args, **kwargs)
552
553

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/io/open.pyc in fiff_open(fname, preload, verbose)
144 directory.append(tag)
145
--> 146 tree, _ = make_dir_tree(fid, directory)
147
148 logger.debug('[done]')

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/io/tree.pyc in make_dir_tree(fid, directory, start, indent, verbose)

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/utils.pyc in verbose(function, *args, **kwargs)
549 finally:
550 set_log_level(old_level)
--> 551 return function(*args, **kwargs)
552
553

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/io/tree.pyc in make_dir_tree(fid, directory, start, indent, verbose)
76 if directory[this].kind == FIFF_BLOCK_START:
77 if this != start:
---> 78 child, this = make_dir_tree(fid, directory, this, indent + 1)
79 tree['nchild'] += 1
80 tree['children'].append(child)

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/io/tree.pyc in make_dir_tree(fid, directory, start, indent, verbose)

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/utils.pyc in verbose(function, *args, **kwargs)
549 finally:
550 set_log_level(old_level)
--> 551 return function(*args, **kwargs)
552
553

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/io/tree.pyc in make_dir_tree(fid, directory, start, indent, verbose)
55
56 if directory[start].kind == FIFF_BLOCK_START:
---> 57 tag = read_tag(fid, directory[start].pos)
58 block = tag.data
59 else:

/home/tkononow/anaconda2/lib/python2.7/site-packages/mne-0.11.0-py2.7.egg/mne/io/tag.pyc in read_tag(fid, pos, shape, rlims)
480 if tag.next != FIFF.FIFFV_NEXT_SEQ:
481 # f.seek(tag.next,0)
--> 482 fid.seek(tag.next, 1) # XXX : fix? pb when tag.next < 0
483
484 return tag

IOError: [Errno 22] Invalid argument


Thank you for your help,

Tadeusz W. Kononowicz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160121/55269845/attachment.html 


More information about the Mne_analysis mailing list