[Mne_analysis] forward solution of data with bad channels

Eric Larson larson.eric.d at gmail.com
Fri Mar 9 11:29:28 EST 2018
Search archives:

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


On Fri, Mar 9, 2018 at 10:23 AM, Maximilien Chaumon <
maximilien.chaumon at gmail.com> wrote:

> 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
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> 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
> http://www.partners.org/complianceline . 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/20180309/3faac882/attachment.html 


More information about the Mne_analysis mailing list