Fiber photometry, from raw photons to publishable figures, without leaving the app.
Load it. Clean it. Align it. Model it. Export it. All in one polished desktop GUI.
Photometry analysis usually means duct-taping five scripts together and praying your timestamps line up. pyBer puts the whole pipeline behind one interactive window: artifact cleaning, motion correction, behavior and DIO alignment, sub-millisecond camera-to-fiber synchronization, PSTHs, transient detection, and temporal modeling. Interactive workflow on top, deterministic and testable processing code underneath.
Built for neuroscientists who want to see every step, not just trust a black box.
Raw signal, fitted-isosbestic baseline, and motion-corrected dFF, side by side, with DIO markers laid right over the trace. Filtering, baseline, artifact handling, and export all live in the rail on the left.
Point an ROI at a sync LED in a video, extract the on/off train, or load a reference signal recorded simultaneously, and auto-align with the same signal recorded with photometry.
Install Miniforge or Anaconda first, then:
cd path\to\pyBer
conda env create -f environment.yml
conda activate pyBer
Rscript -e "install.packages('fastFMM', repos='https://cloud.r-project.org')"
python .\pyBer\main.pyThe fastFMM step is only needed for the FLMM temporal modeling panel. Everything
else works without it.
- Open the repository folder in VS Code.
- Select the interpreter from the
pyBerconda environment. - Open
pyBer/main.py. - Press Run, or:
conda activate pyBer
python .\pyBer\main.pyIf VS Code grabs the wrong Python, run Python: Select Interpreter and pick the
environment created from environment.yml.
- 🧹 Preprocess raw traces: filtering, resampling, baseline correction, motion correction, and artifact handling.
- 🔍 Hunt artifacts with interpolation, cutout, local low-pass filtering, or no-op.
- 🎥 Synchronize photometry time to camera or behavior time from shared TTL/barcode
columns, and export a
time_alignedcolumn for downstream work. - 📊 Align to behavior (DIO, behavior states, onsets, or transitions) and build individual or group PSTHs, heatmaps, and event-duration plots.
- ⚡ Detect transients and compare amplitudes with baseline-prominence normalized metrics.
- 🧠 Model with a continuous GLM or trial-level FLMM, then rank feature contribution with leave-one-feature-out summaries.
- 💾 Export processed CSV or HDF5 with stable, self-describing column names and a
.pyber.jsonmetadata sidecar (embedded inside the HDF5), ready for Python, MATLAB, R, or Prism. What you select is what you get, and the exact output definition is always recorded.
The full user guide lives in docs/index.md: installation, first launch, preprocessing, postprocessing, transient detection, temporal modeling, group workflows, export, and troubleshooting.
| Path | What it is |
|---|---|
pyBer/main.py |
Application entry point and preprocessing window. |
pyBer/analysis_core.py |
Preprocessing and signal-processing backend. |
pyBer/gui_preprocessing.py |
Preprocessing panels. |
pyBer/gui_postprocessing.py |
Postprocessing, PSTH, sync, metrics, and export. |
pyBer/led_extract.py |
LED / barcode sync-signal extraction. |
pyBer/time_sync.py |
Edge detection, pairing, and cross-correlation alignment. |
pyBer/temporal_modeling.py |
GLM and FLMM modeling panel. |
environment.yml |
Conda environment for development and user installs. |
pyBer.spec |
PyInstaller build configuration. |
From an activated environment:
conda activate pyBer
python -m PyInstaller --noconfirm --clean pyBer.specThe executable is written to dist/pyBer.exe.
pyBer sets PYTHONNOUSERSITE=1 so stale packages from the user Python folder cannot
shadow the conda environment. This keeps Qt, pyqtgraph, numpy, and rpy2 stable on Windows.
Made with 🧠 and a lot of dFF at the Bellone Lab.


