Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
6a95aba
Update feature extraction for heatmap visualization
cbmorrell Jul 24, 2024
1bf5dc3
Change features to fe in OnlineStreamer
cbmorrell Jul 24, 2024
3bd2657
Offline regression example
cbmorrell Aug 8, 2024
94091d9
Merge pull request #66 from LibEMG/main
eeddy Aug 14, 2024
353e286
Example for new streamer
eeddy Aug 14, 2024
df08317
Revert "Example for new streamer"
eeddy Aug 14, 2024
34de77a
Rename ColumnFetch to ColumnFetcher
cbmorrell Aug 16, 2024
2da2612
Remove duplicate method
cbmorrell Aug 16, 2024
bc0972f
Add feature queue for time series models
cbmorrell Aug 16, 2024
f4d9e4f
Move constructor docstrings outside __init__
cbmorrell Aug 16, 2024
af1c726
Regression explanation
cbmorrell Aug 16, 2024
ae71d0f
Add explicit conditional check instead of relying on casting
cbmorrell Aug 19, 2024
8e71705
Only pop if queue is at max length
cbmorrell Aug 19, 2024
cfc9a84
Add feature queue parameter to child classes
cbmorrell Aug 19, 2024
6d83b96
Add online channel mask
cbmorrell Aug 19, 2024
f27c6e3
Merge branch 'online-model-feature-queue' into feature-extractor-rework
cbmorrell Aug 19, 2024
19f2049
Revert "Revert "Rework FeatureExtractor""
cbmorrell Aug 19, 2024
81318c1
Add skip until buffer fills up
cbmorrell Aug 19, 2024
d30f608
Merge pull request #68 from LibEMG/rename-column-fetch
eeddy Aug 20, 2024
457e5ec
Merge pull request #59 from LibEMG/offline-regression-example
eeddy Aug 20, 2024
e8701ad
Add TODO
cbmorrell Aug 20, 2024
5a6bd18
Add wildcard to regex helper
cbmorrell Aug 21, 2024
88821ef
Add check for None in RegexFilter
cbmorrell Aug 21, 2024
c5c8748
Add wildcard to regex helper
cbmorrell Aug 21, 2024
2e63dfd
Add check for None in RegexFilter
cbmorrell Aug 21, 2024
87a4003
Add MEC24 workshop to landing page
cbmorrell Aug 22, 2024
e8ddc12
Add post-processing visual to regression example
cbmorrell Aug 22, 2024
34cecb3
Add skip until buffer fills up
cbmorrell Aug 19, 2024
784372c
Regression visualization
cbmorrell Aug 23, 2024
ee3503e
Handle coordinates without steady state frames
cbmorrell Aug 23, 2024
30ef842
Animation documentation
cbmorrell Aug 23, 2024
ac127c3
Add heatmap visualization
cbmorrell Aug 23, 2024
a751cbb
Add string parameters for common metadata operations
cbmorrell Aug 26, 2024
124a1dd
Merge pull request #71 from LibEMG/common-metadata-operations
ECEEvanCampbell Aug 26, 2024
60249b0
ninapro db2 dataglove support added
A-R-Hariri Aug 27, 2024
5d92b81
Merge branch 'feature-extractor-rework' into online-model-feature-queue
cbmorrell Aug 27, 2024
29e677c
Revert "Revert "Revert "Rework FeatureExtractor"""
cbmorrell Aug 27, 2024
8aaf19d
Add online standardization method
cbmorrell Aug 27, 2024
80969d8
Use proper FeatureExtractor interface
cbmorrell Aug 27, 2024
3466dad
Fix heatmap feature extraction
cbmorrell Sep 4, 2024
5f20583
Add clarification to install_standardization docstring
cbmorrell Sep 4, 2024
2c10637
Fix online regressor visualize lag
cbmorrell Sep 4, 2024
7c86fa3
Add docstring to OnlineEMGRegressor.visualize
cbmorrell Sep 4, 2024
5bfe048
Skeleton for Controller class
cbmorrell Sep 4, 2024
6f5e72d
Check for correct MacOS string
cbmorrell Sep 5, 2024
318fc0c
ninapro db2
A-R-Hariri Sep 6, 2024
24c1951
Remove unnecessary pop of oldest window
cbmorrell Sep 6, 2024
9aa3f4e
Create SocketController
cbmorrell Sep 6, 2024
f18ec91
Add comment idea
cbmorrell Sep 6, 2024
48beed0
Add abstract timestamp parsing function
cbmorrell Sep 6, 2024
7ce9bc1
RegressorController
cbmorrell Sep 6, 2024
8254942
Merge pull request #79 from LibEMG/oymotion-streamer-incorrect-os-check
ECEEvanCampbell Sep 9, 2024
95e1111
Merge pull request #73 from LibEMG/online-model-feature-queue
ECEEvanCampbell Sep 9, 2024
25460b3
updates sifi streamer to accept bridge version. forked sifi bridge in…
ECEEvanCampbell Sep 9, 2024
deb3a98
Remove model from RegressorController
cbmorrell Sep 9, 2024
8a20f1b
db2 dataglove support limited to NinaproDB2 class
A-R-Hariri Sep 9, 2024
fb41e9a
ClassifierController implementation
cbmorrell Sep 9, 2024
edb395d
Fix online regressor visualize lag
cbmorrell Sep 4, 2024
19769b5
Add option to parse timestamp
cbmorrell Sep 9, 2024
030d6b2
Remove OnlineEMGRegressor.parse_output and references
cbmorrell Sep 9, 2024
6e436a9
documentation for NinaproDB2
A-R-Hariri Sep 9, 2024
c943fff
Merge pull request #80 from AmirRezaHariri/ninapro_regression
cbmorrell Sep 9, 2024
68942af
Merge pull request #81 from LibEMG/sifi-breakout
cbmorrell Sep 9, 2024
7d0a7d6
Remove duplicate method
cbmorrell Sep 13, 2024
5073d27
Throw error when streaming stops during SGT
cbmorrell Sep 13, 2024
e38e66c
Update .gitignore
cbmorrell Sep 13, 2024
2b49cf7
Convert methods to private
cbmorrell Sep 13, 2024
2142233
Regression Fitts task
cbmorrell Sep 13, 2024
e2357e5
Added sifi-bridge-py to dependencies. Renamed executable to sifibridge
Sep 24, 2024
6965053
cleanup init and sifibridge configurations
Sep 24, 2024
190818c
Change raw writes to sbp methods
Sep 24, 2024
c547681
Updated some redundant parameters and docstrings
Sep 24, 2024
29aafb2
Remove executable from repo
Sep 24, 2024
45c8034
Fixed sifibridge process launch, added sifibridge to gitignore
Sep 24, 2024
a7a839f
Fix gitignore
Sep 24, 2024
ef60d25
Fixed cleanup
Sep 24, 2024
48f907b
make streamer function more in-line with sifi-breakout
Sep 27, 2024
62b0064
docstring, change 'device' to 'name'
Sep 27, 2024
9ae16eb
Remove metric calculation functions
cbmorrell Oct 4, 2024
38031de
Implement classifier controller for visualization
cbmorrell Oct 4, 2024
633f173
Add check for data not being received
cbmorrell Oct 4, 2024
063b965
Add EMG hero legacy code
cbmorrell Oct 4, 2024
e71897c
Replace deque with multiprocessing Queue
cbmorrell Oct 5, 2024
e3b27e5
Fix online ClassifierController parsing
cbmorrell Oct 5, 2024
f846b0b
Fix OnlineEMGClassifier.visualize
cbmorrell Oct 5, 2024
e5e1c26
Automatically start Controller in Environment
cbmorrell Oct 5, 2024
2db5c59
Classifier working in FittsLawTest
cbmorrell Oct 5, 2024
7fb7dd6
Rename FittsLawTest to IsoFitts
cbmorrell Oct 5, 2024
bc16d76
Move common functionality to run method
cbmorrell Oct 5, 2024
f40619c
Update OnlineEMGClassifier visualize docstring
cbmorrell Oct 6, 2024
a697bd1
Hide pygame welcome message
cbmorrell Oct 6, 2024
92756ea
Move functionality to Environment class and Fitts parameters
cbmorrell Oct 6, 2024
5812e7a
Rework prediction map
cbmorrell Oct 6, 2024
b022309
Convert EMGHero to Environment
cbmorrell Oct 6, 2024
f7a126f
Rework _get_action for queue
cbmorrell Oct 6, 2024
d687ec9
Remove _parse_timestamp from Controller class
cbmorrell Oct 6, 2024
a6435c8
Fix prediction map for IsoFitts
cbmorrell Oct 6, 2024
a729a9b
Implemented KeyboardController
cbmorrell Oct 6, 2024
5a7721c
Properly receive None in EMGHero
cbmorrell Oct 6, 2024
4e1fb29
Split environments.py into multiple files
cbmorrell Oct 7, 2024
459c1a2
Add environments to __init__
cbmorrell Oct 7, 2024
c2bf8f5
Fix environment imports
cbmorrell Oct 7, 2024
f8ae722
Hide pygame welcome message
cbmorrell Oct 7, 2024
31d5a46
IsoFitts direction fix
cbmorrell Oct 7, 2024
87ff27e
Convert IsoFitts methods to hidden methods
cbmorrell Oct 7, 2024
277cb14
Environments documentation
cbmorrell Oct 7, 2024
d056439
Rework SocketController
cbmorrell Oct 7, 2024
fad6227
Add wait in OnlineEMGRegressor.visualize
cbmorrell Oct 7, 2024
9822c14
Merge pull request #83 from LibEMG/duplicate-method-in-ninaprodb2
ECEEvanCampbell Oct 8, 2024
d28d0f6
Merge pull request #84 from LibEMG/handle-sgt-streaming-interruption
ECEEvanCampbell Oct 8, 2024
391ab53
Merge pull request #74 from LibEMG/online-regressor-visualization-lag
ECEEvanCampbell Oct 8, 2024
b6121a9
Merge branch 'latest' into game-environments
ECEEvanCampbell Oct 8, 2024
a8367ee
Merge pull request #89 from LibEMG/game-environments
ECEEvanCampbell Oct 8, 2024
bf252a2
fixed windows compilation target
Oct 8, 2024
b483dcf
Override terminate method
cbmorrell Oct 8, 2024
157dc45
Allow non-callable dtypes
cbmorrell Oct 8, 2024
ff61e87
Convert Manager to SharedMemory
cbmorrell Oct 8, 2024
265e482
Add proportional control flag to IsoFitts
cbmorrell Oct 8, 2024
75a71ea
Automatically create parent directories when saving coordinates
cbmorrell Oct 9, 2024
278c202
Update Fitts example with regression
cbmorrell Oct 9, 2024
2ffb798
added sifi bridge to setup
ECEEvanCampbell Oct 10, 2024
938d797
Launch the subprocess in run method for pickling issues
gabrielpgagne Oct 10, 2024
f2c0d5a
Merge branch 'latest' into feature/sifibridge-1.1
ECEEvanCampbell Oct 10, 2024
8dce28b
Merge pull request #93 from gabrielpgagne/feature/sifibridge-1.1
ECEEvanCampbell Oct 10, 2024
d51fe42
Merge pull request #91 from LibEMG/socket-controller-shared-memory
ECEEvanCampbell Oct 10, 2024
ac9ce2f
Update streamers.py
ECEEvanCampbell Oct 10, 2024
4a73b76
removed version from sifi bridge import
ECEEvanCampbell Oct 16, 2024
2fb22a1
added more checks for creating variables
ECEEvanCampbell Oct 16, 2024
b4c42e6
SocketController Lock Fix
cbmorrell Oct 16, 2024
9410fff
Add pygame to setup.py
cbmorrell Oct 16, 2024
22cdcf1
Merge pull request #94 from LibEMG/socket-controller-shared-memory-lo…
ECEEvanCampbell Oct 17, 2024
d1ff3ee
Merge pull request #92 from LibEMG/regression-documentation
ECEEvanCampbell Oct 17, 2024
e58b1cd
Simplify SocketController
cbmorrell Oct 17, 2024
0d95a50
Make socket non-blocking
cbmorrell Oct 17, 2024
f9a8644
Replace classifier_smm_writes with model_smm_writes
cbmorrell Oct 17, 2024
67dc160
Pass model timestamp instead of current time
cbmorrell Oct 17, 2024
d6b0486
Fixed saving of IMU data
ulysseTM Oct 18, 2024
c48b3f8
Remove Delsys pasted docstring
cbmorrell Oct 18, 2024
81727d0
Merge pull request #97 from ulysseTM/patch-1
ECEEvanCampbell Oct 20, 2024
4b04b99
Add numpy import to Delsys API streamer
cbmorrell Oct 23, 2024
8e6ad11
Add check for num_channels in delsys_api_streamer
cbmorrell Oct 23, 2024
1e02c49
Add support for .json when logging environment
cbmorrell Oct 24, 2024
25492e4
Add target and distance radii parameters
cbmorrell Oct 24, 2024
96f7e07
Add option to redo final rep
cbmorrell Oct 29, 2024
960d6f9
Show "Rep X of Y" during data collection
cbmorrell Oct 29, 2024
6e32c11
Automatically calculate rep time for videos
cbmorrell Oct 30, 2024
cf1e181
Find labels files and move to corresponding data directory
cbmorrell Oct 30, 2024
1bbff78
Throw ConnectionError during start callback
cbmorrell Oct 30, 2024
08b0428
GUI docstring update
cbmorrell Oct 30, 2024
a27ca1f
Merge pull request #98 from LibEMG/sgt-gui-improvements
eeddy Oct 31, 2024
f5bf631
Merge pull request #96 from LibEMG/simplify-controllers
eeddy Oct 31, 2024
3113b50
Removed unused dependencies in sifibridge streamer. Set EDA to 0Hz by…
Nov 12, 2024
97be849
Merge pull request #100 from gabrielpgagne/bugfix/sifi-bridge-py-1.2
ECEEvanCampbell Nov 13, 2024
a7bfbc4
Fix visualize_heatmap throwing error for feature lists of length 1
cbmorrell Nov 25, 2024
d25b360
Merge pull request #103 from LibEMG/visualize-heatmap-fix
eeddy Nov 28, 2024
eb9187e
Dataset Updates (#85)
eeddy Nov 29, 2024
defc993
Fixed setup issue
eeddy Nov 29, 2024
57cdf2f
Add HyserMVC Dataset (#105)
cbmorrell Dec 5, 2024
1140ca2
Example of how to include proportional control
eeddy Dec 5, 2024
ea53160
Undo
eeddy Dec 5, 2024
b5248a5
First commit
eeddy Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,28 @@ test_*.py
*.csv
.vscode/*
test_delsys_api.py
resources/
resources/
*.csv
*.txt
ContinuousTransitions/*
FORS-EMG/*
MyoDisCo/*
NinaProDB1/*
*.zip
libemg/_datasets/__pycache__/*
CIILData/*
EMGEPN612.pkl
OneSubjectMyoDataset/
_3DCDataset/
ContractionIntensity/
CIILData/
*.pkl
LimbPosition/
CNN.py
MLP.py
__pycache__/
libemg/environments/
MLPR.py
docs/Makefile
sifibridge-*
*.pyc
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Ethan Eddy, Evan Campbell, Angkoon Phinyomark, Scott Bateman, and Erik Scheme'

# The full version, including alpha/beta/rc tags
release = '1.0.0'
release = '2.0.0'


# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions docs/source/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ The goal of this library is to provide an easy to use and feature-rich API for d
$ pip install libemg
```

# Interactive API Walkthrough

Interactive offline and online walkthroughs were created as part of a `LibEMG` workshop we presented at [MEC24](https://www.unb.ca/ibme/mec/index.html), hosted by the Institute of Biomedical Engineering. These walkthroughs step through much of the core functionality of `LibEMG`, and offer visuals to explain pieces of the API. The offline example is formatted as a jupyter notebook, allowing you to see visuals for each code snippet without running the code yourself. Please check out out the workshop GitHub repository to see these interactive API walkthroughs: <https://github.com/LibEMG/LibEMG_MEC24_Workshop>.

# Questions
Check out our discord server if you have questions, comments, or feature requests: https://discord.gg/NeqTTXmM4F

Expand Down
4 changes: 4 additions & 0 deletions docs/source/documentation/animation/animation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Animation
------------------------------
.. include:: animation_doc.md
:parser: myst_parser.sphinx_
75 changes: 75 additions & 0 deletions docs/source/documentation/animation/animation_doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
## Use Case

The `Animator` class offers some simple functionality to create animations in multiple video formats (e.g., .gif and .mp4). Specific `Animator` classes have been created to help create specific visual prompts, such as bar plots and cartesian plots. These prompts are primarily used for training of regression-based myoelectric control systems, but the `Animator` class can also be used to generate these prompts for any purpose. For fully custom animations, you can inherit from the `Animator` class and pass a set of frames to `save_video()` (see other `Animators` for examples). If you'd rather implement a custom plotting animation that isn't supported, you can inherit from `PlotAnimator` instead.

For all further examples, we will use a generated set of coordinates to illustrate the difference between plots.

```Python
import numpy as np

fps = 24
coordinates = np.concatenate((
np.linspace(0, 1, num=fps), # each movement is 24 frames -> 1 second
np.ones(2 * fps), # steady state
np.linspace(1, -1, num=2 * fps),
np.ones(2 * fps) * -1,
np.linspace(-1, 0, num=fps)
))
coordinates = np.hstack((
np.expand_dims(coordinates, 1),
np.zeros((coordinates.shape[0], 1))
))
```

## Bar Plots

One type of `Animator` built into `LibEMG` creates bar plot animations. Pass in an array of coordinates to the `plot_icon` method to create a bar plot visualization (see Figure 1).

```Python
from libemg.animator import BarPlotAnimator

animator = BarPlotAnimator(['Open', 'Close'], fps=fps)
animator.save_plot_video(coordinates)
```

![alt text](bar.gif)
<p align="center">Figure 1: Simple bar plot animation.</p>

Additional information can also be shown during these animations, such as the next destination and a countdown for steady states (see Figure 2).

```Python
animator = BarPlotAnimator(['Open', 'Close'], fps=fps, show_countdown=True, show_direction=True)
animator.save_plot_video(coordinates)
```

![alt text](bar-info.gif)
<p align="center">Figure 2: Bar plot animation with added information.</p>

Parameters such as the time per unit distance, figure size, and more can also be modified. See the `BarPlotAnimator` API for more details.

## Scatter Plots

`LibEMG` also provides a helper class to animate scatter plots (see Figure 3).

```Python
from libemg.animator import ScatterPlotAnimator

animator = ScatterPlotAnimator(['Open', 'Close'], fps=fps)
animator.save_plot_video(coordinates)
```

![alt text](scatter.gif)
<p align="center">Figure 3: Simple scatter plot animation.</p>

Similar to the bar plot animation, extra information can be added such as next destination, a countdown, and a unit circle boundary (see Figure 4).

```Python

animator = ScatterPlotAnimator(['Open', 'Close'], fps=fps, show_countdown=True, show_direction=True, show_boundary=True)
animator.save_plot_video(coordinates)
```

![alt text](scatter-info.gif)
<p align="center">Figure 4: Scatter plot animation with added information.</p>

Parameters such as the time per unit distance, figure size, and more can also be modified. See the `ScatterPlotAnimator` API for more details.
Binary file added docs/source/documentation/animation/bar-info.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/documentation/animation/bar.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/documentation/animation/scatter.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 0 additions & 101 deletions docs/source/documentation/classification/classification_doc.md

This file was deleted.

Loading