Skip to main content

label_regions

Function label_regions 

Source
fn label_regions(
    phase: &[f64],
    mask: &[u8],
    dims: (usize, usize, usize),
    partitions: usize,
    labelling: PreludeLabelling,
) -> (Vec<u32>, usize)
Expand description

Partition the phase range, label the connected components of each partition, and hand every component across every partition a unique region id (§2.4).

With PreludeLabelling::Slices (or PreludeLabelling::Auto on a volume it resolves to slices for) a component is connected within one slice of the third axis only (4-connected in-plane), so no region spans two slices; the merge is 3D either way. Ids run partition by partition, and within a partition slice by slice.

Returns the per-voxel region map, NO_REGION where there is none, and the number of regions created.