Skip to content

Dynamic Clamp interface for brian2 <-> NI daq systems

Notifications You must be signed in to change notification settings

smestern/ni_dynamicclamp

Repository files navigation

Dynamic Clamp scripts for National Instruments Devices

In this repo are C/C++ Demo scripts for creating (dynamic clamp)[https://www.sciencedirect.com/science/article/pii/S0166223604000554]-based bio-hybrid networks between in vitro neurons and an arbitrary neural network. Also included is a python module for easy integration with Brian2 / Pytorch.

Hardware

Currently, this hardware has been tested with

  • BNC-2110
  • PCIE-6321
  • AMD Ryzen™ 7 5700 (Running Ubuntu LTS with real-time kernel)
  • 64GB memory

Achievable Speeds

Currently clamping rates up to 20 kHz have been achieved. I am hoping to push up to 50kHz and would appreciate any tips / pull requests on performance.

Usage: Brian2

The main focus of this project is integration with the neural / ode modeling software brian2. This project enables the "dynamic clamping" of pretty much any Brian2 implemented spiking model. With 2 caveats:

  • The dynamic clamp current is configured for "current-clamp" mode: E.g. the network outputs a current, the current is applied to the real neuron, the voltage is fed back into the network. Voltage clamp is possible but will require some modifications that I have yet to apply.
  • The network must be able to run in brian2's standalone mode. This may require some modifications of your script, but the standalone version of brian2 supports most if not all functions of the pythonic / cpython version.

The package hooks itself into brian2 standalone code generation, and cross compiles, enabling ultra-fast interface.

About

Dynamic Clamp interface for brian2 <-> NI daq systems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published