Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 24 2017 19:45

    EtienneCmb on screenshot

    Fix canvas names (compare)

  • Aug 24 2017 18:51

    EtienneCmb on screenshot

    Fix factor visibility Add screenshot GUI tooltips (compare)

  • Aug 24 2017 18:33

    EtienneCmb on screenshot

    Remove screenshot menu Screenshot configuration for Sl… (compare)

  • Aug 24 2017 17:57

    EtienneCmb on develop

    Use master figure Bump to version v0.3.1 Merge branch 'release/v0.3.1' i… (compare)

  • Aug 24 2017 17:57

    EtienneCmb on screenshot

    Merge branch 'release/v0.3.1' i… Remove brain GUI components rel… Add UiScreenshot class and 12 more (compare)

agpr141
@agpr141
@raphaelvallat Thanks for your help! I am now preprocessing my data in MNE before calling visbrain.
agpr141
@agpr141

Hi again! I pre-process and then pass my data in to Sleep using the following command:

Sleep(Preprocessed, channels = ["F4", "C4", "O2", "EOG1", "EOG2", "EMG", "EKG"], sf = 256, downsample = 256, use_mne = True).show()

However I notice that this does not import any time information (e.g. start time). I see I can pass an additional 'annotations' argument when I call Sleep class but I ma unsure how to structure my input string. From raw.Info['meas_date'] I can extract the unix starting timestamp, but I do not know where to go from there. Can anyone suggest how to pass information to the Sleep GUI?
Thankyou!

jh
@jh537
hi, I want to use visbrain with sleep. I use Kubuntu19 and have installed everything. What happens next? Sorry for my stupidity.
jh
@jh537
ah i'm getting on
Raphael Vallat
@raphaelvallat
Hi @agpr141 ! The current version of Visbrain does not implement time extraction from an MNE object. If that's really important I suggest that you install my develop version of Sleep: https://github.com/raphaelvallat/visbrain which does support time extraction from MNE object. Thanks!
Hi @jh537 ! I suggest that you try running some of the examples described in the documentation http://visbrain.org/sleep.html
jh
@jh537

hi @raphaelvallat, python3
Python 3.7.3 (default, Aug 20 2019, 17:04:43)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

print(vispy.version)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'vispy' is not defined
import vispy
print(vispy.version)
0.6.1
Sleep().show()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'Sleep' is not defined
from visbrain.gui import Sleep
QSettings::value: Empty key passed
QSettings::value: Empty key passed
WARNING: Although PyQt5 is already imported, the PyQt5 backend could not
be used ("cannot import name 'QtOpenGL' from 'PyQt5' (/usr/lib/python3/dist-packages/PyQt5/init.py)").
Note that running multiple GUI toolkits simultaneously can cause side effects.
Sleep().show()
Data successfully loaded (/home/r7598/Schreibtisch/sleep_edf/excerpt2.edf):

  • Sampling-frequency : 200.00Hz
  • Number of time points (before down-sampling): 360000
  • Down-sampling frequency : 100.00Hz
  • Number of time points (after down-sampling): 180000
  • Number of channels : 23
    kf5.kio.widgets: No node found for item that was just removed: QUrl("file:///home/r7598/Schreibtisch/sleep_edf/excerpt2.edf")
    /usr/local/lib/python3.7/dist-packages/pandas/core/generic.py:5191: FutureWarning: Attribute 'is_copy' is deprecated and will be removed in a future version.
    object.getattribute(self, name)
    /usr/local/lib/python3.7/dist-packages/pandas/core/generic.py:5192: FutureWarning: Attribute 'is_copy' is deprecated and will be removed in a future version.
    return object.setattr(self, name, value)
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/sleep.py", line 100, in init
    annotations)
    File "/usr/local/lib/python3.7/dist-packages/visbrain/io/readsleep.py", line 134, in init
    hypno,
    = read_hypno(hypno, time=time, datafile=file)
    File "/usr/local/lib/python3.7/dist-packages/visbrain/io/rw_hypno.py", line 325, in readhypno
    hypno,
    , sf_hyp = hypno_time_to_sample(df, len(time))
    File "/usr/local/lib/python3.7/dist-packages/visbrain/io/rw_hypno.py", line 69, in hypno_time_to_sample
    time_idx = np.array(df['Time']).astype(float)
    ValueError: could not convert string to float: '1}'

Data https://www.dropbox.com/s/bj1ra95rbksukro/sleep_edf.zip?dl=1

Thank you, I'm still stuck there for the moment.
jh
@jh537
ah ah i'm getting on many thanks
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/sleep.py", line 150, in init
UiElements.init(self)
File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/interface/ui_elements/ui_elements.py", line 23, in init
eval(k + '.init(self)')
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/interface/ui_elements/ui_panels.py", line 44, in init
self._fcn_chan_check_and_create_w()
File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/interface/ui_elements/ui_panels.py", line 280, in _fcn_chan_check_and_create_w
self._chanLayout[i].addWidget(self._chanCanvas[i].canvas.native)
TypeError: addWidget(self, QWidget, stretch: int = 0, alignment: Union[Qt.Alignment, Qt.AlignmentFlag] = Qt.Alignment()): argument 1 has unexpected type 'CanvasBackend'
jh
@jh537
it's going on, Python 3 bindings for Qt5's OpenGL module missing
jh
@jh537
I can't get any further here, it works when loading directly with the code.
Sleep().show()
Data successfully loaded (/home/r7598/visbrain_data/example_data/excerpt2.edf):
  • Sampling-frequency : 200.00Hz
  • Number of time points (before down-sampling): 360000
  • Down-sampling frequency : 100.00Hz
  • Number of time points (after down-sampling): 180000
  • Number of channels : 23
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/sleep.py", line 100, in init
    annotations)
    File "/usr/local/lib/python3.7/dist-packages/visbrain/io/readsleep.py", line 134, in init
    hypno,
    = read_hypno(hypno, time=time, datafile=file)
    File "/usr/local/lib/python3.7/dist-packages/visbrain/io/rw_hypno.py", line 316, in read_hypno
    hypno, sf_hyp = _read_hypno_edf_sample(filename, datafile)
    File "/usr/local/lib/python3.7/dist-packages/visbrain/io/rw_hypno.py", line 505, in _read_hypno_edf_sample
    data_hypno = f.read().decode('utf-8') # read the data
    UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 1: invalid start byte
agpr141
@agpr141
Thanks again @raphaelvallat !
Raphael Vallat
@raphaelvallat
Hi @jh537 ! I think you're trying to load the edf file (with eeg data) as an hypnogram here, hence the error. When prompted for an hypnogram, please click cancel. Thanks!
jh
@jh537
@raphaelvallat many thanks for their answer, I will test it
jh
@jh537

$ sudo -H python3
Python 3.7.3 (default, Aug 20 2019, 17:04:43)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from visbrain.gui import Sleep
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
data = '8.bdf'
Sleep () . show ()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/sleep.py", line 100, in init
annotations)
File "/usr/local/lib/python3.7/dist-packages/visbrain/io/read_sleep.py", line 61, in init
file, ext = get_file_ext(data)
File "/usr/local/lib/python3.7/dist-packages/visbrain/io/rw_utils.py", line 30, in get_file_ext
raise ValueError("The provided path (" + path + ") is not valid.")
ValueError: The provided path () is not valid.
data = '8.bdf'
Sleep () . show ()
/usr/local/lib/python3.7/dist-packages/visbrain/io/mneio.py:51: DeprecationWarning: The use of read_raw_edf for BDF files is deprecated. Please use read_raw_bdf instead.
raw = io.read_raw_edf(path, **kwargs)
Extracting EDF parameters from /home/r7598/Schreibtisch/8.bdf...
BDF file detected
Setting channel info structure...
Creating raw.info structure...
Reading 0 ... 845499 = 0.000 ... 3381.996 secs...
Data successfully loaded (/home/r7598/Schreibtisch/8.bdf):

  • Sampling-frequency : 250.00Hz
  • Number of time points (before down-sampling): 845500
  • Down-sampling frequency : 125.00Hz
  • Number of time points (after down-sampling): 422750
  • Number of channels : 11
    /usr/local/lib/python3.7/dist-packages/visbrain/io/read_sleep.py:213: UserWarning: Wrong channel data amplitude.
    warn("Wrong channel data amplitude. ")
    /usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/visuals/visuals.py:499: RuntimeWarning: divide by zero encountered in log10
    mesh = 20 np.log10(mesh)
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/sleep.py", line 157, in init
    Visuals.init(self)
    File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/visuals/visuals.py", line 1073, in init
    self._spec.set_data(sf, data[0, ...], time, cmap=self._defcmap)
    File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/visuals/visuals.py", line 515, in set_data
    _mesh[~is_finite] = np.percentile(_mesh[is_finite], 5)
    File "/usr/lib/python3/dist-packages/numpy/lib/function_base.py", line 3707, in percentile
    a, q, axis, out, overwrite_input, interpolation, keepdims)
    File "/usr/lib/python3/dist-packages/numpy/lib/function_base.py", line 3826, in _quantile_unchecked
    interpolation=interpolation)
    File "/usr/lib/python3/dist-packages/numpy/lib/function_base.py", line 3405, in _ureduce
    r = func(a, **kwargs)
    File "/usr/lib/python3/dist-packages/numpy/lib/function_base.py", line 3941, in _quantile_ureduce_func
    x1 = take(ap, indices_below, axis=axis)
    weights_below
    File "/usr/lib/python3/dist-packages/numpy/core/fromnumeric.py", line 189, in take
    return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)
    File "/usr/lib/python3/dist-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc
    return getattr(obj, method)(args, *kwds)
    IndexError: cannot do a non-empty take from an empty axes.
    Sleep(data=data).show()
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/sleep.py", line 100, in init
    annotations)
    File "/usr/local/lib/python3.7/dist-packages/visbrain/io/read_sleep.py", line 61, in init
    file, ext = get_file_ext(data)
    File "/usr/local/lib/python3.7/dist-packages/visbrain/io/rw_utils.py", line 30, in get_file_ext
    raise ValueError("The provided path (" + path + ") is not valid.")
    ValueError: The provided path (8.bdf) is not valid.
    from visbrain.gui import Sleep
    data = '8.bdf'
    Sleep(data=data).show()
    Traceback (most recent call last)

python3
Python 3.7.3 (default, Aug 20 2019, 17:04:43)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from visbrain.gui import Sleep
QSettings::value: Empty key passed
QSettings::value: Empty key passed
data = '8.bdf'
Sleep(data=data).show()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/dist-packages/visbrain/gui/sleep/sleep.py", line 100, in init
annotations)
File "/usr/local/lib/python3.7/dist-packages/visbrain/io/read_sleep.py", line 61, in init
file, ext = get_file_ext(data)
File "/usr/local/lib/python3.7/dist-packages/visbrain/io/rw_utils.py", line 30, in get_file_ext
raise ValueError("The provided path (" + path + ") is not valid.")
ValueError: The provided path (8.bdf) is not valid.

sorry, i can't get any further. loading the data has worked so far (openbci). now i only get errors
jh
@jh537
Hello, I'm too high? How come? Is contact gel absolutely necessary? Which filters should I use at the beginning? I have tried it with 1-48 and 12-16 Hz?
I need an amplitude of about 50000.
apavlo89
@apavlo89
hello. Something weird started happening when i save a hypnogram. Instead of each line being 30 seconds epoch I now get 60 lines per 30s epoch!... it makes no sense :/
apavlo89
@apavlo89
actually its 30 lines per 30s epoch
Visbrain didn't use to do that I don't know why its doing it now

Eitherway this question is for Vallat and YASA algorithm. If 30 lines = 1x 30s epoch then am i right to upsample like this?

hypno_up_str = yasa.hypno_upsample_to_data(hypno=hypno, sf_hypno=(30/30), data=data, sf_data=sf)
print(np.unique(hypno_up_str))

Raphael Vallat
@raphaelvallat
Did you update Visbrain recently? It seems that the hypnogram is saved at a 1 sample per sec resolution, so yes you can use yasa.hypno_upsample_to_data(..., sf_hypno=1, ...)
When you save the hypnogram, does the software ask you to manually specify the resolution or format?
apavlo89
@apavlo89
I'm not sure why and when it changed but it seems like after a few recordings hypnogram started exhibiting this behavior. It does it now constantly.
i load a hypnogram that is 1 line per 30s epoch make some corrections on the hypnogram in visbrain and when i save it again it converts the hypnogram to 30 lines per 30s epoch
so sf_hypno=1 should fix this issue yes?
Raphael Vallat
@raphaelvallat
If you're using YASA then yes this will fix the issue.
jh
@jh537
Hi, I get the error Wrong channel data amplitude. The GUI starts after all. The curves are big and too changeable. I don't get sunny curves. Do I still have to pass settings with the text file?
apavlo89
@apavlo89
Thanks Raphael this has fixed the issue. One thing i'd like to see in YASA is spindle density calculation that visbrain has
Raphael Vallat
@raphaelvallat
Thanks @apavlo89 ! Indeed I am planning on implementing that in the next release
Renan Bortoluzzi da Silva
@RenanB
Hi all, I need help to install visbrain Sleep. Can someone help me?
apavlo89
@apavlo89
Great! Btw just saw your opinion piece on lucid dreaming and potential negative impact on sleep ;)
apavlo89
@apavlo89
I'm an LD researcher
Raphael Vallat
@raphaelvallat
Hi @RenanB ! For installing Visbrain, please refer to the documentation at http://visbrain.org/introduction.html#install-visbrain. If you're completely new to Python I suggest that you get help from someone with a little experience as it can be a bit overwhelming at first to navigate between all the packages. Hope this helps!
Nelly Matorina
@nmatorina
Hello, I was wondering if someone could help me run the software. Using both the MNE loading option and the regular loading option for .edf files, the interface doesn't open and I get this in the terminal:
Data successfully loaded (/Users/nellymatorina/Documents/Science/Data/MEMRI_432___SleepPM_20170906_104118_ABM000020.edf):
  • Sampling-frequency : 256.00Hz
  • Number of time points (before down-sampling): 7197184
  • Down-sampling frequency : 128.00Hz
  • Number of time points (after down-sampling): 3598592
  • Number of channels : 26
Raphael Vallat
@raphaelvallat
Hi @nmatorina ! The message that you get in the terminal is not an error -- instead, it seems that the data was successfully loaded. Do you see an error message after that? Please follow closely the installation instructions of Visbrain (http://visbrain.org/introduction.html#install-visbrain), and make sure that PyQt5 is installed. Thanks
mjs966
@mjs966
Hi All,
I am trying this package out for the first time and am running into problems. When I load my select my EDF file it seems to load correctly (similar to Nelly) but when I try to launch the gui it just opens a new blank window and stops responding. I am using Spyder and the versions of the dependent packages are:
PyQt5 = 5.13.2
PyQt5-sip = 12.7.0
PyQtWebEngine = 5.13.2
PyOpenGL = 3.1.0
Pillow = 6.2.0
The same result happens when I run the example data. Any help is appreciated!
Raphael Vallat
@raphaelvallat
Hi @mjs966 ! I think this might be caused by Spyder. I'd suggest that you run the Python file directly from a .py file (e.g. python run_visbrain.py) instead of using Spyder. Let me know if that helped. Thanks!
linefolv
@linefolv
Hi!
I want to filter EEG channels and EMG channels with different settings.
I am just allowed to apply filters for " all channels" or a single channel that gets reversed if I change filter for another single channel. Is this a bug? According to AASM EMG and EEG should be filtered differently...
Thank you :)
HeddaN
@HeddaN
Hi! I'm wondering if there might be a bug in the macOS visbrain software? During scoring, half of the gridlines suddenly go missing in different/random parts of the scoring window. This problem does not using Windows. Any clues to why this is happening and/or ideas for fixing it? Thanks!
Raphael Vallat
@raphaelvallat
HI @linefolv! So, unfortunately, it is not possible to filter the EEG and EMG separately in Visbrain. However, I suggest that you use the MNE-Python package to filter your data before loading them into Visbrain. See https://mne.tools/stable/generated/mne.io.Raw.html#mne.io.Raw.filter
Hi @HeddaN! I don't have a Mac so I cannot replicate the error, I think you're the first to report this issue so I'm not sure if this is related to Visbrain or rather the Python environment (e.g. PyQt, VisPy version..) I'd suggest updating your packages and see if the error persists. Thanks!
Nelly Matorina
@nmatorina
Hello @raphaelvallat, thanks for your message! The data was successfully loaded, and I have PyQt5 installed but no GUI is popping up. So I can't see any new windows or my edf file. Do you have some advice for how to fix this issue?
Etienne Combrisson
@EtienneCmb

Hello @nmatorina , can you try the following small code please :
Create a test.py file and paste the following lines :

from visbrain.objects import BrainObj
BrainObj('B1').preview()

Then from your terminal run the file : python test.py. Do u see the GUI?

linefolv
@linefolv

Hi @raphaelvallat ! Thank you for the MNE tips :)
Is it possible to rearrange the display of the channels so channels are displayed in non-alphabetical order? Ev. rename the channels within visbrain so we can determine how they are displayed?

I am also experiencing the gridline-problem on my Mac laptop as reported by HeddaN and the same goes for my colleague on her Windows laptop. Sometimes all of them and sometimes only half of them.