largest_connected_components

Function largest_connected_components 

Source
pub fn largest_connected_components<S>(
    mask: &ArrayBase<S, Ix3>,
    structure: &ArrayBase<S, Ix3>,
) -> Option<Mask>
where S: Data<Elem = bool>,
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.