An open-source implementation of a closed-loop electrocorticographic Brain-Computer Interface using Micromed, FieldTrip, and PsychoPy
Bob Van Dyck, Arne Van Den Kerchove, Marc M. Van Hulle
TL;DR
The paper tackles the challenge of implementing flexible, closed-loop ECoG BCIs in clinical settings by introducing an open-source, modular Python stack that integrates Micromed data acquisition, FieldTrip-based real-time processing, and PsychoPy-driven user interaction. It contributes three libraries—psychopylib, pymarkerlib, and pyfieldtriplib—that address experiment design, event synchronization, and real-time processing, with runnable use-case examples. The work provides a detailed architectural description, practical latency considerations, and demonstrations of both synchronous and asynchronous BCI use, highlighting the benefits of modularity and transparency. By reducing reliance on monolithic platforms and aiming to remove MATLAB dependencies, the approach lowers barriers for researchers to translate ECoG decoding advances into usable BCI applications in clinical contexts.
Abstract
We present an open-source implementation of a closed-loop Brain-Computer Interface (BCI) system based on electrocorticographic (ECoG) recordings. Our setup integrates FieldTrip for interfacing with a Micromed acquisition system and PsychoPy for implementing experiments. We open-source three custom Python libraries (psychopylib, pymarkerlib, and pyfieldtriplib) each covering different aspects of a closed-loop BCI interface: designing interactive experiments, sending event information, and real-time signal processing. Our modules facilitate the design and operation of a transparent BCI system, promoting customization and flexibility in BCI research, and lowering the barrier for researchers to translate advances in ECoG decoding into BCI applications.
