# kolascoco/eeg-tfr-volume architecture

> Architecture diagram of the GitHub repository kolascoco/eeg-tfr-volume, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kolascoco/eeg-tfr-volume
- Repository: https://github.com/kolascoco/eeg-tfr-volume

## Overview

EEG TFR Volume turns an annotated FIF recording into a self-contained interactive channel × time × frequency power viewer. The principal workflow is to upload/select a recording, choose an event and preprocessing settings, compute an event-locked time-frequency volume, then encode it into HTML for exploration. The CLI also inventories recordings and can build viewers directly. The graph separates the local request workflow, signal processing, and viewer output. Some server-to-processing wiring is in omitted source, so those links are marked unverified rather than asserted.

Main entry points: [`src/eeg_tfr_volume.py`](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py) (Build request), [`src/viewer_template.html`](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/viewer_template.html) (Viewer template), [`docs/index.html`](https://github.com/kolascoco/eeg-tfr-volume/blob/main/docs/index.html) (Interactive HTML)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Local Interaction"]
  node_server["Local server<br/>[eeg_tfr_volume.py]"]
  node_upload["FIF upload<br/>[eeg_tfr_volume.py]"]
  node_build_request["Build request<br/>[eeg_tfr_volume.py]"]
  node_inspect_cli["Recording inventory<br/>[eeg_tfr_volume.py]"]
  node_inspect_report["Inventory report<br/>[eeg_tfr_volume.py]"]
end

subgraph group_processing["EEG Processing"]
  node_fif[("FIF recording")]
  node_event_epochs["Event epochs<br/>[eeg_tfr_volume.py]"]
  node_tfr["TFR volume<br/>[eeg_tfr_volume.py]"]
  node_baseline["Baseline normalization<br/>[eeg_tfr_volume.py]"]
end

subgraph group_viewer["Viewer Output"]
  node_encoding["Volume encoding<br/>[eeg_tfr_volume.py]"]
  node_writer["HTML writer<br/>[eeg_tfr_volume.py]"]
  node_template["Viewer template"]
  node_html["Interactive HTML<br/>[index.html]"]
end

node_user(("EEG user"))

node_user -->|"starts server"| node_server
node_user -->|"selects FIF"| node_upload
node_upload -.->|"provides recording"| node_build_request
node_user -->|"chooses event"| node_build_request
node_server -->|"handles upload"| node_upload
node_server -->|"handles build"| node_build_request
node_build_request -.->|"configures processing"| node_event_epochs
node_fif -.->|"supplies recording"| node_event_epochs
node_event_epochs -->|"transforms epochs"| node_tfr
node_tfr -.->|"normalizes power"| node_baseline
node_baseline -.->|"provides volume"| node_encoding
node_writer -->|"encodes volume"| node_encoding
node_writer -->|"loads template"| node_template
node_writer -.->|"writes viewer"| node_html
node_user -->|"runs inventory"| node_inspect_cli
node_inspect_cli -->|"inspects recording"| node_fif
node_inspect_cli -->|"produces report"| node_inspect_report

click node_server "https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py"
click node_upload "https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py"
click node_build_request "https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py"
click node_inspect_cli "https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py"
click node_event_epochs "https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py"
click node_tfr "https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py"
click node_baseline "https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py"
click node_encoding "https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py"
click node_writer "https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py"
click node_template "https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/viewer_template.html"
click node_html "https://github.com/kolascoco/eeg-tfr-volume/blob/main/docs/index.html"
click node_inspect_report "https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_upload,node_build_request,node_inspect_cli,node_inspect_report,node_user toneBlue
class node_fif,node_event_epochs,node_tfr,node_baseline toneAmber
class node_encoding,node_writer,node_template,node_html toneMint
```

## Components

### Local Interaction

- [Local server](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py): `src/eeg_tfr_volume.py`
- [FIF upload](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py): `src/eeg_tfr_volume.py`
- [Build request](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py): `src/eeg_tfr_volume.py`
- [Recording inventory](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py): `src/eeg_tfr_volume.py`
- [Inventory report](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py): `src/eeg_tfr_volume.py`

### EEG Processing

- **FIF recording**
- [Event epochs](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py): `src/eeg_tfr_volume.py`
- [TFR volume](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py): `src/eeg_tfr_volume.py`
- [Baseline normalization](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py): `src/eeg_tfr_volume.py`

### Viewer Output

- [Volume encoding](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py): `src/eeg_tfr_volume.py`
- [HTML writer](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/eeg_tfr_volume.py): `src/eeg_tfr_volume.py`
- [Viewer template](https://github.com/kolascoco/eeg-tfr-volume/blob/main/src/viewer_template.html): `src/viewer_template.html`
- [Interactive HTML](https://github.com/kolascoco/eeg-tfr-volume/blob/main/docs/index.html): `docs/index.html`

### Other components

- **EEG user**

## Connections

- EEG user → Local server: starts server (evidence: `README.md`)
- EEG user → FIF upload: selects FIF (evidence: `README.md`)
- FIF upload → Build request: provides recording (evidence: `src/eeg_tfr_volume.py`)
- EEG user → Build request: chooses event (evidence: `README.md`)
- Local server → FIF upload: handles upload (evidence: `src/eeg_tfr_volume.py`)
- Local server → Build request: handles build (evidence: `src/eeg_tfr_volume.py`)
- Build request → Event epochs: configures processing (evidence: `src/eeg_tfr_volume.py`)
- FIF recording → Event epochs: supplies recording
- Event epochs → TFR volume: transforms epochs (evidence: `src/eeg_tfr_volume.py`)
- TFR volume → Baseline normalization: normalizes power (evidence: `src/eeg_tfr_volume.py`)
- Baseline normalization → Volume encoding: provides volume (evidence: `src/eeg_tfr_volume.py`)
- HTML writer → Volume encoding: encodes volume (evidence: `src/eeg_tfr_volume.py`)
- HTML writer → Viewer template: loads template (evidence: `src/eeg_tfr_volume.py`)
- HTML writer → Interactive HTML: writes viewer
- EEG user → Recording inventory: runs inventory (evidence: `src/eeg_tfr_volume.py`)
- Recording inventory → FIF recording: inspects recording (evidence: `src/eeg_tfr_volume.py`)
- Recording inventory → Inventory report: produces report (evidence: `src/eeg_tfr_volume.py`)
