Cluster shape

Analysis › Measure · version 1 · can run once per region

The size, extent, orientation and density of the localizations: the

What it does

Describes the shape of a group of localizations in a few numbers: how many there are, the area they cover, how far they spread from their centre, how elongated they are and in which direction, and how densely they are packed.

It is meant for clusters (localizations that lie closer to each other than to the rest). After Find clusters has given every localization a cluster_id, add this plugin to the per-region steps over cluster_id and it runs once in every cluster, a row of numbers each: the size distribution of the clusters, whether they are round or stretched, whether the big ones are also the dense ones. It runs the same way in every ROI of the ROI manager, and on the view, where it measures everything that is shown as one shape.

Each visible layer (one picture of the localizations with its own filter and colours) is measured on its own, as the layer shows it: its filter, and merged blinks if the layer merges them. Merged blinks are usually what is wanted – every blink once, at its better position – since a molecule that blinked in twenty frames would otherwise weigh twenty times.

The numbers describe the localizations, not the structure under them: the spread includes the localization precision, and a cluster of a few localizations has a shape mostly by chance. Compare clusters of similar size, and leave out the small ones: a filter on n_in_cluster before the per-region steps, or Filter ROIs on n_locs for ROIs.

How it works

1. The centre and the spread. The centre is the mean position. The radius of gyration is the typical distance of a localization from it (the root of the mean squared distance): one number for the size, whatever the shape.

2. The axes. The spread is then split by direction. The direction in which the localizations spread most is the long axis; at right angles to it is the short axis. The plugin gives the standard deviation along each, the angle of the long axis, and their ratio, the elongation: 1 for a round cluster, 4 for one four times as long as wide. The positions' full range along each axis is given too, as the extents.

3. The area. The convex hull is the shape a rubber band would take if stretched around all the localizations: the smallest outline without dents that contains them. Its area, and the number of localizations per µm² of it, the density, follow.

4. In 3D, if the table has z_nm, the hull is taken in three dimensions for the volume, and the z range is given as the z extent.

Three simulated structures – a disc, an ellipse four times as long as wide at 30°, and a thin line at 110° – with their localizations (dots), the convex hull (line), the ellipse at two standard deviations along the measured axes (dashed) with the long axis through it, and the true outline (grey). The elongation measured comes out near the true one for the disc and the ellipse; for the line the localization precision sets the width, so the elongation is far below the true one of 38. The hull reaches out to the stray localizations a poor fit put outside the disc.

In detail

For the positions of a region, with the centre their mean:

Radius of gyration. , in x and y only, also in 3D. For a uniformly filled disc of radius it is .

Axes. The covariance matrix of and (with in the denominator, as MATLAB's cov) has eigenvalues ; the standard deviations are and , and the angle is that of 's eigenvector, from the x axis towards the y axis, between 0° and 180°. The elongation is . For a uniformly filled ellipse with semi-axes and the standard deviations are and , so the elongation is ; for a line of length the long one is . The extents are the range of the positions after rotating them onto the two axes.

Hull. The convex hull is computed by qhull (scipy.spatial.ConvexHull) in x and y for the area, and in x, y and z for the volume. The density is divided by the area, per µm². The hull of uniformly scattered points lies inside the true outline, so the area is too small and the density too large: for points scattered evenly in a disc, the hull covers about 98 % of it with 3000 points, 85 % with 100 and half with a dozen. Compare densities of clusters of similar size. A concave cluster (a crescent, a ring) is covered by its hull including the empty part, and its density is underestimated. And the hull runs through the outermost localizations, so a single stray one – a poor fit, a neighbour that DBSCAN counted in – enlarges it; the standard deviations and move far less.

Precision. The measured variances are the cluster's own plus the localization precision's: . Nothing is subtracted. A cluster no larger than the precision is measured as a round blob of about the precision's size, whatever its true shape.

Few points. With no localizations only n_locs (0) is given, the rest NaN. With one, the centre and . The standard deviations, the angle and the extents need two. The area needs three points that are not on one line, the volume four not in one plane; otherwise it is 0, and the density – with nothing to divide by – NaN. An elongation with a short standard deviation of 0 (points on one line: below a millionth of the long one, to absorb rounding) is NaN too.

Names. The values in the region table are n_locs, centre_x_nm, centre_y_nm, area_nm2, density_per_um2, rg_nm, std_long_nm, std_short_nm, angle_deg, elongation, extent_long_nm, extent_short_nm, and in 3D centre_z_nm, z_extent_nm and volume_nm3; for the second and further layers with _L2, _L3, ... appended.

Parameters

settingdefaultwhat it does
use z
use_z
onAlso the volume, the z extent and the z centre, when the table has z_nm.

Untick it for a 3D table whose clusters should be compared by their footprint only, or when z is too imprecise for a volume to mean anything.

Output

The figure shows each layer's localizations, the convex hull, and the ellipse at two standard deviations along the measured axes with the long axis drawn through it. The text gives, per layer, the number of localizations, the area, the density, , the two standard deviations and the angle, the elongation, and in 3D the z extent and the volume. Per region, the same numbers are a row of the region table.

A round cluster has an elongation near 1, but not exactly: localizations scattered evenly in a disc give a median elongation of about 1.2 with 30 of them, 1.1 with 100 and 1.03 with 1000. An elongation that falls as a cluster gets bigger is usually that noise; one that stays the same is a shape.

Differences from SMAP

Based on the shape half of SMAP's Analyze/cluster/ClusterStatistics (Ries 2020), which, despite its description, computed no pair correlation. The main changes:

References