> For the complete documentation index, see [llms.txt](https://docs.imerit.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.imerit.net/labeling/labeling-editor-interface/medical-labeling-editor/smoothing.md).

# Smoothing

The *smoothing* tool allows you to smooth out annotations created with a brush tool you specify.

The *Smoothing* tool is a subset of the *Medical Brush* tool. To activate smoothing, first select a Medical Brush tool from the toolbar on the left, then click on the *Smoothing* button:

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2F4n0vk4mXAu3Y4kFAzkz7%2Fimage.png?alt=media&amp;token=38360034-d883-4531-bad7-0f144f400105" alt=""><figcaption></figcaption></figure>

## Options

Options for the smoothing tool will appear in the bottom left corner of the screen:

<figure><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2Fu7f64pwlcXhmdCTDgW8N%2Fimage.png?alt=media&amp;token=02bb4a35-bca6-4363-98bf-9a24e1085ef4" alt=""><figcaption></figcaption></figure>

**Preset**: Pick here the smoothing type you'd like to apply. Read more about each smoothing preset in the [Smoothing Presets](#smoothing-presets) section.

**Kernel Size:** Pick here the degree to which you'd like to smooth your segmentations, from 1 to 7.\
If you pick a 3x3x3 kernel size for example, the algorithm, for each pixel in 3D space, will consider its 26 immediate neighbors and take the pixel as center of a 3x3x3 cube when applying smoothing.\
In short, the higher the kernel size, the smoother the result (this, however depends on the smoothing type).

While the smoothing tool is active, you may smooth segmentations in the following ways:

* By directly painting over the parts you wish to smooth, effectively functioning as a smoothing brush.
* By clicking on *Apply* in the smoothing settings, applying smoothing to all of the segmentations created with the selected tool in the task.

## Smoothing Presets

Presets are different types of smoothing available on Ango Hub.

Here are details about each:

### Median Smoothing

The median algorithm fills very small holes and smoothes out the general surface of the asset, while keeping the general shape of the asset the same.

Example of median smoothing:

<p align="center"><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2F68pEWFc4Jcd7VaiJCVjB%2Fimage.png?alt=media&amp;token=61e25c08-6341-4184-8370-f98712168799" alt=""> -> <img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FfyWpNxjPZo421K5BeywE%2Fimage.png?alt=media&amp;token=83ef3593-146e-4f9d-966f-8faaf7be8aca" alt=""></p>

The larger the kernel size, the more aggressive the smoothing.

### Opening Smoothing

The opening algorithm never *adds* anything to the asset, only removing extrusions smaller than the selected kernel size. It is useful in removing noise.

The opening algorithm performs erosion (removing noise, shrinking the volume) followed by dilation (expanding the volume while keeping its general shape intact).

Example of opening (click to expand):

<p align="center"><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FOGcEWDz1yLlZqKObkg6u%2Fimage.png?alt=media&amp;token=93aea355-cfaa-491a-9f5e-d7ad63d42787" alt=""> -> <img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FZrAKWHbtBlly8C2MeqBt%2Fimage.png?alt=media&amp;token=402663a6-8de9-404b-b478-74771804916d" alt=""></p>

The larger the kernel, the larger the areas that will be removed. (e.g. more will be eroded.)

### **Closing Smoothing**

The closing algorithm never *removes* anything from the asset, filling holes smaller than the selected kernel size. It is useful in closing small holes or connecting broken parts of an object.

The opening algorithm performs dilation (expanding the volume while keeping its general shape intact) followed by erosion (removing noise, shrinking the volume).

Example of closing (click to expand):

<p align="center"><img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FOGcEWDz1yLlZqKObkg6u%2Fimage.png?alt=media&amp;token=93aea355-cfaa-491a-9f5e-d7ad63d42787" alt=""> -> <img src="https://3895963154-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTcOUG6rfWxqGM0N4db2P%2Fuploads%2FhY1Qk9aH9d5Sj8MpzoDn%2Fimage.png?alt=media&amp;token=37f0e3b2-00e2-4ffe-b87c-129246be6149" alt=""></p>

The larger the kernel, the larger the areas that will be covered (closed). For example, with a 7x7x7 kernel, an area sized 6x6x6 that is completely empty, yet surrounded by full voxels, will be filled in.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.imerit.net/labeling/labeling-editor-interface/medical-labeling-editor/smoothing.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
