mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.69k stars 1.31k forks source link

Bug with lcmv when no SSP #764

Closed yousrabk closed 11 years ago

yousrabk commented 11 years ago

I'm trying to compute LCMV beamformer on evoked data without SSP, it seems that it doesn't work

Apply SSPs

if info['projs']:
    proj, ncomp, _ = make_projector(info['projs'], ch_names)
    G = np.dot(proj, G)

return is_free_ori, picks, ch_names, proj, vertno, G

proj does not exist without getting in the loop, may be we just add a "else: proj = []" ?

rgoj commented 11 years ago

Thanks for catching and reporting this - it's something I've been recently changing.

may be we just add a "else: proj = []" ?

This sounds good to me, though I'd do proj = None. I think it'd be cleanest to also change the statements if info['projs']: later on in _apply_lcmv (and _apply_dics) to if proj:

Would you like to do this?

yousrabk commented 11 years ago

Yes sure, I will do it.

agramfort commented 11 years ago

I'd rather update the read meas info function to make it a list all the time

Le 13 sept. 2013 à 21:55, yousrabk notifications@github.com a écrit :

Yes sure, I will do it.

— Reply to this email directly or view it on GitHub.

rgoj commented 11 years ago

Yes sure, I will do it.

thanks!

I'd rather update the read meas info function to make it a list all the time

Do you mean letting proj be an identity matrix, like this:

proj, ncomp, _ = make_projector(info['projs'], ch_names)
if info['projs']:
    G = np.dot(proj, G)

I guess that would make sense, then the check if info['projs'] here and later on in _apply_lcmv() is good and saves us the computation time of multiplying with an identity matrix even though the proj parameter will then be an identity matrix and could be used if one wished to do that/made a mistake? That's sounds like a nice solution.