mne-tools / mne-python

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

ENH/FIX: default EEG layout when no headshape ore coil positions are present #926

Closed dengemann closed 10 years ago

dengemann commented 10 years ago

I had a chance to more closely look into the issue raised by Jennifer earlier today. Her dataset was converted from a brain vision format and neither includes coil position information nor does it have headshape.

This leads to two sorts of errors

1) fit_sphere_to_headshape necessarily fails

2) after substituting the empty dig with the sample's digitizer points I get a problem from delaunay.Triangulation because it tries to operate on arrays of zeros -- we don't have coil positions ...

We should catch this and provide a default layout with default EEG positions for standard {32, 64, 128} caps.

Any thoughts? @t3on @christianmbrodbeck @agramfort

mluessi commented 10 years ago

Doesn't the layout depend on the manufacturer of the cap, so a single layout may not work?

PS: ore coils are pretty bad for MEG, because they can be magnetic depending on the ore used ;)

mluessi commented 10 years ago

If the BioSemi caps are quite standard, we could get the positions from here: http://www.biosemi.com/headcap.htm

dengemann commented 10 years ago

@mluessi looking at FT there are many different standard layouts that can be used ... another problem then is how to deal with coil positions and names (which underwent renaming ...)

christianbrodbeck commented 10 years ago

Doesn't the layout depend on the manufacturer of the cap, so a single layout may not work?

I would have the same question, even if positions are in a standard system the order in which channels are stored is not standardized. For brain vision systems we can create custom layouts for every recording.

dengemann commented 10 years ago

Btw. more standard layouts https://github.com/yuval-harpaz/ft_BIU/tree/master/matlab/fieldtrip-20120309/template/layout

The custom components are a problem. But we should at least have an API that allows users to add their layouts and coils.

mluessi commented 10 years ago

Users can already use read_layout with a custom layout, doesn't this work?

dengemann commented 10 years ago

read_layout with a custom layout, doesn't this work?

Yes, but still then there is the problem with missing coil positions. the triangulation would fail without chs['loc'] ...

teonbrooks commented 10 years ago

should we just generate the chs['loc'] from the layout? That is an option I have in edf reader. For that, It is currently taking .hpts file, which is pretty similar to the .lay files.

teonbrooks commented 10 years ago

looking to close some issues before i start some more. did we resolve this or is this still an open issue?

dengemann commented 10 years ago

Open issue ....

wmvanvliet commented 10 years ago

The EDF/BDF reader did not correctly fill out all necessary values of the info dict. See my pull request #1541

Now, given a .edf or .bdf file and appropriate .htps, I can use plot_topo without problems.

agramfort commented 10 years ago

I cannot help here. Does it mean #1541 closes this issue?

teonbrooks commented 10 years ago

i think this is being resolved with the open pull request. closing here.