> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/documentation/annotations/pathology-annotation.md). Agents can also search and read this documentation through its [MCP server](https://docs.unitlab.ai/~gitbook/mcp).

# Pathology annotation

Label whole-slide images from slide overview down to single cells, with masks, polygons and points, and measure in micrometers.

Label gigapixel whole-slide images without tiling them yourself. You zoom from the whole slide down to single cells, label tissue regions and cell instances, and keep every shape in the slide's own coordinates.

![Brain tissue slide at cell level with tens of thousands of cell masks, the minimap showing the current area, and the Objects list](https://292810646-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGjVLUz4wthGkGlRKM6rM%2Fuploads%2Fry58K1bbkAyvFyGYQ9rX%2Fpathology-cell-annotations.webp?alt=media)

## When to use it

* Cell and nucleus instance segmentation for training cell detectors.
* Tissue regions: tumor, stroma, necrosis, glands.
* Cell counting with points.
* Regions of interest for a pathologist to review.

## See it in action

Cell nuclei labeled across a stained slide, from the overview down to single cells.

{% embed url="<https://homepage-files.s3.us-east-2.amazonaws.com/hero-videos/hero/pathology-1.mp4>" %}

## Before you begin

* Upload whole-slide images such as `.svs`, or large TIFF files.
* Decide what a shape stands for: a nucleus, a whole cell, a gland or a tissue region. A class named "cell" does not say which boundary to follow.
* Decide whether you label the whole slide or a sampled region, and how to treat touching cells, folds and tears.

## Example: cells on a brain tissue slide

This example is an H\&E-stained brain tissue slide (`.svs`). Each cell is its own **cell** mask, about 77,000 in total. Labeling every cell as a separate object, instead of one big mask, lets you train instance segmentation and count cells.

{% stepper %}
{% step %}

### Survey the slide

Open the slide at full view. Find tissue, empty glass, folds and pen marks. The minimap in the bottom-right corner shows where you are.
{% endstep %}

{% step %}

### Zoom to working scale

Scroll to zoom until single nuclei are clearly visible. Label at this scale; shapes drawn from the overview are too coarse.
{% endstep %}

{% step %}

### Label each cell

Choose the **cell** class. Press `F` for **Brush** and paint one cell, or press `A` for **Auto Select** and click it. Keep touching cells as separate objects.
{% endstep %}

{% step %}

### Label more like it

Select a good example and press `Shift+S` for **Find Similar**, or `S` to **Detect all objects** in view. Check the results and delete false hits.
{% endstep %}

{% step %}

### Check and send

Zoom out to look for missed cells and duplicates in the assigned region, then click **Send to Review**.
{% endstep %}
{% endstepper %}

## Navigate a slide

| Action          | How                                                                                                                              |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Zoom            | Scroll, or `+` / `-`. `0` resets.                                                                                                |
| Pan             | Drag with **Pan** (`V`), or hold `Space` and drag.                                                                               |
| Jump to an area | Click or drag on the minimap.                                                                                                    |
| Rotate          | Drag the compass. Click it to reset.                                                                                             |
| Go to an object | Click it in **Objects**. To bring it into view, turn on **Auto zoom on object list click** in **View settings** > **Auto zoom**. |

## Measure distance

Click **Measure distance** in the left toolbar, then click two points. The length shows in µm, or mm above 1,000 µm. Hover a shape to see its width, height, area or perimeter. Press `Esc` to stop. The tool is off when the slide has no physical scale ("Physical scale metadata is unavailable").

## View settings

Open **View settings** > **Slide Appearance** to change **Original** or **Grayscale**, **Brightness**, **Contrast** and **Gamma**. These change only the display, never the slide or your annotations.

![Slide Appearance settings beside a pathology slide](https://292810646-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGjVLUz4wthGkGlRKM6rM%2Fuploads%2FSx6TLtoVcFFZ0o1Gs2GA%2Fpathology-slide-appearance-live.jpg?alt=media)

Other sections work as in [Geospatial annotation](https://docs.unitlab.ai/documentation/annotations/geospatial-annotation.md): **Annotation Display** (label size, opacity, minimap), **Annotation Tools** and **Auto zoom**.

## Choose the geometry

| You need                                              | Use                                                      |
| ----------------------------------------------------- | -------------------------------------------------------- |
| Cell or nucleus outlines                              | **Mask** (Brush) or **Polygon**, one object per instance |
| Tissue regions and glands                             | **Polygon** with holes, or **Mask**                      |
| Cell counts or centers                                | **Point**                                                |
| A region to review                                    | **Bounding box**                                         |
| Facts about the whole slide, such as stain or quality | **Item properties**                                      |

## Keyboard shortcuts

| Action                            | Shortcut                      |
| --------------------------------- | ----------------------------- |
| Pan                               | `V`, or hold `Space` and drag |
| Brush / Eraser                    | `F` / `E`                     |
| Polygon / Point / Bounding box    | `P` / `U` / `B`               |
| Auto Select / Magic Touch         | `A` / `M`                     |
| Detect all objects / Find Similar | `S` / `Shift+S`               |
| Brush size                        | `]` / `[`                     |
| Zoom in / out / reset             | `+` / `-` / `0`               |
| Hide or show annotations          | `Shift+V`                     |
| Select all objects                | `Ctrl+A` / `Cmd+A`            |
| All shortcuts                     | `H`                           |

## Tips

* Agree on the boundary first: nucleus and whole cell give very different masks.
* Try AI tools on a few regions with different staining before you run them across the slide.
* Keep clinical calls such as grade or diagnosis out of shape labels. Put them in properties that a qualified reviewer checks.

## Related

* [Medical annotation](https://docs.unitlab.ai/documentation/annotations/medical-annotation.md) · [Geospatial annotation](https://docs.unitlab.ai/documentation/annotations/geospatial-annotation.md) · [Detect Anything](https://docs.unitlab.ai/documentation/auto-labeling/detect-anything-sam-1-sam-3.md) · [Curate and filter data](https://docs.unitlab.ai/documentation/data/data-curation.md)
