GithubHelp home page GithubHelp logo

digital-cinema-arts / muse-analysis-tools Goto Github PK

View Code? Open in Web Editor NEW
34.0 6.0 10.0 65.89 MB

A set of tools to analyze and create charts from Muse EEG devices.

License: GNU Affero General Public License v3.0

Python 99.20% Shell 0.80%
eeg-analysis muse-headband eeg eeg-signals-processing eeg-classification eeg-headband

muse-analysis-tools's Introduction

Muse-Analysis-Tools

Algorithmic Biofeedback Control System - Chart Tools

This script will generate a number of charts from Muse headband EEG CSV data files created by the Mind Monitor app. Future versions of these tools will support Muse Direct and Muse Lab files.


Install instructions:

Download and Install

  1. Download the archive file, save in a temp directory
  2. Unzip the file:
    $ unzip Muse-Analysis-Tools-master.zip
  3. Change diretory into the Muse-Analysis-Tools-master directory:
    $ cd Muse-Analysis-Tools-master
  4. Run the setup.py to install the application:
    $ python3 setup.py install

Clone using Git and Install

  1. Clone the project using git in a temp directory.
    $ git clone https://github.com/digital-cinema-arts/Muse-Analysis-Tools.git
  2. Change diretory into the Muse-Analysis-Tools-master directory:
    $ cd Muse-Analysis-Tools-master
  3. Run the setup.py to install the application:
    $ python3 setup.py install

Install from the Python Package Index

The project can be view here: https://pypi.org/project/Muse-Analysis-Tools/

Using the 'pip' command:
$ pip install Muse-Analysis-Tools

Using the 'pip3' command to ensure you're installing the Python 3 packages:
$ pip3 install Muse-Analysis-Tools


NOTE: This application requires Python version 3. To check which version of python you have installed enter this command:
$ python --version
Python 3.7.4

To fix an error with pandas on Linux that occasionally happens, force a reinstall with this command:

pip install --upgrade --force-reinstall pandas

Usage:

  1. Change directory to where the data files are located (sometimes this makes it easier to locate files).
$ cd /Volumes/Archive/muse_recordings/muse_monitor_recordings/   
  1. Startup the application:
    $ analyze_muse_data.py
  2. Select the options and CSV file you want to process.
  3. Make plots!

Notes:

  1. Output images and session data are created within the same directory that the CSV files live. This will change in the future to allow the user to select the output directory.

For more information about the graphs interface (from matplotlib) please refer to this link: https://matplotlib.org/3.1.1/users/navigation_toolbar.html


Options:


$ analyze_muse_data.py -h 
 
usage: analyze_muse_data.py [-h] [--version] [-f CSV_FILE] [-v VERBOSE] [-d]
                            [-b] [-dm] [-pm] [-e] [-p] [-ep] [-hdf5] [-ag]
                            [-mc] [-s] [-c] [--plot_style PLOT_STYLE] [-sm]
                            [-sw SMOOTH_WINDOW] [-r] [-eegc EEG_CLIP] [-fd]
                            [-ft FILTER_TYPE] [-lc LOWCUT] [-hc HIGHCUT]
                            [-o FILTER_ORDER] [-db]

optional arguments:
  -h, --help            show this help message and exit
  --version             Print the current version number
  -f CSV_FILE, --csv_file CSV_FILE
                        CSV file to read)
  -v VERBOSE, --verbose VERBOSE
                        Increase output verbosity
  -d, --display_plots   Display Plots
  -b, --batch           Batch Mode
  -dm, --data_markers   Add Data Markers
  -pm, --plot_markers   Add Plot Markers
  -e, --eeg             Plot EEG Data
  -p, --power           Plot Power Bands
  -ep, --eeg_power      Plot EEG & Power Data Combined
  -hdf5, --write_hdf5_file
                        Write output data into HDF5 file
  -ag, --accel_gyro     Plot Acceleration and Gyro Data
  -mc, --mellow_concentration
                        Plot Mellow and Concentratio Data (Only For Mind
                        Monitor Data)
  -s, --stats_plots     Plot Statistcal Data
  -c, --coherence_plots
                        Plot Coherence Data
  --plot_style PLOT_STYLE
                        Plot Syle: 1=seaborn, 2=seaborn-pastel, 3=seaborn-
                        ticks, 4=fast, 5=bmh
  -sm, --smooth_data    Smooth EEG Data
  -sw SMOOTH_WINDOW, --smooth_window SMOOTH_WINDOW
                        Smoothing Window (Seconds)
  -r, --auto_reject_data
                        Auto Reject EEG Data
  -eegc EEG_CLIP, --eeg_clip EEG_CLIP
                        Cliping for Auto Reject EEG Data
  -fd, --data_filtering
                        Filter EEG Data
  -ft FILTER_TYPE, --filter_type FILTER_TYPE
                        Filter Type 0=default 1=low pass, 2=bandpass
  -lc LOWCUT, --lowcut LOWCUT
                        Filter Low Cuttoff Frequency
  -hc HIGHCUT, --highcut HIGHCUT
                        Filter High Cuttoff Frequency
  -o FILTER_ORDER, --filter_order FILTER_ORDER
                        Filter Order
  -db, --data_base      Send session data and statistics to database
  

To find the current version of the application:

Current version:  1.1.23

The ".ABCS_parms.rc" runtime configuration file can be configured to define often used parameters or for batch processing.

{"First Name": "Debra", "Last Name": "Peri", "Data Dir": "/Volumes/Archive/muse_recordings/muse_monitor_recordings",
"Data Base Location": "/Volumes/Archive/muse_recordings/muse_monitor_recordings", "Filter Data": 1, "Filter Type": 1, "Filter LowCut": 0.5, "Filter HighCut": 70.0}

picture alt

https://github.com/digital-cinema-arts/Muse-Analysis-Tools/wiki/Example-Plots


Important note on sampling rate: Select "Constant" from the Mind Monitor recording interval option.

picture alt


Session data in JSON format.

picture alt


Session data in SQL (SQLite) Database.

picture alt


Session/EEG data in HDF5 format.

picture alt

picture alt


Donations

https://paypal.me/vinyasakramayoga?locale.x=en_US

If you would like to support this project, to help to contribute to disabled folks and to help youth gain access to yoga (in the Olympia, WA area) please send your kind donations to this paypal account

๐Ÿ’ง

muse-analysis-tools's People

Contributors

digital-cinema-arts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

muse-analysis-tools's Issues

macOS - How to.

Hi, could you please help me/us for using your code in a macOS Catalina? Any instructions?

Thanks you.
Alejandro

Add data markers

Add markers from Mind Monitor, Muse Lab and Muse Direct CSV data files.

Convert TimeStamp field to UNIX time

Convert TimeStamp field to UNIX time which is needed for accurate synchronization of data, to be able to keep track of data rejection, assignment of markers, etc.

Install fails on newest Ubuntu release

Installing the required libraries on the latest Ubuntu version is a mess. Primarily it's related to the pandas libraries. Need to dig through this ASAP, it used to work perfectly before this latest Ubuntu dist upgrade.

Batch processing

Batch processing. Build out the rest of e command line options so the application can be scripted for automatically processing multiple files.

Write HDF5 files

Write HDF5 files of the data that was plotted (filtered if the user selected filtering). Include stats and session data too.

File verification

File verification: add verification of the file's header before attempting to read the whole file. More importantly, determine its source (Mind Monitor, Muse Direct, Muse Player, ABCS) to properly configure the data sets and enable options/functions that are specific to that data source.

Marker colors need better contrast

Describe the bug

Marker colors need better contrast to make it easier to identify in the plot.

Marker colors should also not obscure the underlying plot line's color.

Data markers are deleted when auto-reject is used

Describe the bug
Data markers are deleted when auto-reject is used.

To Reproduce
Select auto-reject data.

Expected behavior
Plots with data markers ... :-)

Additional context
Should work, very odd side effect.

Add support for Muse Direct files

Add support for Muse Direct files.

Most of the this is worked out expect for renaming the pandas DataFrame columns for consistency across file formats.

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.