src.clustering.postproc.clustering_post_processor

Classes

ClusteringPostProcessor(**kwargs)

class src.clustering.postproc.clustering_post_processor.ClusteringPostProcessor(**kwargs)
Author:

Alberto M. Esmoris Pena

Interface governing any component of a clustering post-processing pipeline. See Clusterer and Clusterer.post_process().

__init__(**kwargs)

Initialize a ClusteringPostProcessor.

Parameters:

kwargs – The key-word arguments for the initialization of any ClusteringPostProcessor.

abstractmethod __call__(clusterer, pcloud, out_prefix=None)

Abstract method that must be overridden by any concrete (instantiable) component of a clustering post-processing pipeline.

Parameters:
  • clusterer – The clusterer that called the post-processor.

  • pcloud – The point cloud that must be post-processed.

  • out_prefix – The output prefix in case path expansion must be applied.

Returns:

The post-processed point cloud.

Return type:

PointCloud

static build_post_processor(spec)

Build the post-processor from its key-words specification.

Parameters:

spec (dict) – The post-processor specification.

Returns:

Built post-processor.

Return type:

callable

get_cluster_labels(clusterer, pcloud)

Obtain the vector of cluster labels corresponding to the given clusterer.

Parameters:
  • clusterer (Clusterer) – The clusterer whose labels must be extracted.

  • pcloud (PointCloud) – The clustered point cloud.

Returns:

The vector of point-wise cluster labels.

Return type:

np.ndarray

set_cluster_labels(clusterer, pcloud, c)

Set the vector of point-wise cluster labels in the point cloud.

Parameters:
  • clusterer (Clusterer) – The clusterer whose labels must be setted (typically after updating them).

  • pcloud (PointCloud) – The clustered point cloud.

  • c (np.ndarray) – The new vector of point-wise cluster labels.

Returns:

Nothing at all, but the point cloud is udpated in place.

get_domain_from_cluster_labels(c)

Obtain the domain (all unique values but noise [default, -1]) of the cluster labels.

Parameters:

c (np.ndarray) – The vector of point-wise cluster labels.

Returns:

The domain of the cluster labels, i.e.,

Return type:

np.ndarray