Skip to content

triplclust_py API documentation

calculate_dnn(cloud) builtin

Calculate the characteristic length scale of the point cloud

Parameters:

Name Type Description Default
cloud ndarray

The point cloud

required

Returns:

Name Type Description
float float

The characteristic length scale

smooth_pointcloud(cloud, dnn, neighborhood_radius) builtin

Smooth a point cloud which has already been sorted in z

Perform nearest neighbor smoothing on a pointcloud. If dnn is given, the neighborhood radius is calculated from that scale. If dnn is not given and neighborhood_radius is given, neighborhood_radius is used. If neither are given, dnn is calculated from the cloud. This last option should only be used if dnn is not going to be used in subsequent calculations (i.e. clustering).

Parameters:

Name Type Description Default
cloud ndarray

The pointcloud to smooth

required
dnn float | None

The characteristic length scale

required
neighborhood_radius float | None

The maximum raidal distance between neighbors

required

Returns:

Type Description
ndarray

A new smoothed pointcloud

triplet_clustering(smoothed_point_cloud, triplet_neighborhood_size, triplet_max_candidates, triplet_error_cutoff, dnn, cluster_distance_threshold, cluster_scale, min_cluster_size, linkage) builtin

Apply the triplclust algorithm to a smoothed point cloud

Cluster the points by the triplclust triplet metric

Parameters:

Name Type Description Default
smoothed_cloud ndarray

The smoothed, sorted pointcloud

required
triplet_neighborhood_size int

The size of the triplet search neighborhood in points

required
triplet_max_candidates int

The maximum of triplet candidates to consider for a point

required
triplet_error_cutoff float

The error cutoff for evaluating triplet candidates

required
dnn float | None

If given, dnn is used to calculate the comparison scale instead of the cluster scale parameter. See cluster_scale for case where both dnn and cluster_scale are None.

required
cluster_distance_threshold float | None

The cluster distance used as a stopping criterion in the hierarchical clustering. If None, the appropriate threshold is calculated from the data.

required
cluster_scale float | None

The scale factor used in the triplet distance metric. If None and dnn is None, dnn is calculated from the point cloud. This is not recommended, as dnn is typically used in multiple places and is expensive to calculate.

required
min_cluster_size int

The minimum number of points required for a cluster to be valid.

required
linkage str

The type of linkage to use in the agglometrive clustering. Valid values are "single", "complete", "average", and "median".

required

Returns:

Type Description
tuple[ndarray, ndarray]

A set of 1-D integer arrays, where the first is the set of cluster labels for each point in the point cloud and the second is the list of unique cluster labels. A label of -1 indicates that the point was not included in any valid cluster.