GUI that streams from the Trigno Lite system and can receive stim signals from a TMS machine to detect Motor Evoked Potentials (MEPs).
The gif below shows the usual function of the GUI. The left panel shows 10 seconds of the current EMG signal from Channel 1 (though it can be changed to other channels), and the pannel on the right shows 100ms worth of data starting from the moment the TMS sync signal is received.
If you use this software, please cite it as below.
Cubillos, L. H., & Krishnan, C. (2022). A GUI for streaming and recording motor evoked potentials elicited by transcranial magnetic stimulation using the Delsys Trigno Lite EMG system (Version 1.0) [Computer software]. https://github.com/NeuRRoLab/tms_delsys_trigno
The project was extensively tested using Python 3.8 and Windows 10. The specific python packages required are shown in the file requirements.txt. It uses the Delsys API, but no other packages should need to be installed: this can run as a standalone program. The necessary libraries are included in the folder lib.
Sometimes the operating system blocks the libraries that were downloaded from the internet, and so a process is needed to make sure that the libraries downloaded with this repository are usable. To do that, we would need to run the following:
cd repo/bin
streams.exe -d ..\lib\*The hardware requirements are the following:
- Trigno lite system
- Avanti Analog Input Adapter
- Single channel BNC connection: found here, connects the Avanti adapter to the TMS output.
- TMS machine with a BNC rising edge output.
To use the software, clone the repository and then install the Python requirements by doing:
git clone repo_url
cd repo
pip install -r requirements.txtTo setup the system, first we need to place the EMG sensors on the muscles we are interested in testing. The image below shows EMG placement on the Extensor Carpi Radialis. Follow the instructions here for more recommendations from Delsys.

The Avanti analog input adapter must be connected to the rising edge output of the TMS system, as shown in the image below.

Finally, to make the system work properly, we need to copy the key and license files we should have received from Delsys into the config folder. They should be called key and license.lic respectively.
To run the program, make sure that the sensors we want to use are already out of the base station and connected to it. Then, the program starts by opening the Anaconda Powershell and running the following:
# Activate anaconda environment
conda activate newdelsys
python tms_trigno.pyMake sure that the python version is 3.8 and that it has all the necessary packages installed.
The GUI was built using the QT designer. To modify it, we can open the designer which should have been installed as part of the requirements of the project. To open the interface, we must do:
# Go to wherever the python base directory for the interpreter we're using is.
# In the case of anaconda, it will be:
cd C:\Users\[USER]\anaconda3\envs\[ENV_NAME]
# Then, open the designer
cd Lib\site-packages\qt5_applications\Qt\bin\
designer.exeInside the designer, open the QT file, available at [QT/tms_window.ui].
When all changes are ready, update the Python file from the designer file by doing:
pyuic5 -o QT/main_window.py QT/tms_window.uiGetting a constant frame rate from the GUI is challenging. Right now, it is based on a QT timer that runs every 30ms. However, we discovered that if we don't print the time it takes for the plot update method to run, then the GUI as a whole slows down. Some digging will need to be done to avoid the printing while maintaining the frame rate.
If you have any issues, please create a new issue in the repository, or contact Luis Cubillos at lhcubill@umich.edu.
See the License.md file for license rights and limitations (MIT).
