Closed sappelhoff closed 6 years ago
hey @sappelhoff, the reader assumes that the data are in microvolts, so the default scale=1
. the data are stored in Volts in the Raw
object. within the ChannelInfo in .vhdr
file, there's an associated unit for each channel. we take that info to determine what the proper scale. if that is info is missing, we use the scale as a failsafe that is user-defined.
also, the reason it is 1e7 instead of 1e6 is because the resolution is 0.1uV (10e-1 * 10 e-6).
Hi @teonbrooks, thanks for the quick reply and the hint as to why I found 1e-7 instead of the more sensible 1e-6 ...
What you are saying is that it is expected behavior to have the unit "Volts" in the Raw
object - irrespective of the original data format. Could you point me to where this is documented either in a docstring or on the website? Perhaps I missed it.
In case I did not miss it, I think it would be helpful to add this information somewhere either in documentation or even as a key in Raw.info
(though that would of course be more substantial)
yes we store everything in international system units: EEG in V, mag in T, grad in T/m it simplifies things I think.
it could certainly be better documented in :
http://martinos.org/mne/stable/auto_tutorials/plot_creating_data_structures.html and/or http://martinos.org/mne/stable/manual/io.html
@agramfort, thanks for the links. I see now what I probably missed: https://github.com/mne-tools/mne-python/blob/58e59df8aa99aab046eced1374c80eff290c4f2a/tutorials/plot_creating_data_structures.py#L80-L89
We could add a "Note" in a blue box on the Importing Data into MNE doc saying something like:
Note: Irrespective of the units used in your manufacturer's file format, MNE will only use the following units for any
Raw
object and make conversions accordingly:
- V: eeg, eog, seeg, emg, ecg, bio, ecog
- T: mag
- T/m: grad
- M: hbo, hbr
- Am: dipole
- AU: misc
+1 PR welcome
When reading BrainVision Recorder files, the EEG values for my data seemed off by 1e6 decimal points. BV data is usually saved in microVolts, so at first I thought that perhaps MNE is only working in Volts and there was an implicit scaling - however, there is no documentation about this. Furthermore, the docstring of the
mne.io.read_raw_brainvision
function explicitly states the resulting unit to be microvolts.I tried to find an error in the code, but it was too convoluted for me to get an idea. It could be here:
https://github.com/mne-tools/mne-python/blob/58e59df8aa99aab046eced1374c80eff290c4f2a/mne/io/brainvision/brainvision.py#L492
... but it could also be at the place where raw.load_data() is implemented ... ?
I have made a short example showing the problem (see example files in attached .zip folder: example_files.zip). It's weird that for my controlled example, I find the scaling to be 1e7 instead of 1e6 - but I cannot find the reason for that either ...
In any case, the point is made and help would be appreciated!