# oakeslab/aft-alignment_by_fourier_transform architecture

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

- Interactive diagram: https://gitdiagram.com/oakeslab/aft-alignment_by_fourier_transform
- Repository: https://github.com/oakeslab/aft-alignment_by_fourier_transform

## Overview

AFT quantifies fibrillar alignment in biological images, with Python and MATLAB implementations. The principal workflow is image input, local Fourier-based orientation estimation, visualization of angle/eccentricity fields, and order-parameter quantification; parameter search helps select analysis scales and compare samples. The Python source excerpt confirms the local computation and order calculation, while the MATLAB modules and notebook workflows are represented from their names and repository documentation; their internal connections are not verified here.

Main entry points: [`Python_implementation/AFT_tools.py`](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py) (Window analysis), [`MATLAB_implementation/parameter_search/AFT_parameter_search_main.m`](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/parameter_search/AFT_parameter_search_main.m) (MATLAB search), [`MATLAB_implementation/AFT_function.m`](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/AFT_function.m) (Alignment analysis), [`Python_implementation/AFT_SingleImage.ipynb`](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_SingleImage.ipynb) (Single image)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_python["Python analysis"]
  node_single["Single image"]
  node_stack["Image stack"]
  node_window["Window analysis<br/>[AFT_tools.py]"]
  node_decomp["Periodic decomposition<br/>[AFT_tools.py]"]
  node_norm["FFT magnitude<br/>[AFT_tools.py]"]
  node_moments["Orientation moments<br/>[AFT_tools.py]"]
  node_maps["Alignment maps<br/>[AFT_tools.py]"]
  node_order["Order parameter<br/>[AFT_tools.py]"]
end

subgraph group_matlab["MATLAB analysis"]
  node_matinput["Input handling<br/>[user_input.m]"]
  node_matbatch["Batch workflow<br/>[AFT_batch.m]"]
  node_matcore["Alignment analysis<br/>[AFT_function.m]"]
  node_matangle["Angle maps<br/>[AFT_anglemat.m]"]
  node_matorder["Order maps<br/>[AFT_ordermat.m]"]
end

subgraph group_search["Scale selection"]
  node_pysearch["Parameter search"]
  node_matsearch["MATLAB search"]
  node_matbatchsearch["Search batches"]
  node_matperiod["Periodic decomposition"]
  node_matplots["Search plots<br/>[plot_order_decay.m]"]
end

node_researcher(("Image analyst"))

node_researcher -.->|"analyzes image"| node_single
node_researcher -.->|"analyzes stack"| node_stack
node_researcher -.->|"selects scales"| node_pysearch
node_single -.->|"runs analysis"| node_window
node_stack -.->|"runs analysis"| node_window
node_window -->|"decomposes windows"| node_decomp
node_window -->|"computes magnitude"| node_norm
node_window -->|"estimates orientation"| node_moments
node_window -->|"produces fields"| node_maps
node_window -.->|"calculates order"| node_order
node_researcher -.->|"provides images"| node_matinput
node_matinput -.->|"passes inputs"| node_matbatch
node_matbatch -.->|"runs analysis"| node_matcore
node_matcore -.->|"produces angles"| node_matangle
node_matcore -.->|"produces order"| node_matorder
node_researcher -.->|"selects scales"| node_matsearch
node_matsearch -.->|"searches batches"| node_matbatchsearch
node_matsearch -.->|"decomposes images"| node_matperiod
node_matsearch -.->|"plots decay"| node_matplots

click node_single "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_SingleImage.ipynb"
click node_stack "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_ImageStack.ipynb"
click node_window "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py"
click node_decomp "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py"
click node_norm "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py"
click node_moments "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py"
click node_maps "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py"
click node_order "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py"
click node_pysearch "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_Parameter_Search.ipynb"
click node_matinput "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/user_input.m"
click node_matbatch "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/AFT_batch.m"
click node_matcore "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/AFT_function.m"
click node_matangle "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/AFT_anglemat.m"
click node_matorder "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/AFT_ordermat.m"
click node_matsearch "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/parameter_search/AFT_parameter_search_main.m"
click node_matbatchsearch "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/parameter_search/AFT_batch_parameter_search.m"
click node_matperiod "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/parameter_search/periodic_decomposition.m"
click node_matplots "https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/parameter_search/plot_order_decay.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_single,node_stack,node_window,node_decomp,node_norm,node_moments,node_maps,node_order toneBlue
class node_matinput,node_matbatch,node_matcore,node_matangle,node_matorder toneAmber
class node_pysearch,node_matsearch,node_matbatchsearch,node_matperiod,node_matplots toneMint
class node_researcher toneIndigo
```

## Components

### Python analysis

- [Single image](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_SingleImage.ipynb): `Python_implementation/AFT_SingleImage.ipynb`
- [Image stack](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_ImageStack.ipynb): `Python_implementation/AFT_ImageStack.ipynb`
- [Window analysis](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py): `Python_implementation/AFT_tools.py`
- [Periodic decomposition](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py): `Python_implementation/AFT_tools.py`
- [FFT magnitude](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py): `Python_implementation/AFT_tools.py`
- [Orientation moments](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py): `Python_implementation/AFT_tools.py`
- [Alignment maps](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py): `Python_implementation/AFT_tools.py`
- [Order parameter](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_tools.py): `Python_implementation/AFT_tools.py`

### MATLAB analysis

- [Input handling](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/user_input.m): `MATLAB_implementation/user_input.m`
- [Batch workflow](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/AFT_batch.m): `MATLAB_implementation/AFT_batch.m`
- [Alignment analysis](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/AFT_function.m): `MATLAB_implementation/AFT_function.m`
- [Angle maps](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/AFT_anglemat.m): `MATLAB_implementation/AFT_anglemat.m`
- [Order maps](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/AFT_ordermat.m): `MATLAB_implementation/AFT_ordermat.m`

### Scale selection

- [Parameter search](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/Python_implementation/AFT_Parameter_Search.ipynb): `Python_implementation/AFT_Parameter_Search.ipynb`
- [MATLAB search](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/parameter_search/AFT_parameter_search_main.m): `MATLAB_implementation/parameter_search/AFT_parameter_search_main.m`
- [Search batches](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/parameter_search/AFT_batch_parameter_search.m): `MATLAB_implementation/parameter_search/AFT_batch_parameter_search.m`
- [Periodic decomposition](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/parameter_search/periodic_decomposition.m): `MATLAB_implementation/parameter_search/periodic_decomposition.m`
- [Search plots](https://github.com/oakeslab/aft-alignment_by_fourier_transform/blob/master/MATLAB_implementation/parameter_search/plot_order_decay.m): `MATLAB_implementation/parameter_search/plot_order_decay.m`

### Other components

- **Image analyst**

## Connections

- Image analyst → Single image: analyzes image
- Image analyst → Image stack: analyzes stack
- Image analyst → Parameter search: selects scales
- Single image → Window analysis: runs analysis
- Image stack → Window analysis: runs analysis
- Window analysis → Periodic decomposition: decomposes windows (evidence: `Python_implementation/AFT_tools.py`)
- Window analysis → FFT magnitude: computes magnitude (evidence: `Python_implementation/AFT_tools.py`)
- Window analysis → Orientation moments: estimates orientation (evidence: `Python_implementation/AFT_tools.py`)
- Window analysis → Alignment maps: produces fields (evidence: `Python_implementation/AFT_tools.py`)
- Window analysis → Order parameter: calculates order (evidence: `Python_implementation/AFT_tools.py`)
- Image analyst → Input handling: provides images
- Input handling → Batch workflow: passes inputs
- Batch workflow → Alignment analysis: runs analysis
- Alignment analysis → Angle maps: produces angles
- Alignment analysis → Order maps: produces order
- Image analyst → MATLAB search: selects scales
- MATLAB search → Search batches: searches batches
- MATLAB search → Periodic decomposition: decomposes images
- MATLAB search → Search plots: plots decay
