SMLMClustering
Clustering and spatial-statistic backends for single-molecule localization microscopy (SMLM) point data, built on SMLMData.BasicSMLD.
The package exposes three parallel verbs, each dispatched on a concrete configuration type so that the algorithm is selected by which config you pass:
| Verb | Purpose | Returns |
|---|---|---|
cluster | assign a cluster label to every emitter | (smld_out, ::ClusterInfo) |
cluster_statistics | compute read-only spatial statistics | (smld, ::ClusterStatisticsInfo) |
classify_emitters | edge / membrane / interior classification | (smld, ::EdgeClassifyInfo) |
See the User Guide for the calling conventions and the Methods overview for the full backend catalog and the concepts behind each one.

One synthetic localization field run through six labeling backends — see the Methods overview.
Quick start
using SMLMClustering
# Density clustering with DBSCAN: every emitter gets a label on a deep copy.
cfg = DBSCANConfig(eps_nm = 50.0, min_points = 5)
smld_out, info = cluster(smld, cfg)
info.n_clusters # number of clusters found
info.n_noise # emitters left unclustered (label 0)
info.cluster_sizes # size of each cluster, indexed by id
# Read-only spatial statistic: is there clustering tendency at all?
_, stats = cluster_statistics(smld, HopkinsConfig())
stats.statistic # Hopkins H (≈0.5 random, →1 clustered)
# Edge / membrane / interior classification (2D):
_, edge = classify_emitters(smld, KdeValleyConfig())
edge.class # Vector{Symbol}: :outside / :membrane / :interiorcluster is non-mutating — input emitters are deep-copied and labels are written onto the copy's emitter.id (0 = noise, 1..K = clusters). cluster_statistics is pass-through — it returns the same SMLD reference unchanged alongside an info struct. classify_emitters returns a new SMLD (the input's metadata copied, with the published cell mask added under "edge_cells" / "edge_outer_polygon") alongside its info, which carries the per-emitter class.
Backend catalog
Labeling (cluster): DBSCAN, HDBSCAN, Hierarchical, Voronoi (SR-Tesseler), MRF density-regime, Point hysteresis.
Spatial statistics (cluster_statistics): Hopkins statistic, Voronoi density, Local contrast.
Edge classification (classify_emitters): Edge / Membrane Classification (OuterPolygonConfig, KdeValleyConfig).
Installation
using Pkg
Pkg.add("SMLMClustering") # once registered in the General registryUntil then, install directly from GitHub:
Pkg.add(url = "https://github.com/JuliaSMLM/SMLMClustering.jl")License
MIT. Developed in the Lidke Lab at the University of New Mexico.