[Mne_analysis] forward solution of data with bad channels

Maximilien Chaumon maximilien.chaumon at gmail.com
Fri Mar 9 10:23:49 EST 2018
Search archives:

Dear all,

I'm trying to compute a forward solution with data that has bad channels.

raw = mne.io.read_raw_fif(raw_fname)

# raw.info['bads'] = []


trans = subjects_dir + '/' + subject + '/' + subject + '-trans.fif'
src = subjects_dir + '/' + subject + '/' + subject + '-ico4-src.fif'

bem = subjects_dir + '/' + subject + '/' + subject + '-5120-bem-sol.fif'


fwd = mne.make_forward_solution(raw.info, trans=trans, src=src, bem=bem,

meg=True, eeg=False, mindist=5.0, n_jobs=2)


This crashes with the following message, unless I remove the bad channels
specification with raw.info['bads'] = []

Traceback (most recent call last):

  File "<ipython-input-28-73c57cb4dc56>", line 14, in <module>
    meg=True, eeg=False, mindist=5.0, n_jobs=2)

  File "<string>", line 2, in make_forward_solution

  File "/home/anaconda2/lib/python2.7/site-packages/mne/utils.py", line
728, in verbose
    return function(*args, **kwargs)

  File
"/home/anaconda2/lib/python2.7/site-packages/mne/forward/_make_forward.py",
line 608, in make_forward_solution
    infos, coil_types, n_jobs)

  File "<string>", line 2, in _compute_forwards

  File "/home/anaconda2/lib/python2.7/site-packages/mne/utils.py", line
728, in verbose
    return function(*args, **kwargs)

  File
"/home/anaconda2/lib/python2.7/site-packages/mne/forward/_compute_forward.py",
line 851, in _compute_forwards
    Bs = _compute_forwards_meeg(rr, fwd_data, n_jobs)

  File "<string>", line 2, in _compute_forwards_meeg

  File "/home/anaconda2/lib/python2.7/site-packages/mne/utils.py", line
728, in verbose
    return function(*args, **kwargs)

  File
"/home/anaconda2/lib/python2.7/site-packages/mne/forward/_compute_forward.py",
line 807, in _compute_forwards_meeg
    both[:, picks] = B

ValueError: shape mismatch: value array of shape (15372,150) could not be
broadcast to indexing result of shape (139,15372)



Do you have a solution?
Many thanks!
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180309/ce042b3a/attachment.html 


More information about the Mne_analysis mailing list