# Disconnect Touching Labels

This is an experimental module from the Xtra Library: https://xtras.amira-avizo.com.

This module ensures that individual labels are not touching each other, adding a 1-pixel separation between them if necessary. It internally relies on Label Interfaces to identify the boundaries between touching labels.

This is particularly useful to enforce the notion of instances with object classification modules, ensuring that after binarization, objects can be identified as separate connected components.

## Connections

Input | Description
--- | ---
Data: [required] | Label field of objects to be disconnected. Each object should have a unique label ID. Objects that are touching will be separated with a 1-pixel gap.

## Parameters (Ports)

Parameter | Description
--- | ---
Console | Opens the Python Script Object console of the module as the active console window.
Mode | Specify whether the input is interpreted as a 3D volume or a stack of 2D images for processing. 3D: the module configuration is set to 3D. The image will be processed as a whole in 3D using 26-connectedness. 2D: the module configuration is set to 2D. The image will be processed slice by slice.
Apply | Execute the disconnection operation

## Outputs

The module generates a label field with suffix ".instances" where touching labels have been separated by a 1-pixel gap. All voxels at the interfaces between different labels are set to background (0), ensuring that each object remains as a distinct connected component.