# halimmwn/medicaldiagnostichub architecture

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

- Interactive diagram: https://gitdiagram.com/halimmwn/medicaldiagnostichub
- Repository: https://github.com/halimmwn/medicaldiagnostichub

## Overview

Medical Diagnostic Hub is a Flask-based clinical decision-support web app. A user selects an analysis mode and submits an image, ECG signal, live camera capture, or DICOM file; the backend dispatches to a modality-specific detector and returns predictions and visualizations for the web UI. README documents batch DICOM/PACS, live skin camera, and modality capabilities; source excerpts confirm the Flask dispatch and detector behavior, but frontend and template excerpts are partial, so uncertain UI wiring is omitted.

Main entry points: [`app.py`](https://github.com/halimmwn/medicaldiagnostichub/blob/main/app.py) (Flask application), [`static/script.js`](https://github.com/halimmwn/medicaldiagnostichub/blob/main/static/script.js) (UI and camera), [`utils/orthanc_client.py`](https://github.com/halimmwn/medicaldiagnostichub/blob/main/utils/orthanc_client.py) (DICOM client), [`templates/index.html`](https://github.com/halimmwn/medicaldiagnostichub/blob/main/templates/index.html) (Web interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_browser["Web interface<br/>[index.html]"]
  node_client["UI and camera<br/>[script.js]"]
end

subgraph group_backend["Analysis backend"]
  node_flask["Flask application<br/>[app.py]"]
end

subgraph group_clinical["Clinical analysis"]
  node_bone["Bone analysis<br/>[bone_detection.py]"]
  node_brain["Brain analysis<br/>[brain_detection.py]"]
  node_skin["Skin analysis<br/>[skin_detection.py]"]
  node_ecg["ECG analysis<br/>[ecg_detection.py]"]
  node_gradcam["Heatmap generation<br/>[gradcam.py]"]
end

subgraph group_pacs["DICOM integration"]
  node_orthanc_client["DICOM client<br/>[orthanc_client.py]"]
  node_orthanc[("Orthanc PACS")]
end

node_clinician(("Medical user"))

node_clinician -->|"uses"| node_browser
node_browser -->|"loads UI"| node_client
node_client -->|"submits analyses"| node_flask
node_flask -->|"returns results"| node_client
node_flask -->|"dispatches bone"| node_bone
node_flask -->|"dispatches brain"| node_brain
node_flask -->|"dispatches skin"| node_skin
node_flask -->|"dispatches ECG"| node_ecg
node_bone -->|"generates heatmap"| node_gradcam
node_skin -->|"generates heatmap"| node_gradcam
node_flask -->|"uploads DICOM"| node_orthanc_client
node_orthanc_client -->|"uploads and reads"| node_orthanc
node_orthanc_client -->|"returns preview"| node_flask
node_client -->|"shows results"| node_clinician

click node_browser "https://github.com/halimmwn/medicaldiagnostichub/blob/main/templates/index.html"
click node_client "https://github.com/halimmwn/medicaldiagnostichub/blob/main/static/script.js"
click node_flask "https://github.com/halimmwn/medicaldiagnostichub/blob/main/app.py"
click node_bone "https://github.com/halimmwn/medicaldiagnostichub/blob/main/modules/bone_detection.py"
click node_brain "https://github.com/halimmwn/medicaldiagnostichub/blob/main/modules/brain_detection.py"
click node_skin "https://github.com/halimmwn/medicaldiagnostichub/blob/main/modules/skin_detection.py"
click node_ecg "https://github.com/halimmwn/medicaldiagnostichub/blob/main/modules/ecg_detection.py"
click node_gradcam "https://github.com/halimmwn/medicaldiagnostichub/blob/main/utils/gradcam.py"
click node_orthanc_client "https://github.com/halimmwn/medicaldiagnostichub/blob/main/utils/orthanc_client.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_browser,node_client,node_clinician toneBlue
class node_flask toneAmber
class node_bone,node_brain,node_skin,node_ecg,node_gradcam toneMint
class node_orthanc_client,node_orthanc toneRose
```

## Components

### Web experience

- [Web interface](https://github.com/halimmwn/medicaldiagnostichub/blob/main/templates/index.html): `templates/index.html`
- [UI and camera](https://github.com/halimmwn/medicaldiagnostichub/blob/main/static/script.js): `static/script.js`

### Analysis backend

- [Flask application](https://github.com/halimmwn/medicaldiagnostichub/blob/main/app.py): `app.py`

### Clinical analysis

- [Bone analysis](https://github.com/halimmwn/medicaldiagnostichub/blob/main/modules/bone_detection.py): `modules/bone_detection.py`
- [Brain analysis](https://github.com/halimmwn/medicaldiagnostichub/blob/main/modules/brain_detection.py): `modules/brain_detection.py`
- [Skin analysis](https://github.com/halimmwn/medicaldiagnostichub/blob/main/modules/skin_detection.py): `modules/skin_detection.py`
- [ECG analysis](https://github.com/halimmwn/medicaldiagnostichub/blob/main/modules/ecg_detection.py): `modules/ecg_detection.py`
- [Heatmap generation](https://github.com/halimmwn/medicaldiagnostichub/blob/main/utils/gradcam.py): `utils/gradcam.py`

### DICOM integration

- [DICOM client](https://github.com/halimmwn/medicaldiagnostichub/blob/main/utils/orthanc_client.py): `utils/orthanc_client.py`
- **Orthanc PACS**

### Other components

- **Medical user**

## Connections

- Medical user → Web interface: uses
- Web interface → UI and camera: loads UI
- UI and camera → Flask application: submits analyses
- Flask application → UI and camera: returns results
- Flask application → Bone analysis: dispatches bone
- Flask application → Brain analysis: dispatches brain
- Flask application → Skin analysis: dispatches skin
- Flask application → ECG analysis: dispatches ECG
- Bone analysis → Heatmap generation: generates heatmap
- Skin analysis → Heatmap generation: generates heatmap
- Flask application → DICOM client: uploads DICOM
- DICOM client → Orthanc PACS: uploads and reads
- DICOM client → Flask application: returns preview
- UI and camera → Medical user: shows results
