sklearn#

dbdicom.wrappers.sklearn.kmeans(features, mask=None, n_clusters=2, multiple_series=False)[source]#

Labels structures in an image

Wrapper for sklearn.cluster.KMeans function.

Parameters:
  • input (list of dbdicom series (one for each feature)) –

  • mask (optional mask for clustering) –

Returns:

clusters

Return type:

list of dbdicom series, with labels per cluster.

dbdicom.wrappers.sklearn.masks_to_label(masks)[source]#

Convert a list of masks into a single label series

dbdicom.wrappers.sklearn.sequential_kmeans(features, mask=None, n_clusters=2, multiple_series=False)[source]#

Labels structures in an image using sequential k-means clustering

Sequential here means that the clustering is always performed on a single feature using the output of the previous iteration as a mask for the next.

Parameters:
  • input (list of dbdicom series (one for each feature)) –

  • mask (optional mask for clustering) –

Returns:

clusters

Return type:

list of dbdicom series, with labels per cluster.