jackz314 / eeglabio

I/O support for EEGLAB files in Python.
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Export to EEGLAB should support single and double precision #9

Closed larsoner closed 2 years ago

larsoner commented 2 years ago

Quoting https://github.com/mne-tools/mne-python/issues/11015 :

Currently, exporting to EEGLAB always writes double precision floats. However, @arnodelorme mentioned in #11013, the EEGLAB default is actually single precision. Therefore, we should introduce a new parameter precision with two possible options "single" and "double". I'm not sure what the default should be, probably "double" to be on the safe side.

This should probably be implemented in eeglabio. Speaking of which, I wanted to suggest to include the code in MNE-Python directly to make things easier for us. I know we discussed outsourcing this to minimize maintenance costs for us, but this is not really the case. I actually think that maintenance will be easier if we have this code in our package. WDYT?

arnodelorme commented 2 years ago

I think the default should be single precision (32 bits). The max precision of EEG is considered to be 19 bits. BIOSEMI file format is 24 bits. EDF is 16 bits. 64 bit is overkill. For computation (ICA, filtering), data should be converted to double precision though.

jackz314 commented 2 years ago

Makes sense, just pushed an update for precision support

jackz314 commented 2 years ago

Should be fixed in v0.0.2.post3.