CNN-ripple is a 1D convolutional neural network (CNN) operating over high-density LFP recordings to detect hippocampal SWR both offline and online. It works with recordings from several types of recordings (e.g. linear arrays, high-density probes, ultradense Neuropixels).
This plugin allows the use of CNN-ripple as a real-time detection tool as part of the Open Ephys platform.
You can check our results in our manuscript (Navas-Olive, Amaducci et al. eLife 2022)
Download the latest release for your operating system from https://github.com/PridaLab/CNNRippleDetectorOEPlugin/releases.
For Linux:
- Copy the
CNNRippleDetectorOEPlugin.so
file to Open Ephysplugins
folder. - Download Tensorflow 2.3.0 libraries into
CNNRippleDetectorOEPlugin/libs/bin/x64
. You need to extract the content of thelib
folder from this TAR file.
For Windows (default path for plugins: C:\ProgramData\Open Ephys
):
- Copy the
CNNRippleDetectorOEPlugin.dll
file to Open Ephysplugins
folder. - Download Tensorflow 2.3.0 libraries into Open Ephys
shared
folder. You need to extract the.dll
file from thelib
folder from this ZIP file.
For Linux:
- Open a terminal and load Tensorflow dynamic libraries using
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<your_path>/CNNRippleDetectorOEPlugin/libs/bin/x64/
- Run Open Ephys on the same terminal.
For Windows:
- Run Open Ephys.
The plugin receives 8 channels as input. You can use the ChannelMap
plugin to select the channels.
- File: selector for the CNN model
.pb
file. Can be found in theCNNRippleDetectorOEPlugin/model
directory. - Pulse duration: duration of the TTL pulse sent when a ripple is detected (in milliseconds).
- Timeout: recovery time after a pulse is sent (in milliseconds).
- Calibration: calibration time before the experiment to setup the signals normalization (in seconds). One minute is usually enough.
- Threshold: probability threshold for the detections. Between 0 and 1.
- Drift: number of standard deviations above which the signal is considered to be dominated by extreme offset drift and the CNN will not predict.
- Output: output channel for TTL pulses.
- Clone this repository in the same directory where
plugin-GUI
is located. - Download Tensorflow 2.3.0 libraries into
CNNRippleDetectorOEPlugin/libs/bin/x64
. You need to extract the content of thelib
folder from this TAR file (for Linux) or this ZIP file (for Windows). - Go to the
Build
directory and execute to create the CMake project:
For Linux:
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
For Windows:
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_CXX_FLAGS="/EHsc /utf-8" ..
- To compile and install the plugin:
On Linux, in the same Build
directory:
make
make install
On Windows, open Visual Studio 16 2019 and compile and install the solution (see notes below on how to install Visual Studio).
- Install and run the plugin as indicated above.
-
Clone Open Ephys GUI repository.
-
Download and install Visual Studio 2019.
-
Run
Resources/DLLs/FrontPanelUSB-DriverOnly-4.4.0.exe
to install DAQ drivers if needed. -
Install C++ compiling tools for Visual Studio 2019 and create a new project so everything gets properly configured.
-
Download and install CMake. Select "Add CMake to the system PATH".
-
Add the line
add_definitions(-DWIN32)
into line 107 of CMakeLists.txt. -
Open PowerShell, go to folder plugin-GUI/Build and run CMake.
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_CXX_FLAGS="/EHsc /utf-8" ..
-A
indicates the target architecture, which must be specified accordingly.
-
Open
open-ephys-GUI.sln
, which can be found in theBuild
directory, with Visual Studio 2019. -
Compile the solution.