Skip to main content

largest_connected_components

Function largest_connected_components 

Source
pub fn largest_connected_components(
    mask: &ArrayRef3<bool>,
    structure: &ArrayRef3<bool>,
) -> Option<Mask>
Expand description

Returns a new mask, containing the biggest zone of mask.

  • mask - Binary image to be labeled and studied.
  • structure - Structuring element used for the labeling. Must be 3x3x3 (e.g. the result of Kernel3d::generate) and centrosymmetric. The center must be true.

The labeling is done using u16, this may be too small when mask has more than u16::MAX elements.