Thursday, October 12, 2006

Image correlation using Igorpro

Question: How can I show the recemblance of the distribution of spotty signals?

Answer:

There could be two ways.

The first method I propose will give you a single parameter representing the similarity. An easy version of so called "Sum of Absolute Differences".

If shape of each receptor in two images are different (such as when you are labeling different molecules within the receptor complex or so), this will not work.

For comparison, it might be good to have a third image that is not similar (from other cells or so).

Let's say there are two images ch1 and ch2 (should have same row and column numbers). Since two images probably have different dynamic ranges, images must be normalized individually. For this, do "wavestats" and get the maximum pixel intensity.

> wavestats ch1

then you will have V_max. Duplicate the original image

> Duplicate ch1 ch1_norm

If ch1 was 8bit or 16bit, then convert ch1_norm to 64bit by

> Redimension/D test

then get the normalized image by

> ch1_norm = ch1 / V_max

Do similar with ch2.

Then what you could do is subtract the images and get its abs.

> Duplicate ch1_norm ch_difference
> ch_difference = abs(ch2_norm - ch1_norm)

then

> print sum(ch_difference)

will give you the sum of all differences between normalized images.
You could do the same thing with a third image (ch_control) which is NOT similar and get the sum of difference with the same procedure as above, between ch1 and ch_control. The value you get from ch1 and the third image should be much larger than that from ch1 and ch2.


Another way of is image correlation plot.
This can be done by first preparing two 1D waves ch1_int and ch2_int

> make/n=(Dimsize(ch1,0)*Dimsize(ch1,1)) ch1_int, ch2_int

then list all pixel intensities these 1D waves

> ch1_int[]= ch1[p - ( floor(p/Dimsize(ch1,0))*Dimsize(ch1,0))][floor(p/Dimsize(ch1,0))]
> ch2_int[]= ch2[p - ( floor(p/Dimsize(ch2,0))*Dimsize(ch2,0))][floor(p/Dimsize(ch2,0))]

> Display ch1_int vs ch_2_int

if ch1 and ch2 has similar pattern, then the scatter plot should show a linear correlation. Otherwise, the plot is dispersed. Plot might become more clear if you subtract the offset (background intensity) before you do the above calculation.

Links to this post:

Create a Link

<< Home