Login  Register

Fwd: possible bug in the ImageJ Coloc 2

Posted by Daniel White on Dec 06, 2014; 2:16pm
URL: http://imagej.273.s1.nabble.com/Fwd-possible-bug-in-the-ImageJ-Coloc-2-tp5010830.html

Hi Andrii

This is interesting. I remember working hard on this part of the maths
trying to make sure it was right.

Our implementation seems verbose compared to what you suggest from
Wikipedia. I don't know the reason for that. Perhaps Tom K remembers?

I'm not able to spend time on this sadly
At least I can't promise.

But perhaps you can investigate where the difference is between the two
methods. The scatter plot visually suggests that a gradient of close to 3
is not right. But that's no proof.

That the implementations in scipy and numpy give same answer as you have is
encouraging. But perhaps we miss something I forgot over time.

The sample image data pixel values are very far from normally distributed.
So perhaps some assumptions fail.....????

Also I added a large positive offset to both images to simulate data from a
camera that adds a positive offset. Just to make the threshold algorithm
struggle harder.... And in fact fail. As a demonstration of why the offsets
need to be subtracted first. Bit this should not affect a regression or
correlation calculation???????

cheers, Dan

http://chalkie.org.uk
---------- Forwarded message ----------
From: "Andrii Rogov" <[hidden email]>
Date: 5 Dec 2014 17:21
Subject: possible bug in the ImageJ Coloc 2
To: <[hidden email]>
Cc:

Dear Mr White,

>
> I am working on the colocalisation analysis of images and used Costes
> algorithm implemented in ImageJ Coloc 2 plugin.
> I've tried to reproduce the results in my python program, but did not
> succeed.
>
>  The problem is in calculating linear regression - the first step of
> Costes algorithm.
>
> I found your code on github and after translating java code into python
> code was able to obtain the same m and b values as calculated in ImageJ.
> But they are different from values calculated by linear regression
> expressions proposed by Wikipedia. ( http://en.wikipedia.org/wiki/
> Simple_linear_regression )
>
> Maybe you don't calculate the linear regression, but use some other
> value... - what is the reason for this?
>
> Please find attached  2 tif files (the examples from the Coloc2 webpage),
> python program, output of the program and a screenshot of ImageJ Coloc
> output.
> Software used - ImageJ 1.49g, Python 3.4
>
> Channel 1 - red.tif
> Channel 2 - green.tif
>
> Thank you in advance,
>
> Best regards,
> Andrii
>
> --
> ------------------------------------
> Andrii Rogov
> University of Geneva
> GAP - Biophotonics
>
> 22, chemin de Pinchat
> CH-1211 Geneva 4
>
> Phone: +41 22 379 05 66
> Fax:   +41 22 379 05 59
>
> http://www.gap.unige.ch/biophotonics/
>
>
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

calc_linear_regression.py (2K) Download Attachment
green.tif (35K) Download Attachment
imageJ output.PNG (300K) Download Attachment
red.tif (35K) Download Attachment
output.txt (516 bytes) Download Attachment