> ## Documentation Index
> Fetch the complete documentation index at: https://docs.biom.science/llms.txt
> Use this file to discover all available pages before exploring further.

# Annotations

> Draw, label, and annotate your data.

# Annotations

Relay provides a full annotation system for marking up your data with shapes, text, segmentation masks, and comments.

## Annotation types

| Type          | Description                           |
| ------------- | ------------------------------------- |
| **Point**     | Single point marker                   |
| **Line**      | Line segment between two points       |
| **Rectangle** | Rectangular region                    |
| **Circle**    | Circular region                       |
| **Polygon**   | Multi-point closed polygon            |
| **Freehand**  | Freehand drawn shapes                 |
| **Text**      | Text labels at specific positions     |
| **Mask**      | Segmentation masks from model outputs |

All annotations are stored in **world coordinates**, ensuring they stay aligned with the image regardless of zoom or pan.

## Annotation scoping

Annotations can be scoped to:

* **Per Z-slice** — visible only on a specific Z-plane
* **Per time-point** — visible only at a specific time
* **All slices** — visible across the entire Z-stack

## Annotation features

### Styling

* Fill color, stroke color, stroke width, and opacity
* Per-annotation style customization

### Organization

* **Z-order management** — bring to front, send to back, move up/down
* **Per-pane visibility** — the same annotation can be shown or hidden independently per pane
* **Copy across documents** — copy annotations between different files

### Segmentation metadata

Annotations from model outputs (like SAM3) include:

* Instance ID
* Class label
* Confidence score
* Model name that generated the annotation

### Document model

Annotations are organized into **documents** (collections):

* Documents can be scoped to a tab or pane
* Multiple documents per pane, switchable
* Persisted locally in IndexedDB

## Comments

Relay supports threaded comments attached to specific locations in your images:

* **Position-linked** — comments are tied to a specific view state and location
* **Threaded replies** — reply to comments to create discussions
* **Resolve/unresolve** — mark comments as resolved when addressed
* **Per-pane modals** — comment panels are independent per pane
* **Server persistence** — comments sync to the server for shared workspaces
* **Read-only in shares** — viewers can read but not add comments on shared links

## Keypoint labeling

Relay includes a dedicated keypoint annotation workflow designed for creating DeepLabCut training datasets:

* **Session-based** — create labeling sessions with defined keypoint schemas
* **Frame navigation** — step through video frames or image stacks
* **Individual keypoint selection** — click to place each keypoint
* **Undo/redo** — full history stack for corrections
* **Color palettes** — customizable keypoint colors
* **Export** — export labeled keypoints for model training
