  This work introduces Dareplane, a modular and broad technology agnostic open
source software platform for brain-computer interface research with an
application focus on adaptive deep brain stimulation (aDBS). While the search
for suitable biomarkers to inform aDBS has provided rich results over the last
two decades, development of control strategies is not progressing at the same
pace. One difficulty for investigating control approaches resides with the
complex setups required for aDBS experiments. The Dareplane platform supports
aDBS setups, and more generally brain computer interfaces, by providing a
modular, technology-agnostic, and easy-to-implement software platform to make
experimental setups more resilient and replicable. The key features of the
platform are presented and the composition of modules into a full experimental
setup is discussed in the context of a Python-based orchestration module. The
performance of a typical experimental setup on Dareplane for aDBS is evaluated
in three benchtop experiments, covering (a) an easy-to-replicate setup using an
Arduino microcontroller, (b) a setup with hardware of an implantable pulse
generator, and (c) a setup using an established and CE certified external
neurostimulator. Benchmark results are presented for individual processing
steps and full closed-loop processing. The results show that the
microcontroller setup in (a) provides timing comparable to the realistic setups
in (b) and (c). The Dareplane platform was successfully used in a total of 19
open-loop DBS sessions with externalized DBS and electrocorticography (ECoG)
leads. In addition, the full technical feasibility of the platform in the aDBS
context is demonstrated in a first closed-loop session with externalized leads
on a patient with Parkinson's disease receiving DBS treatment.
