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)

Jefferson Souza πŸ‡§πŸ‡·
@Jefinho_ZK_twitter
Hi Raphael. I have trouble with Sleep in Spyder IDE. Maybe, its a problem related to PyQt5 packages and conflicts with my IDE. When I wanna launch and edf, this message appears:
SystemError: <built-in function connectSlotsByName> returned a result with an error set
Sleep(data='SAD01.edf', hypno='Hypnogram_excerpt2.txt', config_file='excerpt2_config.txt',
use_mne=True).show()
I have tried to uninstall and reinstall pyqt5 or pyqtwebengine but always this message appears or Spyder doesn't launch
Raphael Vallat
@raphaelvallat
Hi @Jefinho_ZK_twitter, Have you tried running Visbrain from a simple python script (not in spyder)? That will help us determine if the error comes from Spyder. Thanks
Jefferson Souza πŸ‡§πŸ‡·
@Jefinho_ZK_twitter
Thanks for your attention. I just got it in Spyder.
Does Sleep generate a Welch's periodogram?
Raphael Vallat
@raphaelvallat
@Jefinho_ZK_twitter , nope it does not. For that, I'd recommend using the MNE, SciPy or YASA Python packages
Jefferson Souza πŸ‡§πŸ‡·
@Jefinho_ZK_twitter
Hi again Raphael. How can I get the number and density of slow waves only in NREM sleep? I have tried to delete manually events located in Wake stages but the number and density don't change.
Raphael Vallat
@raphaelvallat
Hi @Jefinho_ZK_twitter , if you want my honest advice I would not use Visbrain for slow-waves detection, but only for visualization. Indeed, the algorithm is somewhat outdated. For all things related to actual analyses of sleep data (not just visualization), I'd recommend using the YASA package. There, you can easily get the slow-waves number and density in different sleep stages. https://raphaelvallat.com/yasa/build/html/generated/yasa.sw_detect.html Thanks!
Jefferson Souza πŸ‡§πŸ‡·
@Jefinho_ZK_twitter
I'm so grateful for your advice! I will run the slow-wave detection in YASA. Thanks!!
samroycGit
@samroycGit
I am new to the site . I would liek to use visbrain to visualize my own algorithm's sleep staging performance vis a vis the available PSG perfromance. I understand this requires me to convert a text file into a .hyp file? I am unable to find the correct set of instructions for this. Any pointers will be very helpful
Raphael Vallat
@raphaelvallat
Hi @samroycGit, you don't need to convert your data to a .hyp file, you can also simply use a txt file, as explained here: http://visbrain.org/sleep.html#id37
Susy
@SCL92_gitlab
Hi @raphaelvallat , I'm finding the programme is detecting K-complexes in the 'wake' portion of my file despite me selecting 'use hypnogram to improve detection'. Is there any way to prevent it doing that or delete the instances where it's detecting them during wake so that the density and number of detections reflects this?
Raphael Vallat
@raphaelvallat
Hi @SCL92_gitlab, that's really strange, it shouldn't happen. Are you certain that you loaded a hypnogram with at least some NREM sleep in it? If so, could you send a screenshot of the detection and Visbrain interface?
Btw, I would encourage you to use YASA instead of Visbrain for slow-waves / KC detection, it has a better algorithm and is more flexible. See: https://raphaelvallat.com/yasa/build/html/generated/yasa.sw_detect.html#yasa.sw_detect
Susy
@SCL92_gitlab
Screen Shot 2020-10-23 at 9.35.42 AM.png
Screen Shot 2020-10-23 at 9.35.30 AM.png
Hi @raphaelvallat , thanks for getting back to me. We haven't staged the sleep, but classed the entire sleep period as N2 to allow for detections during the entire period. We're also using single-channel EEG - I'm not sure if this would likely be causing the issue? Screenshots above :)
Raphael Vallat
@raphaelvallat
Hi @SCL92_gitlab, I don't think the single-channel is an issue, but I would definitely recommend that you score the sleep stages prior to running the KC detection. This will greatly improve the output.
Susy
@SCL92_gitlab
Helloo, please could you tell me what units both the k-complex detection amplitude threshold setting and the spectrograph visualisation use? Thanks :)
madepass
@madepass
Hi! Excellent work! I'm considering using Sleep in conjunction with my rodent sleep autoscorer. My autoscorer outputs uncertainty values for each sleep stage it generates. Ideally, I would like to be able to open the EDF's I autoscored, view the signal & the autogenerated labels, and quickly jump between labels that have high uncertainty values so i can manually correct them. Is this something I could do with Sleep? Thank you very much!
Raphael Vallat
@raphaelvallat
Hi @SCL92_gitlab, the min/max parameters in the k-complex detection are expressed in microVolts. The spectrogram is usually expressed in decibels (= log-transform of the power spectrum, i.e. in Visbrain 20 * log10(power)).
Hi @madepass! There are no native ways to do that in Visbrain but I think it should be pretty straightforward to use annotations as a workaround (http://visbrain.org/sleep.html#import-add-and-save-annotations). You will need to convert your autogenerated labels and confidence to Visbrain's annotations format. Hope this helps!
madepass
@madepass
Thank you Raphael! Also, is there a way to edit the labels as I am scoring rodent sleep, not human sleep?
Raphael Vallat
@raphaelvallat
@madepass the stages that will be displayed on the hypnogram panel are always the same (from human sleep scoring: artefact, wake, N1, N2, N3, REM). There's no way to change this as of now, but what you can do is to use let's say N1 or N2 (= code 1 or 2) as a marker for rodent NREM sleep, and you just ignore the other NREM stages. So you'll only use the Artefact, Wake, N1 (= NREM) and REM sleep stages. Does that make sense? Thanks
amosdixonxc
@amosdixonxc
Hello, I'm trying to get Visbrain Sleep to run using the YASA spindle algorithm. My datasets are in .EDF format and I do not have a hypnogram. I'm attaching a picture of my current code. When I run it, I select my .EDF file, hit cancel as to not select a hypnogram, and the program opens. Everything works as intended in Sleep, until I try to detect spindles, where the program is unresponsive.
Screen Shot 2020-11-10 at 3.26.16 PM.png
Raphael Vallat
@raphaelvallat
Hi @amosdixonxc ! Can you try removing the "hypno=hypno" part? Alos, can you try just running the YASA detection in a separate script / notebook just to make sure that the detection in itself is running correctly on your data? Thanks!
amosdixonxc
@amosdixonxc
Hi again Raphael, removing that line worked, thank you! I have two follow up questions that relate more to YASA which I will ask here. Since they're more centered around YASA, if there's a better forum to discuss them let me know. I can also email you, we've briefly corresponded in the past. Anyways. 1) When running EDFs through YASA spindle analysis through Visbrain vs through Jupyter Lab, I get slightly different results. A difference of about ~5 spindles per channel per 8 hours of data. This is a minor issue, as I'm using Visbrain mainly for visualization rather than original spindle analysis, but I figured I'd inquire as to what the possible sources of this error could be. 2) The project I'm working on originally used YASA 0.1.7 for multi channel spindle analysis (about a year ago). Recently, we received new datasets, and ran them through YASA 0.3.0. To validate our previous datasets we ran them through YASA 0.3.0 and received a very different output, many more spindles on each channel. Has there been a significant change to the YASA algorithm between those two versions that could cause that difference in output? Thanks for taking the time to read this, again I'm happy to discuss this in a more appropriate forum if there is one.
Raphael Vallat
@raphaelvallat
Hi @amosdixonxc! I'd suggest either that you open an issue on the GitHub of YASA, if you feel that your issue may be relevant to others, or that you directly reach out to me via email. Both of the behaviors you describe should not happen :/ Are you using the same detection thresholds and parameters (esp the remove_outliers?). As you can see in the changelog (https://raphaelvallat.com/yasa/build/html/changelog.html), I did not make any significant changes to the detection algorithm since version 0.1.7 so that's really unexpected.
Raphael Vallat
@raphaelvallat
Now that I think about it I think in this commit (https://github.com/raphaelvallat/yasa/commit/ea3fdac034d745d90050336f85828f120394d141#diff-b211bc4b0aea8e9eb5eec857d1ad09ecc3ad68cd6fd4ed8b07a455934364b708L461) I made some changes to the detection thresholds that may explain the differences, especially if you're not using an hypnogram prior to using the detection (which I would really not recommend)
Have you visuall checked to know which of 0.1.7 and 0.3.0 is the most accurate?
manoj
@abstractnew

Hello, I am trying to use the Sleep GUI to load the data from the Sleep EDF database - https://www.physionet.org/content/sleep-edf/1.0.0/ . (format - .rec, .hyp files).

When I try to open the file with the Sleep GUI it loads the .rec file just fine, but fails on selecting the hypnogram (.hyp) file with the following error

File "C:\pathtovisbrain\visbrain\io\rw_hypno.py", line 355, in _read_hypno_hyp_sample
sf_hyp = 1 / float(hyp[0].split()[1])
IndexError: too many indices for array

As a side note, I am able to load/view the signal data array in R just fine. Any suggestions would be greatly appreciated

Raphael Vallat
@raphaelvallat
Hi @abstractnew, this is most likely because your hypnogram does not follow the required format (see http://visbrain.org/sleep.html#hypnogram). Where did your .hyp file come from?
manoj
@abstractnew
@raphaelvallat Thank you. I am using the https://www.physionet.org/content/sleep-edf/1.0.0/ sleep edf dataset. The hyp file comes from their dataset. I was able to load it up with edfReader package in R so I assumed that the formats would be fine. My bad. I will go through the visbrain format and see where the discrepancy is from.
It is an older dataset so maybe the hyp formats are not the right ones. Thanks again.
Raphael Vallat
@raphaelvallat
Sorry for the confusion @abstractnew , indeed the .hyp format in the Physionet database is not the same as the .hyp format in Visbrain (the latter being a custom format that we used in my former lab). But hopefully it shouldn't be too problematic to convert your current hypnogram. Thanks!
manoj
@abstractnew
@raphaelvallat Thanks for clarifying. I will work on trying to convert the hypnogram to a format usable by Visbrain. Thanks again.
sharomer
@sharomer
@agpr141 @raphaelvallat - After you finshed scoring and you have a hypno file - how do you bring it into MNE? Do you have a function to make an Annotation object for MNE or are there better alternatives? Thanks!
Raphael Vallat
@raphaelvallat
Hi @sharomer, what are you trying to do with the hypnogram in MNE? Visbrain hypnograms are not directly compatible with MNE annotations so you'll need to convert them manually. I think it should be pretty straightforward though, because, from memory, you'll just need the start time, duration and label of the event (stage) to create the Annotations; all of which you can get from Visbrain. Hope this helps
sharomer
@sharomer
Hi @raphaelvallat, thanks for the quick attention. I would like to analyze my REM/N3 separately - perhaps clean artifacts differently etc - I was wondering if anyone already wrote the function that reads it in . Or whether there is a nicer way to do it... say I want to plot the average spectrum of all the N3 30s epochs or particular subject. What would would you do?
Raphael Vallat
@raphaelvallat
Hi @sharomer, please have a look at the YASA package (https://github.com/raphaelvallat/yasa), a command-line sleep analysis toolbox, which contains some functions to calculate the spectral power in different sleep stages, or remove artefacts, etc
sharomer
@sharomer
Thanks @raphaelvallat I'll check it out
Jessica Kendall-Bar
@jmkendallbar
Hi all! I am very new to Python and have spent the last few hours troubleshooting installing the Sleep module from visbrain.. I tried doing it through my terminal first and then through the Anaconda terminal, with the current versions of numPy and scipy and then reverting to older versions when I got RunTime errors (scipy 1.4.1 and numpy 1.19.2). I am able to "import visbrain" in Python but when I try to run "from visbrain.gui import Sleep", I get this error: "OSError: [WinError 126] The specified module could not be found" Does anyone have any guidance? Thank you in advance.
Raphael Vallat
@raphaelvallat
Hi @jmkendallbar, have you closely followed the installation instructions on the documentation? If so, are you running Visbrain directly from a Python script (and not from Python / Spyder or Jupyter notebook)? What are you trying to do with Visbrain? Unfortunately, Visbrain is not really updated and/or maintained anymore, and I would recommend the following alternatives: 1) for visualization of EEG data, use EDFBrowser, 2) for complex sleep analysis (spectral power, spindles detection, etc) use YASA (https://raphaelvallat.com/yasa/build/html/index.html). Thanks!
Jessica Kendall-Bar
@jmkendallbar
Hi @raphaelvallat, yes, I've done everything in the instructions but suspect that I am running awry with my file directories. I used anaconda to install both visbrain and now your package, YASA, and when I go to Python, I add the file directory where YASA and visbrain are in my computer (sys.path.append('c:\programdata\anaconda3\lib\site-packages')) and then still get an error when I try "import yasa", with the error ModuleNotFoundError: No module named 'yasa'. However, when I open that file directory in my file browser, I see the folder named yasa. Let me know if you have any tips and thank you for pointing us to your updated tool. I am using EDF Browser to visualize my seal sleep data but would appreciate exploring automated tools to analyze it.
Raphael Vallat
@raphaelvallat
Seal sleep data -- pretty cool!! I think there might be something wrong with your Anaconda installation then, because you shouldn't have to add the site-packages to the path each time you run Python. Do you use the default Anaconda environment (base) or a custom one? If you're using Windows, you may want to add Anaconda directly to your PATH variables.
Jessica Kendall-Bar
@jmkendallbar
Hi, I am using Windows and using the Anaconda environment (base). How do I add Anaconda directly to my PATH variables?