locan.process.filter.exclude_sparse_points¶
- locan.process.filter.exclude_sparse_points(locdata, other_locdata=None, radius=50, min_samples=5)[source]¶
Exclude localizations by thresholding a local density.
A subset of localizations, that exhibit a small local density of localizations from locdata or alternatively from other_locdata, is identified as noise and excluded. Noise is identified by using a nearest-neighbor search (
sklearn.neighbors.NearestNeighbors) to find all localizations within a circle (sphere) of the given radius. If the number of localizations is below the threshold value min_samples, the localization is considered to be noise.The method identifies the same noise points as done by the clustering algorithm DBSCAN [1].
- Parameters:
locdata (
LocData) – Specifying the localization data from which to exclude localization data.other_locdata (
LocData|None) – Specifying the localization data on which to compute local density.radius (
float) – Radius of a circle or sphere in which neighbors are identified (equivalent to epsilon in DBSCAN).min_samples (
int) – The minimum number of samples in the neighborhood that need to be found for each localization to not be identified as noise (equivalent to minPoints in DBSCAN).
- Returns:
All localizations except those identified as sparse (noise) points.
- Return type:
References