Closed mscheltienne closed 2 months ago
@mscheltienne Thanks for bringing the scaling
up. I looked into this earlier and reached to the conclusion that we don't need to do anything on our end. libeep
C library takes care of the scaling in libeep_get_samples
function that we use in
pyeep_get_samples_as_buffer
or pyeep_get_samples
functions.
CNT files do save all relevant scale
and unit
information, and libeep
C library reads all those channel specific information as eegchan_s
structure. See the definition here. Basically the actual sample values are raw_data_buffer * chan_info.iscale * chan_info.rscale
in chan_info.runit
.
Function libeep_get_samples
reads the raw buffer, and then applies the scaling chan_info.iscale * chan_info.rscale
, so that the scaled buffer is in unit chan_info.runit
. Refer to the buffer_scaled
and buffer_scaled
variables here. So, we no longer need to track the scaling explicitly in mne.io.rawANT
objects, i.e., don't expose the pyeep_get_channel_scale
method.
I second you on the absence of filtering information from the CNT file.
Great, thanks for the explanation! Monday, I'll export an actual EEG recording while applying a montage with weird scaling, let's see how it loads back in MNE ;)
OK, I can now confirm that scaling is a non-issue! I exported an actual EEG recording with a couple of surprising scaling in the montage, yielding 'flat' lines in the review mode of the eego software (e.g. 1000uV, 10000 uV, 1000V, 10000V). When loaded in MNE, the signals are correctly scaled ;)
As the last addition to this reader, I wanted to look into the different possible channel references (#5) and different channel units (#19). So, I went into the
eego
software and exported a file applying the followingmontage
:The dataset was recorded with no cap connected (floating pin) thus the data itself is garbage.
eego
software seems to have many options for theScale
and onlyuV
orV
for the units. But in the.cnt
file, I can't retrieve either. The unit is alwaysuV
, and I added thepyeep_get_channel_scale
function but which returns the same float number for all channels, number which does not correspond to anything ineego
.@proloyd Could you have a look through this and confirm that (1) I did not mess up the
pyeep_get_channel_scale
function and (2) that you also can't retrieve the unit/scale information from the attached dataset? Better to have 2 pairs of eyes on this before calling it quit. Thanks!