mne-tools / mne-bids

MNE-BIDS is a Python package that allows you to read and write BIDS-compatible datasets with the help of MNE-Python.
https://mne.tools/mne-bids/
BSD 3-Clause "New" or "Revised" License
132 stars 87 forks source link

Mismatch of coord systems between electrodes and channels/events #1082

Open laemtl opened 2 years ago

laemtl commented 2 years ago

Description of the problem

Channel//Epoch data are exported in the ALS coord space to follow the EEGLAB specs. On the other hand, electrode data are exported in the head/captrak coord space.

Is there any reason to not export the electrode data in the same space?

Steps to reproduce

Exporting an EEGLAB dataset using
write_raw_bids(..., allow_preload=False, overwrite=False, verbose=False)

Link to data

No response

Expected results

Electrode data in the EEGLAB space

Actual results

Electrode data in the Captrak space

Additional information

Platform: Windows-10-10.0.19041-SP0 Python: 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)] Executable: C:\Users\Lae\Documents\hbcd-eeg2bids\Scripts\python.exe CPU: Intel64 Family 6 Model 142 Stepping 9, GenuineIntel: 4 cores Memory: Unavailable (requires "psutil" package) mne: 1.2.0 numpy: 1.20.3 {OpenBLAS 0.3.13.dev with 4 threads} scipy: 1.9.2 matplotlib: 3.6.1 {backend=TkAgg}

sklearn: 1.1.2 numba: 0.56.2 nibabel: Not found nilearn: Not found dipy: Not found openmeeg: Not found cupy: Not found pandas: 1.5.0 pyvista: Not found pyvistaqt: Not found ipyvtklink: Not found vtk: Not found qtpy: Not found ipympl: Not found pyqtgraph: Not found pooch: v1.6.0

mne_bids: 0.10 mne_nirs: Not found mne_features: 0.2.1 mne_qt_browser: Not found mne_connectivity: Not found mne_icalabel: Not found

welcome[bot] commented 2 years ago

Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

laemtl commented 2 years ago

@agramfort

hoechenberger commented 2 years ago

I think that's one for @sappelhoff to tackle 🤠

sappelhoff commented 2 years ago

I think that's a classic case of "it was complicated and we only implemented what users needed at that time". I am afraid this will need a deep dive into the code base ...

agramfort commented 2 years ago

@laemtl technically I think we can do what we do but coordinate systems should be given in the sidecar files. Now I don't know if we do it properly.

@laemtl can you share a folder with some data and a script to replicate / investigate and if possible use one of the mne demo datasets. We have some data in CTF format eg https://mne.tools/dev/auto_tutorials/io/60_ctf_bst_auditory.html