# brainstorm-tools/brainstorm3 architecture

> Architecture diagram of the GitHub repository brainstorm-tools/brainstorm3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/brainstorm-tools/brainstorm3
- Repository: https://github.com/brainstorm-tools/brainstorm3

## Overview

Brainstorm is a GUI-driven neurophysiology analysis application for MEG, EEG, fNIRS, ECoG, depth electrodes, and animal recordings. A researcher imports recordings and sensor metadata, stores them in the Brainstorm database, then dispatches preprocessing and analysis processes. Anatomical MRI operations support coordinate alignment and modeling; forward/inverse tools estimate sources, while time-frequency and connectivity tools produce derived results. The graph reflects the repository tree and README capabilities; sampled source does not include the central GUI orchestration, so those subsystem links are shown conservatively.

Main entry points: [`toolbox/gui`](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/gui) (Brainstorm GUI), [`toolbox/io`](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/io) (Format Import), [`toolbox/process`](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/process) (Process Pipeline), [`toolbox/timefreq`](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/timefreq) (Time-Frequency)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User Interaction"]
  node_gui["Brainstorm GUI"]
end

subgraph group_data["Data Management"]
  node_io["Format Import"]
  node_database[("Analysis Database")]
  node_realtime["Realtime Acquisition"]
end

subgraph group_analysis["Signal Analysis"]
  node_sensors["Sensor Layouts"]
  node_process["Process Pipeline"]
  node_timefreq["Time-Frequency"]
  node_connectivity["Connectivity Analysis"]
end

subgraph group_modeling["Anatomy Modeling"]
  node_anatomy["MRI Anatomy"]
  node_forward["Forward Modeling"]
  node_inverse["Inverse Modeling"]
end

subgraph group_integration["External Integration"]
  node_python["Python Examples"]
end

node_researcher(("Researcher"))
node_recordings["Neuro Recordings"]
node_external_readers["Format Readers"]
node_mne["MNE Python"]
node_results["Analysis Results"]

node_researcher -->|"uses"| node_gui
node_recordings -->|"reads"| node_io
node_io -->|"writes"| node_database
node_gui -->|"dispatches"| node_process
node_gui -->|"dispatches"| node_anatomy
node_gui -->|"dispatches"| node_forward
node_gui -->|"dispatches"| node_inverse
node_gui -->|"dispatches"| node_timefreq
node_gui -->|"dispatches"| node_connectivity
node_io -->|"loads"| node_sensors
node_process -->|"saves"| node_database
node_timefreq -->|"produces"| node_results
node_connectivity -->|"produces"| node_results
node_inverse -->|"produces"| node_results
node_external_readers -.->|"supports"| node_io
node_researcher -.->|"runs"| node_python
node_python -.->|"uses"| node_mne

click node_gui "https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/gui"
click node_io "https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/io"
click node_database "https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/db"
click node_realtime "https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/realtime"
click node_sensors "https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/sensors"
click node_process "https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/process"
click node_timefreq "https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/timefreq"
click node_connectivity "https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/connectivity"
click node_anatomy "https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/anatomy"
click node_forward "https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/forward"
click node_inverse "https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/inverse"
click node_python "https://github.com/brainstorm-tools/brainstorm3/tree/master/python"

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_gui toneBlue
class node_io,node_database,node_realtime toneAmber
class node_sensors,node_process,node_timefreq,node_connectivity toneMint
class node_anatomy,node_forward,node_inverse toneRose
class node_python,node_researcher,node_recordings,node_external_readers,node_mne,node_results toneIndigo
```

## Components

### User Interaction

- [Brainstorm GUI](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/gui): `toolbox/gui`

### Data Management

- [Format Import](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/io): `toolbox/io`
- [Analysis Database](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/db): `toolbox/db`
- [Realtime Acquisition](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/realtime): `toolbox/realtime`

### Signal Analysis

- [Sensor Layouts](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/sensors): `toolbox/sensors`
- [Process Pipeline](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/process): `toolbox/process`
- [Time-Frequency](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/timefreq): `toolbox/timefreq`
- [Connectivity Analysis](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/connectivity): `toolbox/connectivity`

### Anatomy Modeling

- [MRI Anatomy](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/anatomy): `toolbox/anatomy`
- [Forward Modeling](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/forward): `toolbox/forward`
- [Inverse Modeling](https://github.com/brainstorm-tools/brainstorm3/tree/master/toolbox/inverse): `toolbox/inverse`

### External Integration

- [Python Examples](https://github.com/brainstorm-tools/brainstorm3/tree/master/python): `python`

### Other components

- **Researcher**
- **Neuro Recordings**
- **Format Readers**
- **MNE Python**
- **Analysis Results**

## Connections

- Researcher → Brainstorm GUI: uses
- Neuro Recordings → Format Import: reads
- Format Import → Analysis Database: writes
- Brainstorm GUI → Process Pipeline: dispatches
- Brainstorm GUI → MRI Anatomy: dispatches
- Brainstorm GUI → Forward Modeling: dispatches
- Brainstorm GUI → Inverse Modeling: dispatches
- Brainstorm GUI → Time-Frequency: dispatches
- Brainstorm GUI → Connectivity Analysis: dispatches
- Format Import → Sensor Layouts: loads
- Process Pipeline → Analysis Database: saves
- Time-Frequency → Analysis Results: produces
- Connectivity Analysis → Analysis Results: produces
- Inverse Modeling → Analysis Results: produces
- Format Readers → Format Import: supports
- Researcher → Python Examples: runs
- Python Examples → MNE Python: uses
