Skip to content

Latest commit

 

History

History
91 lines (61 loc) · 3.18 KB

File metadata and controls

91 lines (61 loc) · 3.18 KB

NDI-python Tutorials

Prerequisites

Installation

From the NDI-python repository root:

python -m venv venv
source venv/bin/activate   # Linux/macOS
# venv\Scripts\activate    # Windows

python ndi_install.py

This single command clones all dependencies, installs packages, and validates your setup. Run python -m ndi check at any time to re-verify.

Cloud Credentials

Tutorials download datasets from NDI Cloud on first run. Set your credentials via environment variables:

export NDI_CLOUD_USERNAME="your-email@example.com"
export NDI_CLOUD_PASSWORD="your-password"

Or edit the NDI_CLOUD_USERNAME / NDI_CLOUD_PASSWORD variables at the top of each tutorial script.

Available Tutorials

Dabrowska — Rat Electrophysiology & Optogenetic Stimulation

Jess Haley — C. elegans Behavior & E. coli Fluorescence

Each tutorial generates an HTML file in the tutorials/ directory with tables, plots, and analysis results.

Tip: Start with the Dabrowska tutorial first — it's faster and a good way to verify your setup before running the larger Jess Haley dataset.

Notes

  • Virtual environment required. The installer writes a .pth file into your venv's site-packages. Running without a venv may require elevated permissions and is not recommended.
  • Disk space. The Jess Haley dataset is ~16 GB. Make sure you have enough free space under ~/Documents/MATLAB/Datasets/.
  • Dataset storage location. Downloaded datasets are saved to ~/Documents/MATLAB/Datasets/ (matching the MATLAB tutorial convention). This directory is created automatically on first download.
  • Tested on macOS. Linux should work. Windows is untested — please report any issues.

Troubleshooting

ModuleNotFoundError: No module named 'vlt'

vhlab-toolbox-python is not on PyPI. Run python ndi_install.py or manually clone:

git clone https://github.com/VH-Lab/vhlab-toolbox-python.git ~/.ndi/tools/vhlab-toolbox-python

Cannot find NDI root directory

Set the NDI_ROOT environment variable to your NDI-python repo directory, or run scripts from within the repo.

Download takes a long time

The Jess Haley dataset has ~78,700 documents and takes about an hour on first download. Subsequent runs load from the local cache instantly.

Cloud API timeout errors (HTTP 504)

Large dataset operations may hit the 30-second API timeout. The client retries automatically (2 retries with backoff). If errors persist, try again later.