# p-shrestha/erythrosight architecture

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

- Interactive diagram: https://gitdiagram.com/p-shrestha/erythrosight
- Repository: https://github.com/p-shrestha/erythrosight

## Overview

erythroSight’s Cluster tree contains a set of microscopy image-analysis workflows for blood-cell characterization and disease screening. The visible processing path converts Octopi brightfield image pairs into DPC images, then uses ROI outlines to calculate morphological measurements; the repository also includes Cellpose segmentation, time-series stack conversion, classification experiments, and plotting. The DPC and ROI relationships below are supported by excerpts. Other branches are represented from the tree, but their internal wiring is not shown in the supplied evidence.

Main entry points: [`Cluster/DPC-processing/export_DPC_XY_Multiple_CC.py`](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/export_DPC_XY_Multiple_CC.py) (DPC conversion), [`Cluster/MorphologicalParameters/imagej_roi_converter_CC_Archive.py`](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/MorphologicalParameters/imagej_roi_converter_CC_Archive.py) (ROI measurements), [`Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanada.py`](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanada.py) (Canada ROI measurements), [`Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaR.py`](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaR.py) (Canada ROI variant)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_image["Image Processing"]
  node_dpc_main["DPC conversion"]
  node_dpc_canada["Canada DPC conversion"]
  node_dpc_timeseries["Time-series DPC"]
  node_dpc_scratch["Scratch DPC variant"]
  node_dpc_images["DPC images"]
  node_cellpose["Cell segmentation"]
  node_tiff_stack["TIFF stack creation"]
  node_tiff_8bit["8-bit stack conversion"]
end

subgraph group_morph["Cell Morphology"]
  node_outlines["Segmentation outlines"]
  node_roi_nepal["ROI measurements"]
  node_roi_canada["Canada ROI measurements"]
  node_roi_canada_r["Canada ROI variant"]
  node_roi_timeseries["Time-series ROI"]
  node_morph_data["Morphology tables"]
end

subgraph group_classify["Classification"]
  node_classification["Classifier experiments"]
  node_classification_variants["Classification variants"]
  node_metrics["Classification metrics"]
end

subgraph group_results["Analysis Outputs"]
  node_plots["Characterization plots"]
  node_dataset[("Published image dataset")]
end

node_operator(("Cluster operator"))
node_raw["Octopi raw images"]

node_operator -.->|"runs"| node_dpc_main
node_raw -->|"reads pairs"| node_dpc_main
node_dpc_main -->|"writes images"| node_dpc_images
node_raw -->|"reads pairs"| node_dpc_canada
node_dpc_canada -->|"writes images"| node_dpc_images
node_raw -->|"reads pairs"| node_dpc_timeseries
node_dpc_timeseries -->|"writes images"| node_dpc_images
node_raw -->|"reads pairs"| node_dpc_scratch
node_dpc_scratch -->|"writes images"| node_dpc_images
node_dpc_images -->|"opens images"| node_tiff_stack
node_tiff_stack -.->|"converts stacks"| node_tiff_8bit
node_outlines -->|"reads outlines"| node_roi_nepal
node_dpc_images -->|"opens DPC"| node_roi_nepal
node_roi_nepal -->|"saves measurements"| node_morph_data
node_outlines -->|"reads outlines"| node_roi_canada
node_dpc_images -->|"opens DPC"| node_roi_canada
node_roi_canada -->|"saves measurements"| node_morph_data
node_outlines -->|"reads outlines"| node_roi_canada_r
node_dpc_images -->|"opens DPC"| node_roi_canada_r
node_roi_canada_r -->|"saves measurements"| node_morph_data
node_outlines -->|"reads outlines"| node_roi_timeseries
node_dpc_images -->|"opens DPC"| node_roi_timeseries
node_roi_timeseries -->|"saves measurements"| node_morph_data

click node_dpc_main "https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/export_DPC_XY_Multiple_CC.py"
click node_dpc_canada "https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/export_DPC_XY_Multiple_CC_Canada.py"
click node_dpc_timeseries "https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/export_DPC_XY_Multiple_CC_Canada_TimeSeries.py"
click node_dpc_scratch "https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/otherVersions/export_DPC_XY_Multiple_CC_Scratch.py"
click node_cellpose "https://github.com/p-shrestha/erythrosight/tree/main/Cluster/Cellpose2.0-segmentation"
click node_tiff_stack "https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/TimeSeriesTIFFstacks/createTIFFstacks.py"
click node_tiff_8bit "https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/TimeSeriesTIFFstacks/createTIFFstacks8bit.py"
click node_roi_nepal "https://github.com/p-shrestha/erythrosight/blob/main/Cluster/MorphologicalParameters/imagej_roi_converter_CC_Archive.py"
click node_roi_canada "https://github.com/p-shrestha/erythrosight/blob/main/Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanada.py"
click node_roi_canada_r "https://github.com/p-shrestha/erythrosight/blob/main/Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaR.py"
click node_roi_timeseries "https://github.com/p-shrestha/erythrosight/blob/main/Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaTimeSeries.py"
click node_classification "https://github.com/p-shrestha/erythrosight/tree/main/Cluster/Classification/30b19ndmp/coverslipLevel/multipleSplits"
click node_classification_variants "https://github.com/p-shrestha/erythrosight/tree/main/Cluster/Classification"
click node_metrics "https://github.com/p-shrestha/erythrosight/blob/main/Cluster/Classification/30b19ndmp/coverslipLevel/multipleSplits/summarizeMetrics_4groups.m"
click node_plots "https://github.com/p-shrestha/erythrosight/tree/main/Cluster/Plots"

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_dpc_main,node_dpc_canada,node_dpc_timeseries,node_dpc_scratch,node_dpc_images,node_cellpose,node_tiff_stack,node_tiff_8bit toneBlue
class node_outlines,node_roi_nepal,node_roi_canada,node_roi_canada_r,node_roi_timeseries,node_morph_data toneAmber
class node_classification,node_classification_variants,node_metrics toneMint
class node_plots,node_dataset toneRose
class node_operator,node_raw toneIndigo
```

## Components

### Image Processing

- [DPC conversion](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/export_DPC_XY_Multiple_CC.py): `Cluster/DPC-processing/export_DPC_XY_Multiple_CC.py`
- [Canada DPC conversion](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/export_DPC_XY_Multiple_CC_Canada.py): `Cluster/DPC-processing/export_DPC_XY_Multiple_CC_Canada.py`
- [Time-series DPC](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/export_DPC_XY_Multiple_CC_Canada_TimeSeries.py): `Cluster/DPC-processing/export_DPC_XY_Multiple_CC_Canada_TimeSeries.py`
- [Scratch DPC variant](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/otherVersions/export_DPC_XY_Multiple_CC_Scratch.py): `Cluster/DPC-processing/otherVersions/export_DPC_XY_Multiple_CC_Scratch.py`
- **DPC images**
- [Cell segmentation](https://github.com/p-shrestha/erythrosight/tree/main/Cluster/Cellpose2.0-segmentation): `Cluster/Cellpose2.0-segmentation`
- [TIFF stack creation](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/TimeSeriesTIFFstacks/createTIFFstacks.py): `Cluster/DPC-processing/TimeSeriesTIFFstacks/createTIFFstacks.py`
- [8-bit stack conversion](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/DPC-processing/TimeSeriesTIFFstacks/createTIFFstacks8bit.py): `Cluster/DPC-processing/TimeSeriesTIFFstacks/createTIFFstacks8bit.py`

### Cell Morphology

- **Segmentation outlines**
- [ROI measurements](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/MorphologicalParameters/imagej_roi_converter_CC_Archive.py): `Cluster/MorphologicalParameters/imagej_roi_converter_CC_Archive.py`
- [Canada ROI measurements](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanada.py): `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanada.py`
- [Canada ROI variant](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaR.py): `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaR.py`
- [Time-series ROI](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaTimeSeries.py): `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaTimeSeries.py`
- **Morphology tables**

### Classification

- [Classifier experiments](https://github.com/p-shrestha/erythrosight/tree/main/Cluster/Classification/30b19ndmp/coverslipLevel/multipleSplits): `Cluster/Classification/30b19ndmp/coverslipLevel/multipleSplits`
- [Classification variants](https://github.com/p-shrestha/erythrosight/tree/main/Cluster/Classification): `Cluster/Classification`
- [Classification metrics](https://github.com/p-shrestha/erythrosight/blob/main/Cluster/Classification/30b19ndmp/coverslipLevel/multipleSplits/summarizeMetrics_4groups.m): `Cluster/Classification/30b19ndmp/coverslipLevel/multipleSplits/summarizeMetrics_4groups.m`

### Analysis Outputs

- [Characterization plots](https://github.com/p-shrestha/erythrosight/tree/main/Cluster/Plots): `Cluster/Plots`
- **Published image dataset**

### Other components

- **Cluster operator**
- **Octopi raw images**

## Connections

- Cluster operator → DPC conversion: runs
- Octopi raw images → DPC conversion: reads pairs (evidence: `Cluster/DPC-processing/export_DPC_XY_Multiple_CC.py`)
- DPC conversion → DPC images: writes images (evidence: `Cluster/DPC-processing/export_DPC_XY_Multiple_CC.py`)
- Octopi raw images → Canada DPC conversion: reads pairs (evidence: `Cluster/DPC-processing/export_DPC_XY_Multiple_CC_Canada.py`)
- Canada DPC conversion → DPC images: writes images (evidence: `Cluster/DPC-processing/export_DPC_XY_Multiple_CC_Canada.py`)
- Octopi raw images → Time-series DPC: reads pairs (evidence: `Cluster/DPC-processing/export_DPC_XY_Multiple_CC_Canada_TimeSeries.py`)
- Time-series DPC → DPC images: writes images (evidence: `Cluster/DPC-processing/export_DPC_XY_Multiple_CC_Canada_TimeSeries.py`)
- Octopi raw images → Scratch DPC variant: reads pairs (evidence: `Cluster/DPC-processing/otherVersions/export_DPC_XY_Multiple_CC_Scratch.py`)
- Scratch DPC variant → DPC images: writes images (evidence: `Cluster/DPC-processing/otherVersions/export_DPC_XY_Multiple_CC_Scratch.py`)
- DPC images → TIFF stack creation: opens images (evidence: `Cluster/DPC-processing/TimeSeriesTIFFstacks/createTIFFstacks.py`)
- TIFF stack creation → 8-bit stack conversion: converts stacks
- Segmentation outlines → ROI measurements: reads outlines (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_Archive.py`)
- DPC images → ROI measurements: opens DPC (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_Archive.py`)
- ROI measurements → Morphology tables: saves measurements (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_Archive.py`)
- Segmentation outlines → Canada ROI measurements: reads outlines (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanada.py`)
- DPC images → Canada ROI measurements: opens DPC (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanada.py`)
- Canada ROI measurements → Morphology tables: saves measurements (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanada.py`)
- Segmentation outlines → Canada ROI variant: reads outlines (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaR.py`)
- DPC images → Canada ROI variant: opens DPC (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaR.py`)
- Canada ROI variant → Morphology tables: saves measurements (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaR.py`)
- Segmentation outlines → Time-series ROI: reads outlines (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaTimeSeries.py`)
- DPC images → Time-series ROI: opens DPC (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaTimeSeries.py`)
- Time-series ROI → Morphology tables: saves measurements (evidence: `Cluster/MorphologicalParameters/imagej_roi_converter_CC_ArchiveCanadaTimeSeries.py`)
