mango.image.eliminate_labels_by_size

mango.image.eliminate_labels_by_size(input, minsz=0, maxsz=None, val=0, labels_are_connected=True)

Eliminates labeled objects (clusters) according to size (number of voxels). Any labeled object which has size sz in range(minsz, maxsz+1) will be eliminated from the image by replacing the label with val.

Parameters:
  • input (mango.Dds) – A label image (must have input.mtype == mtype("labels")).
  • minsz (int) – The minimum size of the clusters which are to be eliminated.
  • maxsz (int) – The maximum size of the clusters which are to be eliminated.
  • val (int) – The label-value assigned to voxels which are members of eliminated labeled-objects.
  • labels_are_connected (bool) – If True, assumes labeled-objects are (26-neighbour) connected, and uses a less-memory-hungary MPI parallel algorithm for determining the size of the labeled objects/clusters.
Return type:

mango.Dds

Returns:

A label image with specifically sized labeled-objects eliminated.

Previous topic

mango.image.label

Next topic

mango.image.convex_hull_2d

This Page