EtienneCmb / visbrain

A multi-purpose GPU-accelerated open-source suite for brain data visualization
http://visbrain.org
Other
241 stars 65 forks source link

Minor modifications to read EDF files and addition to read hypnogram files in EDF+ format #14

Closed kdeleeuw11 closed 6 years ago

kdeleeuw11 commented 6 years ago

We have been using Visbrain to read files from The Sleep-EDF Database on the Physionet website (https://www.physionet.org/pn4/sleep-edfx/). We rectified two minor issues and also added a function to read the hypnogram files which are in EDF+ format. The issues are:

  1. the record length in seconds in the Physionet files is typically 30. The sampling frequency per record is typically 3000 for the first three channels and 30 for the others. This means that the actual sampling frequency is 100 Hz and 1 Hz respectively. When determining the time axis in Visbrain Sleep, the sample frequency per data record (3000) is used. Instead the actual sample frequency of 100 Hz is required here
  2. as the Physionet files contain channels with different sampling frequency, we use the "use_mne=True" option to use MNE for reading the files. The values of the EEG channels are measured in microVolts. MNE converts these values to Volt, while Visbrain is expecting these values in microVolts
  3. the Physionet files contain hypnogram files in EDF+ format. A new function is added to rw_hypno.py to read these files. Note that some assumptions are made which are detailed in the doc string
codecov[bot] commented 6 years ago

Codecov Report

Merging #14 into master will decrease coverage by 0.17%. The diff coverage is 57.51%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #14      +/-   ##
==========================================
- Coverage    87.3%   87.12%   -0.18%     
==========================================
  Files         144      146       +2     
  Lines       18725    18946     +221     
  Branches     1333     1370      +37     
==========================================
+ Hits        16347    16506     +159     
- Misses       1879     1927      +48     
- Partials      499      513      +14
Impacted Files Coverage Δ
visbrain/io/read_annotations.py 87.5% <ø> (ø) :arrow_up:
visbrain/mne/__init__.py 0% <0%> (ø)
visbrain/mne/plot_fwd.py 0% <0%> (ø)
visbrain/cli.py 33.78% <0%> (ø) :arrow_up:
visbrain/sleep/interface/ui_elements/ui_panels.py 79.07% <100%> (ø) :arrow_up:
visbrain/utils/filtering.py 91.83% <100%> (ø) :arrow_up:
visbrain/visuals/TopoVisual.py 79.36% <100%> (ø) :arrow_up:
visbrain/utils/sleep/detection.py 83.94% <100%> (+0.33%) :arrow_up:
visbrain/topo/topo.py 89.58% <100%> (ø) :arrow_up:
visbrain/io/rw_config.py 94.11% <100%> (+3.2%) :arrow_up:
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5b5b422...c7fd144. Read the comment docs.

EtienneCmb commented 6 years ago

Hi @kdeleeuw11 ,

Sorry for the delay of my answer. But your PR has been merged to the develop branch and will be merged to the master (v 0.4.0) this week !

Thank you,