Metadata-Version: 2.4
Name: oecon
Version: 0.2.1
Summary: Python tools to convert and preprocess OpenEphys data to the DAQ-HDF5 (dh5) format
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: dh5io>=0.4.1
Requires-Dist: open-ephys-python-tools
Requires-Dist: scipy>=1.15.2
Requires-Dist: numpy>2.0
Requires-Dist: vstim>=0.1.0
Requires-Dist: psutil>=7.2.2
Requires-Dist: pydantic>=2.0
Requires-Dist: pyside6>=6.7
Requires-Dist: tqdm>=4.67.3
Requires-Dist: comtypes>=1.4.0; sys_platform == "win32"
Dynamic: license-file

# oecon — Open Ephys Converter

Converts [Open Ephys GUI](https://open-ephys.github.io/gui-docs/index.html) recordings into
[DAQ-HDF5](https://github.com/cog-neurophys-lab/DAQ-HDF5) (DH5) format.

Conversion steps: LFP decimation, MUA/ESA envelope, TTL events, VStim network events, trial map, raw data copy.

## Installation

Requires [uv](https://docs.astral.sh/uv/getting-started/installation/).

```bash
uv tool install oecon
```
or for the latest development version:

```bash
uv tool install git+https://github.com/brain-bremen/oecon.git
```

### Update

```bash
uv tool upgrade oecon
```

## GUI

```bash
oecon-gui       # converter
oecon-inspect   # session browser
```

Configs save session paths, output folder, and all step parameters — enough to reproduce a run.

## CLI

```bash
oecon <session_path> [<session_path> ...]
oecon <session_path> --config config.json --output-folder /out
oecon <session_path> --inspect
```

## Library

```python
from oecon import convert_open_ephys_session
convert_open_ephys_session("/path/to/session")
```

## Default CONT block ranges

| Range       | Purpose |
|---|---|
|    1 – 2000 | Raw neural/analog data |
| 2001 – 3600 | LFP |
| 3601 – 4000 | Downsampled analog |
| 4001 – 5600 | MUA/ESA |
| 6001 – 7600 | High-pass filtered raw (reserved) |

Sorted spikes: SPIKE 1–1000.
