# tristanscloud/sticklemorph architecture

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

- Interactive diagram: https://gitdiagram.com/tristanscloud/sticklemorph
- Repository: https://github.com/tristanscloud/sticklemorph

## Overview

StickleMorph is a Streamlit tool for predicting and editing stickleback image landmarks. The user selects an image and predictor, calibrates image scale with two points, edits predicted landmarks on a canvas, then filters and downloads coordinates. The graph separates image/model input, prediction and editing, and output. The sampled app shows CSV export; TPS export is documented in the README but its implementation is not visible in the excerpt.

Main entry points: [`app.py`](https://github.com/tristanscloud/sticklemorph/blob/master/app.py) (Landmark Editing), [`predictors`](https://github.com/tristanscloud/sticklemorph/tree/master/predictors) (Predictor Files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Image and Model Input"]
  node_image_source[("Image Files")]
  node_model_source[("Predictor Files")]
  node_app["Streamlit App<br/>[app.py]"]
end

subgraph group_landmarks["Prediction and Editing"]
  node_prediction["Landmark Prediction<br/>[app.py]"]
  node_editing["Landmark Editing<br/>[app.py]"]
  node_canvas["Interactive Canvas<br/>[app.py]"]
end

subgraph group_outputs["Calibration and Export"]
  node_calibration["Scale Calibration<br/>[app.py]"]
  node_filtering["Landmark Filtering<br/>[app.py]"]
  node_export["Coordinate Export<br/>[app.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"reads image"| node_image_source
node_app -->|"loads model"| node_model_source
node_app -->|"runs prediction"| node_prediction
node_prediction -->|"provides landmarks"| node_editing
node_editing -->|"renders landmarks"| node_canvas
node_canvas -->|"returns edits"| node_editing
node_user -->|"sets scale points"| node_calibration
node_calibration -->|"scales coordinates"| node_editing
node_editing -->|"provides coordinates"| node_filtering
node_filtering -->|"prepares output"| node_export
node_export -->|"downloads CSV"| node_user
node_export -.->|"offers TPS"| node_user

click node_model_source "https://github.com/tristanscloud/sticklemorph/tree/master/predictors"
click node_app "https://github.com/tristanscloud/sticklemorph/blob/master/app.py"
click node_prediction "https://github.com/tristanscloud/sticklemorph/blob/master/app.py"
click node_editing "https://github.com/tristanscloud/sticklemorph/blob/master/app.py"
click node_canvas "https://github.com/tristanscloud/sticklemorph/blob/master/app.py"
click node_calibration "https://github.com/tristanscloud/sticklemorph/blob/master/app.py"
click node_filtering "https://github.com/tristanscloud/sticklemorph/blob/master/app.py"
click node_export "https://github.com/tristanscloud/sticklemorph/blob/master/app.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_image_source,node_model_source,node_app,node_user toneBlue
class node_prediction,node_editing,node_canvas toneAmber
class node_calibration,node_filtering,node_export toneMint
```

## Components

### Image and Model Input

- **Image Files**
- [Predictor Files](https://github.com/tristanscloud/sticklemorph/tree/master/predictors): `predictors`
- [Streamlit App](https://github.com/tristanscloud/sticklemorph/blob/master/app.py): `app.py`

### Prediction and Editing

- [Landmark Prediction](https://github.com/tristanscloud/sticklemorph/blob/master/app.py): `app.py`
- [Landmark Editing](https://github.com/tristanscloud/sticklemorph/blob/master/app.py): `app.py`
- [Interactive Canvas](https://github.com/tristanscloud/sticklemorph/blob/master/app.py): `app.py`

### Calibration and Export

- [Scale Calibration](https://github.com/tristanscloud/sticklemorph/blob/master/app.py): `app.py`
- [Landmark Filtering](https://github.com/tristanscloud/sticklemorph/blob/master/app.py): `app.py`
- [Coordinate Export](https://github.com/tristanscloud/sticklemorph/blob/master/app.py): `app.py`

### Other components

- **User**

## Connections

- User → Streamlit App: uses (evidence: `README.md`)
- Streamlit App → Image Files: reads image (evidence: `app.py`)
- Streamlit App → Predictor Files: loads model (evidence: `app.py`)
- Streamlit App → Landmark Prediction: runs prediction (evidence: `app.py`)
- Landmark Prediction → Landmark Editing: provides landmarks (evidence: `app.py`)
- Landmark Editing → Interactive Canvas: renders landmarks (evidence: `app.py`)
- Interactive Canvas → Landmark Editing: returns edits (evidence: `app.py`)
- User → Scale Calibration: sets scale points (evidence: `README.md`)
- Scale Calibration → Landmark Editing: scales coordinates (evidence: `app.py`)
- Landmark Editing → Landmark Filtering: provides coordinates (evidence: `app.py`)
- Landmark Filtering → Coordinate Export: prepares output (evidence: `app.py`)
- Coordinate Export → User: downloads CSV (evidence: `app.py`)
- Coordinate Export → User: offers TPS (evidence: `README.md`)
