# anwar-said/neurograph architecture

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

- Interactive diagram: https://gitdiagram.com/anwar-said/neurograph
- Repository: https://github.com/anwar-said/neurograph

## Overview

NeuroGraph is a neuroimaging graph-benchmark package with static and dynamic datasets, fMRI preprocessing tools, and GNN benchmark training. The principal workflow loads a benchmark graph dataset, splits it into train/validation/test sets, trains a GNN, and evaluates it. The README also documents preprocessing as a separate capability. Source excerpts show the static dataset and training links and the dynamic model implementation; the dynamic runner loads serialized data directly. Preprocessing internals and several documented dataset variants are only partially sampled, so their connections are limited to documented or directly visible relationships.

Main entry points: [`NeuroGraph/preprocess.py`](https://github.com/anwar-said/neurograph/blob/main/NeuroGraph/preprocess.py) (fMRI preparation), [`main.py`](https://github.com/anwar-said/neurograph/blob/main/main.py) (Static training), [`Dynamic/main-dynamic.py`](https://github.com/anwar-said/neurograph/blob/main/Dynamic/main-dynamic.py) (Dynamic training), [`NeuroGraph/datasets.py`](https://github.com/anwar-said/neurograph/blob/main/NeuroGraph/datasets.py) (Static datasets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Datasets"]
  node_static_data[("Static datasets<br/>[datasets.py]")]
  node_dynamic_data[("Dynamic datasets<br/>[datasets.py]")]
end

subgraph group_prep["fMRI preprocessing"]
  node_preprocess["fMRI preparation<br/>[preprocess.py]"]
  node_neuro_utils["Connectome utilities<br/>[utils.py]"]
end

subgraph group_static["Static benchmarks"]
  node_static_runner["Static training<br/>[main.py]"]
  node_static_model["Residual GNN<br/>[utils.py]"]
end

subgraph group_dynamic["Dynamic benchmarks"]
  node_dynamic_runner["Dynamic training<br/>[main-dynamic.py]"]
  node_dynamic_model["Temporal GNN<br/>[dynamicGnn.py]"]
end

node_researcher(("Researcher"))
node_hcp[("HCP neuroimaging data")]

node_hcp -.->|"provides scans"| node_preprocess
node_researcher -.->|"prepares fMRI"| node_preprocess
node_researcher -->|"runs benchmark"| node_static_runner
node_static_runner -->|"loads dataset"| node_static_data
node_static_runner -->|"constructs model"| node_static_model
node_researcher -.->|"runs training"| node_dynamic_runner
node_dynamic_runner -->|"constructs model"| node_dynamic_model
node_preprocess -.->|"prepares signals"| node_neuro_utils
node_preprocess -.->|"creates graph data"| node_static_data

click node_preprocess "https://github.com/anwar-said/neurograph/blob/main/NeuroGraph/preprocess.py"
click node_neuro_utils "https://github.com/anwar-said/neurograph/blob/main/NeuroGraph/utils.py"
click node_static_data "https://github.com/anwar-said/neurograph/blob/main/NeuroGraph/datasets.py"
click node_dynamic_data "https://github.com/anwar-said/neurograph/blob/main/NeuroGraph/datasets.py"
click node_static_runner "https://github.com/anwar-said/neurograph/blob/main/main.py"
click node_static_model "https://github.com/anwar-said/neurograph/blob/main/utils.py"
click node_dynamic_runner "https://github.com/anwar-said/neurograph/blob/main/Dynamic/main-dynamic.py"
click node_dynamic_model "https://github.com/anwar-said/neurograph/blob/main/Dynamic/dynamicGnn.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_static_data,node_dynamic_data toneBlue
class node_preprocess,node_neuro_utils,node_hcp toneAmber
class node_static_runner,node_static_model toneMint
class node_dynamic_runner,node_dynamic_model toneRose
class node_researcher toneIndigo
```

## Components

### Datasets

- [Static datasets](https://github.com/anwar-said/neurograph/blob/main/NeuroGraph/datasets.py): `NeuroGraph/datasets.py`
- [Dynamic datasets](https://github.com/anwar-said/neurograph/blob/main/NeuroGraph/datasets.py): `NeuroGraph/datasets.py`

### fMRI preprocessing

- [fMRI preparation](https://github.com/anwar-said/neurograph/blob/main/NeuroGraph/preprocess.py): `NeuroGraph/preprocess.py`
- [Connectome utilities](https://github.com/anwar-said/neurograph/blob/main/NeuroGraph/utils.py): `NeuroGraph/utils.py`

### Static benchmarks

- [Static training](https://github.com/anwar-said/neurograph/blob/main/main.py): `main.py`
- [Residual GNN](https://github.com/anwar-said/neurograph/blob/main/utils.py): `utils.py`

### Dynamic benchmarks

- [Dynamic training](https://github.com/anwar-said/neurograph/blob/main/Dynamic/main-dynamic.py): `Dynamic/main-dynamic.py`
- [Temporal GNN](https://github.com/anwar-said/neurograph/blob/main/Dynamic/dynamicGnn.py): `Dynamic/dynamicGnn.py`

### Other components

- **Researcher**
- **HCP neuroimaging data**

## Connections

- HCP neuroimaging data → fMRI preparation: provides scans
- Researcher → fMRI preparation: prepares fMRI (evidence: `README.md`)
- Researcher → Static training: runs benchmark (evidence: `README.md`)
- Static training → Static datasets: loads dataset (evidence: `main.py`)
- Static training → Residual GNN: constructs model (evidence: `main.py`)
- Researcher → Dynamic training: runs training
- Dynamic training → Temporal GNN: constructs model (evidence: `Dynamic/main-dynamic.py`)
- fMRI preparation → Connectome utilities: prepares signals
- fMRI preparation → Static datasets: creates graph data
