Skip to content

Content-aware Fill

Back to MIB | User interface | Ribbon | Image


Overview

Content-aware fill dialog

Reconstruct selected areas of the dataset using information from neighboring regions, modifying the image and corresponding Selection, Mask, and Labels layers.

Demonstration

Mark the regions to fill using the Mask or Selection layers in the Segmentation panel, then open the dialog from Ribbon → Image → Image tools → Content-aware fill.


Settings

Method: fill algorithm — inpaintCoherent or inpaintExemplar.

Dataset type: scope of the operation — Shown slice (2D), Current stack (3D), or Complete volume (4D).

Mask: layer that defines the fill region — selection or mask.

Radius: for inpaintCoherent — neighbourhood radius (pixels) centred on each pixel to inpaint; for inpaintExemplar — patch size in pixels.

Smoothing factor (inpaintCoherent only): Gaussian filter scale for estimating the coherence direction; controls smoothness of the result (0 = no smoothing).

Fill order (inpaintExemplar only): priority function determining which pixels are filled first — gradient (edge-first) or tensor.

Use Preview to apply the fill to the current slice and inspect the result before committing to the full dataset. Enable to update the preview automatically whenever a parameter changes.


inpaintCoherent

inpaintCoherent example

Restores regions using coherence transport-based inpainting — propagates edge direction and intensity from surrounding areas into the selected region. Works well for smooth textures and gradients. Available from MATLAB R2019a.

Method-specific parameters:

  • Radius: neighbourhood radius (pixels) around each pixel to inpaint; larger values use more context.
  • Smoothing factor: controls how smoothly the coherence direction is estimated.

Reference


inpaintExemplar

inpaintExemplar example

Fills regions by copying and blending texture patches from nearby areas. Works well for repetitive textures and structured backgrounds. Available from MATLAB R2019b.

Method-specific parameters:

  • Radius: patch size in pixels (e.g. 9 for a 9×9 patch).
  • Fill order: determines which pixels are filled first — gradient prioritises strong edges; tensor uses the local structure tensor.

Reference


Back to MIB | User interface | Ribbon | Image