upxo.imageOps.labelops module

Label and connected-component operations for UPXO image data.

upxo.imageOps.labelops.reindex_labels(label_image, background=0, start=1)[source]

Reindex non-background labels to consecutive integers.

upxo.imageOps.labelops.reindex_arrays_by_image_pair(old_image, new_image, old_arrays)[source]

Reindex ID arrays using the old-image to new-image mapping.

upxo.imageOps.labelops.binary_structure(ndim=3, connectivity=1)[source]

Return a SciPy binary structure for connected-component labelling.

upxo.imageOps.labelops.label_components(binary_image, connectivity=1, labeler=None)[source]

Label one binary image using SciPy-compatible labelling.

upxo.imageOps.labelops.label_multistate_components(state_image, states=None, connectivity=1, labeler=None)[source]

Label each state independently and merge labels into one image.

upxo.imageOps.labelops.coerce_lgi_uint8(lgi)[source]

Return a uint8 2D labelled image or None when invalid.