[Mne_analysis] forward solution of data with bad channels

Maximilien Chaumon maximilien.chaumon at gmail.com
Tue Mar 13 08:01:00 EDT 2018
Search archives:

Thanks a lot.
I posted an issue <https://github.com/mne-tools/mne-python/issues/5013>
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
>
>
> 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.
>>
>>
> _______________________________________________
> 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/20180313/beae6b48/attachment.html 


More information about the Mne_analysis mailing list