Repository navigation
Getting Started
This page runs your first end-to-end study two ways — by script and in the GUI — and points you to the deeper pages for each stage. If you haven't installed golgi yet, do Installation first.
The fastest way to see the whole pipeline is the bundled example, which runs on a built-in synthetic nerve (no data needed):
python examples/recruitment_sweep.pyIt loads a nerve, meshes it, places a bipolar cuff, solves the anisotropic field, generates fiber trajectories, sweeps stimulus amplitude, writes a recruitment-curve PNG, and exports a reproducible study bundle. To run on your own surface:
python examples/recruitment_sweep.py --nerve /path/to/nerve.stl --project ./my_studyimport golgi
from golgi.jobs.schemas import SweepRequest
s = golgi.Study.create("vagus_study") # a project dir on disk
s.import_nerve("nerve.stl") # 1. load a surface (STL/NAS/OBJ, mm)
s.set_mesh(use_epi=True, perineurium_ci=True) # 2a. mesh + material options
s.set_electrodes([{ # 2b. design a cuff
"name": "Bipolar @ centre",
"electrode_type": "bipolar ring-pair",
"cuff_anchor": "centroid",
}])
s.run_mesh() # 3. multi-region TetGen mesh
s.run_fem() # 4. anisotropic FEM (lead fields)
s.set_fiber_seed(n_fibers=100,
fiber_method="streamlines") # 5a. fiber-generation params
s.run_fibers() # 5b. curved 3-D trajectories
result = s.run_sweep(SweepRequest( # 6. recruitment across amplitude
mode="recruitment",
amplitudes_mA=[0.1, 0.25, 0.5, 1.0, 2.0]))
s.export_bundle("vagus_study.golgi") # 7. hashed, replayable bundle
s.close()Each numbered step maps to a pipeline stage and a wiki page:
| Step | Method | Learn more |
|---|---|---|
| 1 | import_nerve |
Geometry Import & Segmentation |
| 2a | set_mesh |
Meshing · Conductivity & Tissue Properties |
| 2b | set_electrodes |
Electrodes & Cuff Designer |
| 4 | run_fem |
Finite-Element Solver |
| 5 | run_fibers |
Fiber Populations & Trajectories |
| 6 | run_sweep |
Recruitment Sweeps & Selectivity · Fiber Models & Activation |
| 7 | export_bundle |
Reproducible Study Bundles |
Full method reference: Python API.
golgi replay vagus_study.golgi # byte-for-byte reproducibility checkHand that one file to a colleague; golgi import + golgi replay reconstitutes and verifies the
whole study. See Command-Line Interface.
golgi # open the printed local URL in a browserThen work top to bottom through the navbar:
- Sign in / Create project on the welcome screen.
- File ▸ Import Nerve — a 4-step wizard: Load nerve → Endoneurium → Fibers → Muscle. (Or File ▸ Segment µCT slice… to segment an image first.)
- Designs — add a cuff, pick an electrode type, set per-contact polarities (or open the Cuff Designer for ASCENT-style presets).
- Mesh — set per-region element sizes and Build mesh (TetGen).
- Materials — set tissue conductivities (with the Cole–Cole evaluator) and Update.
- Simulate ▸ Extracellular field (FEM) — pick a solver preset and Run FEM solve.
- Simulate ▸ Single fiber / Fiber population / Sweep — compute thresholds and recruitment.
- Export ▸ Export figures / Export report, and File ▸ Export study to share.
The complete tour, with every panel and control, is in the GUI Walkthrough.
Because the GUI and API share the same on-disk
Studystate, you can build a project in the browser and continue it from a script — or vice-versa.
- Understand the model → Pipeline Overview
- Design electrodes → Electrodes & Cuff Designer
- Scale up → Headless / HPC
- Reproduce the paper → Reproducing the Paper
- Hit a snag → Troubleshooting & FAQ
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