# Electrophysiology setup

## Requirements

1. **OpenEphys:** The [OpenEphys GUI](https://open-ephys.org/gui) (v >= 0.6.4) should be installed.
2. **Custom Plug-Ins:** The following plug-ins should be installed to use the platform: [OpenEphysIGTLink](https://github.com/netstim/OpenEphysIGTLink), [OpenEphysLeadOR](https://github.com/netstim/OpenEphysLeadOR) and [OpenEphysRMS](https://github.com/netstim/OpenEphysRMS).
3. **Data source:** the [OpenEphysNeuroOmega](https://github.com/netstim/OpenEphysNeuroOmega) plug-in (which requires the NeuroOmega SDK; Windows only) provides an interface to use the NeuroOmega device in real-time. To test the platform, example recordings can be downloaded from [here](https://github.com/netstim/SlicerNetstim/releases/download/SampleData/SampleRecordings.zip), and streamed to OpenEphys via the built-in File Readed plug-in.

## Custom plug-ins installation

The links above describe the different ways to install the plug-ins. Here, only the one via GitHub CLI is described. Install [GitHub CLI](https://cli.github.com/) and run the following commands to install the plug-ins:

#### Windows

```
copy /y "C:\Program Files (x86)\AlphaOmega\Neuro Omega System SDK\CPP_SDK\win64\NeuroOmega_x64.dll" "C:\ProgramData\Open Ephys\shared-api8"
gh release download --clobber --dir "C:\ProgramData\Open Ephys\plugins-api8" --pattern *.dll --repo netstim/OpenEphysNeuroOmega
gh release download --clobber --dir "C:\ProgramData\Open Ephys\configs-api8" --pattern *.xml --repo netstim/OpenEphysNeuroOmega
gh release download --clobber --dir "C:\ProgramData\Open Ephys\plugins-api8" --pattern *.dll --repo netstim/OpenEphysRMS
gh release download --clobber --dir "C:\ProgramData\Open Ephys\shared-api8" --pattern *.dll --repo netstim/OpenEphysIGTLink
gh release download --clobber --dir "C:\ProgramData\Open Ephys\plugins-api8" --pattern *.dll --repo netstim/OpenEphysLeadOR
```

## Building a processing pipeline

OpenEphys has a modular framework to create custom processing pipelines. Here, the default processing pipeline for Lead-OR is described. Although this example is done with example recordings, the File Reader plug-in can be replaced by the OpenEphysNeuroOmega plug-in for a novel real-time scenario.

1. Open OpenEphys GUI
2. Drag-and-drop the following plug-ins in order from the left Processors list to the Signal Chain and follow the instructions:
   1. File Reader
      * Click on *F* to navigate and select the downloaded [example recordings](https://github.com/netstim/SlicerNetstim/releases/download/SampleData/SampleRecordings.zip).
   2. Bandpass Filter
      * Click on *Channels* and select all.&#x20;
      * Default 300 to 6000 bandpass should be ok.
   3. LFP Viewer
   4. Root Mean Square
      * Click on *Channels* and select all.&#x20;
      * Set *window\_ms* to 3000.
   5. Lead-OR
      * Click on *Channels* and select all.&#x20;
      * Check *feature* and set *feature\_name* to RMS
      * See next page for the following instructions.

See following screenshot for reference:

<figure><img src="https://652347722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaEKrtfptpsNlKGfPk7Bs%2Fuploads%2FqWwZn2VHaJeFzW3zL6n1%2FScreenshot%202023-03-20%20at%2014.30.14.png?alt=media&#x26;token=47808850-0cc6-4385-8434-c43adffb4343" alt=""><figcaption><p>OpenEphys signal chain.</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://netstim.gitbook.io/leaddbs/lead-or/electrophysiology-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
