Repository navigation
Figures and Reports
golgi turns any study into publication-grade figures and a single multi-page PDF report, from the same registry of plots the GUI shows. Everything is exportable per-panel, in bulk, or as a report.
Source: golgi/figures/ — registry.py (catalog), export.py (presets/formats), report.py
(PDF), render3d.py (off-screen 3-D capture), plus the per-figure builders.
registry.py is the single source of truth for "what figures exist in this project right now."
Each entry (FigureSpec) has an id, title, category, and a source — either a 2-D plotly
figure or an off-screen 3-D render variant — and an availability predicate so only computable
figures are offered. Categories span the pipeline:
| Category | Examples |
|---|---|
| Mesh | surface-quality and tet-quality histograms |
| FEM | axis-line Vₑ, slice Vₑ, activating function, impedance bars |
| Single fiber | pulse, propagation, waterfall, CNAP |
| Population | diameter KDE, cross-section recruitment, propagation, CNAP |
| Conductivity | Cole–Cole σ(f) |
| Sweep | recruitment curve, threshold-vs-diameter, activation heatmap |
| Selectivity | Veraart-SI bars |
| 3-D renders | electrode, mesh (per region), fibers, FEM field, Vₑ on endo/epi/fibers, E-field streamlines, cuff zooms |
The 3-D variants render off-screen with a caller-supplied camera so all variants of a category share one viewpoint.
export.py defines export presets (e.g. screen and publication at higher DPI with serif
fonts) and renders to PNG, PDF, SVG, EPS, JPG for figures and CSV for the underlying data.
Colour-blind-safe palettes are available (cividis-based viridis-cb, the ibm-cb 5-colour palette,
and a grayscale fallback) so output is accessible by default.
Three ways to export:
- Per-panel — an export button beside each plot (format + preset popover) → a single file.
-
Bulk — the Export figures drawer: pick a format + preset, tick figures by category, and
Export to ZIP (figures + a
data/folder of CSVs). - Report — see below.
Export ▸ Export report opens the Generate Report dialog. You tick which sections to include; golgi assembles a single multi-page PDF with:
- Cover — project name, timestamp, author, golgi version, and mesh/FEM hashes.
- Table of contents.
- Per-domain sections (optional) — electrode design, mesh (with quality histogram), fiber trajectories (branch summary), FEM (axis/slice/activating-function), single-fiber, population, and sweep, each with a 3-D snapshot and the relevant figures + parameter tables.
- Auto-included appendices — the conductivity table + σ(f) plot, a reproducibility appendix (hashes + frozen requirements + active config files), a bibliography (citations from the active population preset), and an audit excerpt.
Because the report captures the 3-D viewport once, position the camera before generating. All output respects the chosen export preset.
Recruitment Sweeps & Selectivity · Reproducible Study Bundles · GUI Walkthrough · Reproducing the Paper
golgi · open image-to-recruitment modeling of peripheral nerve stimulation · repository · issues · AGPL-3.0-or-later · data CC-BY-4.0
Get started
Tutorial
Build a model
Simulate & analyze
- Finite-Element Solver
- Fiber Populations & Trajectories
- Fiber Models & Activation
- Recruitment Sweeps & Selectivity
- Recording & CNAP
Share & reproduce
Scripting & scale
Reference
Research & project