Re: Colocalization Finder

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Colocalization Finder

Jeremy Adler
The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
This means that we are using a display that shows correlation to select which pixels to use in a correlation measurement - somewhat self referential.
To test the plugin I generated two uncorrelated images
           newImage("Untitled", "8-bit noise", 256, 256, 2);// Gaussian distributions
and the split them, before running the plugin.
1) Using the whole image produces a sensible Pearson correlation - around zero.
2) Adjusting the ROI to select the upper right quadrant produces a correlation near 1.00 -
A near perfect positive correlation.
3) Selecting the lower right quadrant also produces a near perfect positive correlation

2) and 3)  cannot be correct, a perfect positive correlation in a scatterplot should appear as a diagonal line going thru the origin.

is the Pearson's_Rr shown in the results table the normal Pearson correlation ?

presumably I am missing something important, but what ?

Jeremy Adler
BioVis
Uppsala U








-----Original Message-----
From: ImageJ Interest Group <[hidden email]> On Behalf Of CARL Philippe (LBP)
Sent: den 6 december 2019 18:09
To: [hidden email]
Subject: Re: Colocalization with Coloc2

Dear David,
I would rather recommend you to use the Colocalization Finder plugin:
https://imagejdocu.tudor.lu/plugin/analysis/colocalizationfinder/start
for which I took over the maintenance.
The plugin can be applied for whatever bit depth picture (i.e. 8, 16 or 32 Bit picture) and able you to define "on the fly" an analysis ROI (i.e. within the scatterPlot picture) as well as within the composite picture.
The calculations are generated (inside a results window) when you click inside a ROI (i.e. within the scatterPlot or composite picture) and you can as well set a ROI selection with a double click inside a ROI.
Nevertheless, the plugin has only be written for the analysis of two single pictures as start conditions (i.e. not for a stack).
But the code is very easily scriptable for stacks and you can find two example macros within the website link I indicted higher.
The only drawback of the tool is maybe the lack of a good "biologist compatible" description (sorry I'm only a physicist) of it's features for which I'm waiting for some "biologist colleagues" to write it and you are as well welcome to do so if you wish.
Feel free to contact me if you have any issues with this tool or ideas for improving it.
My best regards,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Knecht, David" <[hidden email]>
À: "imagej" <[hidden email]>
Envoyé: Vendredi 6 Décembre 2019 16:56:21
Objet: Colocalization with Coloc2

I was trying to use the Coloc2 in Fiji and the colocsample data provided in the cookbook. (https://imagej.net/Colocalization_Analysis) to instruct my microscopy students.  I have not done much of this myself so wanted to understand the software before teaching it.

I was unable to generate any useful data.   I got all kinds of warnings when I ran it with the stacks or a single slice from the stacks even though the dataset was clearly colocalized.

1.   I tried to use a freehand ROI to focus on the membrane edge of the cell, but it did not seem to be used or make any difference.  The image shown in the results was always the entire image and nothing seemed to indictate it was working with just the ROI
2.  I tried subtracting background (around 60) from the images so only real data was analyzed and still got lots of warnings.
3.  The results scatterplots seemed meaningless. In no case did it show the high degree of colocalization of the two probes in the sample data.
4.   I am not sure how to generate the useful dot scatterplots of the sort shown in Dunn et al. from this analysis.
5.  With the stacks, I expected a slice by slice analysis.  The image shown in the results seemed to be only the first slice.
6.  I was never able to see an image with the colocalized pixels found by the analysis highlighted.

It would be really useful to someone doing this for the first time if that page were updated with a complete astep by step nalysis of that sample data.  Settings, results, etc. with different inputs (ROI, noise reduction, stacks vs. slices etc.). so all the complexities are clarified.  Is that available somewhere?   Thanks- Dave

Dr. David Knecht
Professor, Department of Molecular and Cell Biology University of Connecticut
91 N. Eagleville Rd.
U-3125
Storrs, CT 06269-3125
860-486-2200


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html








När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here: http://www.uu.se/en/about-uu/data-protection-policy

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Colocalization Finder

jmutterer
Dear Jeremy,
Thanks for reporting this issue. I added a warning note to the plugin's
page, and we will investigate this.
Jerome.


Le mar. 10 déc. 2019 à 12:32, Jeremy Adler <[hidden email]> a
écrit :

> The Colocalization Finder plugin allows for selection part of scatterplot
> for subsequent measurement of correlations.
> This means that we are using a display that shows correlation to select
> which pixels to use in a correlation measurement - somewhat self
> referential.
> To test the plugin I generated two uncorrelated images
>            newImage("Untitled", "8-bit noise", 256, 256, 2);// Gaussian
> distributions
> and the split them, before running the plugin.
> 1) Using the whole image produces a sensible Pearson correlation - around
> zero.
> 2) Adjusting the ROI to select the upper right quadrant produces a
> correlation near 1.00 -
> A near perfect positive correlation.
> 3) Selecting the lower right quadrant also produces a near perfect
> positive correlation
>
> 2) and 3)  cannot be correct, a perfect positive correlation in a
> scatterplot should appear as a diagonal line going thru the origin.
>
> is the Pearson's_Rr shown in the results table the normal Pearson
> correlation ?
>
> presumably I am missing something important, but what ?
>
> Jeremy Adler
> BioVis
> Uppsala U
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: ImageJ Interest Group <[hidden email]> On Behalf Of CARL
> Philippe (LBP)
> Sent: den 6 december 2019 18:09
> To: [hidden email]
> Subject: Re: Colocalization with Coloc2
>
> Dear David,
> I would rather recommend you to use the Colocalization Finder plugin:
> https://imagejdocu.tudor.lu/plugin/analysis/colocalizationfinder/start
> for which I took over the maintenance.
> The plugin can be applied for whatever bit depth picture (i.e. 8, 16 or 32
> Bit picture) and able you to define "on the fly" an analysis ROI (i.e.
> within the scatterPlot picture) as well as within the composite picture.
> The calculations are generated (inside a results window) when you click
> inside a ROI (i.e. within the scatterPlot or composite picture) and you can
> as well set a ROI selection with a double click inside a ROI.
> Nevertheless, the plugin has only be written for the analysis of two
> single pictures as start conditions (i.e. not for a stack).
> But the code is very easily scriptable for stacks and you can find two
> example macros within the website link I indicted higher.
> The only drawback of the tool is maybe the lack of a good "biologist
> compatible" description (sorry I'm only a physicist) of it's features for
> which I'm waiting for some "biologist colleagues" to write it and you are
> as well welcome to do so if you wish.
> Feel free to contact me if you have any issues with this tool or ideas for
> improving it.
> My best regards,
> Philippe
>
> Philippe CARL
> Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de
> Strasbourg Faculté de Pharmacie
> 74 route du Rhin
> 67401 ILLKIRCH
> Tel : +33(0)3 68 85 41 84
>
> ----- Mail original -----
> De: "Knecht, David" <[hidden email]>
> À: "imagej" <[hidden email]>
> Envoyé: Vendredi 6 Décembre 2019 16:56:21
> Objet: Colocalization with Coloc2
>
> I was trying to use the Coloc2 in Fiji and the colocsample data provided
> in the cookbook. (https://imagej.net/Colocalization_Analysis) to instruct
> my microscopy students.  I have not done much of this myself so wanted to
> understand the software before teaching it.
>
> I was unable to generate any useful data.   I got all kinds of warnings
> when I ran it with the stacks or a single slice from the stacks even though
> the dataset was clearly colocalized.
>
> 1.   I tried to use a freehand ROI to focus on the membrane edge of the
> cell, but it did not seem to be used or make any difference.  The image
> shown in the results was always the entire image and nothing seemed to
> indictate it was working with just the ROI
> 2.  I tried subtracting background (around 60) from the images so only
> real data was analyzed and still got lots of warnings.
> 3.  The results scatterplots seemed meaningless. In no case did it show
> the high degree of colocalization of the two probes in the sample data.
> 4.   I am not sure how to generate the useful dot scatterplots of the sort
> shown in Dunn et al. from this analysis.
> 5.  With the stacks, I expected a slice by slice analysis.  The image
> shown in the results seemed to be only the first slice.
> 6.  I was never able to see an image with the colocalized pixels found by
> the analysis highlighted.
>
> It would be really useful to someone doing this for the first time if that
> page were updated with a complete astep by step nalysis of that sample
> data.  Settings, results, etc. with different inputs (ROI, noise reduction,
> stacks vs. slices etc.). so all the complexities are clarified.  Is that
> available somewhere?   Thanks- Dave
>
> Dr. David Knecht
> Professor, Department of Molecular and Cell Biology University of
> Connecticut
> 91 N. Eagleville Rd.
> U-3125
> Storrs, CT 06269-3125
> 860-486-2200
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
>
>
>
>
>
>
>
> När du har kontakt med oss på Uppsala universitet med e-post så innebär
> det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör
> det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/
>
> E-mailing Uppsala University means that we will process your personal
> data. For more information on how this is performed, please read here:
> http://www.uu.se/en/about-uu/data-protection-policy
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Colocalization Finder

chin
Hi Philipppe,

There seems a problem on the latest version of "Colocalization_Finder.jar"
which cannot produce a
 a rectangular selection on the diagram. While using the
"Colocalization_Finder_with_ROI.jar" you
mentioned on previous thread, it could provide spaces for parameter setting
and could produce the
adjustable rectangular selection on the diagram. Please have a look at the
figure.
<http://imagej.1557.x6.nabble.com/file/t378371/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg>

Thanks a lot.
chin



--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Colocalization Finder

CARL Philippe (LBP)
Dear Chin, Jeremy, Jérôme and all,
Please use the last version of the plugin under the following link:
http://punias.free.fr/ImageJ/colocalization-finder.html
and forget all the version I referenced previously, knowing that the features they implemented became obsolete by the last implemented developments.
For example, I got rid of the "Restrain selection to pixels..." feature of the "original version" knowing that you can now easily reproduce it by moving over the selection ROI within the scatterPlot.
And I had previously developped a Colocalization_Finder_with_ROI plugin so that it was possible for the user to set the starting selection ROI within the scatterPlot positions for a use within macro.
The new "on the fly" features illustrated by the two macro examples on the website are now way more powerful and versatile than this special version of the plugin.
Now coming back to your question, please correct me in the case I didn't correctly understand it.
But you were reporting that with the last version of the plugin it isn't anymore possible to have a rectangular selection ROI within the scatterPlot.
In fact looking carefully within your attached picture, (on it's left side scatterPlot) it is possible to see that there is actually a selection ROI within the scatterPlot, it is just covering all the scatterPlot graph.
I put this setting as default (following some biologists colleagues within my laboratory recommandations) and in the case the user deletes the ROI it is automatically regenerated at these positions.
Also you are not anymore restrained to a rectangular ROI within the scattedPlot (although I'm not sure whether such feature makes sense scientifically).
Nevertheless do to the automatic regeneration of the ROI I described higher, you need to go through either the roiManager or a macro command in order to create an oval ROI within the scatterPlot (there isn't such an issue for a Polygon or Freehand selection).
As the issue described by Jeremy, it seems serious and is more than probably a bug, really sorry about that!
However given that I'm quite sick at the moment with spending most of the time in bed, please allow me probably a couple days to seriously look into it and solve it.
Have a nice day,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "chin" <[hidden email]>
À: "imagej" <[hidden email]>
Envoyé: Mercredi 11 Décembre 2019 08:21:40
Objet: Re: Colocalization Finder

Hi Philipppe,

There seems a problem on the latest version of "Colocalization_Finder.jar"
which cannot produce a
 a rectangular selection on the diagram. While using the
"Colocalization_Finder_with_ROI.jar" you
mentioned on previous thread, it could provide spaces for parameter setting
and could produce the
adjustable rectangular selection on the diagram. Please have a look at the
figure.
<http://imagej.1557.x6.nabble.com/file/t378371/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg>

Thanks a lot.
chin



--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Colocalization Finder

chin
Dear Philippe,

Thank you for your prompt explanation. I was used to looking for the white
pixelated area along with moving the rectangular selection ROI within the
scatterPlot. As for this new version, I did not perceive the
new development and the features expressed by using the two demo macros. It
is really a quick and
straightforward way to observe the differences between various ROIs.

Thanks again!
chin




--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Colocalization Finder

CARL Philippe (LBP)
Dear Chin,
I'm very happy you like the new developments of the plugin.
The new macro interface makes it indeed more easy to use and powerful.
I use as well the "mechanism for slow calculations triggered by any Listener" recommanded by Michael for updating "on the fly" the scatterPlot and/or Composite picture on ROI changes when the plugin is used manually.
As for the "white pixelated area" you will get it very easily just by reducing slightly the size of the ROI within the scatterPlot.
But please wait for my answer to the issue reported by Jeremy to use the tool for serious analysis.
And I'm quite afraid it won't be for today...
My best regards,
Philippe

----- Mail original -----
De: "chin" <[hidden email]>
À: "imagej" <[hidden email]>
Envoyé: Mercredi 11 Décembre 2019 15:17:27
Objet: Re: Colocalization Finder

Dear Philippe,

Thank you for your prompt explanation. I was used to looking for the white
pixelated area along with moving the rectangular selection ROI within the
scatterPlot. As for this new version, I did not perceive the
new development and the features expressed by using the two demo macros. It
is really a quick and
straightforward way to observe the differences between various ROIs.

Thanks again!
chin




--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Colocalization Finder

CARL Philippe (LBP)
In reply to this post by Jeremy Adler
Dear Jeremy,

I'm really sorry to not have answered your mail earlier, but I had been quite badly sick spending a couple of days mostly in bed!

> The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
> This means that we are using a display that shows correlation to select which pixels to use in a correlation
> measurement - somewhat self referential.

The plugin able you as well to locate the position within the scatterPlot of a given pixel inside the composite picture.
In order to do so, just take a limiting ROI within the scatterPlot that insn't covering the whole picture (let's say for example 1/4 or 1/8th of the scatterPlot size).
Then press the Ctrl key and move the mouse over the composite picture.
You will then see the ROI within the scatterPlot jumping around, it's center position representing then the pixel selected within the composite picture.

The tests you described are quite interresting and can easily be reproduced with the following macro code:
        newImage("Untitled", "8-bit noise", 256, 256, 2);
        run("Stack to Images");
        run("Colocalization Finder", "image_1=Untitled-0001 image_2=Untitled-0002");
        selectWindow("ScatterPlot");
        makeRectangle(60, 20, 257, 257);
// output = call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
        call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
        makeRectangle(189, 20, 128, 128);
        call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
        makeRectangle(189, 149, 128, 128);
        call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);

Following your observations, I compared on one side the equations within the plugin to the published and theoritical ones (i.e. see paper from Bolte and Cordelière in the journal of microscopy).
So the used calculations are not similar (at least on it's first look) since the plugin uses methods from G. Chinga with the use of the stdev value within the calculation.
Nevertheless by writing down both equations, it is very easy to demonstrate (at most within 2 lines) that they are in fact absolutely similar.
And on the other side, I compared the values calculated by the plugin to the one obtained "by hand" i.e. by making the calculations by Excel and this on several ROI selections within the scatterPlot (using noised picture generated as you described it).
Using both directions (and way on the contrary of what I was expecting at first reading your mail) I didn't figure out any issue or bug within the Pearson's value calculation.

And to push things even further (if you wish) I can send you the Excel file I used for the calculation verifications, together with a "special version" of the colocalization_finder plugin outputing the needed parameters to be put within the Excel spreadsheet.
Following these tests, I even found something quite funny...
So let's say you have 65536 intensity values with 65535 values equal to 0 and only 1 equal to whatever value and you have this for the two pictures (let's call these whatever values x and y).
Then (x - Average) / Stdev = X = (y - Average) / Stdev = Y = almost 256.
And X * Y = 65534 and summed over all the elements gives EXACTLY 65535.
Given that we started with 65536 values, the Pearson's coefficient is then exactly equal to 1!
And what is funny is that this result is exactly the same for whatever initial x and/or y values!!!
More than obviously there is probably a mathematical pattern here that can more than probably also be demonstrated (but this demonstration I didn't try to make it).

So as a conclusion the Pearson's calculation within the colocalization_finder plugin is right for me unless you find new potential issues.

Feel free to contact me for any additional question or issue.

My best regards,

Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Jeremy Adler" <[hidden email]>
À: "imagej"
Envoyé: Mardi 10 Décembre 2019 12:30:40
Objet: Re: Colocalization Finder

The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
This means that we are using a display that shows correlation to select which pixels to use in a correlation measurement - somewhat self referential.
To test the plugin I generated two uncorrelated images
           newImage("Untitled", "8-bit noise", 256, 256, 2);// Gaussian distributions
and the split them, before running the plugin.
1) Using the whole image produces a sensible Pearson correlation - around zero.
2) Adjusting the ROI to select the upper right quadrant produces a correlation near 1.00 -
A near perfect positive correlation.
3) Selecting the lower right quadrant also produces a near perfect positive correlation

2) and 3)  cannot be correct, a perfect positive correlation in a scatterplot should appear as a diagonal line going thru the origin.

is the Pearson's_Rr shown in the results table the normal Pearson correlation ?

presumably I am missing something important, but what ?

Jeremy Adler
BioVis
Uppsala U

-----Original Message-----
From: ImageJ Interest Group On Behalf Of CARL Philippe (LBP)
Sent: den 6 december 2019 18:09
To:
Subject: Re: Colocalization with Coloc2

Dear David,
I would rather recommend you to use the Colocalization Finder plugin:
https://imagejdocu.tudor.lu/plugin/analysis/colocalizationfinder/start
for which I took over the maintenance.
The plugin can be applied for whatever bit depth picture (i.e. 8, 16 or 32 Bit picture) and able you to define "on the fly" an analysis ROI (i.e. within the scatterPlot picture) as well as within the composite picture.
The calculations are generated (inside a results window) when you click inside a ROI (i.e. within the scatterPlot or composite picture) and you can as well set a ROI selection with a double click inside a ROI.
Nevertheless, the plugin has only be written for the analysis of two single pictures as start conditions (i.e. not for a stack).
But the code is very easily scriptable for stacks and you can find two example macros within the website link I indicted higher.
The only drawback of the tool is maybe the lack of a good "biologist compatible" description (sorry I'm only a physicist) of it's features for which I'm waiting for some "biologist colleagues" to write it and you are as well welcome to do so if you wish.
Feel free to contact me if you have any issues with this tool or ideas for improving it.
My best regards,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Knecht, David" <[hidden email]>
À: "imagej"
Envoyé: Vendredi 6 Décembre 2019 16:56:21
Objet: Colocalization with Coloc2

I was trying to use the Coloc2 in Fiji and the colocsample data provided in the cookbook. (https://imagej.net/Colocalization_Analysis) to instruct my microscopy students.  I have not done much of this myself so wanted to understand the software before teaching it.

I was unable to generate any useful data.   I got all kinds of warnings when I ran it with the stacks or a single slice from the stacks even though the dataset was clearly colocalized.

1.   I tried to use a freehand ROI to focus on the membrane edge of the cell, but it did not seem to be used or make any difference.  The image shown in the results was always the entire image and nothing seemed to indictate it was working with just the ROI
2.  I tried subtracting background (around 60) from the images so only real data was analyzed and still got lots of warnings.
3.  The results scatterplots seemed meaningless. In no case did it show the high degree of colocalization of the two probes in the sample data.
4.   I am not sure how to generate the useful dot scatterplots of the sort shown in Dunn et al. from this analysis.
5.  With the stacks, I expected a slice by slice analysis.  The image shown in the results seemed to be only the first slice.
6.  I was never able to see an image with the colocalized pixels found by the analysis highlighted.

It would be really useful to someone doing this for the first time if that page were updated with a complete astep by step nalysis of that sample data.  Settings, results, etc. with different inputs (ROI, noise reduction, stacks vs. slices etc.). so all the complexities are clarified.  Is that available somewhere?   Thanks- Dave

Dr. David Knecht
Professor, Department of Molecular and Cell Biology University of Connecticut
91 N. Eagleville Rd.
U-3125
Storrs, CT 06269-3125
860-486-2200

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Colocalization Finder

Jeremy Adler
Dear Philppe,
Glad to know you are healthy.

When I run your macro - sensible results.

But when I run these ROIs with an image and an inverted pair (Pearson should be -1.0),
I have typed in the Pearson values at the end of each line that defines the ROI.
The first is fine
The next 3 are very strange, one negative and two positive.
And the final ROI, basically a repeat of the first, is fine.
ImageJ 1.52s

I can't offer an explanation.

run("Close All");
newImage("Untitled", "8-bit noise", 256, 256, 2);
run("Stack to Images");
run("Duplicate...", " ");
run("Invert");
rename("Invert 0002");
run("Colocalization Finder", "image_1=[Invert 0002] image_2=Untitled-0002");
makeRectangle(60, 20, 257, 257);  // Pearson -0.999
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(109, 20, 208, 198);// -0.494
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(109, 85, 122, 133);//0.511
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(184, 123, 122, 133);// 0.895
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(68, 28, 238, 228);// -0.988       almost whole area
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);

-----Original Message-----
From: ImageJ Interest Group <[hidden email]> On Behalf Of CARL Philippe (LBP)
Sent: den 17 december 2019 10:20
To: [hidden email]
Subject: Re: Colocalization Finder

Dear Jeremy,

I'm really sorry to not have answered your mail earlier, but I had been quite badly sick spending a couple of days mostly in bed!

> The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
> This means that we are using a display that shows correlation to
> select which pixels to use in a correlation measurement - somewhat self referential.

The plugin able you as well to locate the position within the scatterPlot of a given pixel inside the composite picture.
In order to do so, just take a limiting ROI within the scatterPlot that insn't covering the whole picture (let's say for example 1/4 or 1/8th of the scatterPlot size).
Then press the Ctrl key and move the mouse over the composite picture.
You will then see the ROI within the scatterPlot jumping around, it's center position representing then the pixel selected within the composite picture.

The tests you described are quite interresting and can easily be reproduced with the following macro code:
newImage("Untitled", "8-bit noise", 256, 256, 2);
run("Stack to Images");
run("Colocalization Finder", "image_1=Untitled-0001 image_2=Untitled-0002");
selectWindow("ScatterPlot");
makeRectangle(60, 20, 257, 257);
//output = call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(189, 20, 128, 128);
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(189, 149, 128, 128);
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);

Following your observations, I compared on one side the equations within the plugin to the published and theoritical ones (i.e. see paper from Bolte and Cordelière in the journal of microscopy).
So the used calculations are not similar (at least on it's first look) since the plugin uses methods from G. Chinga with the use of the stdev value within the calculation.
Nevertheless by writing down both equations, it is very easy to demonstrate (at most within 2 lines) that they are in fact absolutely similar.
And on the other side, I compared the values calculated by the plugin to the one obtained "by hand" i.e. by making the calculations by Excel and this on several ROI selections within the scatterPlot (using noised picture generated as you described it).
Using both directions (and way on the contrary of what I was expecting at first reading your mail) I didn't figure out any issue or bug within the Pearson's value calculation.

And to push things even further (if you wish) I can send you the Excel file I used for the calculation verifications, together with a "special version" of the colocalization_finder plugin outputing the needed parameters to be put within the Excel spreadsheet.
Following these tests, I even found something quite funny...
So let's say you have 65536 intensity values with 65535 values equal to 0 and only 1 equal to whatever value and you have this for the two pictures (let's call these whatever values x and y).
Then (x - Average) / Stdev = X = (y - Average) / Stdev = Y = almost 256.
And X * Y = 65534 and summed over all the elements gives EXACTLY 65535.
Given that we started with 65536 values, the Pearson's coefficient is then exactly equal to 1!
And what is funny is that this result is exactly the same for whatever initial x and/or y values!!!
More than obviously there is probably a mathematical pattern here that can more than probably also be demonstrated (but this demonstration I didn't try to make it).

So as a conclusion the Pearson's calculation within the colocalization_finder plugin is right for me unless you find new potential issues.

Feel free to contact me for any additional question or issue.

My best regards,

Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Jeremy Adler" <[hidden email]>
À: "imagej"
Envoyé: Mardi 10 Décembre 2019 12:30:40
Objet: Re: Colocalization Finder

The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
This means that we are using a display that shows correlation to select which pixels to use in a correlation measurement - somewhat self referential.
To test the plugin I generated two uncorrelated images
           newImage("Untitled", "8-bit noise", 256, 256, 2);// Gaussian distributions and the split them, before running the plugin.
1) Using the whole image produces a sensible Pearson correlation - around zero.
2) Adjusting the ROI to select the upper right quadrant produces a correlation near 1.00 - A near perfect positive correlation.
3) Selecting the lower right quadrant also produces a near perfect positive correlation

2) and 3)  cannot be correct, a perfect positive correlation in a scatterplot should appear as a diagonal line going thru the origin.

is the Pearson's_Rr shown in the results table the normal Pearson correlation ?

presumably I am missing something important, but what ?

Jeremy Adler
BioVis
Uppsala U

-----Original Message-----
From: ImageJ Interest Group On Behalf Of CARL Philippe (LBP)
Sent: den 6 december 2019 18:09
To:
Subject: Re: Colocalization with Coloc2

Dear David,
I would rather recommend you to use the Colocalization Finder plugin:
https://imagejdocu.tudor.lu/plugin/analysis/colocalizationfinder/start
for which I took over the maintenance.
The plugin can be applied for whatever bit depth picture (i.e. 8, 16 or 32 Bit picture) and able you to define "on the fly" an analysis ROI (i.e. within the scatterPlot picture) as well as within the composite picture.
The calculations are generated (inside a results window) when you click inside a ROI (i.e. within the scatterPlot or composite picture) and you can as well set a ROI selection with a double click inside a ROI.
Nevertheless, the plugin has only be written for the analysis of two single pictures as start conditions (i.e. not for a stack).
But the code is very easily scriptable for stacks and you can find two example macros within the website link I indicted higher.
The only drawback of the tool is maybe the lack of a good "biologist compatible" description (sorry I'm only a physicist) of it's features for which I'm waiting for some "biologist colleagues" to write it and you are as well welcome to do so if you wish.
Feel free to contact me if you have any issues with this tool or ideas for improving it.
My best regards,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Knecht, David" <[hidden email]>
À: "imagej"
Envoyé: Vendredi 6 Décembre 2019 16:56:21
Objet: Colocalization with Coloc2

I was trying to use the Coloc2 in Fiji and the colocsample data provided in the cookbook. (https://imagej.net/Colocalization_Analysis) to instruct my microscopy students.  I have not done much of this myself so wanted to understand the software before teaching it.

I was unable to generate any useful data.   I got all kinds of warnings when I ran it with the stacks or a single slice from the stacks even though the dataset was clearly colocalized.

1.   I tried to use a freehand ROI to focus on the membrane edge of the cell, but it did not seem to be used or make any difference.  The image shown in the results was always the entire image and nothing seemed to indictate it was working with just the ROI
2.  I tried subtracting background (around 60) from the images so only real data was analyzed and still got lots of warnings.
3.  The results scatterplots seemed meaningless. In no case did it show the high degree of colocalization of the two probes in the sample data.
4.   I am not sure how to generate the useful dot scatterplots of the sort shown in Dunn et al. from this analysis.
5.  With the stacks, I expected a slice by slice analysis.  The image shown in the results seemed to be only the first slice.
6.  I was never able to see an image with the colocalized pixels found by the analysis highlighted.

It would be really useful to someone doing this for the first time if that page were updated with a complete astep by step nalysis of that sample data.  Settings, results, etc. with different inputs (ROI, noise reduction, stacks vs. slices etc.). so all the complexities are clarified.  Is that available somewhere?   Thanks- Dave

Dr. David Knecht
Professor, Department of Molecular and Cell Biology University of Connecticut
91 N. Eagleville Rd.
U-3125
Storrs, CT 06269-3125
860-486-2200

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html








När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here: http://www.uu.se/en/about-uu/data-protection-policy

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Colocalization Finder

CARL Philippe (LBP)
Dear Jeremy,
In the example you posted below, you are actually doing the calculation over a single picture that you duplicate later on.
Thus there is no need to start with a stack of depth 2 but you can rather start with a single picture.
Also (despite the fact your code is working) I would rather prefer to add a selectWindow("ScatterPlot") before selecting the different ROI positions to be really sure to apply the different ROIs on the scatterPlot and not on the composite or whatever other open picture.
Thus, I would rather write the beginning of your code below by:
        run("Close All");
        newImage("Untitled", "8-bit noise", 256, 256, 1);
        run("Duplicate...", " ");
        run("Invert");
        rename("Invert");
        run("Colocalization Finder", "image_1=[Invert] image_2=[Untitled]");
        selectWindow("ScatterPlot");
        makeRectangle(60, 20, 257, 257);
        call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
        ...

Under the following link:
http://punias.free.fr/ImageJ/coloc/Pearson_s_calculation_new.xlsx
you will find an Excel file reproducing "by hand" the results obtained with the plugin for your example macro having a makeRectangle(109, 85, 122, 133).
As for the "special version" of the plugin that outputs the data to be plugged into the Excel file, you can download it under:
http://punias.free.fr/ImageJ/coloc/Colocalization_Finder_Value.java

But all what I'm doing here is to only apply the mathematics of the theoretical equation.
I guess there are very probably limitations for the application of the Pearson's value calculation under given conditions, and we are very probably reaching one here.

So maybe somebody on the list has better explanations about this, but I won't have the time to reach the sharpness to understand why we are sometimes getting such weird results.

My best regards,

Philippe


Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Jeremy Adler" <[hidden email]>
À: "imagej"
Envoyé: Mardi 17 Décembre 2019 12:16:15
Objet: Re: Colocalization Finder

Dear Philppe,
Glad to know you are healthy.

When I run your macro - sensible results.

But when I run these ROIs with an image and an inverted pair (Pearson should be -1.0),
I have typed in the Pearson values at the end of each line that defines the ROI.
The first is fine
The next 3 are very strange, one negative and two positive.
And the final ROI, basically a repeat of the first, is fine.
ImageJ 1.52s

I can't offer an explanation.

run("Close All");
newImage("Untitled", "8-bit noise", 256, 256, 2);
run("Stack to Images");
run("Duplicate...", " ");
run("Invert");
rename("Invert 0002");
run("Colocalization Finder", "image_1=[Invert 0002] image_2=Untitled-0002");
makeRectangle(60, 20, 257, 257);  // Pearson -0.999
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(109, 20, 208, 198);// -0.494
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(109, 85, 122, 133);//0.511
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(184, 123, 122, 133);// 0.895
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(68, 28, 238, 228);// -0.988       almost whole area
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);

-----Original Message-----
From: ImageJ Interest Group On Behalf Of CARL Philippe (LBP)
Sent: den 17 december 2019 10:20
To: "imagej"
Subject: Re: Colocalization Finder

Dear Jeremy,

I'm really sorry to not have answered your mail earlier, but I had been quite badly sick spending a couple of days mostly in bed!

> The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
> This means that we are using a display that shows correlation to
> select which pixels to use in a correlation measurement - somewhat self referential.

The plugin able you as well to locate the position within the scatterPlot of a given pixel inside the composite picture.
In order to do so, just take a limiting ROI within the scatterPlot that insn't covering the whole picture (let's say for example 1/4 or 1/8th of the scatterPlot size).
Then press the Ctrl key and move the mouse over the composite picture.
You will then see the ROI within the scatterPlot jumping around, it's center position representing then the pixel selected within the composite picture.

The tests you described are quite interresting and can easily be reproduced with the following macro code:
newImage("Untitled", "8-bit noise", 256, 256, 2);
run("Stack to Images");
run("Colocalization Finder", "image_1=Untitled-0001 image_2=Untitled-0002");
selectWindow("ScatterPlot");
makeRectangle(60, 20, 257, 257);
//output = call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(189, 20, 128, 128);
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(189, 149, 128, 128);
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);

Following your observations, I compared on one side the equations within the plugin to the published and theoritical ones (i.e. see paper from Bolte and Cordelière in the journal of microscopy).
So the used calculations are not similar (at least on it's first look) since the plugin uses methods from G. Chinga with the use of the stdev value within the calculation.
Nevertheless by writing down both equations, it is very easy to demonstrate (at most within 2 lines) that they are in fact absolutely similar.
And on the other side, I compared the values calculated by the plugin to the one obtained "by hand" i.e. by making the calculations by Excel and this on several ROI selections within the scatterPlot (using noised picture generated as you described it).
Using both directions (and way on the contrary of what I was expecting at first reading your mail) I didn't figure out any issue or bug within the Pearson's value calculation.

And to push things even further (if you wish) I can send you the Excel file I used for the calculation verifications, together with a "special version" of the colocalization_finder plugin outputing the needed parameters to be put within the Excel spreadsheet.
Following these tests, I even found something quite funny...
So let's say you have 65536 intensity values with 65535 values equal to 0 and only 1 equal to whatever value and you have this for the two pictures (let's call these whatever values x and y).
Then (x - Average) / Stdev = X = (y - Average) / Stdev = Y = almost 256.
And X * Y = 65534 and summed over all the elements gives EXACTLY 65535.
Given that we started with 65536 values, the Pearson's coefficient is then exactly equal to 1!
And what is funny is that this result is exactly the same for whatever initial x and/or y values!!!
More than obviously there is probably a mathematical pattern here that can more than probably also be demonstrated (but this demonstration I didn't try to make it).

So as a conclusion the Pearson's calculation within the colocalization_finder plugin is right for me unless you find new potential issues.

Feel free to contact me for any additional question or issue.

My best regards,

Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Jeremy Adler" <[hidden email]>
À: "imagej"
Envoyé: Mardi 10 Décembre 2019 12:30:40
Objet: Re: Colocalization Finder

The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
This means that we are using a display that shows correlation to select which pixels to use in a correlation measurement - somewhat self referential.
To test the plugin I generated two uncorrelated images
           newImage("Untitled", "8-bit noise", 256, 256, 2);// Gaussian distributions and the split them, before running the plugin.
1) Using the whole image produces a sensible Pearson correlation - around zero.
2) Adjusting the ROI to select the upper right quadrant produces a correlation near 1.00 - A near perfect positive correlation.
3) Selecting the lower right quadrant also produces a near perfect positive correlation

2) and 3)  cannot be correct, a perfect positive correlation in a scatterplot should appear as a diagonal line going thru the origin.

is the Pearson's_Rr shown in the results table the normal Pearson correlation ?

presumably I am missing something important, but what ?

Jeremy Adler
BioVis
Uppsala U

-----Original Message-----
From: ImageJ Interest Group On Behalf Of CARL Philippe (LBP)
Sent: den 6 december 2019 18:09
To:
Subject: Re: Colocalization with Coloc2

Dear David,
I would rather recommend you to use the Colocalization Finder plugin:
https://imagejdocu.tudor.lu/plugin/analysis/colocalizationfinder/start
for which I took over the maintenance.
The plugin can be applied for whatever bit depth picture (i.e. 8, 16 or 32 Bit picture) and able you to define "on the fly" an analysis ROI (i.e. within the scatterPlot picture) as well as within the composite picture.
The calculations are generated (inside a results window) when you click inside a ROI (i.e. within the scatterPlot or composite picture) and you can as well set a ROI selection with a double click inside a ROI.
Nevertheless, the plugin has only be written for the analysis of two single pictures as start conditions (i.e. not for a stack).
But the code is very easily scriptable for stacks and you can find two example macros within the website link I indicted higher.
The only drawback of the tool is maybe the lack of a good "biologist compatible" description (sorry I'm only a physicist) of it's features for which I'm waiting for some "biologist colleagues" to write it and you are as well welcome to do so if you wish.
Feel free to contact me if you have any issues with this tool or ideas for improving it.
My best regards,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Knecht, David" <[hidden email]>
À: "imagej"
Envoyé: Vendredi 6 Décembre 2019 16:56:21
Objet: Colocalization with Coloc2

I was trying to use the Coloc2 in Fiji and the colocsample data provided in the cookbook. (https://imagej.net/Colocalization_Analysis) to instruct my microscopy students.  I have not done much of this myself so wanted to understand the software before teaching it.

I was unable to generate any useful data.   I got all kinds of warnings when I ran it with the stacks or a single slice from the stacks even though the dataset was clearly colocalized.

1.   I tried to use a freehand ROI to focus on the membrane edge of the cell, but it did not seem to be used or make any difference.  The image shown in the results was always the entire image and nothing seemed to indictate it was working with just the ROI
2.  I tried subtracting background (around 60) from the images so only real data was analyzed and still got lots of warnings.
3.  The results scatterplots seemed meaningless. In no case did it show the high degree of colocalization of the two probes in the sample data.
4.   I am not sure how to generate the useful dot scatterplots of the sort shown in Dunn et al. from this analysis.
5.  With the stacks, I expected a slice by slice analysis.  The image shown in the results seemed to be only the first slice.
6.  I was never able to see an image with the colocalized pixels found by the analysis highlighted.

It would be really useful to someone doing this for the first time if that page were updated with a complete astep by step nalysis of that sample data.  Settings, results, etc. with different inputs (ROI, noise reduction, stacks vs. slices etc.). so all the complexities are clarified.  Is that available somewhere?   Thanks- Dave

Dr. David Knecht
Professor, Department of Molecular and Cell Biology University of Connecticut
91 N. Eagleville Rd.
U-3125
Storrs, CT 06269-3125
860-486-2200

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Colocalization Finder

Jeremy Adler
Dear Philippe,

The plugin generates a scatterplot with a selection that initially covers the whole area of the scatterplot.
The selection can be manually resized and measurements made from the new scatterplot.
.
If I leave the selection unchanged, the whole scatterplot, the measurement is correct, but the point of plugin is that measurements can be made from different areas.
I get clearly wrong measurements of correlation when running the plugin just once - run plugin, resize selection, measure.
When I start the plugin and keep resizing (not restarting ) the selection and make measurements, the first measurement for the whole scatterplot is correct, subsequent measurements vary, and the correct measurement can later be obtained by making the selection cover the whole scatterplot.
At all times the measurement of the %pixels seems to be correct.
.
This is not an issue of macro code, as the errors can be generated by just running the plugin, and the selection somehow being applied to a different image.

This might be relevant - when the selection, even when no measurement is made, does not include any datapoints in the scatterplot, the plugin crashes.
Exception in thread "scatterPlot update" java.lang.NullPointerException
at Colocalization_Finder.comparison(Colocalization_Finder.java:585)
at Colocalization_Finder.run(Colocalization_Finder.java:236)
at java.lang.Thread.run(Thread.java:745)


Jeremy Adler






-----Original Message-----
From: ImageJ Interest Group <[hidden email]> On Behalf Of CARL Philippe (LBP)
Sent: den 17 december 2019 17:20
To: [hidden email]
Subject: Re: Colocalization Finder

Dear Jeremy,
In the example you posted below, you are actually doing the calculation over a single picture that you duplicate later on.
Thus there is no need to start with a stack of depth 2 but you can rather start with a single picture.
Also (despite the fact your code is working) I would rather prefer to add a selectWindow("ScatterPlot") before selecting the different ROI positions to be really sure to apply the different ROIs on the scatterPlot and not on the composite or whatever other open picture.
Thus, I would rather write the beginning of your code below by:
run("Close All");
newImage("Untitled", "8-bit noise", 256, 256, 1);
run("Duplicate...", " ");
run("Invert");
rename("Invert");
run("Colocalization Finder", "image_1=[Invert] image_2=[Untitled]");
selectWindow("ScatterPlot");
makeRectangle(60, 20, 257, 257);
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
...

Under the following link:
http://punias.free.fr/ImageJ/coloc/Pearson_s_calculation_new.xlsx
you will find an Excel file reproducing "by hand" the results obtained with the plugin for your example macro having a makeRectangle(109, 85, 122, 133).
As for the "special version" of the plugin that outputs the data to be plugged into the Excel file, you can download it under:
http://punias.free.fr/ImageJ/coloc/Colocalization_Finder_Value.java

But all what I'm doing here is to only apply the mathematics of the theoretical equation.
I guess there are very probably limitations for the application of the Pearson's value calculation under given conditions, and we are very probably reaching one here.

So maybe somebody on the list has better explanations about this, but I won't have the time to reach the sharpness to understand why we are sometimes getting such weird results.

My best regards,

Philippe


Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Jeremy Adler" <[hidden email]>
À: "imagej"
Envoyé: Mardi 17 Décembre 2019 12:16:15
Objet: Re: Colocalization Finder

Dear Philppe,
Glad to know you are healthy.

When I run your macro - sensible results.

But when I run these ROIs with an image and an inverted pair (Pearson should be -1.0), I have typed in the Pearson values at the end of each line that defines the ROI.
The first is fine
The next 3 are very strange, one negative and two positive.
And the final ROI, basically a repeat of the first, is fine.
ImageJ 1.52s

I can't offer an explanation.

run("Close All");
newImage("Untitled", "8-bit noise", 256, 256, 2); run("Stack to Images"); run("Duplicate...", " "); run("Invert"); rename("Invert 0002"); run("Colocalization Finder", "image_1=[Invert 0002] image_2=Untitled-0002"); makeRectangle(60, 20, 257, 257);  // Pearson -0.999 call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); makeRectangle(109, 20, 208, 198);// -0.494 call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); makeRectangle(109, 85, 122, 133);//0.511 call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); makeRectangle(184, 123, 122, 133);// 0.895 call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(68, 28, 238, 228);// -0.988       almost whole area
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);

-----Original Message-----
From: ImageJ Interest Group On Behalf Of CARL Philippe (LBP)
Sent: den 17 december 2019 10:20
To: "imagej"
Subject: Re: Colocalization Finder

Dear Jeremy,

I'm really sorry to not have answered your mail earlier, but I had been quite badly sick spending a couple of days mostly in bed!

> The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
> This means that we are using a display that shows correlation to
> select which pixels to use in a correlation measurement - somewhat self referential.

The plugin able you as well to locate the position within the scatterPlot of a given pixel inside the composite picture.
In order to do so, just take a limiting ROI within the scatterPlot that insn't covering the whole picture (let's say for example 1/4 or 1/8th of the scatterPlot size).
Then press the Ctrl key and move the mouse over the composite picture.
You will then see the ROI within the scatterPlot jumping around, it's center position representing then the pixel selected within the composite picture.

The tests you described are quite interresting and can easily be reproduced with the following macro code:
newImage("Untitled", "8-bit noise", 256, 256, 2); run("Stack to Images"); run("Colocalization Finder", "image_1=Untitled-0001 image_2=Untitled-0002"); selectWindow("ScatterPlot"); makeRectangle(60, 20, 257, 257); //output = call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); makeRectangle(189, 20, 128, 128); call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); makeRectangle(189, 149, 128, 128); call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);

Following your observations, I compared on one side the equations within the plugin to the published and theoritical ones (i.e. see paper from Bolte and Cordelière in the journal of microscopy).
So the used calculations are not similar (at least on it's first look) since the plugin uses methods from G. Chinga with the use of the stdev value within the calculation.
Nevertheless by writing down both equations, it is very easy to demonstrate (at most within 2 lines) that they are in fact absolutely similar.
And on the other side, I compared the values calculated by the plugin to the one obtained "by hand" i.e. by making the calculations by Excel and this on several ROI selections within the scatterPlot (using noised picture generated as you described it).
Using both directions (and way on the contrary of what I was expecting at first reading your mail) I didn't figure out any issue or bug within the Pearson's value calculation.

And to push things even further (if you wish) I can send you the Excel file I used for the calculation verifications, together with a "special version" of the colocalization_finder plugin outputing the needed parameters to be put within the Excel spreadsheet.
Following these tests, I even found something quite funny...
So let's say you have 65536 intensity values with 65535 values equal to 0 and only 1 equal to whatever value and you have this for the two pictures (let's call these whatever values x and y).
Then (x - Average) / Stdev = X = (y - Average) / Stdev = Y = almost 256.
And X * Y = 65534 and summed over all the elements gives EXACTLY 65535.
Given that we started with 65536 values, the Pearson's coefficient is then exactly equal to 1!
And what is funny is that this result is exactly the same for whatever initial x and/or y values!!!
More than obviously there is probably a mathematical pattern here that can more than probably also be demonstrated (but this demonstration I didn't try to make it).

So as a conclusion the Pearson's calculation within the colocalization_finder plugin is right for me unless you find new potential issues.

Feel free to contact me for any additional question or issue.

My best regards,

Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Jeremy Adler" <[hidden email]>
À: "imagej"
Envoyé: Mardi 10 Décembre 2019 12:30:40
Objet: Re: Colocalization Finder

The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
This means that we are using a display that shows correlation to select which pixels to use in a correlation measurement - somewhat self referential.
To test the plugin I generated two uncorrelated images
           newImage("Untitled", "8-bit noise", 256, 256, 2);// Gaussian distributions and the split them, before running the plugin.
1) Using the whole image produces a sensible Pearson correlation - around zero.
2) Adjusting the ROI to select the upper right quadrant produces a correlation near 1.00 - A near perfect positive correlation.
3) Selecting the lower right quadrant also produces a near perfect positive correlation

2) and 3)  cannot be correct, a perfect positive correlation in a scatterplot should appear as a diagonal line going thru the origin.

is the Pearson's_Rr shown in the results table the normal Pearson correlation ?

presumably I am missing something important, but what ?

Jeremy Adler
BioVis
Uppsala U

-----Original Message-----
From: ImageJ Interest Group On Behalf Of CARL Philippe (LBP)
Sent: den 6 december 2019 18:09
To:
Subject: Re: Colocalization with Coloc2

Dear David,
I would rather recommend you to use the Colocalization Finder plugin:
https://imagejdocu.tudor.lu/plugin/analysis/colocalizationfinder/start
for which I took over the maintenance.
The plugin can be applied for whatever bit depth picture (i.e. 8, 16 or 32 Bit picture) and able you to define "on the fly" an analysis ROI (i.e. within the scatterPlot picture) as well as within the composite picture.
The calculations are generated (inside a results window) when you click inside a ROI (i.e. within the scatterPlot or composite picture) and you can as well set a ROI selection with a double click inside a ROI.
Nevertheless, the plugin has only be written for the analysis of two single pictures as start conditions (i.e. not for a stack).
But the code is very easily scriptable for stacks and you can find two example macros within the website link I indicted higher.
The only drawback of the tool is maybe the lack of a good "biologist compatible" description (sorry I'm only a physicist) of it's features for which I'm waiting for some "biologist colleagues" to write it and you are as well welcome to do so if you wish.
Feel free to contact me if you have any issues with this tool or ideas for improving it.
My best regards,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Knecht, David" <[hidden email]>
À: "imagej"
Envoyé: Vendredi 6 Décembre 2019 16:56:21
Objet: Colocalization with Coloc2

I was trying to use the Coloc2 in Fiji and the colocsample data provided in the cookbook. (https://imagej.net/Colocalization_Analysis) to instruct my microscopy students.  I have not done much of this myself so wanted to understand the software before teaching it.

I was unable to generate any useful data.   I got all kinds of warnings when I ran it with the stacks or a single slice from the stacks even though the dataset was clearly colocalized.

1.   I tried to use a freehand ROI to focus on the membrane edge of the cell, but it did not seem to be used or make any difference.  The image shown in the results was always the entire image and nothing seemed to indictate it was working with just the ROI
2.  I tried subtracting background (around 60) from the images so only real data was analyzed and still got lots of warnings.
3.  The results scatterplots seemed meaningless. In no case did it show the high degree of colocalization of the two probes in the sample data.
4.   I am not sure how to generate the useful dot scatterplots of the sort shown in Dunn et al. from this analysis.
5.  With the stacks, I expected a slice by slice analysis.  The image shown in the results seemed to be only the first slice.
6.  I was never able to see an image with the colocalized pixels found by the analysis highlighted.

It would be really useful to someone doing this for the first time if that page were updated with a complete astep by step nalysis of that sample data.  Settings, results, etc. with different inputs (ROI, noise reduction, stacks vs. slices etc.). so all the complexities are clarified.  Is that available somewhere?   Thanks- Dave

Dr. David Knecht
Professor, Department of Molecular and Cell Biology University of Connecticut
91 N. Eagleville Rd.
U-3125
Storrs, CT 06269-3125
860-486-2200

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html








När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here: http://www.uu.se/en/about-uu/data-protection-policy

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Colocalization Finder

CARL Philippe (LBP)
Dear Jeremy,
I played with 2 (saved) pictures that were previously generated with the macro you wrote below, i.e.:
        run("Close All");
        newImage("Untitled", "8-bit noise", 256, 256, 1);
        run("Duplicate...", " ");
        run("Invert");
        rename("Invert");
        run("Colocalization Finder", "image_1=[Invert] image_2=[Untitled]");
So what I did is to place different rectangular ROIs within the scatterPlot, launched the measurement and stored the measurement ROI within the roiManager.
Once done I selected again one after the other the ROIs stored within the roiManager, launched again the calculations for each of these ROIs and got exactly the same results as previously.
What I did also is to record a macro where I made as well several calculations on different ROIs (starting by the original ROI covering all the scatter plot) and closed ImageJ (to be even more sure).
Then I reopened ImageJ and launched the same calculations using the generated macro and got exactly the same results as previously.
Then finally I closed and reopened again ImageJ and relaunched the same macro after having erased the first selection (corresponding to the original ROI covering all the scatter plot) and there again I got exactly the same results as previously (with the difference of course that the first value was missing)...
Thus could you please describe more precisely how you arrived to the conclusion : "I get clearly wrong measurements of correlation when running the plugin just once - run plugin, resize selection, measure".
Also you wrote: "when the selection, even when no measurement is made, does not include any datapoints in the scatterplot, the plugin crashes".
Could you please as well explain how you made the plugin crash with the error you copied ?
Indeed, you got the error "at Colocalization_Finder.comparison(Colocalization_Finder.java:585)".
But it comes out that the method "Colocalization_Finder.comparison" is actually the one launched for the calculation!
Again playing with your example described higher, I tried a calculation to be launched when no pixel is selected (as you described it) and nothing happens.
So I pushed things even further by trying to launch a calculation when being wicked and using macro commands in parallel to "weird selections" and then I got indeed as well an error message similar to what you described.
Nevertheless such a "vicious use" of the plugin is not enough to kill it, given that the tool will continue to work as expected after such a "head shot try" (I guess I saw this in one of the X-men movie)!
Thus I'm open for your more precise descriptions about your findings concerning the "clearly wrong measurements".
My best regards,
Philippe


Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Le 19 Déc 19, à 11:28, Jeremy Adler [hidden email] a écrit :

Dear Philippe,

The plugin generates a scatterplot with a selection that initially covers the whole area of the scatterplot.
The selection can be manually resized and measurements made from the new scatterplot.
.
If I leave the selection unchanged, the whole scatterplot, the measurement is correct, but the point of plugin is that measurements can be made from different areas.
I get clearly wrong measurements of correlation when running the plugin just once - run plugin, resize selection, measure.
When I start the plugin and keep resizing (not restarting ) the selection and make measurements, the first measurement for the whole scatterplot is correct, subsequent measurements vary, and the correct measurement can later be obtained by making the selection cover the whole scatterplot.
At all times the measurement of the %pixels seems to be correct.
.
This is not an issue of macro code, as the errors can be generated by just running the plugin, and the selection somehow being applied to a different image.

This might be relevant - when the selection, even when no measurement is made, does not include any datapoints in the scatterplot, the plugin crashes.
Exception in thread "scatterPlot update" java.lang.NullPointerException
at Colocalization_Finder.comparison(Colocalization_Finder.java:585)
at Colocalization_Finder.run(Colocalization_Finder.java:236)
at java.lang.Thread.run(Thread.java:745)


Jeremy Adler






-----Original Message-----
From: ImageJ Interest Group On Behalf Of CARL Philippe (LBP)
Sent: den 17 december 2019 17:20
To: IMAGEJ
Subject: Re: Colocalization Finder

Dear Jeremy,
In the example you posted below, you are actually doing the calculation over a single picture that you duplicate later on.
Thus there is no need to start with a stack of depth 2 but you can rather start with a single picture.
Also (despite the fact your code is working) I would rather prefer to add a selectWindow("ScatterPlot") before selecting the different ROI positions to be really sure to apply the different ROIs on the scatterPlot and not on the composite or whatever other open picture.
Thus, I would rather write the beginning of your code below by:
run("Close All");
newImage("Untitled", "8-bit noise", 256, 256, 1);
run("Duplicate...", " ");
run("Invert");
rename("Invert");
run("Colocalization Finder", "image_1=[Invert] image_2=[Untitled]");
selectWindow("ScatterPlot");
makeRectangle(60, 20, 257, 257);
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
...

Under the following link:
http://punias.free.fr/ImageJ/coloc/Pearson_s_calculation_new.xlsx
you will find an Excel file reproducing "by hand" the results obtained with the plugin for your example macro having a makeRectangle(109, 85, 122, 133).
As for the "special version" of the plugin that outputs the data to be plugged into the Excel file, you can download it under:
http://punias.free.fr/ImageJ/coloc/Colocalization_Finder_Value.java

But all what I'm doing here is to only apply the mathematics of the theoretical equation.
I guess there are very probably limitations for the application of the Pearson's value calculation under given conditions, and we are very probably reaching one here.

So maybe somebody on the list has better explanations about this, but I won't have the time to reach the sharpness to understand why we are sometimes getting such weird results.

My best regards,

Philippe


Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Jeremy Adler" <[hidden email]>
À: "imagej"
Envoyé: Mardi 17 Décembre 2019 12:16:15
Objet: Re: Colocalization Finder

Dear Philppe,
Glad to know you are healthy.

When I run your macro - sensible results.

But when I run these ROIs with an image and an inverted pair (Pearson should be -1.0), I have typed in the Pearson values at the end of each line that defines the ROI.
The first is fine
The next 3 are very strange, one negative and two positive.
And the final ROI, basically a repeat of the first, is fine.
ImageJ 1.52s

I can't offer an explanation.

run("Close All");
newImage("Untitled", "8-bit noise", 256, 256, 2); run("Stack to Images"); run("Duplicate...", " "); run("Invert"); rename("Invert 0002"); run("Colocalization Finder", "image_1=[Invert 0002] image_2=Untitled-0002"); makeRectangle(60, 20, 257, 257);  // Pearson -0.999 call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); makeRectangle(109, 20, 208, 198);// -0.494 call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); makeRectangle(109, 85, 122, 133);//0.511 call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); makeRectangle(184, 123, 122, 133);// 0.895 call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
makeRectangle(68, 28, 238, 228);// -0.988       almost whole area
call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);

-----Original Message-----
From: ImageJ Interest Group On Behalf Of CARL Philippe (LBP)
Sent: den 17 december 2019 10:20
To: "imagej"
Subject: Re: Colocalization Finder

Dear Jeremy,

I'm really sorry to not have answered your mail earlier, but I had been quite badly sick spending a couple of days mostly in bed!

> The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
> This means that we are using a display that shows correlation to
> select which pixels to use in a correlation measurement - somewhat self referential.

The plugin able you as well to locate the position within the scatterPlot of a given pixel inside the composite picture.
In order to do so, just take a limiting ROI within the scatterPlot that insn't covering the whole picture (let's say for example 1/4 or 1/8th of the scatterPlot size).
Then press the Ctrl key and move the mouse over the composite picture.
You will then see the ROI within the scatterPlot jumping around, it's center position representing then the pixel selected within the composite picture.

The tests you described are quite interresting and can easily be reproduced with the following macro code:
newImage("Untitled", "8-bit noise", 256, 256, 2); run("Stack to Images"); run("Colocalization Finder", "image_1=Untitled-0001 image_2=Untitled-0002"); selectWindow("ScatterPlot"); makeRectangle(60, 20, 257, 257); //output = call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); makeRectangle(189, 20, 128, 128); call("Colocalization_Finder.analyzeByMacro", "true", "false", 0); makeRectangle(189, 149, 128, 128); call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);

Following your observations, I compared on one side the equations within the plugin to the published and theoritical ones (i.e. see paper from Bolte and Cordelière in the journal of microscopy).
So the used calculations are not similar (at least on it's first look) since the plugin uses methods from G. Chinga with the use of the stdev value within the calculation.
Nevertheless by writing down both equations, it is very easy to demonstrate (at most within 2 lines) that they are in fact absolutely similar.
And on the other side, I compared the values calculated by the plugin to the one obtained "by hand" i.e. by making the calculations by Excel and this on several ROI selections within the scatterPlot (using noised picture generated as you described it).
Using both directions (and way on the contrary of what I was expecting at first reading your mail) I didn't figure out any issue or bug within the Pearson's value calculation.

And to push things even further (if you wish) I can send you the Excel file I used for the calculation verifications, together with a "special version" of the colocalization_finder plugin outputing the needed parameters to be put within the Excel spreadsheet.
Following these tests, I even found something quite funny...
So let's say you have 65536 intensity values with 65535 values equal to 0 and only 1 equal to whatever value and you have this for the two pictures (let's call these whatever values x and y).
Then (x - Average) / Stdev = X = (y - Average) / Stdev = Y = almost 256.
And X * Y = 65534 and summed over all the elements gives EXACTLY 65535.
Given that we started with 65536 values, the Pearson's coefficient is then exactly equal to 1!
And what is funny is that this result is exactly the same for whatever initial x and/or y values!!!
More than obviously there is probably a mathematical pattern here that can more than probably also be demonstrated (but this demonstration I didn't try to make it).

So as a conclusion the Pearson's calculation within the colocalization_finder plugin is right for me unless you find new potential issues.

Feel free to contact me for any additional question or issue.

My best regards,

Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Jeremy Adler" <[hidden email]>
À: "imagej"
Envoyé: Mardi 10 Décembre 2019 12:30:40
Objet: Re: Colocalization Finder

The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
This means that we are using a display that shows correlation to select which pixels to use in a correlation measurement - somewhat self referential.
To test the plugin I generated two uncorrelated images
           newImage("Untitled", "8-bit noise", 256, 256, 2);// Gaussian distributions and the split them, before running the plugin.
1) Using the whole image produces a sensible Pearson correlation - around zero.
2) Adjusting the ROI to select the upper right quadrant produces a correlation near 1.00 - A near perfect positive correlation.
3) Selecting the lower right quadrant also produces a near perfect positive correlation

2) and 3)  cannot be correct, a perfect positive correlation in a scatterplot should appear as a diagonal line going thru the origin.

is the Pearson's_Rr shown in the results table the normal Pearson correlation ?

presumably I am missing something important, but what ?

Jeremy Adler
BioVis
Uppsala U

-----Original Message-----
From: ImageJ Interest Group On Behalf Of CARL Philippe (LBP)
Sent: den 6 december 2019 18:09
To:
Subject: Re: Colocalization with Coloc2

Dear David,
I would rather recommend you to use the Colocalization Finder plugin:
https://imagejdocu.tudor.lu/plugin/analysis/colocalizationfinder/start
for which I took over the maintenance.
The plugin can be applied for whatever bit depth picture (i.e. 8, 16 or 32 Bit picture) and able you to define "on the fly" an analysis ROI (i.e. within the scatterPlot picture) as well as within the composite picture.
The calculations are generated (inside a results window) when you click inside a ROI (i.e. within the scatterPlot or composite picture) and you can as well set a ROI selection with a double click inside a ROI.
Nevertheless, the plugin has only be written for the analysis of two single pictures as start conditions (i.e. not for a stack).
But the code is very easily scriptable for stacks and you can find two example macros within the website link I indicted higher.
The only drawback of the tool is maybe the lack of a good "biologist compatible" description (sorry I'm only a physicist) of it's features for which I'm waiting for some "biologist colleagues" to write it and you are as well welcome to do so if you wish.
Feel free to contact me if you have any issues with this tool or ideas for improving it.
My best regards,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Knecht, David" <[hidden email]>
À: "imagej"
Envoyé: Vendredi 6 Décembre 2019 16:56:21
Objet: Colocalization with Coloc2

I was trying to use the Coloc2 in Fiji and the colocsample data provided in the cookbook. (https://imagej.net/Colocalization_Analysis) to instruct my microscopy students.  I have not done much of this myself so wanted to understand the software before teaching it.

I was unable to generate any useful data.   I got all kinds of warnings when I ran it with the stacks or a single slice from the stacks even though the dataset was clearly colocalized.

1.   I tried to use a freehand ROI to focus on the membrane edge of the cell, but it did not seem to be used or make any difference.  The image shown in the results was always the entire image and nothing seemed to indictate it was working with just the ROI
2.  I tried subtracting background (around 60) from the images so only real data was analyzed and still got lots of warnings.
3.  The results scatterplots seemed meaningless. In no case did it show the high degree of colocalization of the two probes in the sample data.
4.   I am not sure how to generate the useful dot scatterplots of the sort shown in Dunn et al. from this analysis.
5.  With the stacks, I expected a slice by slice analysis.  The image shown in the results seemed to be only the first slice.
6.  I was never able to see an image with the colocalized pixels found by the analysis highlighted.

It would be really useful to someone doing this for the first time if that page were updated with a complete astep by step nalysis of that sample data.  Settings, results, etc. with different inputs (ROI, noise reduction, stacks vs. slices etc.). so all the complexities are clarified.  Is that available somewhere?   Thanks- Dave

Dr. David Knecht
Professor, Department of Molecular and Cell Biology University of Connecticut
91 N. Eagleville Rd.
U-3125
Storrs, CT 06269-3125
860-486-2200


När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here: http://www.uu.se/en/about-uu/data-protection-policy

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html