topostats.tracing.skeletonize#

Skeletonize molecules

Attributes#

Functions#

get_skeleton(→ numpy.ndarray)

Factory method for skeletonizing molecules.

_get_skeletonize(→ Callable)

Creator component which determines which skeletonize method to use.

_skeletonize_zhang(→ numpy.ndarray)

_skeletonize_lee(→ numpy.ndarray)

_skeletonize_medial_axis(→ numpy.ndarray)

_skeletonize_thin(→ numpy.ndarray)

Module Contents#

topostats.tracing.skeletonize.LOGGER#
topostats.tracing.skeletonize.get_skeleton(image: numpy.ndarray, method: str) numpy.ndarray#

Factory method for skeletonizing molecules.

Parameters:
  • image (np.ndarray) – Image of molecule to be skeletonized.

  • method (str) – Method to use, default is ‘zhang’ other options are ‘lee’, ‘medial_axis’ and ‘thin’.

Returns:

Skeletonised version of the image.all($0)

Return type:

np.ndarray

Notes

This is a thin wrapper to the methods provided by the skimage.morphology module. See also the `examples <https://scikit-image.org/docs/stable/auto_examples/edges/plot_skeleton.html>_

topostats.tracing.skeletonize._get_skeletonize(method: str = 'zhang') Callable#

Creator component which determines which skeletonize method to use.

Parameters:

method (str) – Method to use for skeletonizing, methods are ‘zhang’ (default), ‘lee’, ‘medial_axis’, and ‘thin’.

Returns:

Returns the function appropriate for the required skeletonizing method.

Return type:

Callable

topostats.tracing.skeletonize._skeletonize_zhang(image: numpy.ndarray) numpy.ndarray#
topostats.tracing.skeletonize._skeletonize_lee(image: numpy.ndarray) numpy.ndarray#
topostats.tracing.skeletonize._skeletonize_medial_axis(image: numpy.ndarray) numpy.ndarray#
topostats.tracing.skeletonize._skeletonize_thin(image: numpy.ndarray) numpy.ndarray#