MUExplorer
is an interactive MATLAB GUI for manually identifying and refining motor unit templates from high-density surface EMG (HDsEMG) signals. It allows users to click-select spike events, generate templates, run template-matching convolution, and export results in a DEMUSE-compatible format.
- Visualizes multi-channel HDsEMG data with per-channel vertical stacking
- Manual spike peak selection and template averaging
- Matched filter convolution for spike detection
- Subtraction of detected motor units to reveal residual activity
- Zooming, panning, and keyboard-driven interaction
- Supports export in DEMUSE-compatible format
- Handles data from synchronized
.mat
recordings and provides GUI layout for reviewing and editing MU templates - Can optionally launch and connect to a Node.js-based parameter server for integration with external systems
Requires MATLAB R2021b or later (earlier versions may work but are untested).
If you want MUExplorer to automatically launch and connect to the Node.js parameter server on startup, you must have Node.js installed.
- Download and install Node.js from https://nodejs.org/
- Recommended: Use the LTS (Long-Term Support) version.
- On Windows, check the box to add Node.js to your system
PATH
during installation.
- Verify installation:
Both commands should print version numbers without error.
node -v npm -v
- Ensure the
parameter_server.js
file is available in the expected location (see yourconfig.yaml
if customized).
When launching MUExplorer, if the parameter server is not running, the app will attempt to start it automatically.
- Download and unzip this repo.
- Copy/paste
@MUExplorer
into any MATLAB workspace folder you like. Make sure your MATLAB Editor's current folder is set to that location. - Inside
@MUExplorer
, updateconfig.yaml
if you want to use auto file-name parsing/loading:- DataRoot, InputSubfolder, InputSuffix, and LayoutFile — Set these to match your experiment data structure. Example:
<Your DataRoot Folder>/ ├── <SessionName Folder> (e.g. "Max_2025_05_20") │ ├── tmsi_layout.mat # contains REMAP indexing vector │ ├── <InputSubfolder>/ │ │ ├── Max_2025_05_20_2_synchronized.mat ├── <Other Session Folders...>
- DemuseInputSubfolder — Where to look for DEMUSE results (inside the SessionName folder).
- OutputSubfolder — Where to save MUExplorer results.
- DataRoot, InputSubfolder, InputSuffix, and LayoutFile — Set these to match your experiment data structure. Example:
The constructor supports multiple calling styles via MATLAB’s arguments
block.
If you have data Data
(channels × samples) and a sample rate fs
:
app = MUExplorer(Data, fs);
If you have a synchronization/reference indicator sync
(1 × samples):
app = MUExplorer(Data, fs, sync);
If you’ve organized your data into the recommended folder structure:
sessionName = "Max_2025_05_20";
experimentNum = 5;
app = MUExplorer(sessionName, experimentNum);
app = MUExplorer(sessionName, experimentNum, true);
The constructor now accepts name–value pair options:
app = MUExplorer("2025_03_06", 3, false, ...
'DataRoot', "G:\Shared drives\NML_MetaWB\Data\MCP_08", ...
'Prefix', "MCP08_", ...
'Suffix', "_custom", ...
'ConfigFile', "C:\path\to\my_config.yaml");
Options:
Prefix
(string) – Added beforesessionName
in filename constructionSuffix
(string) – Added aftersessionName
in filename constructionDataRoot
(string) – Override the default data root folderConfigFile
(string) – Path to a YAML configuration file
Follow these steps for a typical spike template creation session:
- Hold Ctrl + Left Click to select a region with spikes.
- Left-click near peaks of spikes with consistent shape.
- Press Enter to generate a template and run matched filter convolution.
- Adjust lower/upper spike detection bounds as needed (Left/Right Click).
- Regenerate or start a new template with N.
- Save with Ctrl + S (MUExplorer format) or Alt + S (DEMUSE format).
Key / Combo | Action |
---|---|
H |
Show help |
Enter |
Generate template + convolution |
Space |
Run convolution only |
Escape |
Reset selected peaks |
Ctrl + S |
Save MUExplorer file |
Alt + S |
Save DEMUSE file |
Ctrl + L |
Load MUExplorer file |
Alt + L |
Load DEMUSE file |
N |
New template group |
Tab |
Switch to next group |
↑ / ↓ |
Navigate groups |
← / → |
Pan left/right |
Mouse Action | Description |
---|---|
Left Click | Add peak at clicked channel/time |
Right Click | Remove nearest peak |
Middle Click + Drag | Pan |
Ctrl + Click + Drag | Box zoom |
Mouse Scroll Down | Reset zoom |
- Native (
*_muresults.mat
) – Templates, spikes, residuals, GUI state - DEMUSE-Compatible (
*_DEMUSE.mat
) –MUPulses
,IPTs
,PNR
,SIG
,ref_signal
@MUExplorer/
├── MUExplorer.m
├── <Methods of MUExplorer>
├── config.yaml
If you use MUExplorer in your work, please cite this repository or reference the DEMUSE format.
Developed by the Neuro-Mechatronics Lab.
For questions, open an issue or submit a pull request.