Medical Imaging Interaction Toolkit
2025.08.99-f7084adb
Medical Imaging Interaction Toolkit
|
This document explains the MITK MultiLabel Segmentation Stack Format, including the structure of image and JSON files. This format allows exporting/importing a multi-label segmentation composed of multiple labeled regions, grouped logically, and enriched with metadata. There are several reader and writer in MITK that support this format.
A typical stack includes:
The .json
file determines how image files are interpreted and combined into a mitk::MultiLabelSegmentation
. The images can have any format that is supported by MITK. IMPROTANT: The images of one segmentation stack have to have the same image geometry
Segmentations are organized into label groups. Each group may:
This is configured by the save_strategy
:
group
: Saves one image per grouplabel
: Saves one image per labelMITK handles both variants at import/export.
Key | Required | Description |
---|---|---|
version | ✅ | Format version (integer) |
type | ✅ | Must be "org.mitk.multilabel.segmentation.stack" |
uid | ❌ | Unique ID for the segmentation |
groups | ✅ | Array of label groups |
properties | ❌ | Global image metadata/properties |
Each entry in "groups"
defines a group of labels:
Key | Required | Description |
---|---|---|
name | ❌ | Optional group name |
_file | ❌ | Path to the group image file |
labels | ✅ | Array of labels in the group |
*(any)* | ❌ | Any additional key is stored as a custom property |
Each label includes visual and semantic metadata, and optionally its own image file:
Key | Required | Description |
---|---|---|
name | ✅ | Label name. When stored as DICOM this will be mapped into the tag Segment Label (0062,0005) |
value | ✅ | Unique label value (it hase to be unique for the whole segmentation not just the group!) |
_file | ❌ | Path to binary label image |
_file_value | ❌ | Voxel value in the image to map to/form value on import/export |
color | ✅ | Controls UI color — RGB values [r, g, b] (0.0–1.0). When stored as DICOM this will be mapped into the tag Recommended Display CIELab Value (0062,000D) |
opacity | ✅ | Opacity (0.0–1.0) |
locked | ✅ | Controls UI editability — true disables editing |
visible | ✅ | Visibility in the UI |
tracking_id | ✅ | Tracking ID (string or number). When stored as DICOM this will be mapped into the tag TrackingID (0062,0020) |
tracking_uid | ❌ | Optional unique identifier. When stored as DICOM this will be mapped into the tag TrackingUID (0062,0021) |
description | ❌ | Optional user description. When stored as DICOM this will be mapped into the tag Segment Description (0062,0006) |
*(any)* | ❌ | Custom label properties (e.g., DICOM metadata, flags) |
Some keys on group and label level are not supposed to be converted into regular properties, but the are supposed as meta information that control the way labels are processed/handled. Those meta keys will not be "imported", thus transformed into properties of the label data structure. Those keys are indicated by a "_" prefix. The most regular seen keys of that type are _file
and _file_value
.
To control voxel value interpretation:
_file_value
to specify which voxel value in the image corresponds to this label.1
.If _file_value
is omitted, the label value
must match the voxel value in the image.
Saved under "properties"
:
These can store standard metadata (e.g., DICOM attributes) or user-defined content. On this level (which resembles the level of a data instance (like an image)) the properties are stored in the same format like any node or data properties in MITK.
Labels and groups may contain custom tags/properties. For simplicity/readablility reasons simple types are directly stored as simple key/value pairs.
Supported types:
TemporoSpatialStringProperty
)Unknown or unsupported types may cause import failure if not handled correctly. Structured properties (representing more complex properties (e.g. TemporoSpatialStringProperty
) are stored in the following structure:
Example for a structured property stored at group or label level:
A mixed segmentation stack may contain:
_file
) containing label values (e.g., 1, 2, 3)._file
) with optional _file_value
mappings._file
at all, relying entirely on per-label images.The cmd app MitkFileConverter.offers the possibility to import and export segmentation stacks (also using this json meta file). For more information about how to do that please visit the MitkFileConverter segmentation stack guide.