Skip to content

Measure Colocalization

Measure Colocalization measures how the intensities of two channels go together, pixel by pixel: Pearson’s correlation, Manders’ M1 and M2, the overlap coefficient, K1 and K2, the rank-weighted colocalization (RWC) and, optionally, Manders with Costes’ automatic thresholds. It gives these values for the whole image and, optionally, for each object of a class. The values are those of CellProfiler’s MeasureColocalization, value for value.

A scatter plot of the two channels' pixels: Pearson uses every pixel; the thresholds (a percentage of each channel's maximum) split the plot, and Manders, overlap, K1/K2 and RWC use the pixels above both thresholds (top right) against those above each channel's own threshold

This is not the Colocalization object command. That one works on objects: it finds objects of different classes that overlap and links them. Measure Colocalization works on intensities: it asks whether bright pixels in channel A are also bright in channel B, with no objects needed.

It is a measurement step: it runs once per image plane, after all tiles of the image are read and all objects are found.

ParameterDescription
IDThe step’s ID, unique in the project. It is given automatically (coloc_01, …) and starts the names of its values in the results.
Channel AThe first channel (default 0).
Channel BThe second channel (default 1).
Threshold (% of maximum)A pixel counts for Manders, the overlap, K1/K2 and RWC when it is brighter than this percentage of its channel’s maximum - in the image, or in the object. Default 15 %.
Costes thresholdsManders with Costes’ automatic thresholds, and how they are searched: Off, Faster (default), Fast or Accurate - see Costes’ thresholds.
Per object ofThe objects of this class get values of their own as well. Unset (default): the whole image only.

Each name ends with the two channels, e.g. “Pearson (channel 0 × channel 1)”. With Per object of set, each value (except the slope) also comes per object, named “Pearson per object (channel 0 × channel 1)”.

MeasurementUnitRangeDescription
Pearson--1 to 1Correlation of A and B over all pixels. 1: they rise and fall together; 0: unrelated; -1: opposite.
Slope--The slope of the least-squares line B = slope · A + c over all pixels. Image only.
Manders M10-10 to 1The part of A’s intensity (above its threshold) in pixels where B is above its threshold too.
Manders M20-10 to 1The same for B: the part of B’s intensity where A is above its threshold too.
Overlap-0 to 1Manders’ overlap coefficient of the pixels above both thresholds.
K1-≥ 0Overlap split: how much A contributes.
K2-≥ 0Overlap split: how much B contributes.
RWC 10-10 to 1Like M1, but each pixel weighted by how similar its ranks in A and B are.
RWC 20-10 to 1Like M2, weighted the same way.
Manders M1 (Costes)0-10 to 1M1 with Costes’ automatic thresholds. Only when Costes thresholds is not Off.
Manders M2 (Costes)0-10 to 1M2 with Costes’ automatic thresholds. Only when Costes thresholds is not Off.

The intensities ai,bia_i, b_i of the two channels are taken as values from 0 to 1 (the gray value divided by the bit depth’s maximum); an RGB image is turned into its luminance first. Over the whole image every pixel counts, the background too; for an object, the pixels of its mask.

r=∑i(ai−aˉ)(bi−bˉ)∑i(ai−aˉ)2 ∑i(bi−bˉ)2,slope=∑i(ai−aˉ)(bi−bˉ)∑i(ai−aˉ)2r = \frac{\sum_i (a_i - \bar a)(b_i - \bar b)}{\sqrt{\sum_i (a_i - \bar a)^2 \, \sum_i (b_i - \bar b)^2}}, \qquad \text{slope} = \frac{\sum_i (a_i - \bar a)(b_i - \bar b)}{\sum_i (a_i - \bar a)^2}

Pearson uses every pixel, so a large dark background where both channels are low raises it. Measure per object to look only at the cells.

A pixel is “bright” in A when aia_i is above tA=p⋅max⁡a/100t_A = p \cdot \max a / 100, with pp the Threshold (% of maximum), and the same for B. Over the whole image the maximum is the image’s; per object it is the object’s own. As in CellProfiler, over the image a pixel must be above the threshold, in an object at or above it.

With CC the pixels bright in both channels:

M1=∑i∈Cai∑ai>tAai,M2=∑i∈Cbi∑bi>tBbiM_1 = \frac{\sum_{i \in C} a_i}{\sum_{a_i > t_A} a_i}, \qquad M_2 = \frac{\sum_{i \in C} b_i}{\sum_{b_i > t_B} b_i} Overlap=∑Caibi∑Cai2 ∑Cbi2,K1=∑Caibi∑Cai2,K2=∑Caibi∑Cbi2\text{Overlap} = \frac{\sum_{C} a_i b_i}{\sqrt{\sum_{C} a_i^2 \, \sum_{C} b_i^2}}, \qquad K_1 = \frac{\sum_{C} a_i b_i}{\sum_{C} a_i^2}, \qquad K_2 = \frac{\sum_{C} a_i b_i}{\sum_{C} b_i^2}

M1 answers “how much of A is where B is”: 1 means all of A’s bright signal lies in B’s bright pixels. M1 and M2 can differ a lot - e.g. a small vesicle stain (A) inside a large cytoplasm stain (B) gives a high M1 and a low M2.

Each pixel gets its rank among the different values of its channel (0 for the darkest). With RR the larger number of different values in the two channels, a pixel in CC is weighted by how close its two ranks are:

wi=R−∣rank(ai)−rank(bi)∣R,RWC1=∑Caiwi∑ai>tAaiw_i = \frac{R - |\text{rank}(a_i) - \text{rank}(b_i)|}{R}, \qquad \text{RWC}_1 = \frac{\sum_{C} a_i w_i}{\sum_{a_i > t_A} a_i}

and RWC 2 the same for B. A pixel that is bright in both channels but much brighter in one counts less. Over the image the ranks are those of the whole image; per object, those of the pixels of all the objects together.

Instead of a fixed percentage, Costes’ method finds the thresholds from the data: candidate thresholds lie on the orthogonal regression line of B over A (through the pixels where either channel is not 0). Starting from the top, the threshold is lowered until the pixels below it (in A or in B) no longer correlate positively (Pearson ≤ 0). M1 and M2 are then computed with these thresholds (pixels strictly above them).

The three search methods are CellProfiler’s:

MethodSearch
FasterA window of candidates that shrinks around the answer - a few passes over the image, also for 16-bit images.
FastCandidates from the top down, skipping several at a time while the correlation is far from 0. Slow on 16-bit images.
AccurateEvery candidate from the top down, one gray value at a time. Very slow on 16-bit images.

Per object, the whole image’s Costes thresholds are used; they are not searched again for each object.

As in CellProfiler: when no pixel of any object is bright in both channels, the per-object Manders, overlap, K1/K2 and RWC are 0. Values that can’t be computed (e.g. Pearson of a constant channel, M1 with no bright A pixel) get no value.

The image values belong to the image plane; in the List view they are under Columns › Measurements, named “coloc_01 · Pearson (channel 0 × channel 1)”. With A row per: Images each image shows its own value; with A row per: Objects each object row shows the value of its image plane.

The per-object values (“coloc_01 · Pearson per object (channel 0 × channel 1)”) belong to each object of the class and are shown on its row; with A row per: Images they are aggregated over the image’s objects like any other column. The ranges (-1 to 1, 0 to 1) are fixed, so the colour scales of the Plate view stay comparable between plates.

The export option Measurements - one row per value writes every value with the image, plane, region (image or object), object ID, step, measurement, unit and key - see Exporting Results.

  • Two channels per step. For more pairs, add a step for each.
  • Values are per plane; there is no 3D colocalization over a z-stack.
  • It measures the channels as they are loaded from the image: filters earlier in the pipeline (e.g. a background subtraction) do not change them. There is no background correction other than the thresholds.