NETrex is a real-time neural network modeling and dynamic clamp application for neuroscience research. It combines the functionality of the legacy NetSim (simulation) and NetClamp (dynamic clamp) applications into a single unified program.
Key features:
- Build networks of model neurons with Hodgkin-Huxley conductances, synapses, gap junctions, and current injection electrodes
- Run pure simulations or real-time dynamic clamp experiments with NI-DAQmx hardware
- Real-time trace plotting, CSV data export, and configurable timing protocols
- Cross-platform: works on Windows, Linux, and macOS
Author: E. Brady Trexler, Ph.D.
License: GNU General Public License v3
Website: hudsonvalleysci.com
Pre-built binaries are available on the Releases page.
- Download
NETrex-Windows-x64.zipfrom the latest release - Extract the zip to a folder (e.g.,
C:\NETrex) - Double-click
NETrex.exeto run - For dynamic clamp with NI hardware: Install the free NI-DAQmx Runtime from ni.com. NETrex will automatically detect your DAQ device.
- For simulation only: No additional software needed — just run the app
- Download
NETrex-macOS.zipfrom the latest release - Extract the zip — you'll get
NETrex.app - Drag
NETrex.appto your Applications folder - Before first launch, open Terminal and run:
This removes the macOS quarantine flag that blocks unsigned apps downloaded from the internet.
xattr -cr /Applications/NETrex.app
- Double-click
NETrex.appto run - Note: macOS runs in simulation mode only (no NI-DAQmx hardware support). A mock DAQ backend is included for testing dynamic clamp networks.
- Download
NETrex-Linux-x64.zipfrom the latest release - Extract and make executable:
chmod +x NETrex - Run:
./NETrex - Requires Qt 5 libraries (
sudo apt install libqt5widgets5on Ubuntu/Debian) - For dynamic clamp: Install the NI-DAQmx driver for Linux
git clone <repo-url> NETrex
cd NETrex
mkdir build && cd build
cmake ..
make NETrex
./NETrex| Dependency | Required | Notes |
|---|---|---|
| C++17 compiler | Yes | GCC 7+, Clang 5+, MSVC 2017+ |
| CMake 3.15+ | Yes | Build system |
| Qt 5 (Widgets) | Yes | GUI framework |
| NI-DAQmx driver | No | Only needed for real hardware dynamic clamp |
All other dependencies (nlohmann/json, NI-DAQmx headers) are included in the repository.
This is the primary target for dynamic clamp experiments.
-
Install prerequisites:
- Visual Studio 2019 or 2022 (Community edition is free) — select "Desktop development with C++"
- CMake (3.15 or newer)
- Qt 5.15 — install the MSVC 2019 64-bit component
- NI-DAQmx driver — install the full driver (not just Runtime)
-
Set up environment:
set CMAKE_PREFIX_PATH=C:\Qt\5.15.2\msvc2019_64
Adjust the path to match your Qt installation.
-
Build:
git clone <repo-url> NETrex cd NETrex mkdir build && cd build cmake .. -G "Visual Studio 17 2022" -A x64 cmake --build . --config Release --target NETrex
-
Run:
Release\NETrex.exe
CMake will automatically detect the NI-DAQmx library and enable hardware support. You should see this during cmake configuration:
-- NI-DAQmx found: C:/.../nidaqmx.lib -
Deploy (create standalone folder):
mkdir deploy copy Release\NETrex.exe deploy\ cd deploy windeployqt NETrex.exe
The
deployfolder can be zipped and shared — it contains all needed Qt DLLs.
NI-DAQmx is supported on select Linux distributions (RHEL, CentOS, Ubuntu, openSUSE).
-
Install prerequisites:
# Ubuntu/Debian sudo apt install build-essential cmake qt5-default # Fedora/RHEL sudo dnf install gcc-c++ cmake qt5-qtbase-devel
-
Install NI-DAQmx (optional, for hardware): Download the Linux driver from ni.com. Follow NI's installation instructions. The library installs to
/usr/lib/x86_64-linux-gnu/libnidaqmx.so. -
Build:
git clone <repo-url> NETrex cd NETrex mkdir build && cd build cmake .. make NETrex
If NI-DAQmx is installed, cmake will report:
-- NI-DAQmx found: /usr/lib/x86_64-linux-gnu/libnidaqmx.soIf not installed, it will use the mock backend for testing.
-
Run:
./NETrex
NI-DAQmx is not available on macOS. NETrex runs with a mock DAQ backend that simulates a biological cell with Hodgkin-Huxley currents, allowing full development and testing of networks.
-
Install prerequisites:
# Install Xcode command line tools xcode-select --install # Install Homebrew packages brew install cmake qt@5
-
Build:
git clone <repo-url> NETrex cd NETrex mkdir build && cd build cmake .. -DCMAKE_PREFIX_PATH=$(brew --prefix qt@5) make NETrex
-
Run:
./NETrex
When a network contains only model cells (no biological cells), NETrex runs as a pure simulator. The network is updated at the requested sample rate using RK4 integration, and results are plotted in real time.
When a network contains one or more biological cells, NETrex automatically switches to dynamic clamp mode:
- Analog input channels read membrane voltages from the amplifier
- The network model computes synaptic/intrinsic currents based on the measured voltages
- Computed currents are written to analog output channels and injected into the cell
The timing protocol supports three phases:
- Before: DAQ is reading but no current is injected (baseline)
- During: Active dynamic clamp — currents are computed and injected
- After: DAQ is reading but current injection stops (recovery)
- Model Cell — Integrate-and-fire neuron with configurable currents
- Vm Playback Cell — Plays back a voltage waveform from a file
- Biological Cell — Represents a real neuron connected via DAQ hardware
- Hodgkin-Huxley conductance (HH, HH2)
- Gap junction
- Voltage clamp PID
- Generic bidirectional synapse
- Playback current waveform
Networks are saved as JSON files (.json). Example:
{
"cells": [
{
"name": "Cell 1",
"type": "Model Cell",
"active": true,
"currents": [...]
}
],
"electrodes": [...],
"synapses": [...]
}cmake can't find Qt5:
Set CMAKE_PREFIX_PATH to your Qt installation:
cmake .. -DCMAKE_PREFIX_PATH=/path/to/qt5NI-DAQmx not detected:
Ensure the full NI-DAQmx driver is installed (not just Runtime). Check that libnidaqmx is in your library path. cmake will print a status message indicating whether the library was found.
Mock backend on Windows/Linux: If you want to develop without hardware, NETrex works fine — it just uses the mock backend. No configuration needed.
cmake --build . --config Release --target NETrex
mkdir deploy
copy Release\NETrex.exe deploy\
cd deploy
windeployqt NETrex.exeZip the deploy folder. Recipients need the NI-DAQmx Runtime (free download from ni.com) if using hardware.
# Build with static Qt or use linuxdeployqt:
# https://github.com/probonopd/linuxdeployqt
make NETrex
linuxdeployqt NETrex -appimageProduces a portable AppImage. Recipients need NI-DAQmx driver for hardware.
make NETrex
macdeployqt NETrex.app -dmgProduces a .dmg for distribution (simulation only, no DAQ hardware support).