NeuroSimo: an open-source software for closed-loop EEG- or EMG-guided TMS
Authors:
- Olli-Pekka KahilakoskiOKOlli-Pekka Kahilakoski
- Kyösti AlkioKAKyösti Alkio
- Oula SiljamoOSOula Siljamo
- Joonas LaurinojaJLJoonas Laurinoja
- Lisa HaxelLHLisa Haxel
- Matilda MakkonenMMMatilda Makkonen
- Tuomas P. MutanenTMTuomas P. Mutanen
- Timo TommilaTTTimo Tommila
- Roberto GuidottiRGRoberto Guidotti
- Giulia PieramicoGPGiulia Pieramico
- Risto J. IlmoniemiRIRisto J. Ilmoniemi
Preprint
Abstract
Objective Our goal was to create open-source software for closed-loop EEG–TMS that allows researchers to rapidly prototype and develop novel stimulation paradigms in a high-level programming language. This addresses the limitations of current solutions, which often rely on proprietary hardware and software, limiting their accessibility and customizability, or comprise ad-hoc pipelines tailored to specific use cases. Approach We developed NeuroSimo, a software platform that enables arbitrary EEG–TMS stimulation protocols written in Python, leveraging Python’s ecosystem of scientific, neuroimaging, and machine learning libraries. The core software is written in C++ with an embedded Python interpreter and employs the Robot Operating System (ROS 2) for inter-process communication. NeuroSimo runs on real-time-enabled Linux Ubuntu, using LabJack T4 for pulse triggering, and supports two EEG device models (Bittium NeurOne, BrainProducts actiCHamp) and TMS devices that deliver pulses via trigger signals. The software includes a graphical user interface for configuration and performance monitoring, and supports GPU processing for neural network computations. Main results In brain-state-dependent stimulation using the Phastimate algorithm, which targets TMS pulses to the trough of sensorimotor μ-rhythm, NeuroSimo achieved a median timing error of 0.2 ms (95% CI: 0.2–0.2 ms), a 99th-percentile of 0.6 ms (0.6–0.6 ms), and a maximum of 1.4 ms. Significance As an open-source platform combining Python’s flexibility with real-time closed-loop EEG– TMS, NeuroSimo enables researchers to develop and implement novel therapeutic approaches, marking a significant advance in personalized brain stimulation.Keywords
Funding Information
- European Research Council (ERC) – Synergy Grant (810377)
- Research Council of Finland (353798)
- Aalto-Yliopisto
- Emil Aaltosen Säätiö
- Else Kröner Medical Scientists Kolleg “Clinbrain: Artificial Intelligence for Clinical Brain Research”
This publication has 43 references indexed in Scilit:
- systemd2022
- Multi-locus transcranial magnetic stimulation system for electronically targeted brain stimulationBrain Stimulation, 2022
- The Brain Electrophysiological recording & STimulation (BEST) toolboxBrain Stimulation, 2022
- Evidence-based guidelines on the therapeutic use of repetitive transcranial magnetic stimulation (rTMS): An update (2014–2018)Clinical Neurophysiology, 2020
- Docker Compose2018
- Multi-locus transcranial magnetic stimulation—theory and implementationBrain Stimulation, 2018
- Real-time EEG-defined excitability states determine efficacy of TMS-induced plasticity in human motor cortexBrain Stimulation, 2018
- Software Defined Anything—From Software-Defined Hardware to Software Defined Anything2016
- Inter-subject and Inter-session Variability of Plasticity Induction by Non-invasive Brain Stimulation: Boon or Bane?Brain Stimulation, 2015
- Review of Real-Time Simulator and the Steps Involved for Implementation of a Model from MATLAB/SIMULINK to Real-TimeJournal of The Institution of Engineers (India): Series B, 2014