Metadata-Version: 2.4
Name: imro-neuropixels
Version: 0.2.0
Summary: NP1.0 Neuropixels probe configuration and IMRO/Kilosort file generator with GUI
Author-email: Vitaly Lerner <vitaly.lerner@mail.huji.ac.il>
License: MIT
Project-URL: Homepage, https://github.com/vitalylerner/imro-neuropixels
Project-URL: Repository, https://github.com/vitalylerner/imro-neuropixels
Project-URL: Issues, https://github.com/vitalylerner/imro-neuropixels/issues
Keywords: neuropixels,imro,spikeglx,openephys,kilosort,electrophysiology,neuroscience
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyQt5>=5.15.0
Requires-Dist: pyqtgraph>=0.12.0
Requires-Dist: numpy>=1.20.0
Requires-Dist: pandas>=1.3.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=4.0; extra == "dev"
Dynamic: license-file

# IMRO Neuropixels Generator
![Main Window](https://raw.githubusercontent.com/vitalylerner/imro-neuropixels/main/docs/img/mainwindow_mixed.png)

Neuropixels probe channel configuration tool. Create IMRO files for SpikeGLX/OpenEphys and export probe configurations for Kilosort.

**Problem:** The [OpenEphys Neuropixels Plugin](https://open-ephys.github.io/gui-docs/User-Manual/Plugins/Neuropixels-PXI.html) can load [SpikeGLX IMRO](https://billkarsh.github.io/SpikeGLX/help/imroTables/) files but provides no tool to create them.

**Solution:** IMRO Generator lets you configure which electrodes to record from based on depth coverage, then export as IMRO files or [Kilosort probe dictionaries](https://kilosort.readthedocs.io/en/latest/tutorials/make_probe.html).

The GUI lets you:
- Choose one or more recording depth ranges (0–44.16 mm) — several disjoint windows at once ("virtual banks")
- Select assignment mode (Mixed or Striped) for uniform electrode distribution
- Optionally export a partial map (only in-range channels, < 384)
- Configure gains, filters, and reference type
- Save IMRO files for OpenEphys/SpikeGLX
- Save JSON file for kilosort
- Load and modify existing IMRO configurations

## Installation
For an isolated environment, create a separate conda environment, any python>3.8 (for example, 3.11) and name it for example `imro`

```bash
$ conda -n imro python==3.11

$ conda activate imro 
```
Installation using pip
```bash
$ pip install imro-neuropixels
```

Run the gui
```bash
$ imro-gui
```
## Documentation
[Quick Start](QUICKSTART.md)
[Architecture](docs/ARCHITECTURE.md)
[Electrodes-channel assignment algorithm](docs/imro_algorithm.md)
[User Guide](docs/imro_user_guide_A_tutorial.md)

## Future directions

#### Adding more probes. 
Currently works fine with a single [Neropixels1.0-NHP](https://www.neuropixels.org/probe-1-0-nhp-long) probe. The definitions are not hard-coded, but rather are defined in settings files. Need to add more probes to the settings/probes and test with other probes.

#### MRI pictures overlay
Don't have this functionality at the moment, but might be useful in future

## Example use

### Mapping 2cm from the tip up

example file `20mm.imro` in action, as seen in [`OpenEphys Probe Viewer`](https://open-ephys.github.io/gui-docs/User-Manual/Plugins/Probe-Viewer.html), when flashes of light (2Hz) are shown to a fixating subject, while Neuropixels1.0-NHP is inserted in a visual area. 

![20mm](https://raw.githubusercontent.com/vitalylerner/imro-neuropixels/main/docs/img/oephys-probeview.jpg)

### Picking an active region for recording

![IMRO generator main window](https://raw.githubusercontent.com/vitalylerner/imro-neuropixels/main/docs/img/mainwindow_striped.png)

Set boundaries according to what you
Map -> Save as IMRO 
Map -> Save kilosort probe

## Helpful Resources

- **[OpenEphys Neuropixels Plugin](https://open-ephys.github.io/gui-docs/User-Manual/Plugins/Neuropixels-PXI.html)** — GUI for recording with Neuropixels probes, loads IMRO files
- **[SpikeGLX IMRO Format](https://billkarsh.github.io/SpikeGLX/help/imroTables/)** — Complete IMRO specification and format documentation
- **[Kilosort Probe Dictionary](https://kilosort.readthedocs.io/en/latest/tutorials/make_probe.html)** — Format for probe configurations in Kilosort4
- **[Neuropixels Probe 1.0 NHP](https://www.neuropixels.org/probe-1-0-nhp-long)** — Official probe specifications
