Commit graph

8 commits

Author SHA1 Message Date
5d50c8baaf Picker: relabel "bad ROIs" → "only ROIs" in user-facing strings
Both the annotation-bar tooltip and the post-submit flash message
now show the positive sense ("only ROIs 2,4,6") instead of the
negative ("bad ROIs 1,3,5"). The CSV column stays bad_rois — the
flip is purely cosmetic.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 14:33:11 +01:00
d314c02d05 Picker: lighter annotation bar + room below it
Background was nearly black (#181818) which made the bar barely visible
against the page. Switched to mid-grey (#555) so the red mark stands
out and the bar reads as an interactive element.

Added 2rem bottom margin so the tooltip below the mark doesn't crash
into the action buttons. Empty (un-annotated) state collapses to
zero height so it doesn't add space when there's no mark to show.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 14:31:21 +01:00
d0f0e2d443 Picker: render existing annotation as a clickable mark below the video
When a video that already has a barrier_opening row is loaded, a thin
bar now appears below the player with a red vertical line at the
marked opening_s. A tooltip shows the timestamp, the analyst's
initials, and the bad_rois flag. Clicking the line snaps the player
to the exact opening; clicking elsewhere on the bar seeks
proportionally. Bar is hidden for un-annotated videos.

API change: each queue item now carries an `existing` field with the
opening_s, bad_rois, analyst, etc. from barrier_opening.csv when
available, so the frontend can paint the mark without extra requests.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 14:27:33 +01:00
2623df4172 Picker: identify the analyst (initials) per pick
Each annotation row now carries an `analyst` column. On first visit the
web picker shows a small login modal asking for initials, persists them
in localStorage, and shows the badge in the top-right. Click the badge
to change identities. Submissions without initials are rejected by the
backend (HTTP 400). Skip remains analyst-free.

Backfill: every existing barrier_opening.csv row marked as `GG` since
all current picks were done by Giorgio.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 14:23:57 +01:00
12568b82cc Welcome modal + port 8085
Add a dismissable welcome modal that walks first-time users through the
proper annotation sequence (slider to end → check open ROIs → slider to
start → arrow-key fine-tune → click). Stays hidden after the first
"Got it" via localStorage; the ? button in the header reopens it any
time. Picker keyboard shortcuts are inert while the modal is showing.

Container exposes 8085 instead of 8000 (8000 was free, but Giorgio's
preferred 8082 is already in use on this host; 8085 is the closest
free port). Internal port stays 8000 so the FastAPI app is unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 14:15:42 +01:00
3f0760c98e Picker: simpler keyboard shortcuts (±5 s / ±30 s)
Dropped Ctrl+arrow (±0.1 s) and ,/. frame stepping — too fine for
spotting the barrier opening visually. Shift+arrow now jumps ±30 s
instead of ±1 s, which matches how analysts actually navigate (5 s
for fine, 30 s for skipping ahead). Drag the seekbar if you need
sub-second precision.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 14:11:36 +01:00
4ed988a617 Show experimental metadata above the video in the picker
Each video row now carries a `metadata` dict aggregated from the
merged TSV: species, memory (STM/LTM), training_length_hr,
consolidation_length_hr, age, training/testing date-time, and
trained/naive fly counts. The UI renders these as a row of key:value
pills above the video, with the session role (training/testing)
colour-coded so the analyst can see at a glance what they're picking.

The merged TSV currently has duplicate rows per (date, machine, ROI);
the aggregator de-dups on those keys so counts aren't doubled. (The
duplication itself should be cleaned up upstream.)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 12:54:40 +01:00
1a7542def2 Add barrier_picker_app — Dockerised web picker for barrier opening
A FastAPI app + plain HTML5 video page that replaces the matplotlib
picker. Browse to http://host:8000/, scrub through each video with
arrow keys (±5 s, ±1 s with Shift, ±0.1 s with Ctrl, ±1 frame with
,/.), and click one of three buttons:
  - All barriers open      — every ROI usable
  - Upper barrier opens    — ROIs 1,3,5 usable; lower row marked bad
  - Lower barrier opens    — ROIs 2,4,6 usable; upper row marked bad

The current playhead time is recorded as opening_s; bad_rois is set
accordingly. Also keyboard shortcuts (1/2/3 for the three modes,
s/u for skip/unusable). Refresh-safe: every submission persists to
data/metadata/barrier_opening.csv before advancing.

Server uses byte-range streaming so seeking inside long videos is
fast. Dockerfile + docker-compose.yml mount the data volume RO and
the metadata folder RW.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-01 12:33:28 +01:00