# dynamo-inserm/pyfmlab_dynamo architecture

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

- Interactive diagram: https://gitdiagram.com/dynamo-inserm/pyfmlab_dynamo
- Repository: https://github.com/dynamo-inserm/pyfmlab_dynamo
- Video tour (about a minute): https://gitdiagram.com/dynamo-inserm/pyfmlab_dynamo/video

## Overview

PyFMlab is an AFM data-analysis application for extracting viscoelastic parameters from force-distance and microrheology measurements. The user workflow starts in the PyQt GUI, loads and preprocesses AFM files, runs selected analyses, and views or exports results. Its three documented libraries divide responsibilities among GUI, data handling, and rheology. The source index supports several key calls; other format-specific readers and GUI features are represented at subsystem level where their implementation was not sampled.

Main entry points: [`PyFMGUI_DyNaMo/src/pyfmgui/main_window.py`](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/main_window.py) (Main window), [`PyFMGUI_DyNaMo/src/pyfmgui/compute.py`](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/compute.py) (Analysis dispatch), [`PyFMGUI_DyNaMo/src/main.py`](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/main.py) (Application entry), [`PyFMGUI_DyNaMo/src/pyfmgui/widgets`](https://github.com/dynamo-inserm/pyfmlab_dynamo/tree/main/PyFMGUI_DyNaMo/src/pyfmgui/widgets) (Analysis widgets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gui["Desktop GUI"]
  node_app["Application entry<br/>[main.py]"]
  node_window["Main window<br/>[main_window.py]"]
  node_session["Session state<br/>[session.py]"]
  node_fileload["File loading<br/>[loadfiles.py]"]
  node_params["Analysis parameters<br/>[const.py]"]
  node_analysisui["Analysis widgets"]
  node_exportui["Export dialog<br/>[exportdialog.py]"]
  node_export["Result export<br/>[export.py]"]
  node_compute["Analysis dispatch<br/>[compute.py]"]
end

subgraph group_reader["AFM Data"]
  node_readerapi["Reader interface<br/>[pyfmreader.py]"]
  node_formats["AFM format readers"]
  node_uff["UFF import and save<br/>[uff.py]"]
  node_curve["Force curves<br/>[forcecurve.py]"]
  node_segment["Curve segments<br/>[segment.py]"]
end

subgraph group_analysis["Rheology Analysis"]
  node_routines["Analysis routines"]
  node_hertz["Hertz fitting<br/>[HertzFit.py]"]
  node_micro["Microrheology sine"]
  node_drag["Viscous drag"]
  node_signals["Signal processing"]
  node_rheologymodel["Rheology models<br/>[rheology.py]"]
end

node_user(("AFM analyst"))

node_user -->|"launches"| node_app
node_app -->|"creates"| node_window
node_app -->|"creates"| node_session
node_window -->|"uses"| node_session
node_window -->|"invokes"| node_fileload
node_window -->|"opens"| node_analysisui
node_window -->|"opens"| node_exportui
node_fileload -.->|"loads data"| node_readerapi
node_readerapi -.->|"dispatches"| node_formats
node_uff -->|"loads formats"| node_formats
node_formats -->|"builds curves"| node_curve
node_curve -->|"preprocesses"| node_segment
node_analysisui -.->|"configures"| node_params
node_analysisui -->|"requests analysis"| node_compute
node_compute -->|"dispatches"| node_hertz
node_compute -->|"dispatches"| node_micro
node_compute -->|"dispatches"| node_drag
node_micro -->|"calls"| node_hertz
node_micro -->|"detrends"| node_signals
node_drag -->|"detrends"| node_signals
node_drag -->|"computes with"| node_rheologymodel
node_compute -->|"dispatches"| node_routines
node_exportui -.->|"initiates export"| node_export
node_export -->|"uses reader data"| node_readerapi

click node_app "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/main.py"
click node_window "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/main_window.py"
click node_session "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/session.py"
click node_fileload "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/loadfiles.py"
click node_params "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/const.py"
click node_analysisui "https://github.com/dynamo-inserm/pyfmlab_dynamo/tree/main/PyFMGUI_DyNaMo/src/pyfmgui/widgets"
click node_exportui "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/widgets/exportdialog.py"
click node_export "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/export.py"
click node_compute "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/compute.py"
click node_readerapi "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMReader_DyNaMo/src/pyfmreader/pyfmreader.py"
click node_formats "https://github.com/dynamo-inserm/pyfmlab_dynamo/tree/main/PyFMReader_DyNaMo/src/pyfmreader"
click node_uff "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMReader_DyNaMo/src/pyfmreader/uff.py"
click node_curve "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMReader_DyNaMo/src/pyfmreader/utils/forcecurve.py"
click node_segment "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMReader_DyNaMo/src/pyfmreader/utils/segment.py"
click node_routines "https://github.com/dynamo-inserm/pyfmlab_dynamo/tree/main/PyFMRheo_DyNaMo/src/pyfmrheo/routines"
click node_hertz "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMRheo_DyNaMo/src/pyfmrheo/routines/HertzFit.py"
click node_micro "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMRheo_DyNaMo/src/pyfmrheo/routines/MicrorheologySine.py"
click node_drag "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMRheo_DyNaMo/src/pyfmrheo/routines/ViscousDragSteps.py"
click node_signals "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMRheo_DyNaMo/src/pyfmrheo/utils/signal_processing.py"
click node_rheologymodel "https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMRheo_DyNaMo/src/pyfmrheo/models/rheology.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_app,node_window,node_session,node_fileload,node_params,node_analysisui,node_exportui,node_export,node_compute toneBlue
class node_readerapi,node_formats,node_uff,node_curve,node_segment toneAmber
class node_routines,node_hertz,node_micro,node_drag,node_signals,node_rheologymodel toneMint
class node_user toneIndigo
```

## Components

### Desktop GUI

- [Application entry](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/main.py): `PyFMGUI_DyNaMo/src/main.py`
- [Main window](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/main_window.py): `PyFMGUI_DyNaMo/src/pyfmgui/main_window.py`
- [Session state](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/session.py): `PyFMGUI_DyNaMo/src/pyfmgui/session.py`
- [File loading](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/loadfiles.py): `PyFMGUI_DyNaMo/src/pyfmgui/loadfiles.py`
- [Analysis parameters](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/const.py): `PyFMGUI_DyNaMo/src/pyfmgui/const.py`
- [Analysis widgets](https://github.com/dynamo-inserm/pyfmlab_dynamo/tree/main/PyFMGUI_DyNaMo/src/pyfmgui/widgets): `PyFMGUI_DyNaMo/src/pyfmgui/widgets`
- [Export dialog](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/widgets/exportdialog.py): `PyFMGUI_DyNaMo/src/pyfmgui/widgets/exportdialog.py`
- [Result export](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/export.py): `PyFMGUI_DyNaMo/src/pyfmgui/export.py`
- [Analysis dispatch](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMGUI_DyNaMo/src/pyfmgui/compute.py): `PyFMGUI_DyNaMo/src/pyfmgui/compute.py`

### AFM Data

- [Reader interface](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMReader_DyNaMo/src/pyfmreader/pyfmreader.py): `PyFMReader_DyNaMo/src/pyfmreader/pyfmreader.py`
- [AFM format readers](https://github.com/dynamo-inserm/pyfmlab_dynamo/tree/main/PyFMReader_DyNaMo/src/pyfmreader): `PyFMReader_DyNaMo/src/pyfmreader`
- [UFF import and save](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMReader_DyNaMo/src/pyfmreader/uff.py): `PyFMReader_DyNaMo/src/pyfmreader/uff.py`
- [Force curves](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMReader_DyNaMo/src/pyfmreader/utils/forcecurve.py): `PyFMReader_DyNaMo/src/pyfmreader/utils/forcecurve.py`
- [Curve segments](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMReader_DyNaMo/src/pyfmreader/utils/segment.py): `PyFMReader_DyNaMo/src/pyfmreader/utils/segment.py`

### Rheology Analysis

- [Analysis routines](https://github.com/dynamo-inserm/pyfmlab_dynamo/tree/main/PyFMRheo_DyNaMo/src/pyfmrheo/routines): `PyFMRheo_DyNaMo/src/pyfmrheo/routines`
- [Hertz fitting](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMRheo_DyNaMo/src/pyfmrheo/routines/HertzFit.py): `PyFMRheo_DyNaMo/src/pyfmrheo/routines/HertzFit.py`
- [Microrheology sine](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMRheo_DyNaMo/src/pyfmrheo/routines/MicrorheologySine.py): `PyFMRheo_DyNaMo/src/pyfmrheo/routines/MicrorheologySine.py`
- [Viscous drag](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMRheo_DyNaMo/src/pyfmrheo/routines/ViscousDragSteps.py): `PyFMRheo_DyNaMo/src/pyfmrheo/routines/ViscousDragSteps.py`
- [Signal processing](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMRheo_DyNaMo/src/pyfmrheo/utils/signal_processing.py): `PyFMRheo_DyNaMo/src/pyfmrheo/utils/signal_processing.py`
- [Rheology models](https://github.com/dynamo-inserm/pyfmlab_dynamo/blob/main/PyFMRheo_DyNaMo/src/pyfmrheo/models/rheology.py): `PyFMRheo_DyNaMo/src/pyfmrheo/models/rheology.py`

### Other components

- **AFM analyst**

## Connections

- AFM analyst → Application entry: launches
- Application entry → Main window: creates (evidence: `PyFMGUI_DyNaMo/src/main.py`)
- Application entry → Session state: creates (evidence: `PyFMGUI_DyNaMo/src/main.py`)
- Main window → Session state: uses (evidence: `PyFMGUI_DyNaMo/src/pyfmgui/main_window.py`)
- Main window → File loading: invokes (evidence: `PyFMGUI_DyNaMo/src/pyfmgui/main_window.py`)
- Main window → Analysis widgets: opens (evidence: `PyFMGUI_DyNaMo/src/pyfmgui/main_window.py`)
- Main window → Export dialog: opens (evidence: `PyFMGUI_DyNaMo/src/pyfmgui/main_window.py`)
- File loading → Reader interface: loads data
- Reader interface → AFM format readers: dispatches (evidence: `PyFMReader_DyNaMo/src/pyfmreader/jpk/loadjpkimg.py`)
- UFF import and save → AFM format readers: loads formats (evidence: `PyFMReader_DyNaMo/src/pyfmreader/uff.py`)
- AFM format readers → Force curves: builds curves (evidence: `PyFMReader_DyNaMo/src/pyfmreader/ardf/loadARDFcurve.py`)
- Force curves → Curve segments: preprocesses (evidence: `PyFMReader_DyNaMo/src/pyfmreader/utils/forcecurve.py`)
- Analysis widgets → Analysis parameters: configures (evidence: `PyFMGUI_DyNaMo/src/pyfmgui/widgets/vdrag_widget.py`)
- Analysis widgets → Analysis dispatch: requests analysis (evidence: `PyFMGUI_DyNaMo/src/pyfmgui/widgets/microrheo_widget.py`)
- Analysis dispatch → Hertz fitting: dispatches (evidence: `PyFMGUI_DyNaMo/src/pyfmgui/compute.py`)
- Analysis dispatch → Microrheology sine: dispatches (evidence: `PyFMGUI_DyNaMo/src/pyfmgui/compute.py`)
- Analysis dispatch → Viscous drag: dispatches (evidence: `PyFMGUI_DyNaMo/src/pyfmgui/compute.py`)
- Microrheology sine → Hertz fitting: calls (evidence: `PyFMRheo_DyNaMo/src/pyfmrheo/routines/MicrorheologySine.py`)
- Microrheology sine → Signal processing: detrends (evidence: `PyFMRheo_DyNaMo/src/pyfmrheo/routines/MicrorheologySine.py`)
- Viscous drag → Signal processing: detrends (evidence: `PyFMRheo_DyNaMo/src/pyfmrheo/routines/ViscousDragSteps.py`)
- Viscous drag → Rheology models: computes with (evidence: `PyFMRheo_DyNaMo/src/pyfmrheo/routines/ViscousDragSteps.py`)
- Analysis dispatch → Analysis routines: dispatches (evidence: `PyFMGUI_DyNaMo/src/pyfmgui/compute.py`)
- Export dialog → Result export: initiates export
- Result export → Reader interface: uses reader data (evidence: `PyFMGUI_DyNaMo/src/pyfmgui/export.py`)
