Skip to main content

Multi-label Mask

The Multi-label Mask tools manage masks that contain multiple labeled regions within a single mask object. Multi-label masks efficiently store multiple segmentations using different integer values to identify each region.

Accessing the Tool

  1. Navigate to the Segmentation tab in the ribbon.
  2. Click Multi-label Mask in the Operations section.
  3. Select the desired operation from the dropdown menu.

Operations

Merge Multiple Masks

Combine several individual mask objects into a single multi-label mask:

ParameterDescription
InputSelect the masks to merge.
TargetTarget mask to merge into (optional - creates new if not specified).
Remove input objectsIf enabled, input mask objects will be removed after a successful merge operation.

Each source mask becomes a separate label in the result. Label values are assigned automatically.

Extract Labels as Separate Masks

Create individual mask objects from each label in a multi-label mask:

Information:

  • Number of labels: Displays the total number of labels present in the active mask

Options:

  • Separate only the largest labels: When enabled, specify the number of largest labels to separate based on their volume
  • Remove active mask: If enabled, the active mask will be removed after a successful split operation

Each extracted label becomes an independent mask object.

Convert to Normal Mask(s)

Remove label information from a multi-label mask, converting it to a standard binary mask:

ParameterDescription
Target mask(s)Select the multi-label mask(s) to convert.

Multi-Label Mask Editor

Interactively manage labels within a multi-label mask:

FeatureDescription
Active mask labelsTable view displaying all labels in the active mask.
Show label annotationWhen enabled, picking in the 3D view and table item will be active, and annotations will be shown in all views, positioned at the label's first voxel.
Copy annotation to MeasurementCopy the label annotation to the Measurement tool.
Create new mask object from selected label(s)Extract selected labels to a new mask object.

Label Management

Labels Table

The editor displays a table of all labels in the mask:

ColumnDescription
ValueThe integer label value.
NameUser-assigned label name.
ColorDisplay color for the label.
Voxel CountNumber of voxels with this label.
VolumePhysical volume of the label.

Label Operations

OperationDescription
Random ColorsAssign random colors to selected labels.
Select ColorChoose a specific color for a label.
Combine SelectedMerge selected labels into one.
Remove SelectedDelete selected labels.
Create Mask from SelectedExtract labels to a new mask.

Workflow Examples

Creating a Multi-label Mask

  1. Segment multiple structures as individual masks.
  2. Open Multi-label Mask → Merge Multiple Masks.
  3. Select the masks to combine.
  4. Enter a name for the result.
  5. Click Apply to create the multi-label mask.

Editing Label Properties

  1. Select the multi-label mask.
  2. Open Multi-label Mask → Multi-Label Mask Editor.
  3. In the labels table, select labels to modify.
  4. Use the editing buttons to rename, recolor, or combine labels.
  5. Click Apply to save changes.

Extracting Specific Labels

  1. Select the multi-label mask.
  2. Open Multi-label Mask → Extract Labels as Separate Masks.
  3. Select the labels to extract.
  4. Click Apply to create individual masks.

Use Cases

  • AI Segmentation Results: Import multi-label results from AI frameworks.
  • Efficient Storage: Store multiple structures in a single file.
  • Batch Processing: Process all labels simultaneously.
  • Label Editing: Correct or refine labels from automatic segmentation.
info

Multi-label masks are commonly used with AI segmentation frameworks like TotalSegmentator, which output all anatomical structures as a single multi-label mask.

Scripting

Multi-label operations are available via the Python scripting API:

import ScriptingApi as api

app = api.Application()
mask_operations = app.get_mask_operations()

# Check if a mask is multi-label
is_multilabel = mask_operations.is_multilabel_mask("Segmentation")

# Get label information
mask_label_info_list = mask_operations.get_mask_labels("Segmentation")
for mask_label_info in mask_label_info_list:
print(f"Label {mask_label_info.value}: {mask_label_info.annotation}")

See the MaskOperations API Reference for details.

See Also