forward solution of data with bad channels

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

This looks like an indexing bug we'll need to fix. Can you open an issue on
GitHub, preferably with a minimal example using the `sample` dataset
showing how to replicate?

In the meantime it sounds like you at least have a usable workaround by
setting info['bads']=[] temporarily.

Eric

Thanks a lot.
I posted an issue <Issues · mne-tools/mne-python · GitHub;
this morning.
In brief, it seems to be a problem with handling bad channels on our old
CTF data and a specific correction (compensation) method applied to it.
Max

Le ven. 9 mars 2018 ? 17:30, Eric Larson <larson.eric.d at gmail.com> a ?crit :

This looks like an indexing bug we'll need to fix. Can you open an issue
on GitHub, preferably with a minimal example using the `sample` dataset
showing how to replicate?

In the meantime it sounds like you at least have a usable workaround by
setting info['bads']= temporarily.

Eric

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

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you
in error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

The information in this e-mail is intended only for the person to whom it
is
addressed. If you believe this e-mail was sent to you in error and the
e-mail
contains patient information, please contact the Partners Compliance
HelpLine at
MyComplianceReport.com: Compliance and Ethics Reporting . If the e-mail was sent to you in
error
but does not contain patient information, please contact the sender and
properly
dispose of the e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180313/beae6b48/attachment.html