# rbiswasgroup/resrijan architecture

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

- Interactive diagram: https://gitdiagram.com/rbiswasgroup/resrijan
- Repository: https://github.com/rbiswasgroup/resrijan

## Overview

ReSrijan digitises scientific figures, supports hand correction and analysis/fitting, and redraws data in journal styles; it also composes new multi-panel figures. The principal workflow runs from CLI or GUI through input loading, detection and extraction, checks, reporting, and plotting. The README documents capabilities beyond the sampled code; edges for those branches are included only where the README or source index supports them. Unsampled implementations are represented by their exact tree paths, and their internal links are omitted where evidence is unavailable.

Main entry points: [`resrijan/pipeline.py`](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/pipeline.py) (Digitisation pipeline), [`resrijan/plot/engine.py`](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/plot/engine.py) (Plot engine), [`resrijan/cli.py`](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/cli.py) (Command line), [`resrijan/gui/mainwindow.py`](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/gui/mainwindow.py) (Desktop application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_cli["Command line<br/>[cli.py]"]
  node_gui["Desktop application<br/>[mainwindow.py]"]
  node_digitize_ui["Digitize page<br/>[digitize.py]"]
end

subgraph group_digitize["Figure digitisation"]
  node_loader["Figure loader<br/>[loader.py]"]
  node_pipeline["Digitisation pipeline<br/>[pipeline.py]"]
  node_axes["Axes detection<br/>[axes.py]"]
  node_calibration["Axis calibration<br/>[calibration.py]"]
  node_ocr["Label OCR<br/>[ocr.py]"]
  node_vector["Vector extraction<br/>[vector.py]"]
  node_curves["Curve extraction<br/>[curves.py]"]
  node_bars["Bar extraction<br/>[bars.py]"]
  node_heatmap["Heatmap extraction<br/>[heatmap.py]"]
  node_imagefig["Image figures<br/>[imagefig.py]"]
  node_micrograph["Micrograph analysis<br/>[micrograph.py]"]
  node_anomaly["Anomaly checks<br/>[anomaly.py]"]
  node_report["Extraction report<br/>[report.py]"]
end

subgraph group_workbench["Data workbench"]
  node_editor["Data editor<br/>[editor.py]"]
  node_analysis["Data analysis<br/>[analysis.py]"]
  node_curvefit["Curve fitting<br/>[curvefit.py]"]
end

subgraph group_figures["Figure generation"]
  node_plot["Plot engine<br/>[engine.py]"]
  node_templates["Journal templates<br/>[templates.py]"]
  node_layout["Panel layout<br/>[layout.py]"]
  node_compose["Figure composition<br/>[compose.py]"]
end

node_user(("Researcher"))

node_user -->|"runs command"| node_cli
node_user -->|"opens application"| node_gui
node_gui -->|"hosts page"| node_digitize_ui
node_digitize_ui -->|"runs digitisation"| node_pipeline
node_cli -->|"runs digitisation"| node_pipeline
node_pipeline -->|"loads figures"| node_loader
node_pipeline -->|"detects axes"| node_axes
node_axes -->|"reads labels"| node_ocr
node_axes -->|"calibrates ticks"| node_calibration
node_pipeline -->|"extracts vector data"| node_vector
node_pipeline -->|"extracts curves"| node_curves
node_pipeline -->|"extracts bars"| node_bars
node_pipeline -->|"extracts heatmaps"| node_heatmap
node_pipeline -->|"analyses image panels"| node_imagefig
node_imagefig -->|"analyses micrographs"| node_micrograph
node_pipeline -->|"checks results"| node_anomaly
node_pipeline -->|"writes report"| node_report
node_pipeline -->|"creates replot"| node_plot
node_digitize_ui -->|"opens corrections"| node_editor
node_cli -->|"runs analysis"| node_analysis
node_cli -->|"runs fitting"| node_curvefit
node_analysis -->|"uses plotting"| node_plot
node_curvefit -->|"uses plotting"| node_plot
node_plot -->|"applies styles"| node_templates
node_plot -->|"arranges panels"| node_layout
node_gui -->|"offers composition"| node_compose
node_compose -.->|"builds figures"| node_plot

click node_cli "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/cli.py"
click node_gui "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/gui/mainwindow.py"
click node_digitize_ui "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/gui/pages/digitize.py"
click node_loader "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/io/loader.py"
click node_pipeline "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/pipeline.py"
click node_axes "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/detect/axes.py"
click node_calibration "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/detect/calibration.py"
click node_ocr "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/detect/ocr.py"
click node_vector "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/detect/vector.py"
click node_curves "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/extract/curves.py"
click node_bars "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/extract/bars.py"
click node_heatmap "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/extract/heatmap.py"
click node_imagefig "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/extract/imagefig.py"
click node_micrograph "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/extract/micrograph.py"
click node_anomaly "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/anomaly.py"
click node_report "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/report.py"
click node_editor "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/gui/editor.py"
click node_analysis "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/analysis.py"
click node_curvefit "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/curvefit.py"
click node_plot "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/plot/engine.py"
click node_templates "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/plot/templates.py"
click node_layout "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/plot/layout.py"
click node_compose "https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/gui/pages/compose.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_gui,node_digitize_ui toneBlue
class node_loader,node_pipeline,node_axes,node_calibration,node_ocr,node_vector,node_curves,node_bars,node_heatmap,node_imagefig,node_micrograph,node_anomaly,node_report toneAmber
class node_editor,node_analysis,node_curvefit toneMint
class node_plot,node_templates,node_layout,node_compose toneRose
class node_user toneIndigo
```

## Components

### User entry points

- [Command line](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/cli.py): `resrijan/cli.py`
- [Desktop application](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/gui/mainwindow.py): `resrijan/gui/mainwindow.py`
- [Digitize page](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/gui/pages/digitize.py): `resrijan/gui/pages/digitize.py`

### Figure digitisation

- [Figure loader](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/io/loader.py): `resrijan/io/loader.py`
- [Digitisation pipeline](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/pipeline.py): `resrijan/pipeline.py`
- [Axes detection](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/detect/axes.py): `resrijan/detect/axes.py`
- [Axis calibration](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/detect/calibration.py): `resrijan/detect/calibration.py`
- [Label OCR](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/detect/ocr.py): `resrijan/detect/ocr.py`
- [Vector extraction](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/detect/vector.py): `resrijan/detect/vector.py`
- [Curve extraction](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/extract/curves.py): `resrijan/extract/curves.py`
- [Bar extraction](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/extract/bars.py): `resrijan/extract/bars.py`
- [Heatmap extraction](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/extract/heatmap.py): `resrijan/extract/heatmap.py`
- [Image figures](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/extract/imagefig.py): `resrijan/extract/imagefig.py`
- [Micrograph analysis](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/extract/micrograph.py): `resrijan/extract/micrograph.py`
- [Anomaly checks](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/anomaly.py): `resrijan/anomaly.py`
- [Extraction report](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/report.py): `resrijan/report.py`

### Data workbench

- [Data editor](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/gui/editor.py): `resrijan/gui/editor.py`
- [Data analysis](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/analysis.py): `resrijan/analysis.py`
- [Curve fitting](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/curvefit.py): `resrijan/curvefit.py`

### Figure generation

- [Plot engine](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/plot/engine.py): `resrijan/plot/engine.py`
- [Journal templates](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/plot/templates.py): `resrijan/plot/templates.py`
- [Panel layout](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/plot/layout.py): `resrijan/plot/layout.py`
- [Figure composition](https://github.com/rbiswasgroup/resrijan/blob/main/resrijan/gui/pages/compose.py): `resrijan/gui/pages/compose.py`

### Other components

- **Researcher**

## Connections

- Researcher → Command line: runs command (evidence: `resrijan/cli.py`)
- Researcher → Desktop application: opens application
- Desktop application → Digitize page: hosts page (evidence: `resrijan/gui/mainwindow.py`)
- Digitize page → Digitisation pipeline: runs digitisation (evidence: `resrijan/gui/pages/digitize.py`)
- Command line → Digitisation pipeline: runs digitisation (evidence: `resrijan/cli.py`)
- Digitisation pipeline → Figure loader: loads figures (evidence: `resrijan/pipeline.py`)
- Digitisation pipeline → Axes detection: detects axes (evidence: `resrijan/pipeline.py`)
- Axes detection → Label OCR: reads labels (evidence: `resrijan/detect/axes.py`)
- Axes detection → Axis calibration: calibrates ticks (evidence: `resrijan/detect/axes.py`)
- Digitisation pipeline → Vector extraction: extracts vector data (evidence: `resrijan/pipeline.py`)
- Digitisation pipeline → Curve extraction: extracts curves (evidence: `resrijan/pipeline.py`)
- Digitisation pipeline → Bar extraction: extracts bars (evidence: `resrijan/pipeline.py`)
- Digitisation pipeline → Heatmap extraction: extracts heatmaps (evidence: `resrijan/pipeline.py`)
- Digitisation pipeline → Image figures: analyses image panels (evidence: `resrijan/pipeline.py`)
- Image figures → Micrograph analysis: analyses micrographs (evidence: `resrijan/extract/imagefig.py`)
- Digitisation pipeline → Anomaly checks: checks results (evidence: `resrijan/pipeline.py`)
- Digitisation pipeline → Extraction report: writes report (evidence: `resrijan/pipeline.py`)
- Digitisation pipeline → Plot engine: creates replot (evidence: `resrijan/pipeline.py`)
- Digitize page → Data editor: opens corrections (evidence: `resrijan/gui/pages/digitize.py`)
- Command line → Data analysis: runs analysis (evidence: `resrijan/cli.py`)
- Command line → Curve fitting: runs fitting (evidence: `resrijan/cli.py`)
- Data analysis → Plot engine: uses plotting (evidence: `resrijan/analysis.py`)
- Curve fitting → Plot engine: uses plotting (evidence: `resrijan/curvefit.py`)
- Plot engine → Journal templates: applies styles (evidence: `resrijan/plot/engine.py`)
- Plot engine → Panel layout: arranges panels (evidence: `resrijan/plot/engine.py`)
- Desktop application → Figure composition: offers composition (evidence: `resrijan/gui/mainwindow.py`)
- Figure composition → Plot engine: builds figures
