# tkepp/resa-oct architecture

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

- Interactive diagram: https://gitdiagram.com/tkepp/resa-oct
- Repository: https://github.com/tkepp/resa-oct

## Overview

The repository implements two retinal OCT analysis workflows: multimodal anisotropic B-scan interpolation and resolution-independent atlas registration/reconstruction/segmentation. The graph preserves their separate entry points and the major atlas inference variants. Relationships are based on README statements, the SOURCE INDEX reference lists, and shown excerpts; unsampled implementation details are not assumed.

Main entry points: [`atlas registration/experiments/GINR_Atlas_base.py`](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/experiments/GINR_Atlas_base.py) (Atlas training entry), [`atlas registration/datasets/healthyOCT.py`](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/datasets/healthyOCT.py) (OCT patch dataset), [`anisotropic interpolation/train_test_geninr.py`](https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/train_test_geninr.py) (Generalizable INR), [`anisotropic interpolation/train_test_singleinr.py`](https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/train_test_singleinr.py) (Single-pair INR)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interp["Anisotropic interpolation"]
  node_geninr["Generalizable INR"]
  node_singleinr["Single-pair INR"]
  node_interp_training["INR fitting<br/>[training.py]"]
  node_interp_eval["Interpolation evaluation<br/>[evaluation.py]"]
  node_interp_plots["Result plots<br/>[plots.py]"]
end

subgraph group_interp_model["Interpolation model"]
  node_interp_mlp["MLP<br/>[mlp.py]"]
  node_interp_activation["Layer activations"]
  node_interp_mapper["Coordinate mapper<br/>[mapper.py]"]
end

subgraph group_atlas_data["Atlas data"]
  node_oct_dataset["OCT patch dataset<br/>[healthyOCT.py]"]
  node_oct_blocks["OCT block dataset"]
  node_atlas_dataset["Atlas dataset<br/>[atlasDataset.py]"]
  node_patch_ops["Patch and coordinates<br/>[Patches.py]"]
end

subgraph group_atlas_models["Atlas models"]
  node_siren["SIREN<br/>[SIREN.py]"]
  node_modulated_siren["Modulated SIREN<br/>[modulatedSIREN.py]"]
  node_recon_seg["Reconstruction heads"]
end

subgraph group_atlas_runtime["Atlas workflows"]
  node_atlas_train["Atlas training<br/>[GINR_Atlas_Reg.py]"]
  node_atlas_fit["Instance fitting"]
  node_inference_routines["Other inference routines"]
  node_atlas_metrics["Registration metrics<br/>[metrics.py]"]
  node_base_experiment["Atlas training entry<br/>[GINR_Atlas_base.py]"]
  node_base_inference["Base inference"]
  node_affine_inference["Affine inference"]
  node_resolution_inference["Resolution inference"]
  node_inr_inference["INR atlas inference"]
  node_atlas_files["Config and paths<br/>[files.py]"]
end

node_researcher(("Researcher"))
node_atlas_user(("Atlas operator"))

node_researcher -->|"runs"| node_geninr
node_researcher -->|"runs"| node_singleinr
node_geninr -->|"fits model"| node_interp_training
node_singleinr -->|"fits model"| node_interp_training
node_geninr -->|"uses"| node_interp_mlp
node_geninr -->|"uses"| node_interp_mapper
node_singleinr -->|"uses"| node_interp_mlp
node_singleinr -->|"uses"| node_interp_mapper
node_interp_mlp -->|"uses"| node_interp_activation
node_interp_training -->|"evaluates"| node_interp_eval
node_interp_training -->|"plots results"| node_interp_plots
node_geninr -->|"evaluates"| node_interp_eval
node_singleinr -->|"evaluates"| node_interp_eval
node_interp_eval -->|"summarizes"| node_interp_plots
node_atlas_user -->|"runs"| node_base_experiment
node_base_experiment -->|"loads data"| node_oct_dataset
node_oct_dataset -->|"samples patches"| node_patch_ops
node_oct_blocks -->|"uses coordinates"| node_patch_ops
node_atlas_dataset -->|"uses patches"| node_patch_ops
node_base_experiment -->|"trains"| node_atlas_train
node_base_experiment -->|"configures"| node_siren
node_base_experiment -->|"configures"| node_modulated_siren
node_base_experiment -->|"configures"| node_recon_seg
node_atlas_train -->|"computes metrics"| node_atlas_metrics
node_base_experiment -->|"reads config"| node_atlas_files
node_base_inference -->|"loads data"| node_oct_dataset
node_base_inference -->|"loads blocks"| node_oct_blocks
node_base_inference -->|"fits instance"| node_atlas_fit
node_affine_inference -->|"loads data"| node_oct_dataset
node_affine_inference -->|"loads blocks"| node_oct_blocks
node_affine_inference -->|"fits instance"| node_atlas_fit
node_resolution_inference -->|"loads data"| node_oct_dataset
node_resolution_inference -->|"evaluates blocks"| node_oct_blocks
node_resolution_inference -->|"fits instance"| node_atlas_fit
node_inr_inference -->|"loads data"| node_oct_dataset
node_inr_inference -->|"uses"| node_inference_routines
node_base_inference -->|"uses"| node_inference_routines
node_affine_inference -->|"uses"| node_inference_routines
node_atlas_fit -->|"computes metrics"| node_atlas_metrics

click node_geninr "https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/train_test_geninr.py"
click node_singleinr "https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/train_test_singleinr.py"
click node_interp_training "https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/training.py"
click node_interp_eval "https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/evaluation.py"
click node_interp_plots "https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/plots.py"
click node_interp_mlp "https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/model/mlp.py"
click node_interp_activation "https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/model/layer_activations.py"
click node_interp_mapper "https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/model/mapper.py"
click node_oct_dataset "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/datasets/healthyOCT.py"
click node_oct_blocks "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/datasets/healthyOCT16Bscans.py"
click node_atlas_dataset "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/datasets/atlasDataset.py"
click node_patch_ops "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/utilities/Patches.py"
click node_siren "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/architectures/SIREN.py"
click node_modulated_siren "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/architectures/modulatedSIREN.py"
click node_recon_seg "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/architectures/reconSegMultiHead.py"
click node_atlas_train "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/routines/GINR_Atlas_Reg.py"
click node_atlas_fit "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/routines/GINR_Atlas_Reg_Inference.py"
click node_inference_routines "https://github.com/tkepp/resa-oct/tree/main/atlas%20registration/routines"
click node_atlas_metrics "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/utilities/metrics.py"
click node_base_experiment "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/experiments/GINR_Atlas_base.py"
click node_base_inference "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/experiments/GINR_Atlas_base_inference.py"
click node_affine_inference "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/experiments/GINR_Atlas_Affine_inference.py"
click node_resolution_inference "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/experiments/GINR_Atlas_resolution_inference.py"
click node_inr_inference "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/experiments/INR_Atlas_inference.py"
click node_atlas_files "https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/utilities/files.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_geninr,node_singleinr,node_interp_training,node_interp_eval,node_interp_plots toneBlue
class node_interp_mlp,node_interp_activation,node_interp_mapper toneAmber
class node_oct_dataset,node_oct_blocks,node_atlas_dataset,node_patch_ops toneMint
class node_siren,node_modulated_siren,node_recon_seg toneRose
class node_atlas_train,node_atlas_fit,node_inference_routines,node_atlas_metrics,node_base_experiment,node_base_inference,node_affine_inference,node_resolution_inference,node_inr_inference,node_atlas_files,node_researcher,node_atlas_user toneIndigo
```

## Components

### Anisotropic interpolation

- [Generalizable INR](https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/train_test_geninr.py): `anisotropic interpolation/train_test_geninr.py`
- [Single-pair INR](https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/train_test_singleinr.py): `anisotropic interpolation/train_test_singleinr.py`
- [INR fitting](https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/training.py): `anisotropic interpolation/training.py`
- [Interpolation evaluation](https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/evaluation.py): `anisotropic interpolation/evaluation.py`
- [Result plots](https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/plots.py): `anisotropic interpolation/plots.py`

### Interpolation model

- [MLP](https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/model/mlp.py): `anisotropic interpolation/model/mlp.py`
- [Layer activations](https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/model/layer_activations.py): `anisotropic interpolation/model/layer_activations.py`
- [Coordinate mapper](https://github.com/tkepp/resa-oct/blob/main/anisotropic%20interpolation/model/mapper.py): `anisotropic interpolation/model/mapper.py`

### Atlas data

- [OCT patch dataset](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/datasets/healthyOCT.py): `atlas registration/datasets/healthyOCT.py`
- [OCT block dataset](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/datasets/healthyOCT16Bscans.py): `atlas registration/datasets/healthyOCT16Bscans.py`
- [Atlas dataset](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/datasets/atlasDataset.py): `atlas registration/datasets/atlasDataset.py`
- [Patch and coordinates](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/utilities/Patches.py): `atlas registration/utilities/Patches.py`

### Atlas models

- [SIREN](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/architectures/SIREN.py): `atlas registration/architectures/SIREN.py`
- [Modulated SIREN](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/architectures/modulatedSIREN.py): `atlas registration/architectures/modulatedSIREN.py`
- [Reconstruction heads](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/architectures/reconSegMultiHead.py): `atlas registration/architectures/reconSegMultiHead.py`

### Atlas workflows

- [Atlas training](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/routines/GINR_Atlas_Reg.py): `atlas registration/routines/GINR_Atlas_Reg.py`
- [Instance fitting](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/routines/GINR_Atlas_Reg_Inference.py): `atlas registration/routines/GINR_Atlas_Reg_Inference.py`
- [Other inference routines](https://github.com/tkepp/resa-oct/tree/main/atlas%20registration/routines): `atlas registration/routines`
- [Registration metrics](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/utilities/metrics.py): `atlas registration/utilities/metrics.py`
- [Atlas training entry](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/experiments/GINR_Atlas_base.py): `atlas registration/experiments/GINR_Atlas_base.py`
- [Base inference](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/experiments/GINR_Atlas_base_inference.py): `atlas registration/experiments/GINR_Atlas_base_inference.py`
- [Affine inference](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/experiments/GINR_Atlas_Affine_inference.py): `atlas registration/experiments/GINR_Atlas_Affine_inference.py`
- [Resolution inference](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/experiments/GINR_Atlas_resolution_inference.py): `atlas registration/experiments/GINR_Atlas_resolution_inference.py`
- [INR atlas inference](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/experiments/INR_Atlas_inference.py): `atlas registration/experiments/INR_Atlas_inference.py`
- [Config and paths](https://github.com/tkepp/resa-oct/blob/main/atlas%20registration/utilities/files.py): `atlas registration/utilities/files.py`

### Other components

- **Researcher**
- **Atlas operator**

## Connections

- Researcher → Generalizable INR: runs (evidence: `README.md`)
- Researcher → Single-pair INR: runs (evidence: `README.md`)
- Generalizable INR → INR fitting: fits model (evidence: `anisotropic interpolation/train_test_geninr.py`)
- Single-pair INR → INR fitting: fits model (evidence: `anisotropic interpolation/train_test_singleinr.py`)
- Generalizable INR → MLP: uses (evidence: `anisotropic interpolation/train_test_geninr.py`)
- Generalizable INR → Coordinate mapper: uses (evidence: `anisotropic interpolation/train_test_geninr.py`)
- Single-pair INR → MLP: uses (evidence: `anisotropic interpolation/train_test_singleinr.py`)
- Single-pair INR → Coordinate mapper: uses (evidence: `anisotropic interpolation/train_test_singleinr.py`)
- MLP → Layer activations: uses (evidence: `anisotropic interpolation/model/mlp.py`)
- INR fitting → Interpolation evaluation: evaluates (evidence: `anisotropic interpolation/training.py`)
- INR fitting → Result plots: plots results (evidence: `anisotropic interpolation/training.py`)
- Generalizable INR → Interpolation evaluation: evaluates (evidence: `anisotropic interpolation/train_test_geninr.py`)
- Single-pair INR → Interpolation evaluation: evaluates (evidence: `anisotropic interpolation/train_test_singleinr.py`)
- Interpolation evaluation → Result plots: summarizes (evidence: `anisotropic interpolation/evaluation.py`)
- Atlas operator → Atlas training entry: runs (evidence: `README.md`)
- Atlas training entry → OCT patch dataset: loads data (evidence: `atlas registration/experiments/GINR_Atlas_base.py`)
- OCT patch dataset → Patch and coordinates: samples patches (evidence: `atlas registration/datasets/healthyOCT.py`)
- OCT block dataset → Patch and coordinates: uses coordinates (evidence: `atlas registration/datasets/healthyOCT16Bscans.py`)
- Atlas dataset → Patch and coordinates: uses patches (evidence: `atlas registration/datasets/atlasDataset.py`)
- Atlas training entry → Atlas training: trains (evidence: `atlas registration/experiments/GINR_Atlas_base.py`)
- Atlas training entry → SIREN: configures (evidence: `atlas registration/experiments/GINR_Atlas_base.py`)
- Atlas training entry → Modulated SIREN: configures (evidence: `atlas registration/experiments/GINR_Atlas_base.py`)
- Atlas training entry → Reconstruction heads: configures (evidence: `atlas registration/experiments/GINR_Atlas_base.py`)
- Atlas training → Registration metrics: computes metrics (evidence: `atlas registration/routines/GINR_Atlas_Reg.py`)
- Atlas training entry → Config and paths: reads config (evidence: `atlas registration/experiments/GINR_Atlas_base.py`)
- Base inference → OCT patch dataset: loads data (evidence: `atlas registration/experiments/GINR_Atlas_base_inference.py`)
- Base inference → OCT block dataset: loads blocks (evidence: `atlas registration/experiments/GINR_Atlas_base_inference.py`)
- Base inference → Instance fitting: fits instance (evidence: `atlas registration/experiments/GINR_Atlas_base_inference.py`)
- Affine inference → OCT patch dataset: loads data (evidence: `atlas registration/experiments/GINR_Atlas_Affine_inference.py`)
- Affine inference → OCT block dataset: loads blocks (evidence: `atlas registration/experiments/GINR_Atlas_Affine_inference.py`)
- Affine inference → Instance fitting: fits instance (evidence: `atlas registration/experiments/GINR_Atlas_Affine_inference.py`)
- Resolution inference → OCT patch dataset: loads data (evidence: `atlas registration/experiments/GINR_Atlas_resolution_inference.py`)
- Resolution inference → OCT block dataset: evaluates blocks (evidence: `atlas registration/experiments/GINR_Atlas_resolution_inference.py`)
- Resolution inference → Instance fitting: fits instance (evidence: `atlas registration/experiments/GINR_Atlas_resolution_inference.py`)
- INR atlas inference → OCT patch dataset: loads data (evidence: `atlas registration/experiments/INR_Atlas_inference.py`)
- INR atlas inference → Other inference routines: uses (evidence: `atlas registration/experiments/INR_Atlas_inference.py`)
- Base inference → Other inference routines: uses (evidence: `atlas registration/experiments/GINR_Atlas_base_inference.py`)
- Affine inference → Other inference routines: uses (evidence: `atlas registration/experiments/GINR_Atlas_Affine_inference.py`)
- Instance fitting → Registration metrics: computes metrics (evidence: `atlas registration/routines/GINR_Atlas_Reg_Inference.py`)
