# How to determine foci colocalization in a microscopy RGB image

I have a series of microscopy RGB images of the cell nucleus like this one

The red and green dots are clusters of different proteins and I would like to determine when these dots colocalize.

Through many examples I was able to assemble this code that given the image i, extracts the red channel, determines the foci correlating the channel image with a Gaussian kernel and then isolates the foci positions through WatershedComponents[] and ComponentMeasurments[].

At the end I visualize the foci and store their coordinates in the variable "myCoordFoci"

adj = ImageAdjust[i];
rgb = {r, g, b} = ColorSeparate[i];
currentImage = r
GaussianMatrix[2],NormalizedSquaredEuclideanDistance], .31]]
marker = MaxDetect[%, .1];
Colorize[%]
myFoci = SelectComponents[watershed, "Count", 0 < # < 50 &];
myMeasures = ComponentMeasurements[myFoci, {"Centroid", "Label"}];
myMarkedFociImage = Show[currentImage,
Graphics[{Red, Text["+", #] & /@ (myMeasures[[All, 2, 1]])}]]
myCoordFoci = myMeasures[[All, 2, 1]];


Probably this is a very ugly and inefficient way to do it, but it works - nevertheless I'm open to suggestions!

My problem is:

Now that I have the coordinates for the red and green foci, how could I determine if some foci colocalize with others?

• Have you seen PearsonCorrelationTest[]? – Dr. belisarius Nov 10 '14 at 19:27
• Could you include an example image ? – lalmei Oct 13 '15 at 15:07