by

## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
• Create your own community
##### 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
Hi. Question re: hypnogram lengths. Can anyone explain to me why, when Sleep generates the point-by-second hypnogram (i.e. the old format), it can be imprecise? My data file is 39503 seconds long, yet the hypnogram generated is 39658 seconds long. Where does this discrepancy actually come from? Is it a case of extra seconds just added onto the end of the file, or will there be some lag/displacement of assigned states throughout the hypnogram? I know you brought in the new format to deal with the discrepancy, but I just want to understand what is going on with the old format.
I'm unsure currently how to use the new format to separate out individual sleep states, so the old format is certainly simpler to use...
Raphael Vallat
@raphaelvallat
Hi @agpr141 , re: hypnogram length. Could you try to load your data without downsampling (Sleep(downsample=False).show()) and let us know if you find the same discrepancy in the point-by-second hypnogram export?
Also, I recently opened a survey on hypnogram format on the Github of Visbrain, please feel free to add your opinion: EtienneCmb/visbrain#72
As for the MAC vs Windows issue, I honestly have no idea... (I don't have a Mac so cannot try Visbrain on it) -- I wonder if this is related to your Visbrain installation or your data, I would suggest you try to open and load some of the example files, play around with Visbrain and see if you end up with the same bugs
zbandit98
@zbandit98
Hi Community,
I am new to Visbrain and I am trying to use a 1-D Numpy Array that lacks a hypnogram file to analyze slow wave sleep, but following some of the examples posted I am unable to get it working and receive "file not supported" everytime I try something new. I was wondering if anyone had working examples of loading a raw NumPy array into Sleep and receiving output?
MirandaChappelFarley
@MirandaChappelFarley
Hi- I am just wondering if the module displays negative signals as plotted on the negative y-axis or positive y-axis? Perhaps I missed it in the documentation- thanks!
Raphael Vallat
@raphaelvallat
Hi @zbandit98 , can you please share your code and a screenshot of the error you're getting?
@MirandaChappelFarley negative is down and positive is up! Does that answer your question? Thanks!
Susy
@SCL92_gitlab
Hi, I'm wondering whether there's any functionality within the Sleep module to exclude epochs labelled as artefacts from the automatic detections?
apavlo89
@apavlo89

Hello everyone,

When trying to run sleep using the following command:

from visbrain.gui import Sleep

# Run the interface (requires loading of a data file):

Sleep().show()

I get:

Python 3.7.7 (default, Mar 23 2020, 23:19:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

from visbrain.gui import Sleep

# Run the interface (requires loading of a data file):

Sleep().show()
AttributeError: getattribute

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\apavl\anaconda3\envs\neuroscience\lib\site-packages\visbrain\gui\sleep\sleep.py", line 88, in init
UiInit.init(self)
File "C:\Users\apavl\anaconda3\envs\neuroscience\lib\site-packages\visbrain\gui\sleep\interface\ui_init.py", line 26, in init
self.setupUi(self)
File "C:\Users\apavl\anaconda3\envs\neuroscience\lib\site-packages\visbrain\gui\sleep\interface\gui\sleep_gui.py", line 2008, in setupUi
QtCore.QMetaObject.connectSlotsByName(MainWindow)
SystemError: <built-in function connectSlotsByName> returned a result with an error set

>

Raphael Vallat
@raphaelvallat
Hi @SCL92_gitlab, there is currently no automatic detection of artifacts in Visbrain. If you're comfortable with command-line tools you can check https://raphaelvallat.com/yasa/build/html/generated/yasa.art_detect.html
Hi @apavlo89 , it seems that you need to upgrade your version of PyQt, see here: GNS3/gns3-gui#2819
Jefferson Souza 🇧🇷
Hi people! I cant set up my hipnogram.txt to run in GUI sleep. Indeed, I need to use the hipnogram generated by Alice Sleepware (Respironics) in Sleep GUI. How can I get this data to Sleep GUI?
Raphael Vallat
@raphaelvallat
Hi @Jefinho_ZK_twitter, I've never used Alice Sleepware but you will probably need to convert your hypnogram to a format compatible with Visbrain. Please read the documentation for more details: http://visbrain.org/sleep.html#hypnogram
Jefferson Souza 🇧🇷
Thank you Raphael. I would like to ask one more thing. The values of sleep latency (N1, N2, N3 and REM) are calculated based on the entire register and I have the first 20~40 minutes of edf files still awake (cognitive tests performed before naps). How I could disconsider these prior minutes awake in Sleep?
Raphael Vallat
@raphaelvallat
Hi @Jefinho_ZK_twitter. The best solution is to crop and re-export your EDF data to only include time in bed using Alice Sleepware or EDFBrowser. Or, if you prefer to stay in Python you can use the MNE .crop() function. Hope this helps! Thanks
Jefferson Souza 🇧🇷
@raphaelvallat Thanks a lot Raphael! I will use Python (Spyder IDE) to crop the lights off - lights on interval.
apavlo89
@apavlo89
Thanks Vallat, visbrain now works. By the way, why does my Visbrain output hypnograms that when using the 'old method', it outputs 30 values per 30 seconds and not 1 value per 30 seconds? Is this how it should normally behave or am I doing something wrong? If it is working as intended, it would be great to have 3 methods for hypnogram output: 1) 1 value per 30 seconds, 2) 30 values per 30 seconds and 3) the new method you've implemented in 0.4.
MarcoSleepCBT-I
@MarcoSleepCBT-I
Hi people, thanks a lot for visbrain-python/sleep! it's very usefull for me! So is there a function to extract an FFT output with specific BIN frequencies? and what is the bin resolution for the analyses?
Raphael Vallat
@raphaelvallat
Hi @MarcoSleepCBT-I ! Visbrain is a visualization tool and as such does not implement advanced analysis functions. To calculate the power spectrum of your data, you will have to use create a Python script. Specifically, you can use the men package to load your data (for EDF see mne.io.read_raw_edf), and then the scipy.stats.peridogram or scipy.stats.welch to calculate the power spectrum. If you then want to calculate the spectral power in different frequency bands, please check this blog post: https://raphaelvallat.com/bandpower.html
MarcoSleepCBT-I
@MarcoSleepCBT-I
Hi, Thanks again, i'll try to use your information! are there guides with more details?have a good day!
AJ Hirsch Allen
@ajhallen_gitlab
Hi guys I am new to using visbrain sleep and relatively new to eeg analysis. I have about 500 elf files that I converted from sandman psgs at my sleep lab. I am trying to figure out a few things.

First when I try to import an edf using the following code# Import the Sleep module from visbrain :
from visbrain.gui import Sleep

# Run the interface :

Sleep().show()

AJ Hirsch Allen
@ajhallen_gitlab
and then select an elf file and hit cancel as to not load a hypnogram . the sleep interface opens but I get the spinning wheel of death and am forced to quit. Second I am going to post a screen shot of what is contained in the my original folder for each patient for the sleep lab because I do not know if I actually have a hypnogram file that is compatible with this package. Third , I was wondering if I need a hypnogram to break the sleep study in to stages with visbrains functionality or if the raw egg data is enough. Above when I wrote elf I meant edf
AJ Hirsch Allen
@ajhallen_gitlab
I just realized I do not know how to post the screen shot of my folders to this forum can anybody help with that too.
thanks for all the help
AJ
Raphael Vallat
@raphaelvallat
Hi @ajhallen_gitlab , you don't need to have an hypnogram to run Visbrain. The hypnogram file format supported in Visbrain are described here: http://visbrain.org/sleep#hypnogram I think you can upload screenshots to Gitter by just doing drag-and-drop. Finally I don't know what you mean y "break the sleep study in stages with Visbrain functionality"? Remember that Visbrain is a visualization tool, not an analysis tool. Thanks!
AJ Hirsch Allen
@ajhallen_gitlab
thanks for your response i was interested in identifying k complexes will that be possible without the hypnogram file. Also do I Have anything that resembles a hypnogram file in the screenshots I uploaded .
thanks again
AJ Hirsch Allen
@ajhallen_gitlab
I got the program to work without the hypnogram file. the issue was I was using Jupiter notebooks and when I ran the code for the GUI from the terminal it worked. I am still interested if I have a hypnogram file that may work in the screenshots I sent of if I have a file I could convert into a format that would work. Also I was wondering if the GUi allows you to look at multiple files at the same Time and if so how.
thanks
Raphael Vallat
@raphaelvallat
Hi @ajhallen_gitlab, good to know for Visbrain! I think the stage.evt is probably the hypnogram file in the screenshot that you sent however I do not know what file format .evt is, and what software is needed to open this file (Visbrain cannot). I suggest you try to open it into a text editor and see if you can convert it to a Visbrain-readable hypnogram (e.g. a simple text file). You can detect slow-waves / K-complex without hypnogram but it's usually much better to use the sleep stage information when you have it. Thanks
AJ Hirsch Allen
@ajhallen_gitlab
thanks I will work on the conversion. Also in regards to my last question can you use the interface to open multiple files at the same time or is it just for visualizing one patient at a time.
Raphael Vallat
@raphaelvallat
Hi, the interface can only visualize one recording at a time. Thanks
AJ Hirsch Allen
@ajhallen_gitlab
when I upload my edf files and view them with the GUI it only loads under 1 hour for each file even though there are upto 10 hours of sleep data in each one. what do you think that is the case and do you have any suggestions
thanks AJ
Raphael Vallat
@raphaelvallat
Hmm that's weird. Are you sure the EDF file is valid? Maybe there's an issue with your sampling frequency. I'd recommend using the EDFBrowser free software to visualize your data and check that you have 10 hours of data. Thanks
AJ Hirsch Allen
@ajhallen_gitlab
I have already visualized my data with mne python and have extracted vents and epochs. This is data from UBC sleep lab and the pigs have already been scored and there is between 7-10 hours in all the Edf's but when I try to visualize with visbrain it only shows less then 1 our per edf
sindyburnburn
@sindyburnburn
Hi there, I was referred to this discussion by my friend and colleague Christian O'Reilly. I have a question regarding sleep spindle detection. I'm wondering what does it mean when there are grey verticle lines bordering the putative spindle vs when there are no grey verticle lines?
https://imgur.com/EyO5pry link to example figure
sindyburnburn
@sindyburnburn
also is it possible to export the colormap for the spectrogram?
Raphael Vallat
@raphaelvallat
Hi @sindyburnburn , the grey verticle lines highlight the limits of the current selected spindles in the left Detection panel.
Could you please provide more details s to what you mean by "exporting the colormap"? Thanks
sindyburnburn
@sindyburnburn
thanks for your quick response!
i guess i'm a little confused because there is a red marking covering the areas where spindles are detected and sometimes there are grey verticle lines around these red parts and sometimes there aren't
by colormap, i mean that usually in figures there is a colorbar to match the color map to tell you what each color means quantitatively. I guess for the time-frequency spectrogram, the units are arbitrary, so I can just put the color bar from 0 to 1, but i was just wondering if there was some way to export this (otherwise, it's okay!)
Raphael Vallat
@raphaelvallat
@sindyburnburn there is no way to export the colorbar in Visbrain, however if you're not afraid of writing code you can have a look at the yasa.plot_spectrogram function: https://raphaelvallat.com/yasa/build/html/generated/yasa.plot_spectrogram.html
sindyburnburn
@sindyburnburn
Afraid of writing code? Interesting way to put it. Not afraid! Thanks a lot