This module import morphology functions

image.algo.morpho.component_labeling(img, structure=None, output=None, threshold=0, number_labels=0)[source]

Connected-component label features in an array.

Parameters:
  • img (array) - object to be labeled.

Any non-zero values in input are counted as features and zero values are considered the background.

  • structure (array) optional - structuring element that defines feature connections.

structure must be symmetric. If no structuring element is provided, one is automatically generated with a squared connectivity equal to one.

That is, for a 2D input array, the default structuring element is:

array([[0,1,0],
[1,1,1], [0,1,0]])
  • output (None, data-type, array) optional

If output is a data type, it specifies the type of the resulting labeled feature array If output is an array-like object, then output will be updated with the labeled features from this function.

  • threshold (float) optional

If threshold > 0, the threshold is used to the input The input contains elements 'False' if input < threshold, and elements 'True' elsewhere

  • number_labels (int)

If number_labels > 0, number_labels of connected component labels is returned If number_labels = 1, the largest connected component label is returned

Returns Type:
  • labeled_array - array object where each unique feature has a unique value
  • num_features (int)

If output is None or a data type, this function returns a tuple : (labeled_array, num_features). If output is an array, then it will be updated with values in : labeled_array and only num_features will be returned by this function.

image.algo.morpho.skiz(image, points, vectors=None)[source]

Compute the Skeleton of Influence Zone - also know as Generalized Voronoi Diagram.

Compute a labelled image ...

Parameters:
  • image : initial 3d image to get its shape
  • points : a list of 3d points
  • vectors: a list of 3d points
Returns:
  • labelled image with the same shape of the initial one.

This Page