Coder Social home page Coder Social logo

aroethen / rbdtector Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 220.31 MB

RBDtector detects phasic, tonic and any events linked to REM sleep behaviour disorder. It closely follows SINBAR and AASM scoring guidelines.

License: MIT License

Python 100.00%
rbd rem-sleep-behavior-disorder rswa rem-sleep-without-atonia detection scoring automated

rbdtector's Introduction

RBDtector

A python software tool to detect REM sleep behavioral disorder (RBD) in .edf files. Relies on .txt files of previously classified periods of sleep phases and arousals.

Table of contents:

  1. How to install
    1. Windows
    2. Mac and Linux
  2. License
  3. Acknowledgements

How to install

Windows

  1. Download the zipped version of RBDtector here: dist/RBDtector.zip
  2. Extract the zip file into a folder of your choice
  3. Click the extracted RBDtector.exe to run RBDtector

In some cases, Windows Defender SmartScreen will flag RBDtector as an 'Application of unknown source'. This warning can simply be clicked away. If you want to, you can also submit the file to Windows' malware analysis before trusting it.

Mac and Linux

Installing RBDtector under MacOS or Linux requires the usage of simple terminal commands. General commands that work in the terminals of both operating systems can be found here.

  1. Prerequisites: Ensure you have a version of Git and Python 3 installed (including pip and tkinter - usually already included in Python 3)
  2. Open a terminal
  3. (optional: navigate to a folder into which you want to place RBDtector)
  4. Enter the following commands line by line:
    1. Clone git repository git clone https://github.com/aroethen/RBDtector.git
    2. Install requirements python3 -m pip -r RBDtector/requirements.txt
    3. Change into folder with main.py cd RBDtector/RBDtector
    4. Run with python3 main.py

License

This project is licensed under the MIT License (s. LICENSE file).

Acknowledgements

This project gratefully uses the following third-party open source libraries:

Library License
pyEDFlib BSD 2-Clause "Simplified" License
numpy [BSD 3-Clause "New" or "Revised" License] (https://github.com/numpy/numpy/blob/main/LICENSE.txt)
pandas [BSD 3-Clause "New" or "Revised" License] (https://github.com/pandas-dev/pandas/blob/main/LICENSE)
scipy [BSD 3-Clause "New" or "Revised" License] (https://github.com/scipy/scipy/blob/main/LICENSE.txt)
openpyxl [MIT License] (https://foss.heptapod.net/openpyxl/openpyxl/-/blob/branch/3.0/LICENCE.rst)

rbdtector's People

Contributors

aroethen avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tommy44458

rbdtector's Issues

README install requirements is missing pip argument

README has command for installing the requirements from requirements.txt but the command is missing the install argument. Right now the readme has python3 -m pip -r RBDtector/requirements.txt but should be python3 -m pip install -r RBDtector/requirements.txt

Compatibility with RemLogic

Hello,

I'm trying to run your program with edf and txt file extracted from RemLogic. We are working for a Swiss University Hospital.

I'm getting the following error:

### 25.04.2023 10:44:17 ###   edf: C:\Users\emp8124242\dev\RBDtector\Data\Test_AM_10_20_230216_(1).edf
### 25.04.2023 10:48:04 ###   Unexpected error in file C:/Users/emp8124242/dev/RBDtector/Data:
 'sleep_profile'
, ### 25.04.2023 10:48:04 ###   Traceback (most recent call last):
  File "C:\Users\emp8124242\dev\RBDtector\RBDtector\app_logic\PSG_controller.py", line 110, in single_psg_run
    PSGController.run_rbd_detection(input_path, output_path)
  File "C:\Users\emp8124242\dev\RBDtector\RBDtector\app_logic\PSG_controller.py", line 26, in run_rbd_detection
    raw_data, annotation_data = ir.read_input(directory_name=input_path,
  File "C:\Users\emp8124242\dev\RBDtector\RBDtector\input_handling\input_reader.py", line 48, in read_input
    annotation_data: AnnotationData = __read_txt_files(filenames, read_baseline, read_human_rating)
  File "C:\Users\emp8124242\dev\RBDtector\RBDtector\input_handling\input_reader.py", line 158, in __read_txt_files
    sleep_profile = __read_sleep_profile(filenames['sleep_profile'])
KeyError: 'sleep_profile'

The extract of RemLogic gives us a single txt file, with all the data required to run your analysis. I believe we just need to convert into a similar format as yours. I don't mind writing a script to parse the txt file, but I would like to know what is the format of the files Sleep profile, Flow Events, Classification Arousals, Start-Baseline, and Generic.
The best would be if you would push sample files with synthetic data.

Bests
Guillaume

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.