# ashna111/multimodal-image-fusion-to-detect-brain-tumors architecture

> Architecture diagram of the GitHub repository ashna111/multimodal-image-fusion-to-detect-brain-tumors, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors
- Repository: https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors

## Overview

This Flask application guides a user through CT/MRI upload, landmark-based MRI registration, multimodal fusion, and watershed-style segmentation. The main processing stages are implemented in app.py; the browser coordinate helper is separate. README also describes notebook workflows, but the sampled source does not establish their runtime connections. The graph focuses on the GUI path; omitted source excerpts limit evidence for some route and output relationships.

Main entry points: [`app.py`](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py) (Flask routes), [`static/js/coord.js`](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/static/js/coord.js) (Landmark selection), [`static`](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/tree/master/static) (Registered MRI output), [`templates/form.html`](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/templates/form.html) (Upload form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_flask["Flask routes<br/>[app.py]"]
  node_upload["Image upload<br/>[app.py]"]
  node_form["Upload form<br/>[form.html]"]
  node_result_views["Result views"]
end

subgraph group_registration["Image registration"]
  node_coordinate["Landmark selection<br/>[coord.js]"]
  node_registration_view["Registration view<br/>[registration.html]"]
  node_register["Landmark registration<br/>[app.py]"]
  node_registered["Registered MRI output"]
end

subgraph group_fusion["Image fusion"]
  node_fusion_route["Fusion route<br/>[app.py]"]
  node_wavelet["Wavelet decomposition<br/>[app.py]"]
  node_vgg["VGG19 fusion<br/>[app.py]"]
  node_fused["Fused image output"]
end

subgraph group_segmentation["Image segmentation"]
  node_watershed["Watershed segmentation<br/>[app.py]"]
  node_segmented["Segmented image output"]
end

node_user(("Clinician or user"))

node_user -->|"uses GUI"| node_flask
node_flask -->|"renders"| node_form
node_flask -->|"routes upload"| node_upload
node_user -->|"selects landmarks"| node_coordinate
node_coordinate -->|"posts coordinates"| node_register
node_register -->|"renders"| node_registration_view
node_register -->|"writes registered MRI"| node_registered
node_flask -->|"routes fusion"| node_fusion_route
node_fusion_route -->|"reads registered MRI"| node_registered
node_fusion_route -->|"decomposes images"| node_wavelet
node_fusion_route -->|"invokes fusion"| node_vgg
node_fusion_route -->|"writes fused image"| node_fused
node_flask -->|"routes segmentation"| node_watershed
node_watershed -->|"reads fused image"| node_fused
node_watershed -.->|"writes segmentation"| node_segmented
node_flask -.->|"renders results"| node_result_views

click node_flask "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py"
click node_upload "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py"
click node_form "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/templates/form.html"
click node_coordinate "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/static/js/coord.js"
click node_registration_view "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/templates/registration.html"
click node_register "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py"
click node_registered "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/tree/master/static"
click node_fusion_route "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py"
click node_wavelet "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py"
click node_vgg "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py"
click node_fused "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/tree/master/static"
click node_watershed "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py"
click node_segmented "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/tree/master/static"
click node_result_views "https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/tree/master/templates"

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_flask,node_upload,node_form,node_result_views,node_user toneBlue
class node_coordinate,node_registration_view,node_register,node_registered toneAmber
class node_fusion_route,node_wavelet,node_vgg,node_fused toneMint
class node_watershed,node_segmented toneRose
```

## Components

### Web interface

- [Flask routes](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py): `app.py`
- [Image upload](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py): `app.py`
- [Upload form](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/templates/form.html): `templates/form.html`
- [Result views](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/tree/master/templates): `templates`

### Image registration

- [Landmark selection](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/static/js/coord.js): `static/js/coord.js`
- [Registration view](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/templates/registration.html): `templates/registration.html`
- [Landmark registration](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py): `app.py`
- [Registered MRI output](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/tree/master/static): `static`

### Image fusion

- [Fusion route](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py): `app.py`
- [Wavelet decomposition](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py): `app.py`
- [VGG19 fusion](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py): `app.py`
- [Fused image output](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/tree/master/static): `static`

### Image segmentation

- [Watershed segmentation](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/blob/master/app.py): `app.py`
- [Segmented image output](https://github.com/ashna111/multimodal-image-fusion-to-detect-brain-tumors/tree/master/static): `static`

### Other components

- **Clinician or user**

## Connections

- Clinician or user → Flask routes: uses GUI (evidence: `README.md`)
- Flask routes → Upload form: renders (evidence: `app.py`)
- Flask routes → Image upload: routes upload (evidence: `app.py`)
- Clinician or user → Landmark selection: selects landmarks (evidence: `static/js/coord.js`)
- Landmark selection → Landmark registration: posts coordinates (evidence: `static/js/coord.js`)
- Landmark registration → Registration view: renders (evidence: `app.py`)
- Landmark registration → Registered MRI output: writes registered MRI (evidence: `README.md`)
- Flask routes → Fusion route: routes fusion (evidence: `app.py`)
- Fusion route → Registered MRI output: reads registered MRI (evidence: `app.py`)
- Fusion route → Wavelet decomposition: decomposes images (evidence: `app.py`)
- Fusion route → VGG19 fusion: invokes fusion (evidence: `app.py`)
- Fusion route → Fused image output: writes fused image (evidence: `app.py`)
- Flask routes → Watershed segmentation: routes segmentation (evidence: `app.py`)
- Watershed segmentation → Fused image output: reads fused image (evidence: `app.py`)
- Watershed segmentation → Segmented image output: writes segmentation
- Flask routes → Result views: renders results
