All Tools
Behavior · Fiber Photometry

EthoTrace

Behavioral annotation and fiber-photometry analysis in one offline browser environment. Score bouts directly on the video timeline, and the same event definitions drive event alignment, figures, and statistical testing on the ΔF/F computed in the same environment, with no export step in between.

Launch EthoTrace Download (single HTML file) Runs offline: no install, no upload, no server
Henry Oo
Developed by Henry Oo, with Dr. Can Tao & Dr. Guang-Wei Zhang. See the team page →

What it does

Relating neural activity to natural behavior is a chain of decisions: an experimenter defines when a behavior starts and stops, neural activity is aligned to that event, and measurements from the aligned signal support a statistical inference. These steps usually live in separate programs, with behavioral events exported from an annotation tool and re-imported into a photometry script. That hand-off is where errors enter without announcing themselves: an assumed frame rate or a misaligned export shifts every event in time, and no downstream script will object.

EthoTrace keeps behavioral annotation and fiber-photometry analysis in one computational context. The video and the fluorescence record are opened together from a single session folder, and a bout marked on the video is the same object that is aligned, plotted, and tested. The whole application is one self-contained HTML file in plain JavaScript that runs in the browser on your own computer. There is no package to install, no Python or MATLAB runtime, no server, and no account, and your data are never uploaded.

Session foldervideo + Fluorescence.csv
Annotatebouts on the video timeline
ΔF/Fisosbestic-corrected
Aligntrials, heat maps, mean ± SEM
Statisticswith the test decision kept

How it works

1

One folder, one timeline

Open a session folder containing the behavioral video (MP4) and the photometry file exported by the acquisition software (Fluorescence.csv: a configuration line, a header row, then one row per sample with a millisecond timestamp and paired 410-nm and 470-nm values). Both streams are loaded onto one timeline. Behavior is scored on a frame grid whose rate you set (30 frames/s by default), independently of the video's native frame rate. The analyses place photometry samples by their own timestamps rather than by frame index; the trace drawn under the video while annotating is a navigation aid spread evenly across the video's length. Annotations and analysis settings (analysis_settings.json) are written back into the same folder as plain files, so each session carries its own analysis configuration alongside its raw data.

2

Annotate on the synchronized timeline

The video plays above the ΔF/F trace and the behavior track, all sharing one zoom window, so signal and behavior are navigated together. Five categories sit on keys 1–5 (pup retrieval, nest-based care, pup approaching, pup investigation, and out of nest), and a bout is marked by pressing I at its first frame and O at its last.

  • Bouts occupy one exclusive track, so no frame can carry two labels. They can be relabeled, resized, or deleted, with undo.
  • Annotations save automatically as a human-readable JSON file listing each bout's inclusive frame range and category.
  • Any bout can be exported as a video clip for inspection, or for training an automated classifier elsewhere.
  • The ΔF/F trace can be hidden so that scoring stays blind to the signal.
3

Photometry processing · the baseline convention, stated

The 470-nm signal is regressed on the 410-nm isosbestic channel by ordinary least squares across the whole session. The baseline is the fitted control offset by the 10th percentile of the regression residuals, and the resulting ΔF/F is smoothed with a Savitzky–Golay filter (11-sample window, cubic). No other detrending, z-scoring, or per-trial baseline subtraction is applied.

The Annotate tab shows a fast display ΔF/F (baseline = fitted control) for navigation; every reported number uses the analysis ΔF/F defined above. Keeping the two explicitly separate avoids treating a trace read off the annotation screen as the analyzed signal. (If a session has only a precomputed ΔF/F and no raw Fluorescence.csv, the analysis runs on that trace and the report warns that the baseline convention and timing differ.)

4

Individual events, then aligned averages

A bout becomes an analysis object as soon as it is marked. Every retrieval is drawn as its own trial, from 5 s before to 10 s after onset, with neighboring bouts shaded by behavior. When behaviors occur as a stereotyped sequence, a signal change near onset may belong to the scored behavior or to what immediately preceded it. Drawing each trial in its own behavioral context makes that ambiguity visible on the trial itself, which an average across trials cannot.

Repeated bouts of each of the four pup-directed behaviors (approach, investigation, retrieval, and nest-based care) are then aligned to their own onsets and shown as a heat map (longest bout first, one shared color scale) with the mean ± SEM beneath. Each bout keeps its full observed duration. Where an aligned window extends beyond a bout's available data, the cells are left empty rather than padded, held, or extrapolated: they appear hatched, and the mean is drawn dashed wherever fewer than half the bouts contribute, so declining data coverage is visible in the figure.

5

Statistics, with the decision retained

Every bout enters the statistics as an individual observation, and the test for each comparison is selected from assumption checks computed on the values being compared:

  • Before vs. after onset: each bout contributes its mean ΔF/F over a window before onset and a window after onset (bouts that do not cover both windows are excluded). A Shapiro–Wilk test on the paired differences selects a paired t-test or a Wilcoxon signed-rank test.
  • Between behaviors: each bout is reduced to the mean of its analysis ΔF/F from onset to offset and shown as an individual point on a box plot. Shapiro–Wilk tests on each group and a median-centered Levene's test select Student's t-test, Welch's t-test, or the Mann–Whitney U test.
  • When a deciding assumption test returns P between 0.04 and 0.06, the choice is flagged as marginal and the P value of the test not selected is reported alongside it.
  • Selection can instead be forced to parametric or nonparametric for a session, and the forced choice is recorded.

Tests are two-sided at α = 0.05, each with an effect size and a 95% confidence interval of the mean difference, and a Holm correction can be applied across the comparisons on a panel (on by default in the current build). The Stats .txt button saves a plain-text report listing every assumption check, every test, and every excluded bout, and figures export as PDF, PNG, or SVG.

Checked against NumPy and SciPy

The ΔF/F computation and statistical tests are dependency-free JavaScript reimplementations, so the build described in the manuscript (23 September 2026) was verified against SciPy 1.17.1 and NumPy 2.4.3. Across six other recording sessions (against an in-house Python reference implementation) and synthetic inputs (against SciPy directly), including 488 two-sample comparisons with ties and unequal group sizes, P values agreed within 2 × 10−13 relative error for the t, Wilcoxon signed-rank, Levene, and Mann–Whitney tests, and within 6 × 10−9 absolute error for Shapiro–Wilk. In the demonstration session, all seven P values agreed within 10−14 relative error with the same tests selected, and the analysis ΔF/F agreed with the NumPy/SciPy computation within 6 × 10−16.

This agreement is a property of that build, not a guarantee for later builds.

The workflow is demonstrated in the manuscript on a 26.4-min pup-retrieval session in a Vgat-Cre dam, following 72 annotated bouts of approach, investigation, retrieval, and nest-based care from their defining video frames through neural alignment to statistical comparison.

Scope

EthoTrace complements, rather than replaces, dedicated photometry packages and behavioral event loggers. It analyzes one session at a time with the bout as the unit of analysis, so its tests describe a session rather than a population; comparisons across animals belong in whatever analysis consumes its exported values. It does not detect transients or batch-process sessions, and the current build scores five fixed category slots (which can be renamed) for one animal on a single track. Synchronization assumes that video and photometry start together, with photometry timestamps starting at zero at the video's first frame, so hardware (TTL) synchronization should be used where available.

Highlights

Offline: no install, no upload, no server One self-contained HTML file Annotation and analysis on one timeline Missing data left empty, never extrapolated Test-selection decisions recorded Checked against NumPy/SciPy (manuscript build)

Quick start

  1. Use a desktop Chrome or Edge browser (EthoTrace reads and writes your session folder through the browser's File System Access API).
  2. Click Launch EthoTrace, or download the single HTML file and open it locally.
  3. Click Open Video Folder and choose a session folder with the MP4 video and its Fluorescence.csv. Annotations auto-save next to the video. (You can also drop the files onto the page and save manually.)
  4. Mark bouts in the Annotate tab, then open the Analysis tab for the aligned figures and statistics.

Questions, data, and source

The session data supporting the manuscript will be posted on this page. The tool is also available from the corresponding authors on request: guangwei.zhang@vcuhealth.org and can.tao@vcuhealth.org.

Reference. Oo H, Tao C*, Zhang G-W*. EthoTrace: from behaviour to neural dynamics in a unified analysis framework. Manuscript in preparation, 2026. *Corresponding authors.

Department of Neuroscience and Anatomy, School of Medicine, Virginia Commonwealth University.