mne-tools / mne-python

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

Raw browser issues (and ideas) #10955

Open cbrnr opened 2 years ago

cbrnr commented 2 years ago

I think that a couple of features might be missing from our raw browser (not specific to any backend):

  1. There is no indication of the absolute values of a channel, because the scale bar only shows a range. It would be very helpful if e.g. the zero value (or min/max) was shown as well.
  2. The browser always shows "0.0 AU" in the scale bar for "stim" and "misc" channels (and possibly other types).
  3. There is only one scale bar even if there are two different channels types (e.g. "misc" and "stim").
  4. Could we automatically show the best unit prefix (e.g. instead of 20,000µV -> 20mV)? This would make the scale bar easier to read for more exotic scalings.

Here's an example which demonstrates these issues:

import mne
from numpy.random import default_rng

fs, nchans = 250, 3
rng = default_rng(42)
data = rng.standard_normal(size=(nchans, 50 * fs)) * 5e-6
data[0] += 10
info = mne.create_info(nchans, fs, ["eeg", "misc", "stim"])
raw = mne.io.RawArray(data, info)
raw.plot()
  1. The first channel has an offset of 10V, but this is not apparent from the plot.
  2. The second channel has a scale bar with "0.0 AU".
  3. The third channel does not have a separate scale bar, although it has a different type than the second channel.
cbrnr commented 2 years ago

@drammock @larsoner WDYT?

larsoner commented 2 years ago
  1. ... It would be very helpful if e.g. the zero value (or min/max) was shown as well.

By default, DC is removed (and sometimes huge) so this is going to be application specific. I can't think of a good way to implement this but maybe it's possible

  1. The browser always shows "0.0 AU"

This seems unhelpful -- we should show something other than 0.0 (though the AU seems fine)

  1. There is only one scale bar even if there are two different channels types

I think this is fine assuming they have the same units and scale preferences (according to scalings). But I guess there's no harm in adding another scale bar, as it just helps tell people "there are different channel types here".

Could we automatically show the best unit prefix

It has the disadvantage that it gets a bit harder to read/interpret if this switches often. A change from 100 uV to 1100 uV when scrolling is easier to see / understand immediately than a change from 100 uV to 1.1 mV. But maybe people would get used to it, or it wouldn't switch all that often. So I guess we could try it.