# yaman-ajaj/curvature_estimation_bacterianearsurface_complete architecture

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

- Interactive diagram: https://gitdiagram.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete
- Repository: https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete

## Overview

This MATLAB toolkit analyzes 2D trajectories to estimate curvature on near-surface track segments, then validates and tunes estimators with synthetic ground truth. The main workflow runs from trajectory input through `analyzeAllTracks.m` to saved per-track results; separate branches generate synthetic data, sweep parameters, compare errors, and visualize outcomes. The README documents these relationships and capabilities; source excerpts were unavailable, so uncertain implementation-level calls are omitted.

Main entry points: [`groundTruthComparison.m`](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/groundTruthComparison.m) (Ground-truth comparison), [`run_sweep_tests.m`](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/run_sweep_tests.m) (Parameter sweeps), [`analyzeAllTracks.m`](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/analyzeAllTracks.m) (Track analyzer), [`create_synthetic_trajectories.m`](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/create_synthetic_trajectories.m) (Synthetic generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Trajectory data"]
  node_trajectory_input[("Trajectory MAT input")]
  node_synthetic_generator["Synthetic generator"]
  node_synthetic_data[("Synthetic tracks")]
  node_real_data[("Real tracks")]
  node_results[("Curvature results")]
  node_ground_truth[("Known curvature<br/>[getTrueCurvature.m]")]
end

subgraph group_analysis["Curvature analysis"]
  node_analyzer["Track analyzer<br/>[analyzeAllTracks.m]"]
  node_estimators["Curvature estimators"]
  node_circle_estimator["Circle fitting"]
  node_angle_estimator["Tangent angle"]
  node_diff_estimator["Finite differences"]
  node_poly_estimator["Local polynomial"]
  node_spline_estimator["Spline methods"]
  node_spline_smoothing["Spline smoothing"]
  node_curvature_smoothing["Curvature smoothing<br/>[smoothCurvature.m]"]
end

subgraph group_validation["Validation and tuning"]
  node_comparison["Ground-truth comparison"]
  node_edge_trim["Edge trimming<br/>[edgeTrimPercent.m]"]
  node_sweeps["Parameter sweeps<br/>[run_sweep_tests.m]"]
  node_sweep_helpers["Sweep helpers<br/>[sweep_localPoly.m]"]
  node_result_comparison["Result-file comparison"]
end

subgraph group_visualization["Visualization"]
  node_track_plots["Trajectory plots"]
  node_curvature_plots["Comparative plots"]
  node_inset_plot["Track inset plot<br/>[PlotWithInset.m]"]
end

node_user(("Researcher"))

node_user -->|"runs"| node_synthetic_generator
node_synthetic_generator -->|"writes clean and noisy"| node_synthetic_data
node_user -->|"selects method"| node_analyzer
node_trajectory_input -->|"loads tracks"| node_analyzer
node_analyzer -->|"dispatches"| node_estimators
node_estimators -->|"selects"| node_circle_estimator
node_estimators -->|"selects"| node_angle_estimator
node_estimators -->|"selects"| node_diff_estimator
node_estimators -->|"selects"| node_poly_estimator
node_estimators -->|"selects"| node_spline_estimator
node_spline_estimator -->|"smooths path"| node_spline_smoothing
node_analyzer -->|"saves"| node_results
node_user -->|"runs tuning"| node_sweeps
node_sweeps -->|"runs grids"| node_sweep_helpers
node_sweeps -->|"uses noisy tracks"| node_synthetic_data
node_sweeps -->|"evaluates against"| node_ground_truth
node_user -->|"runs evaluation"| node_comparison
node_comparison -->|"loads"| node_results
node_comparison -->|"compares with"| node_ground_truth
node_comparison -->|"trims edges"| node_edge_trim
node_user -->|"runs comparison"| node_result_comparison
node_result_comparison -->|"loads files"| node_results
node_user -->|"views tracks"| node_track_plots
node_track_plots -->|"reads"| node_trajectory_input
node_user -->|"views results"| node_curvature_plots
node_curvature_plots -->|"reads"| node_results
node_user -->|"views inset"| node_inset_plot
node_inset_plot -->|"reads"| node_results

click node_synthetic_generator "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/create_synthetic_trajectories.m"
click node_analyzer "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/analyzeAllTracks.m"
click node_circle_estimator "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/curvature_estimation_leastSquaresCircle.m"
click node_angle_estimator "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/curvatureEstimationTangentAngle.m"
click node_diff_estimator "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/curvature_estimation_centralDiff.m"
click node_poly_estimator "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/curvature_estimation_localPoly.m"
click node_spline_estimator "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/curvature_estimation_splineDerivative.m"
click node_spline_smoothing "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/smoothTrajectorySpline.m"
click node_curvature_smoothing "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/smoothCurvature.m"
click node_ground_truth "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/getTrueCurvature.m"
click node_comparison "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/groundTruthComparison.m"
click node_edge_trim "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/edgeTrimPercent.m"
click node_sweeps "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/run_sweep_tests.m"
click node_sweep_helpers "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/sweep_localPoly.m"
click node_result_comparison "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/compareCurvatureVariationAcrossResultFiles.m"
click node_track_plots "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/Plot_Trajectories.m"
click node_curvature_plots "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/plotTrackByIndexComparative.m"
click node_inset_plot "https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/PlotWithInset.m"

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_trajectory_input,node_synthetic_generator,node_synthetic_data,node_real_data,node_results,node_ground_truth toneBlue
class node_analyzer,node_estimators,node_circle_estimator,node_angle_estimator,node_diff_estimator,node_poly_estimator,node_spline_estimator,node_spline_smoothing,node_curvature_smoothing toneAmber
class node_comparison,node_edge_trim,node_sweeps,node_sweep_helpers,node_result_comparison toneMint
class node_track_plots,node_curvature_plots,node_inset_plot toneRose
class node_user toneIndigo
```

## Components

### Trajectory data

- **Trajectory MAT input**
- [Synthetic generator](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/create_synthetic_trajectories.m): `create_synthetic_trajectories.m`
- **Synthetic tracks**
- **Real tracks**
- **Curvature results**
- [Known curvature](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/getTrueCurvature.m): `getTrueCurvature.m`

### Curvature analysis

- [Track analyzer](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/analyzeAllTracks.m): `analyzeAllTracks.m`
- **Curvature estimators**
- [Circle fitting](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/curvature_estimation_leastSquaresCircle.m): `curvature_estimation_leastSquaresCircle.m`
- [Tangent angle](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/curvatureEstimationTangentAngle.m): `curvatureEstimationTangentAngle.m`
- [Finite differences](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/curvature_estimation_centralDiff.m): `curvature_estimation_centralDiff.m`
- [Local polynomial](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/curvature_estimation_localPoly.m): `curvature_estimation_localPoly.m`
- [Spline methods](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/curvature_estimation_splineDerivative.m): `curvature_estimation_splineDerivative.m`
- [Spline smoothing](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/smoothTrajectorySpline.m): `smoothTrajectorySpline.m`
- [Curvature smoothing](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/smoothCurvature.m): `smoothCurvature.m`

### Validation and tuning

- [Ground-truth comparison](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/groundTruthComparison.m): `groundTruthComparison.m`
- [Edge trimming](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/edgeTrimPercent.m): `edgeTrimPercent.m`
- [Parameter sweeps](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/run_sweep_tests.m): `run_sweep_tests.m`
- [Sweep helpers](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/sweep_localPoly.m): `sweep_localPoly.m`
- [Result-file comparison](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/compareCurvatureVariationAcrossResultFiles.m): `compareCurvatureVariationAcrossResultFiles.m`

### Visualization

- [Trajectory plots](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/Plot_Trajectories.m): `Plot_Trajectories.m`
- [Comparative plots](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/plotTrackByIndexComparative.m): `plotTrackByIndexComparative.m`
- [Track inset plot](https://github.com/yaman-ajaj/curvature_estimation_bacterianearsurface_complete/blob/main/PlotWithInset.m): `PlotWithInset.m`

### Other components

- **Researcher**

## Connections

- Researcher → Synthetic generator: runs
- Synthetic generator → Synthetic tracks: writes clean and noisy
- Researcher → Track analyzer: selects method
- Trajectory MAT input → Track analyzer: loads tracks
- Track analyzer → Curvature estimators: dispatches
- Curvature estimators → Circle fitting: selects
- Curvature estimators → Tangent angle: selects
- Curvature estimators → Finite differences: selects
- Curvature estimators → Local polynomial: selects
- Curvature estimators → Spline methods: selects
- Spline methods → Spline smoothing: smooths path
- Track analyzer → Curvature results: saves
- Researcher → Parameter sweeps: runs tuning
- Parameter sweeps → Sweep helpers: runs grids
- Parameter sweeps → Synthetic tracks: uses noisy tracks
- Parameter sweeps → Known curvature: evaluates against
- Researcher → Ground-truth comparison: runs evaluation
- Ground-truth comparison → Curvature results: loads
- Ground-truth comparison → Known curvature: compares with
- Ground-truth comparison → Edge trimming: trims edges
- Researcher → Result-file comparison: runs comparison
- Result-file comparison → Curvature results: loads files
- Researcher → Trajectory plots: views tracks
- Trajectory plots → Trajectory MAT input: reads
- Researcher → Comparative plots: views results
- Comparative plots → Curvature results: reads
- Researcher → Track inset plot: views inset
- Track inset plot → Curvature results: reads
