# echonet/dynamic architecture

> Architecture diagram of the GitHub repository echonet/dynamic, 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/echonet/dynamic
- Repository: https://github.com/echonet/dynamic

## Overview

EchoNet-Dynamic turns apical-4-chamber echocardiogram videos into left-ventricle segmentations and clip-level ejection-fraction estimates, then combines those outputs for beat-by-beat assessment of cardiac function and cardiomyopathy. The Python CLI exposes the segmentation and video-model workflows; the Echo dataset handles labels, traces, and clip sampling, while shared utilities decode videos and compute metrics. The README also documents DICOM-to-AVI preprocessing. The beat-analysis relationship is documented, but its implementation is not sampled; other unsampled wiring is omitted rather than inferred.

Main entry points: [`echonet/__init__.py`](https://github.com/echonet/dynamic/blob/master/echonet/__init__.py) (Command-line app), [`echonet/datasets/echo.py`](https://github.com/echonet/dynamic/blob/master/echonet/datasets/echo.py) (Echo dataset), [`scripts/beat_by_beat_analysis.R`](https://github.com/echonet/dynamic/blob/master/scripts/beat_by_beat_analysis.R) (Beat assessment), [`echonet/utils/segmentation.py`](https://github.com/echonet/dynamic/blob/master/echonet/utils/segmentation.py) (LV segmentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and configuration"]
  node_cli["Command-line app<br/>[__init__.py]"]
  node_module_entry["Module entry<br/>[__main__.py]"]
  node_settings["Data configuration<br/>[config.py]"]
  node_version["Package version<br/>[__version__.py]"]
end

subgraph group_data["Video data"]
  node_dicom_prep["DICOM preprocessing"]
  node_echo_dataset["Echo dataset<br/>[echo.py]"]
  node_video_io["Video I/O<br/>[__init__.py]"]
end

subgraph group_inference["Model workflows"]
  node_segmentation["LV segmentation<br/>[segmentation.py]"]
  node_ef_prediction["Clip EF prediction<br/>[video.py]"]
end

subgraph group_analysis["Beat analysis"]
  node_beat_analysis["Beat assessment"]
  node_seg_results["Segmentation outputs<br/>[segmentation.py]"]
  node_clip_results["Clip EF outputs<br/>[video.py]"]
end

node_user(("Researcher"))

node_user -->|"runs commands"| node_cli
node_module_entry -->|"calls main"| node_cli
node_cli -->|"registers command"| node_segmentation
node_cli -->|"registers command"| node_ef_prediction
node_echo_dataset -->|"uses default path"| node_settings
node_echo_dataset -->|"loads video"| node_video_io
node_user -->|"converts DICOM"| node_dicom_prep
node_segmentation -->|"writes documented outputs"| node_seg_results
node_ef_prediction -->|"writes documented outputs"| node_clip_results
node_beat_analysis -->|"reads size.csv"| node_seg_results
node_beat_analysis -->|"reads predictions"| node_clip_results

click node_cli "https://github.com/echonet/dynamic/blob/master/echonet/__init__.py"
click node_module_entry "https://github.com/echonet/dynamic/blob/master/echonet/__main__.py"
click node_settings "https://github.com/echonet/dynamic/blob/master/echonet/config.py"
click node_version "https://github.com/echonet/dynamic/blob/master/echonet/__version__.py"
click node_dicom_prep "https://github.com/echonet/dynamic/blob/master/scripts/ConvertDICOMToAVI.ipynb"
click node_echo_dataset "https://github.com/echonet/dynamic/blob/master/echonet/datasets/echo.py"
click node_video_io "https://github.com/echonet/dynamic/blob/master/echonet/utils/__init__.py"
click node_segmentation "https://github.com/echonet/dynamic/blob/master/echonet/utils/segmentation.py"
click node_ef_prediction "https://github.com/echonet/dynamic/blob/master/echonet/utils/video.py"
click node_beat_analysis "https://github.com/echonet/dynamic/blob/master/scripts/beat_by_beat_analysis.R"
click node_seg_results "https://github.com/echonet/dynamic/blob/master/echonet/utils/segmentation.py"
click node_clip_results "https://github.com/echonet/dynamic/blob/master/echonet/utils/video.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_cli,node_module_entry,node_settings,node_version toneBlue
class node_dicom_prep,node_echo_dataset,node_video_io toneAmber
class node_segmentation,node_ef_prediction toneMint
class node_beat_analysis,node_seg_results,node_clip_results toneRose
class node_user toneIndigo
```

## Components

### CLI and configuration

- [Command-line app](https://github.com/echonet/dynamic/blob/master/echonet/__init__.py): `echonet/__init__.py`
- [Module entry](https://github.com/echonet/dynamic/blob/master/echonet/__main__.py): `echonet/__main__.py`
- [Data configuration](https://github.com/echonet/dynamic/blob/master/echonet/config.py): `echonet/config.py`
- [Package version](https://github.com/echonet/dynamic/blob/master/echonet/__version__.py): `echonet/__version__.py`

### Video data

- [DICOM preprocessing](https://github.com/echonet/dynamic/blob/master/scripts/ConvertDICOMToAVI.ipynb): `scripts/ConvertDICOMToAVI.ipynb`
- [Echo dataset](https://github.com/echonet/dynamic/blob/master/echonet/datasets/echo.py): `echonet/datasets/echo.py`
- [Video I/O](https://github.com/echonet/dynamic/blob/master/echonet/utils/__init__.py): `echonet/utils/__init__.py`

### Model workflows

- [LV segmentation](https://github.com/echonet/dynamic/blob/master/echonet/utils/segmentation.py): `echonet/utils/segmentation.py`
- [Clip EF prediction](https://github.com/echonet/dynamic/blob/master/echonet/utils/video.py): `echonet/utils/video.py`

### Beat analysis

- [Beat assessment](https://github.com/echonet/dynamic/blob/master/scripts/beat_by_beat_analysis.R): `scripts/beat_by_beat_analysis.R`
- [Segmentation outputs](https://github.com/echonet/dynamic/blob/master/echonet/utils/segmentation.py): `echonet/utils/segmentation.py`
- [Clip EF outputs](https://github.com/echonet/dynamic/blob/master/echonet/utils/video.py): `echonet/utils/video.py`

### Other components

- **Researcher**

## Connections

- Researcher → Command-line app: runs commands (evidence: `README.md`)
- Module entry → Command-line app: calls main (evidence: `echonet/__main__.py`)
- Command-line app → LV segmentation: registers command (evidence: `echonet/__init__.py`)
- Command-line app → Clip EF prediction: registers command (evidence: `echonet/__init__.py`)
- Echo dataset → Data configuration: uses default path (evidence: `echonet/datasets/echo.py`)
- Echo dataset → Video I/O: loads video (evidence: `echonet/datasets/echo.py`)
- Researcher → DICOM preprocessing: converts DICOM (evidence: `README.md`)
- LV segmentation → Segmentation outputs: writes documented outputs (evidence: `README.md`)
- Clip EF prediction → Clip EF outputs: writes documented outputs (evidence: `README.md`)
- Beat assessment → Segmentation outputs: reads size.csv (evidence: `README.md`)
- Beat assessment → Clip EF outputs: reads predictions (evidence: `README.md`)
