Skip to main content

Cavity Fill

The Cavity Fill tool removes holes that are not connected to the boundary of the target mask(s). This operation fills internal cavities and enclosed voids within mask objects.

Accessing the Tool

  1. Navigate to the Segmentation tab in the ribbon.
  2. Click Cavity Fill in the Operations section.

How It Works

The algorithm identifies and fills holes using grayscale filling:

  1. Identifies all empty (background) regions within the mask.
  2. Determines which regions are not connected to the boundary.
  3. Fills these internal holes by converting them to mask voxels.

Regions connected to the image boundary are considered external and are not filled. The connectivity mode determines how voxels are considered connected.

Parameters

Target Object(s)

OptionDescription
Active maskFill cavities in the active mask only.
Selected masksFill cavities in all selected masks.
Visible masksFill cavities in all visible masks.
All masksFill cavities in every mask.

Connectivity Mode

OptionDescription
6-connectivity (default)A voxel is considered connected only to its directly adjacent neighbors that share a face, excluding connections along edges or corners, resulting in up to 6 possible connections in a 3D grid.
26-connectivityA voxel is considered connected to all of its surrounding neighbors, including those along edges and corners (diagonal connections), resulting in a total of 26 possible connections in a 3D grid.

Workflow

  1. Open the Cavity Fill tool from the Segmentation tab.
  2. Select the Target Object(s).
  3. Choose the Connectivity Mode (6-connectivity or 26-connectivity).
  4. Click Apply to fill the cavities.

Use Cases

Solid Object Creation

Convert hollow segmentations to solid for volume calculation or 3D printing:

  • Fill all internal cavities
  • Result is a watertight solid mask

Anatomical Segmentation

Fill internal anatomical spaces when segmenting an organ as a solid structure:

  • Air spaces within tissue
  • Blood vessels within organs

Quality Control

Identify and fill unintended holes in segmentation results.

Comparison with Fill Holes

FeatureCavity FillFill Holes
TargetHoles not connected to boundaryMedium-sized holes and cavities
DetectionUses grayscale hole fillingUses voting binary iterative hole filling
Typical UseCreate solid objectsClose surface holes
RequirementsWorks with any maskRequires binary masks only
tip

Use Cavity Fill for internal voids and Fill Holes for more controlled hole filling with size parameters. For complete sealing, apply both operations.

Tips

  • Use 6-connectivity for more conservative filling (only face-adjacent voxels).
  • Use 26-connectivity for more aggressive filling (includes edge and corner connections).
  • Preview the result to verify only unwanted cavities are filled.
  • For masks with complex internal anatomy, consider which cavities should be preserved.

See Also