# jitheswar/sih26038 architecture

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

- Interactive diagram: https://gitdiagram.com/jitheswar/sih26038
- Repository: https://github.com/jitheswar/sih26038

## Overview

This is a MATLAB diabetic-retinopathy screening product: a fundus image is assessed for quality, graded, checked against lesion and explanation evidence, then assigned a screening disposition. The README also documents a single-case demonstration app and a separate district-capacity simulation. Relationships below follow those documented capabilities; source excerpts were unavailable, so internal call wiring beyond the documented workflow is not asserted.

Main entry points: [`src/+app/runScreeningCase.m`](https://github.com/jitheswar/sih26038/blob/master/src/%2Bapp/runScreeningCase.m) (Case runner), [`src/+grade/decisionPolicy.m`](https://github.com/jitheswar/sih26038/blob/master/src/%2Bgrade/decisionPolicy.m) (Screening policy), [`src/+grade/infer.m`](https://github.com/jitheswar/sih26038/blob/master/src/%2Bgrade/infer.m) (Calibrated grading), [`src/+explain/buildLesionEvidence.m`](https://github.com/jitheswar/sih26038/blob/master/src/%2Bexplain/buildLesionEvidence.m) (Lesion evidence)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_screening["Screening workflow"]
  node_case_runner["Case runner<br/>[runScreeningCase.m]"]
  node_preprocess["Image preprocessing<br/>[preprocess.m]"]
  node_quality["Image quality<br/>[assess.m]"]
  node_grade["Calibrated grading<br/>[infer.m]"]
  node_temperature["Probability calibration<br/>[applyTemperature.m]"]
  node_decision["Screening policy<br/>[decisionPolicy.m]"]
end

subgraph group_evidence["Evidence channels"]
  node_gradcam["Grad-CAM evidence<br/>[gradcam.m]"]
  node_lesion_seg["Learned lesion channel<br/>[segmentLesions.m]"]
  node_lesion_detect["Classical lesion channel<br/>[detect.m]"]
  node_lesion_evidence["Lesion evidence"]
  node_spatial_check["Spatial agreement<br/>[spatialAgreement.m]"]
end

subgraph group_interfaces["Product interfaces"]
  node_app_ui["Screening app<br/>[ScreeningApp.m]"]
end

subgraph group_capacity["Capacity simulation"]
  node_capacity_runner["Simulation runner"]
  node_district_model["District capacity model<br/>[district_model.slx]"]
  node_district_config["District configuration"]
end

node_clinician(("Screening user"))
node_fundus["Fundus photo"]

node_clinician -->|"uses"| node_app_ui
node_fundus -->|"provides image"| node_app_ui
node_app_ui -->|"demonstrates case"| node_case_runner
node_case_runner -->|"processes image"| node_preprocess
node_case_runner -->|"assesses quality"| node_quality
node_case_runner -->|"predicts grade"| node_grade
node_grade -->|"calibrates probabilities"| node_temperature
node_case_runner -->|"generates explanation"| node_gradcam
node_case_runner -->|"segments lesions"| node_lesion_seg
node_case_runner -->|"detects candidates"| node_lesion_detect
node_case_runner -->|"builds evidence"| node_lesion_evidence
node_case_runner -->|"checks agreement"| node_spatial_check
node_case_runner -->|"selects disposition"| node_decision
node_grade -->|"supplies grade"| node_decision
node_quality -->|"supplies quality"| node_decision
node_lesion_evidence -->|"supplies evidence"| node_decision
node_gradcam -->|"supplies heatmap"| node_spatial_check
node_lesion_evidence -->|"supplies locations"| node_spatial_check
node_capacity_runner -->|"runs simulation"| node_district_model
node_district_config -->|"configures run"| node_capacity_runner

click node_app_ui "https://github.com/jitheswar/sih26038/blob/master/app/ScreeningApp.m"
click node_case_runner "https://github.com/jitheswar/sih26038/blob/master/src/%2Bapp/runScreeningCase.m"
click node_preprocess "https://github.com/jitheswar/sih26038/blob/master/src/%2Bcommon/preprocess.m"
click node_quality "https://github.com/jitheswar/sih26038/blob/master/src/%2Bquality/assess.m"
click node_grade "https://github.com/jitheswar/sih26038/blob/master/src/%2Bgrade/infer.m"
click node_temperature "https://github.com/jitheswar/sih26038/blob/master/src/%2Bgrade/applyTemperature.m"
click node_gradcam "https://github.com/jitheswar/sih26038/blob/master/src/%2Bexplain/gradcam.m"
click node_lesion_seg "https://github.com/jitheswar/sih26038/blob/master/src/%2Bsegment/segmentLesions.m"
click node_lesion_detect "https://github.com/jitheswar/sih26038/blob/master/src/%2Bsegment/detect.m"
click node_lesion_evidence "https://github.com/jitheswar/sih26038/blob/master/src/%2Bexplain/buildLesionEvidence.m"
click node_spatial_check "https://github.com/jitheswar/sih26038/blob/master/src/%2Bgrade/spatialAgreement.m"
click node_decision "https://github.com/jitheswar/sih26038/blob/master/src/%2Bgrade/decisionPolicy.m"
click node_capacity_runner "https://github.com/jitheswar/sih26038/blob/master/simulink/runDistrictSimulation.m"
click node_district_model "https://github.com/jitheswar/sih26038/blob/master/simulink/district_model.slx"
click node_district_config "https://github.com/jitheswar/sih26038/blob/master/simulink/district_config.json"

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_case_runner,node_preprocess,node_quality,node_grade,node_temperature,node_decision,node_clinician toneBlue
class node_gradcam,node_lesion_seg,node_lesion_detect,node_lesion_evidence,node_spatial_check toneAmber
class node_app_ui toneMint
class node_capacity_runner,node_district_model,node_district_config toneRose
class node_fundus toneIndigo
```

## Components

### Screening workflow

- [Case runner](https://github.com/jitheswar/sih26038/blob/master/src/%2Bapp/runScreeningCase.m): `src/+app/runScreeningCase.m`
- [Image preprocessing](https://github.com/jitheswar/sih26038/blob/master/src/%2Bcommon/preprocess.m): `src/+common/preprocess.m`
- [Image quality](https://github.com/jitheswar/sih26038/blob/master/src/%2Bquality/assess.m): `src/+quality/assess.m`
- [Calibrated grading](https://github.com/jitheswar/sih26038/blob/master/src/%2Bgrade/infer.m): `src/+grade/infer.m`
- [Probability calibration](https://github.com/jitheswar/sih26038/blob/master/src/%2Bgrade/applyTemperature.m): `src/+grade/applyTemperature.m`
- [Screening policy](https://github.com/jitheswar/sih26038/blob/master/src/%2Bgrade/decisionPolicy.m): `src/+grade/decisionPolicy.m`

### Evidence channels

- [Grad-CAM evidence](https://github.com/jitheswar/sih26038/blob/master/src/%2Bexplain/gradcam.m): `src/+explain/gradcam.m`
- [Learned lesion channel](https://github.com/jitheswar/sih26038/blob/master/src/%2Bsegment/segmentLesions.m): `src/+segment/segmentLesions.m`
- [Classical lesion channel](https://github.com/jitheswar/sih26038/blob/master/src/%2Bsegment/detect.m): `src/+segment/detect.m`
- [Lesion evidence](https://github.com/jitheswar/sih26038/blob/master/src/%2Bexplain/buildLesionEvidence.m): `src/+explain/buildLesionEvidence.m`
- [Spatial agreement](https://github.com/jitheswar/sih26038/blob/master/src/%2Bgrade/spatialAgreement.m): `src/+grade/spatialAgreement.m`

### Product interfaces

- [Screening app](https://github.com/jitheswar/sih26038/blob/master/app/ScreeningApp.m): `app/ScreeningApp.m`

### Capacity simulation

- [Simulation runner](https://github.com/jitheswar/sih26038/blob/master/simulink/runDistrictSimulation.m): `simulink/runDistrictSimulation.m`
- [District capacity model](https://github.com/jitheswar/sih26038/blob/master/simulink/district_model.slx): `simulink/district_model.slx`
- [District configuration](https://github.com/jitheswar/sih26038/blob/master/simulink/district_config.json): `simulink/district_config.json`

### Other components

- **Screening user**
- **Fundus photo**

## Connections

- Screening user → Screening app: uses
- Fundus photo → Screening app: provides image
- Screening app → Case runner: demonstrates case
- Case runner → Image preprocessing: processes image
- Case runner → Image quality: assesses quality
- Case runner → Calibrated grading: predicts grade
- Calibrated grading → Probability calibration: calibrates probabilities
- Case runner → Grad-CAM evidence: generates explanation
- Case runner → Learned lesion channel: segments lesions
- Case runner → Classical lesion channel: detects candidates
- Case runner → Lesion evidence: builds evidence
- Case runner → Spatial agreement: checks agreement
- Case runner → Screening policy: selects disposition
- Calibrated grading → Screening policy: supplies grade
- Image quality → Screening policy: supplies quality
- Lesion evidence → Screening policy: supplies evidence
- Grad-CAM evidence → Spatial agreement: supplies heatmap
- Lesion evidence → Spatial agreement: supplies locations
- Simulation runner → District capacity model: runs simulation
- District configuration → Simulation runner: configures run
