> 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/medical-annotation.md). Agents can also search and read this documentation through its [MCP server](https://docs.unitlab.ai/~gitbook/mcp).

# Medical annotation

Label CT, MRI and other DICOM, NIfTI or NRRD volumes with masks, contours and boxes across axial, sagittal, coronal and 3D views.

Label 3D scans while you see the same anatomy in four views at once. You paint masks on the axial, sagittal or coronal plane, check them in the other views and in 3D, and use tracking to carry a shape through the slices that follow.

![Abdominal CT in a 2x2 layout: axial slice with left and right kidney masks, sagittal and coronal views with the liver, a 3D view, and tracks for each organ on the timeline](https://292810646-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGjVLUz4wthGkGlRKM6rM%2Fuploads%2FxMkPl6j3NpNivBHEeUef%2Fmedical-mpr-hero.webp?alt=media)

## When to use it

* Organ and tissue segmentation for training models such as abdominal organ or bone segmenters.
* Lesion detection and grading with structured clinical properties, such as LI-RADS.
* Contours on a prescribed slice and plane.
* Landmarks on anatomy, with structured properties such as side or finding type.

## See it in action

An organ segmented on a CT scan and carried through the slices with tracking, checked in the axial, sagittal, coronal and 3D views.

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

## Before you begin

* Upload DICOM series, NIfTI volumes (`.nii`, `.nii.gz`) or NRRD files. DICOM files are grouped into one volume per series. Use de-identified data.
* Give each structure the right geometry in the ontology: **mask** for regions, **polygon** for contours, **bounding box** or **point** for findings.
* Agree on boundary rules, which slices an object should cover, and how to record uncertain cases.

## Example: abdominal organs on a CT scan

This example uses a contrast CT of the abdomen, 256 axial slices.

| Class    | Geometry     | Properties                   |
| -------- | ------------ | ---------------------------- |
| Liver    | Mask         |                              |
| Spleen   | Mask         |                              |
| Kidney   | Mask         | Side (required): Left, Right |
| Aorta    | Polygon      |                              |
| Vertebra | Bounding box |                              |
| Lesion   | Point        | Finding                      |

Each kidney is its own object with **Side** set, so the left and right kidney stay separate through every slice.

{% stepper %}
{% step %}

### Set up the views

Click **Multiview layout** in the header and pick a 2x2 grid under **Current file**. You see **Axial**, **Sagittal**, **Coronal** and **3D View**. Change any panel's view from the menu at its top.
{% endstep %}

{% step %}

### Set the window for the tissue

Open **View settings** > **Hounsfield unit presets** and choose **Soft Tissue** for organs or **Bone** for vertebrae.
{% endstep %}

{% step %}

### Paint the first slice

Click the axial panel to make it active. Choose the **Kidney** class, press `F` for **Brush**, and paint the kidney. Press `E` for **Eraser** to remove spill into fat or bowel. Set **Side** in the inspector.
{% endstep %}

{% step %}

### Carry it through the slices

Press `D` to track forward through the next slices and `R` to track backward. Scroll over the axial panel to step one slice at a time and fix the first slice where the mask drifts.
{% endstep %}

{% step %}

### Check the other planes

Look at the sagittal and coronal panels for gaps, islands or leaks between slices. The crosshair (`T`) shows where the views meet. Fix a leak right there: make that panel active and erase it.
{% endstep %}

{% step %}

### Review and send

Check the timeline: each organ's bar should start and end where the organ does. Then click **Send to Review**.
{% endstep %}
{% endstepper %}

## Edit in any plane

You can draw on whichever plane shows the structure best. Make the sagittal or coronal panel active, then paint with **Brush** (`F`) or erase with **Eraser** (`E`) as you would on an axial slice. While you paint, the stroke appears in the other planes and the 3D view. When you save, the mask is written back slice by slice, so it stays one object across the whole volume.

Only the active panel takes edits. The other panels show the same mask as a read-only projection with the crosshair (`T`), so you can check the boundary from three directions while you work.

Use this for structures that run along the body axis, such as the aorta, the spinal cord or a long lesion edge, where one sagittal or coronal stroke replaces many axial ones.

## Example: grade a liver lesion with a clinical ontology

This example uses an arterial-phase CT of a patient with hepatocellular carcinoma: 109 axial slices of 2.5 mm, with the liver and the tumor segmented. The data is from the HCC-TACE-Seg collection on the NCI Imaging Data Commons (CC BY 4.0).

<figure><img src="https://292810646-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGjVLUz4wthGkGlRKM6rM%2Fuploads%2FU85gcsa6u1nk0OaEXnDe%2Fcap-med-mpr-2x2.webp?alt=media" alt="Liver CT in a 2x2 layout: axial slice 72 with the liver in purple and the lesion in red, labeled Suspicious, LR-5, Heterogeneous, 120; sagittal and coronal views with the same masks; a 3D view; and item properties and tracks on the timeline" width="800"><figcaption><p>The liver (purple) and the lesion (red) in the axial, sagittal, coronal and 3D views. The lesion's properties show on the canvas.</p></figcaption></figure>

The ontology puts the clinical questions on the objects and on the scan itself.

| Where                   | Property                        | Type             | Values                                         |
| ----------------------- | ------------------------------- | ---------------- | ---------------------------------------------- |
| **Lesion** class        | **Location** (required)         | Single select    | Liver, Kidney, Pancreas, Other                 |
| **Lesion** class        | **Finding** (required)          | Single select    | Benign, Suspicious, Indeterminate              |
| Under **Suspicious**    | **LI-RADS category** (required) | Single select    | LR-3, LR-4, LR-5, LR-M                         |
| Under **Indeterminate** | **Follow-up**                   | Single select    | 3 months, 6 months, Biopsy                     |
| **Lesion** class        | **Size (mm)**                   | Number, 1 to 300 |                                                |
| **Lesion** class        | **Enhancement** (dynamic)       | Single select    | None, Rim, Homogeneous, Heterogeneous          |
| Item properties         | **Contrast phase** (required)   | Single select    | Non-contrast, Arterial, Portal venous, Delayed |
| Item properties         | **Study quality**               | Single select    | Good, Motion artifact, Noisy                   |

<div align="left"><figure><img src="https://292810646-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGjVLUz4wthGkGlRKM6rM%2Fuploads%2FYoaIIZy60uo7r3VH8CRN%2Fcap-med-clinical-ontology.webp?alt=media" alt="Inspector for Lesion 1: Location Liver, Finding Suspicious with the nested LI-RADS category set to LR-5, Size 120, and Enhancement marked Dynamic set to Heterogeneous" width="300"><figcaption><p>Choosing <strong>Suspicious</strong> opens the nested <strong>LI-RADS category</strong>.</p></figcaption></figure></div>

* **Nested properties** appear only when they apply. **LI-RADS category** shows up after you choose **Suspicious**, and **Follow-up** after **Indeterminate**.
* **Required** properties are checked as you work. When one is missing, the inspector says how many, and a toggle shows only the incomplete ones.
* A **dynamic** property, marked **Dynamic** in the inspector, can change from slice to slice, such as enhancement that differs across the tumor.
* **Item properties** describe the whole scan, such as its contrast phase and quality. They appear as rows at the top of the timeline.
* **Relations** link two objects, for example a lesion and the vessel it invades. Add them with **Add relation**.

Set up these properties in the project ontology; see [Nested properties](https://docs.unitlab.ai/documentation/ontologies/nested-properties.md). Properties apply to one item (one series or volume). A study with several series uses item properties on each series.

## Compare series side by side

To compare phases or a prior scan, click **Multiview layout** and pick a grid under **Multiple files**. Each panel opens the next item in the queue, here the arterial and portal venous phases of the same patient.

<figure><img src="https://292810646-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGjVLUz4wthGkGlRKM6rM%2Fuploads%2FW8tZNG4BJvAkFuP0MC4z%2Fcap-med-multiview-phases.webp?alt=media" alt="Two axial CT panels side by side at slice 72: the arterial phase with the liver and lesion masks, and the portal venous phase of the same patient" width="800"><figcaption><p>Arterial phase (left, labeled) next to the portal venous phase (right).</p></figcaption></figure>

Each panel holds its own file, with its own slice, zoom and window, so you can line up the same anatomy in both phases. Panels under **Current file** show one volume, so an edit in one appears in all of them at once.

## Navigate a volume

| Action                 | How                                                 |
| ---------------------- | --------------------------------------------------- |
| Next or previous slice | Scroll over a panel, or press `→` / `←`             |
| Zoom                   | Hold `Shift` and scroll                             |
| Make a panel active    | Click it, or scroll over it                         |
| Play through slices    | **Play** under the panel, or `Space`                |
| Enlarge one panel      | **Expand viewport** at its top right                |
| Jump to a slice        | Type the number in the frame box under the timeline |

The 3D view rotates freely when you drag. It has no slice bar.

## View settings

Open **View settings** in the left toolbar. These settings change only the display, never the source data or your annotations.

![View settings with Hounsfield unit presets and Projection (MIP) expanded](https://292810646-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGjVLUz4wthGkGlRKM6rM%2Fuploads%2Fb0JebScmJoqOF9PuvKLI%2Fmedical-view-settings.webp?alt=media)

| Section                     | What you can change                                                                                                                                                                                                                           | Default                   |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
| **Hounsfield unit presets** | Pick a window and level: **Bone (2500/480)**, **Soft Tissue (400/40)**, **Muscle (180/60)**, **Fat (100/-100)**, **Lung (1500/-600)**, **Liver (150/90)**, **Brain (80/40)**. Type a **Preset name** and click **Save W/L** to keep your own. | **Default** from the file |
| **Windows Levels**          | Drag the window and level directly, or hold `Tab` and use the arrow keys (left and right for window, up and down for level). **VOI LUT**: **Linear** or **Sigmoid**.                                                                          | Linear                    |
| **Projection (MIP)**        | **Mode**: **Single slice**, **MIP (max)**, **MinIP (min)** or **Average**, over a **Slab thickness** of 1 to 30 slices. Use MIP to find vessels and small bright structures.                                                                  | Single slice, 1           |
| **3D Viewer Settings**      | **Threshold** (0 to 50%) and **Opacity** (2 to 100) for the 3D rendering.                                                                                                                                                                     | 26%, 2                    |
| **Image Adjustments**       | **Color Map** (Raw, Bone, Jet, Hot, Seismic, Paired), **Brightness**, **Contrast**, **Image Saturation**.                                                                                                                                     | Raw, 50                   |
| **Annotation Display**      | Label font size and object opacity.                                                                                                                                                                                                           |                           |

Go back to **Single slice** before you edit a boundary: a projection blends several slices.

## Choose the geometry

| You need                           | Use                           | Check                                                       |
| ---------------------------------- | ----------------------------- | ----------------------------------------------------------- |
| Which voxels belong to a structure | **Mask**                      | Leaks, holes and stray islands across slices                |
| A contour on a set slice and plane | **Polygon**                   | The contour is closed and on the right slice                |
| Where a finding is                 | **Bounding box** or **Point** | It follows your detection rule; a box is not a segmentation |

## Speed up with AI

* **Auto Select** (`A`) and **Magic Touch** (`M`) turn a click into a mask on the axial slice.
* Tracking (`D`, `R`, `Y`) carries a shape through slices. Treat it as a draft and check every slice it fills.
* See [Detect Anything](https://docs.unitlab.ai/documentation/auto-labeling/detect-anything-sam-1-sam-3.md) for prompt-based segmentation.

## Keyboard shortcuts

| Action                          | Shortcut                |
| ------------------------------- | ----------------------- |
| Brush / Eraser                  | `F` / `E`               |
| Polygon / Bounding box / Point  | `P` / `B` / `U`         |
| Track forward / backward / full | `D` / `R` / `Y`         |
| Next / previous slice           | `→` / `←`               |
| Next / previous file            | `Shift+→` / `Shift+←`   |
| Crosshair                       | `T`                     |
| Brush size                      | `]` / `[`               |
| Window and level                | Hold `Tab` + arrow keys |
| Hide or show annotations        | `Shift+V`               |
| All shortcuts                   | `H`                     |

## Tips

* Paint a middle slice first, where the organ is largest, then track up and down from there.
* Use the same window preset for the whole project so boundaries are drawn the same way.
* Record uncertain cases with a property value, such as **Indeterminate** with a **Follow-up**, instead of guessing.

## Related

* [Medical study and clinical document](https://docs.unitlab.ai/documentation/multimodal-annotations/medical-study-and-clinical-document.md) · [Pathology annotation](https://docs.unitlab.ai/documentation/annotations/pathology-annotation.md) · [Multiview Workbench](https://docs.unitlab.ai/documentation/multimodal-annotations/multiview-workbench.md) · [Nested properties](https://docs.unitlab.ai/documentation/ontologies/nested-properties.md) · [Detect Anything](https://docs.unitlab.ai/documentation/auto-labeling/detect-anything-sam-1-sam-3.md)
